from math import radians import sys,random input = lambda :sys.stdin.readline().rstrip() mi = lambda :map(int,input().split()) li = lambda :list(mi()) N,M = mi() A = li() S = set() for a in A: S.add(a) if M==1: print(len(a),1) else: print(len(a),0)