Easy game (1) P64042


Statement
 

pdf   zip

html

Consider the following game: Given an initially empty set and a sequence of words, insert each word w in the set if w was not yet in it, and delete w from the set if w was already in it. At the end, print the words that are in the set, and also the words that have been in the set but finally are not in it.

Input

Input is a sequence of words.

Output

Print the words that finally are in the set, one per line and in increasing order. Afterwards, print twenty hyphens in a line, followed by the words that have been in the set but finally are not in it, one per line and in decreasing order.

Public test cases
  • Input

    que
    qui
    com
    on
    on
    why
    quan
    qui
    que
    qui
    why
    

    Output

    com
    quan
    qui
    --------------------
    why
    que
    on
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++
    User solutions
    C++