//
// Written by Fyodor Menshikov 20.02.2010
// 08:13-09:09
//

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

class Assert {

   static void check(boolean e) {
      if (!e) {
         throw new Error();
      }
   }
}

class Main2 {

   Scanner in;
   PrintWriter out;

   String getSuffixCommand(StringBuilder s) {
      int suffix[] = new int[s.length()];
      int match = s.length();
      suffix[s.length() - 1] = match;
      for (int i = s.length() - 2; i >= 0; i--) {
         while (true) {
            Assert.check(match > 1);
            Assert.check(i < match - 1);
            Assert.check(match <= s.length());
            if (s.charAt(i) == s.charAt(match - 1)) {
               match--;
               Assert.check(match > 0);
               break;
            } else if (match == s.length()) {
               break;
            } else {
               Assert.check(match < s.length());
               Assert.check(suffix[match] > match);
               match = suffix[match];
            }
         }
         suffix[i] = match;
      }
      match = s.length();
      int minMatch = match;
      int minI = s.length();
      for (int i = s.length() - 2; i >= 0; i--) {
         while (true) {
            if (s.charAt(i) == s.charAt(match - 1) && (s.length() - i) >= (s.length() - match + 1) * 2) {
               match--;
               Assert.check(match > 0);
               break;
            } else if (match == s.length()) {
               break;
            } else {
               Assert.check(match < s.length());
               Assert.check(suffix[match] > match);
               match = suffix[match];
            }
         }
         if (match < minMatch) {
            minMatch = match;
            minI = i;
         }
      }
      int len = s.length() - minMatch;
      if (len == 0 || len == 1) {
         s.setLength(s.length() - 1);
         return "letter";
      } else {
         Assert.check(len > 1);
         s.setLength(minMatch);
         return "copy " + (minI + 1) + " " + (minI + len + 1);
      }
   }

   void solve() {
      StringBuilder s = new StringBuilder(in.nextLine());
      Stack<String> answer = new Stack<String>();
      while (s.length() > 0) {
         answer.push(getSuffixCommand(s));
      }
      out.println(answer.size());
      while (!answer.isEmpty()) {
         out.println(answer.pop());
      }
   }

   void run() {
      try {
         in = new Scanner(System.in);
         out = new PrintWriter(new OutputStreamWriter(System.out));
      } catch (Exception e) {
         throw new Error(e);
      }
      try {
         solve();
      } finally {
         out.close();
      }
   }

   public static void main(String args[]) {
      new Main2().run();
   }
}
