#B3911. Shot Put Cup Data Labeling Challenge

    ID: 11568 Type: Default 1000ms 256MiB

Shot Put Cup Data Labeling Challenge

Shot Put Cup Data Labeling Challenge

Blue-Edge Shot Put organizes the "Shot Put Cup" data labeling contest. In order to achieve the grand path to Au, LeAuingZ participates in the competition.

Blue-Edge Shot Put provides NN integer variables with names and values and asks LeAuingZ to label data for kk sentences. Each sentence consists of uppercase/lowercase letters, spaces, commas, periods, and the characters { and }. The text within {} is one of the NN variable names. LeAuingZ needs to replace every occurrence of ({\texttt{variable_name}}) with its corresponding value.

For example, if a=3a=3 and b=4b=4, then for the sentence "We know a is {a}, b is {b}." the output should be "We know a is 3, b is 4."

inputFormat

Input Format:
1. The first line contains two integers NN and kk, where NN is the number of variables and kk is the number of sentences.
2. The next NN lines each contain a variable name and an integer value, separated by a space.
3. The following kk lines each contain a sentence. The sentence may include letters, spaces, commas, periods, and braces. Placeholders appear in the form {variable_name} and should be replaced by the corresponding integer value.

outputFormat

Output Format:
Print kk lines. Each line is the sentence after all occurrences of the placeholder {variable_name} have been replaced by its corresponding value.

sample

2 1
a 3
b 4
We know a is {a}, b is {b}.
We know a is 3, b is 4.