시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 399 157 120 37.855%

문제

꿍은 도비에게 영어단어들을 제시한 후 어떤 단어가 대소문자를 구분하지 않고 사전순으로 가장 앞서는지 맞추면 양말을 주어 자유를 얻게해준다고 하였다.

하지만 인성이 좋지 않은 꿍은 사실 그러고 싶지 않았기 때문에 대소문자를 마구 섞어가며 단어들을 제시했다. 예를 들어, apPle은 Bat보다 앞서지만 AnT보다는 뒤에 있는 단어다.

도비에게 희망은 여러분뿐이다! 여러분이 도비에게 자유를 선물해주도록 하자!

입력

각 테스트케이스는 정수 n (2 ≤ n ≤ 1000) 으로 시작하며 주어지는 단어의 개수를 뜻한다.

다음 각 n줄은 길이가 최대 20인 단어가 주어지며 대소문자의 구분을 없앴을 때 똑같은 단어는 주어지지 않는다.

마지막 입력은 0이 주어진다.

출력

각 줄에 각 테스트케이스에서 사전상 가장 앞서는 단어를 출력한다.

예제 입력 1

3
Cat
fat
bAt
4
call
ball
All
Hall
0

예제 출력 1

bAt
All
W3sicHJvYmxlbV9pZCI6IjIyMDQiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWIzYzRcdWJlNDRcdWM3NTggXHViMDljXHViM2M1XHVjOTlkIFx1ZDE0Y1x1YzJhNFx1ZDJiOCIsImRlc2NyaXB0aW9uIjoiPHA+XHVhZmNkXHVjNzQwIFx1YjNjNFx1YmU0NFx1YzVkMFx1YWM4YyBcdWM2MDFcdWM1YjRcdWIyZThcdWM1YjRcdWI0ZTRcdWM3NDQgXHVjODFjXHVjMmRjXHVkNTVjIFx1ZDZjNCBcdWM1YjRcdWI1YTQgXHViMmU4XHVjNWI0XHVhYzAwIFx1YjMwMFx1YzE4Y1x1YmIzOFx1Yzc5MFx1Yjk3YyBcdWFkNmNcdWJkODRcdWQ1NThcdWM5YzAgXHVjNTRhXHVhY2UwIFx1YzBhY1x1YzgwNFx1YzIxY1x1YzczY1x1Yjg1YyBcdWFjMDBcdWM3YTUg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W5lIHNob3VsZCBub3QgYmUgcHJvY2Vzc2VkLjxcL3A+XHJcbiIsIm91dHB1dCI6IjxwPkZvciBlYWNoIHNldCBvZiB3b3Jkcywgb3V0cHV0IGp1c3QgdGhlIHdvcmQgdGhhdCBjb21lcyBmaXJzdCBhbHBoYWJldGljYWxseSwgb24gYSBsaW5lIGJ5IGl0c2VsZiwgYXMgaXQgYXBwZWFycyBpbiB0aGUgaW5wdXQuPFwvcD5cclxuIiwiaGludCI6IiIsIm9yaWdpbmFsIjoiMSIsInByb2JsZW1fbGFuZ19jb2RlIjoiXHVjNjAxXHVjNWI0In1d

출처

ACM-ICPC > Regionals > South Pacific > South Pacific Region > New Zealand Programming Contest > NZPC 2005 A번

  • 문제의 오타를 찾은 사람: 5hyunseok
  • 잘못된 데이터를 찾은 사람: bupjae
  • 문제를 번역한 사람: seok9311