static int KMP(char[] p, char[] t) {
		int i = 0, j = 0, m = p.length, n = t.length;
		boolean palindrome = false, alindrome = false;
		while (i < n) {
			while (j >= 0 && t[i] != p[j])
				j = b[j];
			i++;
			j++;
			if (j == m) {
				if (i == j)
					palindrome = true;
				else if (i != n)
					alindrome = true;
				j = b[j];
			}
		}
		return alindrome ? 0 : palindrome ? 1 : 2;
	}