#include <iostream>
#include <cstring>
#include <algorithm>
#include <queue>
#include <unordered_map>
using namespace std;
unordered_map<string,int>d;
unordered_map<string,pair<string,char>>path;
queue<string>q;
int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, 1, 0, -1};
string e="12345678x";
char op[]={"urdl"};
int bfs(string state){
q.push(state);
d[state]=0;
while(q.size()){
auto t=q.front();
q.pop();
if(t==e)return d[t];
int u=t.find('x');
int a=u/3,b=u%3;
int dis=d[t];
auto tmp=t;
for(int i=0;i<4;i++){
int x=a+dx[i],y=b+dy[i];
if(x<0||x>=3||y<0||y>=3)continue;
swap(t[x*3+y],t[u]);
if(!d.count(t)){
d[t]=dis+1;
q.push(t);
path[t]={tmp,op[i]};
}
swap(t[x*3+y],t[u]);
}
}
return -1;
}
int main()
{
char c;
string s="";
for(int i=0;i<9;i++)
cin>>c,s+=c;
if(bfs(s)!=-1)
{
string pp="";
while(path.count(e))
{
pp+=path[e].second;
e=path[e].first;
}
reverse(pp.begin(),pp.end());
cout<<pp<<endl;
}
else
{
cout<<"unsolvable"<<endl;
}
}