توجه: سوال‌ها لزوما به ترتیب سختی مرتب نشده‌اند و ترتیب آن‌ها (تقریبا!) اتفاقی است. استفاده از منابع از پیش آماده شده و دیکشنری‌ها در حین مسابقه مجاز است.

برای سرعت بیشتر برنامه‌ها، بجای پایتون می‌توانید با PyPy کدتان را ارسال کنید.

لینک‌های مفید برای شرکت در مسابقه:

می‌توانید سوال‌های خود را از بخش "سوال بپرسید" مطرح کنید.

The Good, the Bad and the Ugly (1966)


  • Memory Limit: 256MB
  • Time Limit: 4sec

Nima and Sina are searching for a bag full of money. They know the money has been hidden in a grave in the cemetery, but they don't know which grave it is.

Nima has a friend in the Civil Registry Office, and with the help of his friend, he gathered a list of people who are buried in this cemetery. Meanwhile, Sina ran into the cemetery and wrote down all the grave names he saw. They noticed Sina's list has one name more than Nima's list. They believe there is exactly one grave that is not registered in the Civil Registry Office, and the money is hidden in it. They want you to find its name; If you help them you have the chance to get 4,500,0004,500,000 Chugh from the bag.

Input🔗

The first line of input contains the integer NN, the number of names in Sina's list.

Each of the following NN lines contains the names of grave names.

The additional N1N-1 lines contain the names of people in Nima's list.

All the names will consist of at least one and at most 2020 lowercase letters of the English alphabet. The names in a list won’t necessarily be unique.

1N100 0001 \le N \le 100\ 000

Output🔗

The first and only line of output must contain the name of the fake grave.

Sample Input 1🔗

3
stanton
karimi
bagheri
bagheri
karimi
Plain text

Sample Output 1🔗

stanton
Plain text

Sample Input 2🔗

4
nimaei
sinaei
nimaei
gol
sinaei
gol
nimaei
Plain text

Sample Output 2🔗

nimaei
Plain text
ارسال پاسخ برای این سؤال
در حال حاضر شما دسترسی ندارید.