Under construction

Still being built. Things may change

Reverse

Time limit1sMemory limit1024 MB

Summary
For each input line, reverse the order of the words that start with a vowel and leave consonant-initial words in their original positions.
Level

Easy3 of 10

Topics
String, Two pointers, Implementation
Solved
No attempts yet

Problem

At a contest you have been asked to write a program that reads in a line of text and reverses the order of all words that begin with vowels. Words that begin with consonants keep their position in the line of text. You are not sure why you would ever need this, but it is worth points.

Input

There will be an unknown number of lines to process. Each line will contain only words, each separated by a single space.

Output

For each input, display the converted line on its own line.

Examples1

  1. Example 1

    Input
    apple
    Eat apples
    snakes are coming into Your house
    Axe hat bat other toy octagon me I love oranges
    
    Expected output
    apple
    apples Eat
    snakes into coming are Your house
    oranges hat bat I toy octagon me other love Axe