import java.io.*; /** * A Java application to demonstrate the NFA1 class by * using it to filter the standard input stream. Those * lines that are accepted by NFA1 are echoed to the * standard output. */ public class NFA1Filter { public static void main(String[] args) throws IOException { BufferedReader in = // standard input new BufferedReader(new InputStreamReader(System.in)); // Read and echo lines until EOF. String s = in.readLine(); while (s!=null) { if (NFA1.accepts(s)) System.out.println(s); s = in.readLine(); } } }