import sys # Function to read a single line of input def input(): return sys.stdin.readline().strip() # Read the integer N # Note: input() reads a string, int() converts it. # The input string itself might contain digits, but that's allowed. # The restriction is on the source code file. n_str = input() N = int(n_str) # --- Define constants without using digit characters --- # Use len() of strings to get small integers _s_abc = "abc" # Length is 3 three = len(_s_abc) _s_abcde = "abcde" # Length is 5 five = len(_s_abcde) # Calculate other needed numbers using the defined constants # Using integer division or subtraction to get 1 and 0 one = three // three # 3 // 3 = 1 zero = three - three # 3 - 3 = 0 # Calculate 15 fifteen = three * five # 3 * 5 = 15 # --- FizzBuzz Logic --- # Initialize the counter i = one # Start from 1 # Loop from 1 up to N (inclusive) while i <= N: # Check for divisibility using the modulo operator (%) and compare with zero # Order matters: check for 15 first, then 3, then 5. is_divisible_by_fifteen = (i % fifteen == zero) is_divisible_by_three = (i % three == zero) is_divisible_by_five = (i % five == zero) if is_divisible_by_fifteen: print("FizzBuzz") elif is_divisible_by_three: print("Fizz") elif is_divisible_by_five: print("Buzz") else: # Print the number itself if none of the above conditions are met print(i) # Increment the counter i = i + one # i = i + 1