local n, m = io.read("*n", "*n") local t = {} for i = 1, m do t[i] = 0 end for i = 1, n do local a = io.read("*n") if 1 <= a and a <= m then t[a] = t[a] + 1 end end for i = 1, m do print(i .. " " .. t[i]) end