#include <stdio.h>
#include <string.h>
#include <stdlib.h>
char s1[1000], s2[1000], stack[1000], ans[3000][8];
int top = -1, cnt = 0, top1 = 0;
int main(){
scanf("%s%s",s1,s2);
int len2 = (int)strlen(s2), len1 = (int)strlen(s1), flag = 0, i = 0;
while(i < len2){
if(top1 < len1){
if(s1[top1] == s2[i]){
strcpy(ans[cnt++], "1->2");
top1++;
i++;
}
else if(top > -1 && stack[top] == s2[i]){
strcpy(ans[cnt++], "3->2");
top--;
i++;
}
else{
strcpy(ans[cnt++], "1->3");
stack[top+1] = s1[top1++];
top++;
}
}
else if(top > -1){
if(stack[top] == s2[i]){
strcpy(ans[cnt++], "3->2");
top--;
i++;
}
else if(i < len2) {
flag = 1;
break;
}
}
}
if(flag)
printf("Are you kidding me?\n");
else
for(int j = 0; j < cnt; j++)
printf("%s\n", ans[j]);
return 0;
}