// Arup Guha
// 7/13/07
// Solution for BHCSI 2007 Week #1 Programming Contest Problem Palindrome

import java.util.*;
import java.io.*;

public class pal {
	
	public static void main(String[] args) throws IOException {
  		
  		Scanner fin = new Scanner(new File("pal.in"));
  		
  		int numcases = fin.nextInt();
  		
  		// Loop through each case individually.
  		for (int i=1; i<=numcases; i++) {
  		
  			String word = fin.next();
  			word = word.toLowerCase(); // So comparisons are case insensitive.
  			
  			// Check if this word is a palindrome by comparing pairs of letters
  			// from the ends of the word.
  			boolean isPal = true;
  			for (int j=0; j<word.length()/2; j++)
  				if (word.charAt(j) != word.charAt(word.length()-1-j))
  					isPal = false;
  					
  			// Output for the case.
  			if (isPal)
  				System.out.println("Found a palindrome!");
  			else
  				System.out.println("Not a palindrome.");	
  		}
  	}
}