1. 
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

/**
* FWP, Ausgewählte Probleme aus dem ACM Programming Contest, SS11
* Problem: 164 String Computer
* Link: http://uva.onlinejudge.org/external/1/164.pdf
*
* @author Bastian Hoecker
* @author Philipp Hauck Thalheim
* @version 1.0, 06/16/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 1.144
*/

public class Main {

static private int del = 0;
static private int ins = 0;
static private String res = "";

static int[][] lDis(char[] s, char[] t) {
// for all i and j, d[i,j] will hold the Levenshtein distance between
// the first i characters of s and the first j characters of t;
// note that d has (m+1)x(n+1) values
int[][] d = new int[s.length + 1][t.length + 1];

for (int i = 0; i <= s.length; i++) {
d[i][0] = i; // the distance of any first string to an empty second
// string
}
for (int j = 0; j <= t.length; j++) {
d[0][j] = j; // the distance of any second string to an empty first
// string
}
for (int j = 1; j <= t.length; j++) {
for (int i = 1; i <= s.length; i++) {
if (s[i - 1] == t[j - 1]) {
d[i][j] = d[i - 1][j - 1]; // no operation required
} else {
int min = Math.min(d[i - 1][j] + 1,
Math.min(d[i][j - 1] + 1, d[i - 1][j - 1] + 1));
d[i][j] = min;

}
}
}

return d;
}


// Länge nach einem Delete bearbeiten und damit richtige Stelle errechnen
static String backtrace(int i, int j, int[][] D, char[] s, char[] t) {
if (i > 0 && (D[i - 1][j] + 1 == D[i][j])) {
backtrace(i - 1, j, D, s, t);
if ((i - del + ins) > 9) {
res = res + "D" + s[i - 1] + (i - del + ins);
del++;
return "";
} else {
res = res + "D" + s[i - 1] + "0" + (i - del + ins);
del++;
return "";
}
}
if (j > 0 && (D[i][j - 1] + 1 == D[i][j])) {
backtrace(i, j - 1, D, s, t);
if (j > 9) {
res = res + "I" + t[j - 1] + (j);
ins++;
return "";
} else {
res = res + "I" + t[j - 1] + "0" + (j);
ins++;
return "";
}
}
if (i > 0 && j > 0 && (D[i - 1][j - 1] == D[i][j]) && D[i - 1][j] != 0
&& D[i][j - 1] != 0) {
backtrace(i - 1, j - 1, D, s, t);
return "";
}
if (i > 0 && j > 0 && (D[i - 1][j - 1] >= 0)) {
backtrace(i - 1, j - 1, D, s, t);
if (j > 9) {
res = res + "C" + t[j - 1] + (j);
return "";
} else {
res = res + "C" + t[j - 1] + "0" + (j);
return "";
}
}
return "";
}

static char[] reverse(char[] word) {
char[] tmp = new char[word.length];
for (int i = 0; i < tmp.length; i++) {
tmp[i] = word[tmp.length - 1 - i];
}

return tmp;
}

public static void main(String[] args) throws IOException {

BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());

char[] first = st.nextToken().toCharArray();

char[] second;

while (!(first[0] == '#')) {

second = st.nextToken().toCharArray();
int[][] erg = lDis(first, second);
// for (int i = 0; i < erg.length; i++) {
// for (int j = 0; j < erg[i].length; j++) {
// System.out.printf("%d", erg[i][j]);
// }
// System.out.printf("\n");
// }
backtrace(erg.length - 1, erg[0].length - 1, erg, first, second);
System.out.println(res + "E");

del = 0;
ins = 0;
res = "";

st = new StringTokenizer(br.readLine());
first = st.nextToken().toCharArray();

}

}
}