Given an array of length n of strings. For each query Q you are given a string S and a number K. You have to print the index of the string in array which contains string S as prefix and comes K in alphabetical order of all the string in array containg S as the prefix. Print -1 if not possible.
0<N<10^5
0<Q<10^4
0<K<N