import sys input = sys.stdin.readline N,T=map(int,input().split()) P=[list(map(int,input().split())) for i in range(N)] for days in range(T): u,v=map(int,input().split()) print(3,flush=True)