A higher resolution is required to access the IDE
- 34
Learning Opportunities
This puzzle can be solved using the following concepts. Practice using these concepts and improve your skills.
Statement
Goal
«Story Background»It is the year 2636, and the United Colonies of Kalbodia are the premiere producers of wine in the Solar System. Who'd have thought that the asteroid belt could be so fruitful with just a touch of terraforming? History aside, Kordak is a new employee of the Kalbodiwine Company, which handles wine trade between high-class residential asteroids and wine-producing asteroids. There are many languages in use throughout the United Colonies of Kalbodia, and it is up to Kordak to determine which shipment of wine goes where.
«Prompt»
Kordak receives N requests of wine from the residential asteroids. For legibility, these requests are formatted as single strings containing the letters
Both wine requests and crates are indexed from
Input
Line 1: An integer N representing the number of requests / crates
Next N lines: A string representing the i-th wine request with lettersA-Z
Next N lines: A string representing what is inside the j-th crate with lettersa-z
Next N lines: A string representing the i-th wine request with letters
Next N lines: A string representing what is inside the j-th crate with letters
Output
N lines of integers in the same order as the wine requests given
Constraints
2 ≤ N ≤ 100
2 ≤ types of wine per request/crate ≤ 26
1 ≤ bottles of wine in a request/crate ≤ 100
There is one unique answer
2 ≤ types of wine per request/crate ≤ 26
1 ≤ bottles of wine in a request/crate ≤ 100
There is one unique answer
Example
Input
2 ABF DDCC mmjj xys
Output
2 1
A higher resolution is required to access the IDE