//
// Written by Fyodor Menshikov 20.02.2010
// 08:13-09:09
// 21.02.2010 11:03-11:23 char[] 
// 21.02.2010 16:07-16:18 lazy suffix[] computation
//

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

class Main3 {

   Scanner in;
   PrintWriter out;

   int getPrevLen(char s[], int len, Stack<String> answer) {
      int suffix[] = new int[len];
      suffix[len - 1] = len;
      int minComputedSuffix = len - 1;
      int match = len;
      int minMatch = match;
      int minI = len;
      for (int i = len - 2; i >= 0; i--) {
         while (true) {
            if (s[i] == s[match - 1] && (len - i) >= (len - match + 1) * 2) {
               match--;
               assert(match > 0);
               break;
            } else if (match == len) {
               break;
            } else {
               assert(match < len);
               while (minComputedSuffix > match) {
                  int selfMatch = suffix[minComputedSuffix];
                  while (true) {
                     assert(selfMatch > 1);
                     assert(i < selfMatch - 1);
                     assert(selfMatch <= len);
                     if (s[minComputedSuffix - 1] == s[selfMatch - 1]) {
                        selfMatch--;
                        assert(selfMatch > 0);
                        break;
                     } else if (selfMatch == len) {
                        break;
                     } else {
                        assert(selfMatch < len);
                        assert(suffix[selfMatch] > selfMatch);
                        selfMatch = suffix[selfMatch];
                     }
                  }
                  suffix[minComputedSuffix - 1] = selfMatch;
                  minComputedSuffix--;
               }
               assert(minComputedSuffix <= match);
               assert(suffix[match] > match);
               match = suffix[match];
            }
         }
         if (match < minMatch) {
            minMatch = match;
            minI = i;
         }
      }
      int copyLen = Math.max(len - minMatch, 1);
      String line;
      if (copyLen == 1) {
         line = "letter";
      } else {
         assert(copyLen > 1);
         line = "copy " + (minI + 1) + " " + (minI + copyLen + 1);
      }
      answer.push(line);
      return len - copyLen;
   }

   void solve() {
      char s[] = in.nextLine().toCharArray();
      Stack<String> answer = new Stack<String>();
      int len = s.length;
      while (len > 0) {
         len = getPrevLen(s, len, answer);
      }
      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 Main3().run();
   }
}
