Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.  The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
import sys
from collections import Counter

if __name__ == '__main__':
    # ??????????????\???
    # line = 'Thank you for your mail and your lectures'
    data = []
    for line in sys.stdin:
        data = line.strip().lower().split(' ')

    print(data)

    
    c = Counter(data)  
    most_frequent_word = c.most_common(1)[0][0]
    
    max_length_word = ''
    for w, freq in c.most_common():
        if len(w) > len(max_length_word):
            max_length_word = w

    
    print('{0} {1}'.format(most_frequent_word, max_length_word))
import sys
from collections import Counter

if __name__ == '__main__':
    # ??????????????\???
    # line = 'Thank you for your mail and your lectures'
    data = []
    for line in sys.stdin:
        data = line.strip().strip('.').lower().split(' ')

    # print(data)

    
    c = Counter(data)  
    most_frequent_word = c.most_common(1)[0][0]
    
    max_length_word = ''
    for w, freq in c.most_common():
        if len(w) > len(max_length_word):
            max_length_word = w

    
    print('{0} {1}'.format(most_frequent_word, max_length_word))