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

class Main {

   Scanner in;
   PrintWriter out;
                        
   int []getMaxShift(char []s, int []z, int start) {
      int len = s.length;
      int l = start, r = start;
      z[start] = 0;
      int best = 0;
      int idx = 0;
      for (int i = start + 1; i < len; ++i) {
         z[i] = 0;
         if (z[i - l + start] + i <= r) {
            z[i] = z[i - l + start];
         } else {
            l = i;
            if (i > r) {
               r = i;
            }
            for (z[i] = r - i; r < len; ++r, ++z[i]) {
               if (s[r] != s[z[i] + start]) {
                  break;
               }  
            }
            --r;           
         }
         int curr = Math.min(z[i], i - start); 
         if (curr > best) {
            best = curr;
            idx = i;
         }
      }
      int []ar = new int[2];
      ar[0] = best;
      ar[1] = idx;
      return ar;
   }
                         
   void solve() {
      StringBuilder sb = new StringBuilder(in.nextLine());
      sb = sb.reverse();
      char s[] = sb.toString().toCharArray();

      int z[] = new int[s.length];

      int pos = 0;      
      Stack <String> stack = new Stack <String>();      
      while (pos < s.length) {
         int []ans = getMaxShift(s, z, pos);
         int shift = ans[0];
         int highIdx = s.length - 1 - ans[1];
         int lowIdx = s.length - 1 - (ans[1] + shift - 1);
         if (shift == 0 || shift == 1) {
            stack.add("letter");
            pos++;
         } else {
            pos += shift;
            stack.add("copy " + (lowIdx + 1) + " " + (highIdx + 2));
         }        
      }
                     
      out.println(stack.size());                      
      while (!stack.isEmpty()) {
         out.println(stack.pop());
      }
   }

   void solveAll(){
      int low = 0;
      int high = 14;
      for (int i = low; i <= high; i++) {
         long time = System.currentTimeMillis();
         PrintWriter times;
         try {
            in = new Scanner(new FileReader(i + ".in"));
            out = new PrintWriter(new FileWriter(i + ".outZ"));
            times = new PrintWriter(i + ".timeZ");
         } catch (IOException e) {
            throw new Error();
         }
         solve();
         out.close();
         times.print(System.currentTimeMillis() - time);
         times.close();       
      }
   }

   void run(){
      try {
         in = new Scanner(new InputStreamReader(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 Main().solveAll();
      new Main().run();
   }
}
