Solve problem "Countries and cities" online - Learn Python 3 - Snakify

Problem «Countries and cities» (Medium)


Statement

Given a list of countries and cities of each country. Then given the names of the cities. For each city specify the country in which it is located.


In all the problems input the data using input() and print the result using print().



Saved solutions

Tests

Input Correct answer Result
2
USA Boston Pittsburgh Washington Seattle
UK London Edinburgh Cardiff Belfast
3
Cardiff
Seattle
London
UK
USA
UK
2
Russia Moscow Petersburg Novgorod Kaluga
Ukraine Kiev Donetsk Odessa
3
Odessa
Moscow
Novgorod
Ukraine
Russia
Russia
5
A B
C D
E F
G H
I J
5
J
H
F
D
B
I
G
E
C
A
5
A B
C D E
F G H I
J K L M N
O P Q R S T
15
T
S
N
R
M
I
Q
L
H
E
P
K
G
D
B
O
O
J
O
J
F
O
J
F
C
O
J
F
C
A