--- /dev/null
+readings = dict()
+
+most_frequent = None
+second_most_frequent = None
+
+N = int(input())
+for i in range(N):
+ R = int(input())
+ if R in readings:
+ readings[R] += 1
+ else:
+ readings[R] = 1
+
+ if most_frequent is None or (
+ readings[R] > readings[most_frequent] or (readings[R] == readings[most_frequent] and R > most_frequent)):
+ most_frequent = R
+
+test = []
+for i in readings:
+ test.append((i, readings[i]))
+
+
+def get_second(a):
+ return a[1]
+
+
+test.sort(reverse=True, key=get_second)
+print(test)
+f = test[1][1]
+for i in test:
+
+second_most_frequent = test[1][0]
+
+print()