/*
 * File: ArticleTester.java
 * Reads a text and with the help of the Processor class checks
 * and corrects the placement of the articles a and an.
 */
 
import java.io.*; 
public class ArticleTester {

   public static void main (String[] args) throws IOException {
   
      String line;
      BufferedReader br=
         new BufferedReader(new InputStreamReader(System.in));
      line =  br.readLine();

      while (! line.equals("QUIT")) {

         Processor processor = new Processor(line);
         boolean readyToPrint = processor.process();   
         line = br.readLine();

         if (! readyToPrint) 
            processor.finish(line);

         System.out.println(processor.toString());
      }
   
   }
}

