#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;
 
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()

const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001;

int N, lo, hi, A[2*MX];
set<array<int,3>> cur, alt; // start, end, type

// 0: 00000...
// 1: 11111...
// 2: 01010101...
// 3: 1010101010

void prin(set<array<int,3>>& S) {
    for (auto a: S) cout << a[0] << " " << a[1] << " " << a[2] << "\n";
    cout << "---\n";
}

void ins(int a, int b, int c) {
    if (a > b) return;
    if (a == b) c |= 2;
    cur.insert({a,b,c});
    if (c >= 2) alt.insert({a,b,c});
}

void del(array<int,3> a) {
    cur.erase(a);
    if (a[2] >= 2) alt.erase(a);
}

void init(int mid) {
    cur.clear(), alt.clear();
    vpi CUR;
    F0R(i,2*N-1) {
        int tmp = (A[i] <= mid);
        if (sz(CUR) == 0 || CUR.back().f != tmp) CUR.pb({tmp,0});
        CUR.back().s ++;
    }
    for (int l = 0, i = 0; i < sz(CUR); ) {
        if (CUR[i].s == 1) {
            int I = i; while (i < sz(CUR) && CUR[i].s == 1) i++;
            ins(l,l+i-I-1,CUR[I].f+2);
            l += i-I;
        } else {
            ins(l,l+CUR[i].s-1,CUR[i].f);
            l += CUR[i].s;
            i ++;
        }
    }
    //for (auto a: CUR) cout << a.f << " " << a.s << "\n";
    //prin(cur);
    //exit(0);
}

void remLeft() {
    auto a = *cur.begin(); del(a);
    if (a[2] >= 2) ins(a[0]+1,a[1],a[2]^1);
    else ins(a[0]+1,a[1],a[2]);
}

void remRight() {
    auto a = *prev(cur.end()); del(a);
    if (a[2] >= 2) ins(a[0],a[1]-1,a[2]);
    else ins(a[0],a[1]-1,a[2]);
}

int CO = 0;

void process() {
    // prin(cur);
    
    set<array<int,3>> ALT; swap(alt,ALT);
    for (auto a: ALT) {
        // cout << "HI " << a[0] << " " << a[1] << " " << a[2] << "\n";
        auto it = cur.find(a); 
        if (a[0] == a[1]) {
            if (it != cur.begin() && next(it) != cur.end()) {
                auto a = *prev(it), b = *next(it);
                cur.erase(prev(it)); cur.erase(next(it)); cur.erase(it);
                ins(a[0],b[1],a[2]);
            }
        } else {
            if (next(it) != cur.end()) {
                auto IT = next(it);
                auto A = *IT; cur.erase(IT);
                A[0] --, a[1] --;
                cur.insert(A);
            }
            if (it != cur.begin()) {
                auto IT = prev(it);
                auto A = *IT; cur.erase(IT);
                A[1] ++, a[0] ++; a[2] ^= 1;
                cur.insert(A);
            }
            cur.erase(it);
            ins(a[0],a[1],a[2]^1);
        }
    }
    
    // prin(cur);
    remLeft();
    remRight();
    
    // prin(cur);
    // for (auto a: alt) cout << "OOPS " << a[0] << " " << a[1] << " " << a[2] << "\n";
    // CO ++; if (CO == 3) exit(0);
}

bool test(int mid) {
    init(mid);
    /*if (mid == 1) {
        prin(cur);
        exit(0);
    }*/
    F0R(i,N-1) process();
    // exit(0);
    return (*cur.begin())[2] % 2;
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    cin >> N; 
    F0R(i,2*N-1) cin >> A[i];
    lo = 1, hi = 2*N-1;
    while (lo < hi) {
        int mid = (lo+hi)/2;
        if (test(mid)) hi = mid;
        else lo = mid+1;
    }
    cout << lo;
}

// read the question correctly (is y a vowel? what are the exact constraints?)
// look out for SPECIAL CASES (n=1?) and overflow (ll vs int?) ARRAY OUT OF BOUNDSS

Measured memory_bytes: 8132