import java.util.ArrayList; import java.util.*; public class LabArray { public static void main(String[] args) { // TODO Auto-generated method stub ArrayList<String> firstname = new ArrayList<String>(); ArrayList<String> surname = new ArrayList<String>(); ArrayList<Integer> Grade = new ArrayList<Integer>(); String fname; String sname; int grade; Scanner kb = new Scanner(System.in); for (int i=0; i < 20; i++){ fname = kb.nextLine(); firstname.add(fname); sname = kb.nextLine(); surname.add(sname); grade = kb.nextInt(); Grade.add(grade); System.out.println(firstname.get(i) + " " + surname.get(i) + " " + Grade.get(i)); } for (int j = 0; j < 20; j++){ grade = kb.nextInt(); Grade.add(grade); if( grade >= 85 && grade <= 100 ) { System.out.println( "Distinction" ); } else if( grade >= 65 && grade < 84 ) { System.out.println( "Merit" ); } else if( grade >= 39 && grade < 65 ) { System.out.println( "Pass" ); } else if( grade >= 39 && grade < 0 ) { System.out.println( "fail" ); } System.out.println(firstname.get(j) + " " + surname.get(j) + " " +Grade.get(j)); } } }