#include #define int long long using namespace std; const int MOD = 1000000007; using Graph = vector>; signed main() { int N, M; cin >> N >> M; map num; for( int i = 0; i < N; i++ ){ int L; cin >> L; if( L > M ) continue; if( num.count(L) ) num[L]++; else num[L] = 1; } for( int i = 1; i <= M; i++ ){ if( num.count(i) ) cout << i << " " << num[i] << endl; else cout << i << " " << 0 << endl; } }