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

public class java_3
{
   public static void main(String[] argv) throws IOException, FileNotFoundException
   {
      BufferedReader br = new BufferedReader(new FileReader("input.txt"));
      Pattern pattern = Pattern.compile("(?i)dog");
      Matcher matcher;
      String line;

      while ( (line = br.readLine()) != null )
      {
         matcher = pattern.matcher(line);
         if (matcher.find()) {
            System.out.println(line);
         }
      }
   }
}
