#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,x,y) for(int i=x; i<=y; ++i)
#define pre(i,x,y) for(int i=x; i>=y; --i)
const int N = 1e5 + 10, M = 4e3 + 10;
const ll INF = 1e17;
#define int long long
const double eps = 1e-4;
bool st[N];
void solve(){
double a, b;
cin >> a >> b;
int sx = a * 10000, sy = b * 10000;
queue<pair<int, string>> q;
q.push({sx, ""});
while(!q.empty()) {
auto t = q.front();
q.pop();
if(t.first == sy) {
cout << t.second << '\n';
return;
}
int x = t.first * 0.5;
if(!st[x]) {
st[x] = true;
q.push({x, t.second + '1'});
}
x = t.first * 0.5 + 0.5 * 10000;
if(!st[x]) {
st[x] = true;
q.push({x, t.second + '2'});
}
}
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr), cout.tie(nullptr);
int t = 1;
// cin >> t;
while(t --) {
solve();
}
}