class State: def __init__(self): _n, _t = map(int, input().split()) self.dp = [[0 for j in range(14 * 14)] for i in range(14 * 14)] for start_i in range(0, 14): for start_j in range(0, 14): for goal_i in range(0, 14): for goal_j in range(0, 14): value = abs(start_i - start_j) + abs(goal_i - goal_j) self.dp[start_i * 14 + start_j][goal_i * 14 + goal_j] = value * 1000 self.dp[goal_i * 14 + goal_j][start_i * 14 + start_j] = value * 1000 self.sum_s = 0 self.paths = {} for _ in range(3000): a, b, c, d = map(int, input().split()) a -= 1 b -= 1 c -= 1 d -= 1 self.paths[(a, b, c, d)] = self.dp[a * 14 + b][c * 14 + d] self.paths[(a, b, c, d)] = self.dp[c * 14 + d][a * 14 + b] self.highway_count = 0 self.collaborator_count = 0 self.money = 10**6 def solve(self, t): _u, _v = map(int, input().split()) print(2, flush=True) def main(): state = State() for t in range(400): state.solve(t) if "__main__" == __name__: main()