Given names of n people (numbered from 1 to n in the given order), where each name is written on a separate line.
Your task is to answer m queries of the form "AB", where A corresponds to the number of the person and B to the index of character of the persons' name.
For each query, print a single character corresponding to character of the person's name.
First line contains number of people n(n≤105) and number of queries m(m≤1000). Each of the next n lines contains one name and can be up to 105 characters long.
Each of the next m lines contains two numbers A(1≤A≤n) and B(0≤B < length of the name of a person number A).
It is known that there won't be more than 107 characters in the input.
For each query "AB" print a single character corresponding to character of the person's name. Print all characters in one line.