public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		
		int tests = Integer.parseInt(in.readLine());
		
		while (tests > 0) {
			stringSim(in.readLine());
			//kmpTable(in.readLine());
			/*if (kmpSearch(in.readLine(), in.readLine())) {
				System.out.println("TRUE");
			} else {
				System.out.println("FALSE");
			}*/
			tests--;
		}
	}