P0010. Words in odd positions P16111


Statement
 

pdf   zip

thehtml

Your task is to write a program that reads a sequence of words ending with a dot and prints, in reverse order, those that are in odd positions.

Input

The input is a sequence of words ending with a dot, one per line.

Output

Your program must print the words which are in odd positions in reverse order, one per line.

Observation

Vectors are not allowed in this exercise.

Public test cases
  • Input

    first
    second
    third
    fourth
    fifth
    sixth
    .
    

    Output

    fifth
    third
    first
    
  • Input

    first
    second
    third
    fourth
    fifth
    .
    

    Output

    fifth
    third
    first
    
  • Input

    boing
    tupolev
    airbus
    .
    

    Output

    airbus
    boing
    
  • Input

    .
    

    Output

    
            
                                
  • Information
    Author
    Professorat de P1
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++
    User solutions
    C++ Python