/*
  quine.java
  Is the Name of This Problem, MCPC 2012 Problem D
  Java solution by Gabriel Foust
*/

import java.io.*;
import java.util.*;

public class quine
{
    public static void mainString[] args throws FileNotFoundException
    {
        Scanner scanner= new Scannernew File"quine.in" ) );
        
        String line;

        line= scanner.nextLine();
        while (!line.equals"END" ))
        {
            if (line.length() >= &&
                line.charAt== '"' &&
                line.charAtline.length()/== '"' &&
                line.charAtline.length()/== ' ')
            {
                String A = line.substring1, line.length()/);
                String B = line.substringline.length()/);

                if (A.equals&& !A.contains"\"" ))
                {
                    System.out.printf"Quine(%s)", A );
                    System.out.println();
                }
                else
                    System.out.println"not a quine" );
            }
            else
                System.out.println"not a quine" );

            line= scanner.nextLine();
        }
    }
}