/*****************************************************************
** FindString - find the specified string in words read from stdin
**
** (c) Scott MacKenzie, 2000                             
******************************************************************/
import java.io.*;
import java.util.*;

public class FindString
{
   public static void main(String[] args) throws IOException
   {
      // precisely one command-line argument required
      if (args.length != 1)
      {
         System.out.println("usage: java FindString \"string\"");
         return;
      }

      // prepare keyboard for input
      BufferedReader stdin =
            new BufferedReader(new InputStreamReader(System.in), 1);

      // process lines until 'null' (no more input)
      String line;
      while ((line = stdin.readLine()) != null)
      {
         // prepare to tokenize line
         StringTokenizer st = new StringTokenizer(line);

         // process tokens in line
         while (st.hasMoreTokens())
         {
            String s = st.nextToken();
            if (s.indexOf(args[0]) >= 0)
               System.out.println(s);
         }
      } 
   }         
}

