x, y = 7, 5 # Initial valid solution (a=3, b=4, c=5) X = int(input()) while True: current_digits = len(str(y)) if current_digits == X: a = (x - 1) // 2 b = a + 1 print(a, b, y) break # Generate next solution using recurrence relations next_x = 3 * x + 4 * y next_y = 2 * x + 3 * y x, y = next_x, next_y