import java util Scanner public class Main public static void main Str

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int[] schools = new int[99];
int n = Integer.valueOf(sc.nextLine());
for (int i = 0; i < n; i++) {
String line = sc.nextLine();
String[] sp = line.split(" ");//Иванов П.С. 57
schools[Integer.valueOf(sp[2]) - 1]++;
}
int min = Integer.MAX_VALUE;
int minSchool = 0;
for (int i = 0; i < schools.length; i++) {
if (schools[i] != 0 && schools[i] < min) {
min = schools[i];
minSchool = i + 1;
}
}
System.out.println();
System.out.print(minSchool);
}
}