Printing cool words P42568


Statement
 

pdf   zip

In this problem, we say that a word is cool if it does not have two consecutive consonants. Write a program to print all the cool words with nn lowercase letters, vv of which are vowels, that can be made up from the xx first letters of the alphabet.

For instance, these are some of the many cool words for n=5n = 5, v=3v = 3 and x=5x = 5:

aabab ababa babaa cecea deeac

Input

Input consists of three natural numbers n>0n > 0, 0vn0 \le v \le n, and 2x262 \le x \le 26.

Output

Print, in alphabetic order, all the cool words with nn lowercase letters, vv of which are vowels, that can be made up from the xx first lowercase letters. Assume that ‘y’ is a consonant.

Public test cases
  • Input

    3 2 3
    

    Output

    aab
    aac
    aba
    aca
    baa
    caa
    
  • Input

    2 1 5
    

    Output

    ab
    ac
    ad
    ba
    be
    ca
    ce
    da
    de
    eb
    ec
    ed
    
  • Input

    42 20 26
    

    Output

    
            
                                
  • Input

    31 15 2
    

    Output

    bababababababababababababababab
    
  • Input

    2 2 26
    

    Output

    aa
    ae
    ai
    ao
    au
    ea
    ee
    ei
    eo
    eu
    ia
    ie
    ii
    io
    iu
    oa
    oe
    oi
    oo
    ou
    ua
    ue
    ui
    uo
    uu
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Translator
    Salvador Roura
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++
    User solutions
    C++