#include using namespace std; int main() { set s; map m; int n, t; cin >> n; while (n--) { cin >> t; s.insert(t); m[t]++; } for (set::iterator it = s.begin(); it != s.end(); it++) { cout << *it << ' ' << m[*it] << endl; } return 0; }