n, t = map(int, input().split()) for i in range(n): input() for i in range(t): print(3) if i + 1 < t: input()