// clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<pii> vpii;
typedef vector<vi> vvi;
typedef vector<vb> vvb;
typedef vector<vpii> vvpii;
const int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
const int MOD = 1000000007;
const double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
bool odd(const int &n) { return n & 1; }
bool even(const int &n) { return !odd(n); }
template<typename V> typename V::value_type sum(const V &v) { return accumulate(all(v), 0); }
void solve();

// clang-format on

main {
  vs t(9);
  rep(i, 9) cin >> t[i];
  int h = 5, w = t[1].size();
  vvi m(h, vi(w));
  rep(i, h) {
    int k = i * 2;
    rep(j, t[k].size()) {
      if (t[k][j] == '1') {
        m[i][j] += 0b10;
        m[i][j + 1] += 0b1000;
      }
    }
  }
  rep(i, h - 1) {
    int k = i * 2 + 1;
    rep(j, t[k].size()) {
      if (t[k][j] == '1') {
        m[i][j] += 0b100;
        m[i + 1][j] += 0b1;
      }
    }
  }
  rep(i, h) {
    rep(j, w) cerr << setw(3) << m[i][j];
    cerr << endl;
  }
  int x = 0, y = 0, p = 1, wa = 2;
  char c[] = {'U', 'R', 'D', 'L'};
  int dx[] = {0, 1, 0, -1};
  int dy[] = {-1, 0, 1, 0};
  do {
    // TODO: simulation (aka yarudake)
    // Sorry, but I have no time to implement it.
  } while (!(x == 0 && y == 0));
  cout << endl;
  return 0;
}