VDENSITY - Vowel Density

no tags 

Description

For the scope of this problems, vowels are the letters A, E, I, O, and U (and their lowercase forms).
Vowel density is the ratio of vowels to total letters. For example, "Erlang" has the vowel density 2/6.
Given a list of words, find the words of least and greatest vowel density. In both cases, break ties by choosing the lexiographically first word (case-sensitive).

Input

The first line is the number of words, 0 < N <= 100.
On each of the next N lines is a "word", which is non-empty sequence of letters not exceeding 50 characters.

Output

The first line is the word of least vowel density.
The last line is the word of greatest vowel density.
Words should have the same case as in the input.
Input Input
3
strengths
Aerie
gray
2
Me
me
Output Output
strengths
Aerie
Me
Me
To clarify: Of the ones with greatest vowel density, choose the lexicographically first one. Of the ones with least vowel density, choose the lexicographically first one.


Added by:BYU Admin
Date:2014-02-23
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM32-GCC MAWK BC C-CLANG NCSHARP CPP14 CPP14-CLANG COBOL COFFEE D-CLANG D-DMD DART ELIXIR FANTOM FORTH GOSU GRV JS-MONKEY JULIA KTLN NIM OBJC OBJC-CLANG OCT PICO PROLOG PYPY PYPY3 R RACKET RUST CHICKEN SQLITE SWIFT UNLAMBDA VB.NET