public class Main {
private static Scanner s = null;
public static void main(String[] args) {
s = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
int time = s.nextInt();
int[] numbers = new int[1000002];
for (int i = 0; i < time; i++) {
numbers[s.nextInt()]++;
}
for (int i = 0; i < numbers.length; i++) {
if (numbers == 0)
continue;
System.out.println(i + " " + numbers);
}
}
}