N,T=map(int,input().split()) people=[tuple(map(int,input().split())) for i in range(N)] for i in range(T): u,v=map(int,input().split()) print(3)