Enumerate sandwich numbers X48217


Statement
 

pdf   zip

thehtml

Exactly like in the exercise "Sandwich numbers", we define a sandwich number as a natural number n with only two different digits d and e that are repeated in the form de1e2ekd, with k ≥ 1.

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

Input

The input consists of a natural number X, with 3 ≤ X ≤ 9.

Output

A list of sandwich numbers of X 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.

Public test cases
  • Input

    3

    Output

    101
    121
    131
    141
    151
    161
    171
    181
    191
    202
    212
    232
    242
    252
    262
    272
    282
    292
    303
    313
    323
    343
    353
    363
    373
    383
    393
    404
    414
    424
    434
    454
    464
    474
    484
    494
    505
    515
    525
    535
    545
    565
    575
    585
    595
    606
    616
    626
    636
    646
    656
    676
    686
    696
    707
    717
    727
    737
    747
    757
    767
    787
    797
    808
    818
    828
    838
    848
    858
    868
    878
    898
    909
    919
    929
    939
    949
    959
    969
    979
    989
    
  • Information
    Author
    PRO1
    Language
    English
    Translator
    Original language
    Catalan
    Other languages
    Catalan Spanish
    Official solutions
    C++
    User solutions
    C++