Enumerate sandwich numbers

Exactly like in the exercise "Sandwich numbers", we define a sandwich number as a natural number nn with only two different digits dd and ee that are repeated in the form de1e2ekdde_1e_2\cdots e_kd, with k1k \geq 1.

Write a program that displays all the sandwich numbers of XX digits on the screen.

Input

The input consists of a natural number XX, with 3X93 \leq X \leq 9.

Output

A list of sandwich numbers of XX digits, one per line. The numbers can be written in any order. You can generate the numbers as you wish, either as integers or character by character.

Problem information

Author: PRO1

Generation: 2026-01-25T21:36:33.218Z

© Jutge.org, 2006–2026.
https://jutge.org