import sys def solve(): """ Solves the Turtleman and Gaming Console problem. Reads input, determines if Turtleman can play Coderraria without buying new consoles, and prints the result. """ # Read the single line of input from standard input and remove leading/trailing whitespace line = sys.stdin.readline().strip() # --- Parse N --- n_str = "" idx = 0 # Iterate through the beginning of the string to find the digits representing N # Stop when a non-digit character is encountered or the end of the string is reached. while idx < len(line) and line[idx].isdigit(): # Append the digit character to n_str n_str += line[idx] # Move to the next character idx += 1 # Convert the extracted string part (which represents N) to an integer n = int(n_str) # --- Extract strings A and B --- # Calculate the starting index for string A (immediately after the digits for N) a_start = idx # Calculate the starting index for string B (immediately after string A) # String A has length N. b_start = idx + n # Slice the input line to get string A # A represents which consoles support the game ('o' for yes, 'x' for no) # A has length N, spanning indices from a_start up to (but not including) b_start. a = line[a_start : b_start] # Slice the input line to get string B # B represents which consoles Turtleman owns ('o' for yes, 'x' for no) # B also has length N, spanning indices from b_start up to (but not including) b_start + n. b = line[b_start : b_start + n] # --- Check if Turtleman can play --- # Initialize a boolean flag to False. This flag tracks if we find at least one console # that supports the game AND is owned by Turtleman. can_play = False # Iterate through each console type, using an index i from 0 to N-1 for i in range(n): # Check if the i-th console meets both conditions: # 1. The i-th console supports Coderraria (a[i] == 'o') # 2. Turtleman owns the i-th console (b[i] == 'o') if a[i] == 'o' and b[i] == 'o': # If both conditions are true for this console i, Turtleman can play the game. # Set the flag to True. can_play = True # Since we've found a suitable console, there's no need to check the remaining ones. # We can exit the loop early using break. break # --- Print the result --- # After checking all consoles (or breaking early), check the value of the can_play flag. if can_play: # If can_play is True, it means a suitable console was found. print("Lucky Turtleman") else: # If can_play is still False, it means no console met both conditions. print("Unlucky Turtleman") # Call the solve function to execute the logic when the script is run. solve()