from collections import deque def play_game(N, K): # Directions: up, down, left, right directions = [(-1, 0), (1, 0), (0, -1), (0, 1)] # Create an empty grid grid = [[None] * N for _ in range(N)] # Initialize Alice's starting point (K-1, 0) and Bob's starting point (K-1, N-1) grid[K-1][0] = 'A' grid[K-1][N-1] = 'B' # Initialize queues for BFS-like approach alice_queue = deque([(K-1, 0)]) bob_queue = deque([(K-1, N-1)]) # Counters for cells colored by Alice and Bob alice_count = 1 bob_count = 1 # Flag to track whose turn is next: True for Alice, False for Bob alice_turn = True # Perform moves until 2*N*N turns are exhausted or no more moves for _ in range(2 * N * N): if alice_turn: if not alice_queue: break x, y = alice_queue.popleft() for dx, dy in directions: nx, ny = x + dx, y + dy if 0 <= nx < N and 0 <= ny < N and grid[nx][ny] is None: grid[nx][ny] = 'A' alice_queue.append((nx, ny)) alice_count += 1 else: if not bob_queue: break x, y = bob_queue.popleft() for dx, dy in directions: nx, ny = x + dx, y + dy if 0 <= nx < N and 0 <= ny < N and grid[nx][ny] is None: grid[nx][ny] = 'B' bob_queue.append((nx, ny)) bob_count += 1 alice_turn = not alice_turn if alice_count > bob_count: print("Alice") else: print("Bob") N, K = map(int, input().split()) play_game(N, K)