// Arup Guha
// 4/3/2017
// Solution to 1991 UCF HS Contest Problem: Confused Choo Choo

import java.util.*;

public class train {

	public static int n;
	public static String cars;
	public static int[] rank;

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);

		// Process each case.
		while (stdin.hasNext()) {

			// Read the original string and store each character's rank.
			cars = stdin.next();
			n = cars.length();
			rank = new int[n];
			computeRank();

			// An iteration adds at least one car in alpha order to the train.
			while (!alpha()) {
				cars = iter();
				computeRank();
			}

			System.out.println("The train is ready to go!");

			// Super annoying - only between cases, not after each case.
			if (stdin.hasNext()) System.out.println();
		}
	}

	// Computes all of the ranks based on the current string.
	public static void computeRank() {
		for (int i=0; i<n; i++) {
			rank[i] = 0;
			for (int j=0; j<n; j++)
				if (cars.charAt(j) < cars.charAt(i))
					rank[i]++;
		}
	}

	// Returns true iff the cars are in alpha order.
	public static boolean alpha() {
		for (int i=0; i<n-1; i++)
			if (cars.charAt(i) > cars.charAt(i+1))
				return false;
		return true;
	}

	public static String iter() {

		// i is first car out of order.
		int i = 0;
		while (rank[i] == i) i++;

		// j is the car to replace it.
		int j = i;
		while (rank[j] != i) j++;

		// Unhitch part that is correct.
		System.out.println("reverse");
		System.out.println("decouple at "+cars.charAt(j));

		// Switch and unhitch part that is incorrect.
		System.out.println("forward");
		System.out.println("switch");
		System.out.println("reverse");
		System.out.println("decouple at "+cars.charAt(i));

		// Add in correct part.
		System.out.println("forward");
		System.out.println("switch");
		System.out.println("reverse");
		System.out.println("couple");
		System.out.println("forward");

		// Add old incorrect behind it.
		System.out.println("switch");
		System.out.println("reverse");
		System.out.println("couple");
		System.out.println("forward");

		// This is the new ordering.
		return cars.substring(0, i) + cars.substring(j) + cars.substring(i, j);
	}
}