#include <bits/stdc++.h>
using namespace std;
const int maxn = 4;
int mp[maxn][maxn];
int fact[10];
void init(){
fact[0] = 1;
for(int i=1; i<9; i++) fact[i] = fact[i-1]*(i);
return;
}
int n;
int sx, sy;
struct Node{
int m[maxn][maxn];
int step = 0;
int x, y;
char mov[140];
int len;
};
int dx[4] = {-1, 1, 0, 0};
int dy[4] = {0, 0, 1, -1};
char move_di[4] ={'u', 'd', 'r', 'l'};
const int max_num = 362879+10;
int ter = 0;
int vis[max_num];
int cal(int num[][maxn]){
int temp[9];
for(int i=0; i<3; i++)
for(int j=0; j<3; j++) temp[i*3+j] = num[i][j];
int ans = 0;
for(int i=0; i<9; i++){
int cnt = 0;
for(int j=i+1; j<9; j++){
if(temp[j]<temp[i]){
cnt++;
}
}
ans += fact[8-i]*cnt;
}
return ans;
}
bool judge(int x, int y){
if(x<0||x>=3||y<0||y>=3) return false;
return true;
}
char last_ans[140];
bool bfs()
{
Node s;
s.x = sx;
s.y = sy;
s.step = 0;
s.len = 0;
for(int i=0; i<3; i++)
for(int j=0; j<3; j++) s.m[i][j] = mp[i][j];
queue<Node> q;
q.push(s);
int number = cal(s.m);
vis[number] = true;
while(!q.empty()){
Node temp = q.front();
q.pop();
number = cal(temp.m);
if(number == ter) {
temp.mov[temp.len] = '\0';
for(int i=0; i<=temp.len; i++){
last_ans[i] = temp.mov[i];
}
return true;
}
for(int i=0; i<4; i++){
int nx = temp.x+dx[i];
int ny = temp.y+dy[i];
if(judge(nx, ny)){
Node temp1 = temp;
swap(temp1.m[temp.x][temp.y], temp1.m[nx][ny]);
number = cal(temp1.m);
if(vis[number])continue;
else{
temp1.mov[temp1.len] = move_di[i];
temp1.len = temp.len+1;
temp1.step = temp.step+1;
temp1.x = nx;
temp1.y = ny;
vis[number] = true;
q.push(temp1);
}
}
}
}
return false;
}
int main()
{
init();
ios::sync_with_stdio(false);
int tot = 0;
char temp[30];
while(gets(temp)){
tot = 0;
memset(vis, 0, sizeof(vis));
for(int i=0; i<3; i++){
for(int j=0; j<3; j++){
char temp_num;
temp_num = temp[tot];
tot += 3;
if(temp_num == 'x') mp[i][j] = 0;
else mp[i][j] = temp_num-'0';
if(mp[i][j] == 0){
sx = i, sy = j;
}
}
}
bool is_true;
is_true = bfs();
if(!is_true){
printf("unsolvable\n");
}
else cout<<last_ans<<endl;
}
return 0;
}