import java.io.*;
import java.util.*;
import java.net.*;
//_____________________________________________________________
public class dig
{ 
   String lk = "4352536";
   String gen11  = "BRAJYO BRA ALHYM AO HJMYM VAO HARE";
//_____________________________________________________________
public static final void main(String[] args) throws Exception
{
   dig bnk = new dig();
   bnk.start(args);
}
//_____________________________________________________________
dig() throws Exception 
{
}
//___________________________________________________________________________
boolean start(String[] args)
{
   System.out.println("This proves pattern 59.");
   if (args.length == 0)
   {
      args = gen11.split(" ");
   }
   StringBuffer buf = new StringBuffer();
   for (int i = args.length - 1; i >= 0; i--)
   {
      buf.append(args[i].length());
   }
   lk = buf.toString();
   int pos = 0;
   String pi = getFile2("pi.dec");
   for (int i = 0; i < 1000; i++)
   {
      pos = pi.indexOf(lk,pos+1);
      String str = Integer.toString(pos);
      if (str.indexOf("73") >= 0) 
      {
         System.out.println(pos);
         if (str.indexOf("777") >= 0) return(true);
         break;
      }
   }
   return(false);
}
//___________________________________________________________________________
public static String getFile2(String file) 
{
   StringBuffer buf=new StringBuffer();String str;
  try
  {
   BufferedReader in = new BufferedReader (new FileReader (file));
   while((str=in.readLine())!=null)
   {
      buf.append(str);
   }
   in.close();
  }
  catch (Exception e)
  {
   System.out.println(e);
  }
   return (buf.toString());
}
}//__________________________________________________________________________