Alliteration

시간 제한2초메모리 제한2048 MB

요약
n개의 각 줄에서 가장 많은 단어를 시작하는 소문자를 찾고, 동점이면 알파벳 순으로 앞선 글자를 출력한다.
난이도

쉬움10점 중 3점

유형
문자열, 해시맵, 구현
정답자
아직 제출이 없습니다

문제

Many magnificent minstrels have made massive manuscripts made with multitudes of matching marks. Indeed, introverted intellectuals not infrequently instigate these intriguing itineraries intending to invigorate their insatiable intellects. Nevertheless... you get the idea. For each line of text in the input, output the letter that starts the most words in the line. In case there's a tie, output the first letter alphabetically in the tie. Words in the text are always separated by spaces or new lines; a hyphenated word only counts as one word, not two.

입력

The first line contains a single integer nn, the number of lines of text that follow.

The next nn lines of input are all lines of text, up to 10610^6 characters long. The text consists of only lowercase letters, spaces, and punctuation.

출력

The output should be nn lines long; each line of output should only contain the letter that starts the most words in the corresponding line of input.

제한

  • 0<n≤1000 < n \leq 100

예제1

  1. 예제 1

    입력
    5
    a b c a b a
    t!
    m z m z m z
    az. bz, cz: az; bz! az?
    the mitochondria is the powerhouse of the cell.
    
    예상 출력
    a
    t
    m
    a
    t