#include<bits/stdc++.h> using namespace std; map<int,int> hs; int main(){ int n; cin>>n; while(n--){ int x; cin>>x; hs[x]++; } for(auto x:hs) cout<<x.first<<' '<<x.second<<endl; return 0; }