#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

int main() {
  int n;
  cin >> n;
  if(n == 3) {
    cout << "6 10 15" << endl;
    return 0;
  }
  set<int> se;
  int now = 6;
  while(now <= 100000) {
    se.insert(now);
    now += 6;
  }
  now = 10;
  while(now <= 100000) {
    se.insert(now);
    now += 10;
  }
  now = 15;
  while(now <= 100000) {
    se.insert(now);
    now += 15;
  }
  auto itr = se.begin();
  bool f = false;
  vector<int> v;
  while(n--) {
    if(f) cout << " ";
    cout << *itr;
    itr++;
    f = true;
    v.push_back(*itr);
  }
  cout << endl;
  // rep(i, v.size()) {
  //   rep2(j, i+1, v.size()) {
  //     int g = gcd(v.at(i), v.at(j));
  //     if(g == 1) {
  //       cout << "!!!!" << v.at(i) << " " << v.at(j) << endl;
  //       return 1;
  //     }
  //   }
  // }
  // int g = v.front();
  // rep2(i, 1, v.size()) g = gcd(g, v.at(i));
  // cerr << g << endl;
  return 0;
}
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <sstream>
#include <algorithm>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <climits>
#include <bitset>
#include <functional>
#include <numeric>
#include <ctime>
#include <cassert>
#include <cstring>
#include <fstream>

using namespace std;

int main() {
    int n;
    cin >> n;
    int m = 1;
    for (int i = 0; i < n; i++) {
        m *= 2;
    }
    vector<int> a(m);
    for (int i = 0; i < m; i++) {
        cin >> a[i];
    }
    int x = 0, y = m/2;
    for (int i = 0; i*2 < m; i++) {
        if (a[i] > a[x]) x = i;
        if (a[i + m / 2] > a[y]) y = i + m / 2;
    }
    if (a[x] > a[y])
        cout << y+1 << endl;
    else
        cout << x+1 << endl;

    return 0;
}