import java.util.Scanner;
public class Test1014
{
    public static void main (String[] args)
    {
        Scanner in=new Scanner(System.in);
        int x=in.nextInt();
        System.out.println("输入x次:"+x);
        for (int i=1;i<=x ;i++ )
        {
            int a=in.nextInt();
            int b=in.nextInt();
            int c=in.nextInt();
            int d=in.nextInt();
            if(a<60)
            {
                System.out.println("Fail");
            }else
            {
                System.out.println("Pass");
            }
            if(b<60)
            {
                System.out.println("Fail");
            }else
            {
                System.out.println("Pass");
            }
            if(c<60)
            {
                System.out.println("Fail");
            }else
            {
                System.out.println("Pass");
            }
            if (d<60)
            {
                System.out.println("Fail");
            }else
            {
                System.out.println("Pass");
            }
        }
    }
}