N,Q=map(int, input().split()) a=[] s=set() for i in [0]*N: x=input() if not x in s:a.append("1 "+x) a.append(f"2 {x} {x}") while len(a)