Determine whether a text T includes a pattern P. Your program should answer for given queries consisting of P_i.
In the first line, a text T is given. In the second line, an integer Q denoting the number of queries is given. In the following Q lines, the patterns P_i are given respectively.
For each question, print 1 if the text includes P_i, or print 0 otherwise.
aabaaa 4 aa ba bb xyz
1 1 0 0