#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <array>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <fstream>
#include <complex>
#include <cstring>
#include <unordered_map>
#include <unordered_set>
using namespace std;

// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
// #pragma GCC target("avx512f,avx512dq,avx512cd,avx512bw,avx512vl")

using ll = long long;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
// constexpr int mod = 998244353;

template<class T>
inline bool chmax(T& x, T y){
    if(x < y){
        x = y;
        return true;
    }
    return false;
}
template<class T>
inline bool chmin(T& x, T y){
    if(x > y){
        x = y;
        return true;
    }
    return false;
}

int sx, sy, gx, gy;
ll score;

inline void query(){
    cin >> sx >> sy >> gx >> gy;
}

string get_str(){
    string res = "";
    while(sx < gx) { res += 'D'; ++sx; }
    while(sx > gx) { res += 'U'; --sx; }
    while(sy < gy) { res += 'R'; ++sy; }
    while(sy > gy) { res += 'L'; --sy; }
    return res;
}

inline void output(string s){
    cout << s << endl;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    for(int i = 0; i < 1000; ++i){
        query();
        output(get_str());
        cin >> score;
    }

    return 0;
}
/*  *Which of the favors of your Lord will you deny ?*  */
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define vpnt(ans)                       \
    for (ll i = 0; i < ans.size(); i++) \
        cout << ans[i] << (i + 1 < ans.size() ? ' ' : '\n');
#define setbit(x, k) (x |= (1LL << k))
#define clearbit(x, k) (x &= ~(1LL << k)) //x er last theke k-1 tomo ghor
#define checkbit(x, k) (x & (1LL << k))
#define mp make_pair
#define scl(x) scanf("%lld", &x)
#define sci(x) scanf("%d", &x)
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define ff first
#define ss second
#define pii pair<int, int>
#define YES printf("YES\n")
#define Yes printf("Yes\n")
#define yes printf("yes\n")
#define NO printf("NO\n")
#define No printf("No\n")
#define no printf("no\n")
#define nn cout << "\n";
#define INF (1 << 30)
#define LL_INF (1LL << 32)
#define pll pair<ll, ll>
#define pp(n, p) (ll)(pow(n, p) + 0.5)
#define ok ios::sync_with_stdio(false);
#define fine cin.tie(nullptr);
#define mod 1000000007
#define N 100005

int main()
{
    ll n;
    cin>>n;
    vector<int>a, b;
    map<int,int>m;
    n = (1<<n);
    for(int i=0; i<n; i++)
    {
        ll x;
        cin>>x;
        a.pb(x);
        m[x] = i+1;
    }
    while(a.size()>2)
    {
        vector<int>t;
        for(int i=0; i<a.size(); i+=2)
        {
            t.pb(max(a[i], a[i+1]));
        }
        a = t;
    }
    int res = min(a[0], a[1]);
    cout<<m[res];nn;
}