SP6898 SUB_PROB - Substring Problem

Description

String Matching is an important problem in computer science research and finds applications in Bioinformatics, Data mining,pattern recognition, Internet security and many more areas. The problem we consider here is a smaller version of it. You are given a string M and N other strings smaller in length than M. You have to find whether each of these N strings is a substring of M. All strings consist of only alphanumeric characters. You are required to write a C/CPP code to solve the problem.

Input Format

Input to the program consists of a series of lines. The first line contains the string M (no more than **100000** characters long). The next line contains an integer N (

Output Format

Output should consist of N lines each with a character 'Y'/'N' indicating whether the string S is a substring of String M or not.