   import java.io.*;
    public class problem4
   {
       public static void main(String[]args)throws IOException
      {
         String text;
         int counter=0;
         String sub;
         BufferedReader input;
         input=new BufferedReader(new FileReader("DATA4.txt"));
         text=input.readLine();
         PrintWriter output;
         output = new PrintWriter (new FileWriter ("OUT4.txt"));
         while (text!=null)
         {
            while (counter<text.length())
            {
               counter++;
               sub=text.substring(0,counter);
               if (text.lastIndexOf(sub)==0)
               {
                  output.println (text.charAt(counter-1));
                  break;
               }
            }
            counter=0;
            text=input.readLine();
         }
      output.close();
      }
   }

