import java.util.Scanner;

public class Marksheet {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        // user se number of students lena
        System.out.print("Enter number of students: ");
        int n = sc.nextInt();
        sc.nextLine(); // buffer clear

        // loop jitne students hain utni baar chalega
        for (int s = 1; s <= n; s++) {
            System.out.println("\nEnter details of Student " + s + ":");

            // Input student details
            System.out.print("Enter Name: ");
            String name = sc.nextLine();

            System.out.print("Enter Roll No: ");
            int roll = sc.nextInt();

            // Input marks of 3 subjects
            System.out.print("Enter marks of English: ");
            int eng = sc.nextInt();
            System.out.print("Enter marks of Math: ");
            int math = sc.nextInt();
            System.out.print("Enter marks of Science: ");
            int sci = sc.nextInt();

            sc.nextLine(); // buffer clear karna

            int total = eng + math + sci;
            double percentage = total / 3.0;

            // Marksheet print
            System.out.println("\n========== Marksheet ==========");
            System.out.println("Name       : " + name);
            System.out.println("Roll No    : " + roll);
            System.out.println("English    : " + eng);
            System.out.println("Math       : " + math);
            System.out.println("Science    : " + sci);
            System.out.println("-----------------------------");
            System.out.println("Total Marks: " + total);
            System.out.println("Percentage : " + percentage + "%");

            if (percentage >= 33) {
                System.out.println("Result     : PASS");
            } else {
                System.out.println("Result     : FAIL");
            }
            System.out.println("===============================\n");
        }
    }
}