12829 - WF_Python   

Description

Given a few lines of text, you need to parse it and perform the following requirements.

Hint: Please use sys.stdin instead of input() in this homework as there are multiple lines, else you will not be accepted!!!

Input

In this assignment, a few lines of text will be given as an input.

Output

You will need to read the given input and calculate the word frequency in the input text.

Then, print out only the bottom 3 as your output results.

For example,

Example

If we get two lines of Input:

'Hello Hello John'

'Hello Bob'

WF value:

'John' is equal to 1

'Bob' is also equal to 1

'Hello' is equal to 3      

Output:

John

Bob

Hello

Print the bottom 3 as your OUTPUT. 

(If values are the same, the order should depend on their appearance order)

 
 
 
 

Sample Input  Download

Sample Output  Download

Tags




Discuss