This page is still under construction.

Parts of this page are still being built. What you see may change.

IT Passport Examination Grading

Time limit2sMemory limit256 MB

Summary
Add each applicant's three field scores and mark PASS only when the total reaches 55 and every field meets its 30 percent cutoff.
Level

Easy1 of 10

Topics
Implementation
Solved
No attempts yet

Problem

The IT Passport Examination has 100 questions worth one point each, so the maximum score is 100. The questions cover three fields.

  • Strategy, 35 points
  • Management, 25 points
  • Technology, 40 points

An applicant passes only when both conditions hold. The total score is at least 55% of 100, and the score in every field is at least 30% of that field's points. The thresholds are used as they are, with no rounding: 10.5 points in strategy, 7.5 points in management, and 12 points in technology.

Write a program that reads the three field scores of each applicant and reports the total score and the verdict.

Input

The first line contains the number of applicants NN (1≤N≤100 0001 \le N \le 100\,000).

Each of the next NN lines describes one applicant: an eight digit applicant number followed by three integers s1s_1, s2s_2, s3s_3, separated by spaces. s1s_1, s2s_2, s3s_3 are the scores in strategy, management, and technology, and satisfy 0≤s1≤350 \le s_1 \le 35, 0≤s2≤250 \le s_2 \le 25, 0≤s3≤400 \le s_3 \le 40. An applicant number can start with zeros.

Output

Print one line per applicant, in the order given in the input. Each line contains the applicant number, the total score, and the verdict, separated by single spaces. The verdict is PASS when the applicant passes and FAIL otherwise.

Examples3

  1. Example 1

    Input
    5
    12345601 10 20 30
    12345610 15 15 25
    12345615 15 15 30
    12345620 15 7 33
    12345432 11 12 35
    
    Expected output
    12345601 60 FAIL
    12345610 55 PASS
    12345615 60 PASS
    12345620 55 FAIL
    12345432 58 PASS
    
  2. Example 2

    Input
    1
    00000001 11 8 36
    
    Expected output
    00000001 55 PASS
    
  3. Example 3

    Input
    3
    20000001 0 0 0
    20000002 35 25 40
    20000003 12 8 12
    
    Expected output
    20000001 0 FAIL
    20000002 100 PASS
    20000003 32 FAIL