// Arup Guha
// 2/10/2016
// Solution to 2016 FHSPS Playoff Problem: Pass or Fail

import java.util.*;

public class pass {

    final public static int MIN_PASS_SCORE = 6;

    public static void main(String[] args) {

        Scanner stdin = new Scanner(System.in);
        int numCases = stdin.nextInt();

        // Process each case.
        for (int loop=0; loop<numCases; loop++) {

            // Read the score and print the appropriate outcome.
            int score = stdin.nextInt();
            if (score >= MIN_PASS_SCORE)
                System.out.println("PASS");
            else
                System.out.println("FAIL");
        }
    }
}
