#include <iostream>
#include <vector>
#include <unordered_map>
#include <map>

using namespace std;

vector<int> teamsFunc(vector<map<int,pair<int,int>>> &vec, int teams){
    vector<int> res(teams*2,0);
    int max = 0;
    bool zeroIsAvailable = true;
    pair<int,int> pair = {0,0};
    for(int j=0;j<teams;j++){
        for(int i=0;i<vec.size();i++){
        if(!vec[i].empty() && vec[i].rbegin()->first > max){
            int ind = vec[i].rbegin()->second.second;
            while((ind-1 >= 0 && vec[ind-1].empty()) || (ind==0 && zeroIsAvailable==false)){
                int val = vec[i].rbegin()->first;
                vec[i].erase(val);
                if(vec[i].empty()){
                    std::pair<int,std::pair<int,int>> coppia = make_pair(0,make_pair(0,0));
                    vec[i].insert(coppia);
                    break;
                }
                ind = vec[i].rbegin()->second.second;
            }
        }

        if(!vec[i].empty() && vec[i].rbegin()->first > max){
            max = vec[i].rbegin()->first;
            pair = vec[i].rbegin()->second;
            }

        }
   // cout << "inserisco=" << pair.first << " " << pair.second << " che hanno valore" << max << endl;
    res[pair.first] = pair.second+1;
    res[pair.second] = pair.first+1;
    if(pair.first!=0) vec[pair.first-1].clear();
    if(pair.second!=0) vec[pair.second-1].clear();
    if(pair.first==0 || pair.second==0) zeroIsAvailable=false;
    max = 0;

    // cout << "SITUAZIONE:" << endl;
    //   for(auto &e : res){
    //     cout << e << " ";
    // }
   // cout << endl << "FINE SITUAZIONE" << endl << endl;
}

    // for(auto &e : res){
    //     cout << e << " ";
    // }
   return res;
}

int main(int argc, char *argv[]) {
// 2
// 6
// 1 2
// 3 4 5

//3 487060 3831 161856 845957 794650 976977 83847 50566 691206 498447 698377 156232 59015 382455 626960
    int teams;
    cin >> teams;
    vector<map<int,pair<int,int>>> vector;
    for(int i=0;i<(2*teams-1);i++){
        map<int,pair<int,int>> tmp;
        vector.push_back(tmp);
    }
    int el = 1;
    int mate = 0;
    for(int i=0;i<2*teams-1;i++){
        for(int j=0;j<el;j++){
            int tmp;
            cin >> tmp;
            pair<int,pair<int,int>> coppia = make_pair(tmp,make_pair(i+1,mate));
            vector[i].insert(coppia);
            mate++;
        }
        mate=0;
        el++;
    }
    // for(auto &el : vector){
    //     for(auto &e : el){
    //         cout << "pair = " << e.second.first << " - " << e.second.second << " value = " << e.first << endl;
    //     }
    //}
    std::vector<int> result = teamsFunc(vector,teams);
    for(auto &e : result){
        cout << e << " ";
    }
    cout << endl;

    // for(auto &e : vector){
    //     for(auto &el : e){
    //         cout << "valore = " << el.first << " con compagno = " << el.second << endl;
    //     }
    // }

	return 0;

}


// 失敗するからこそ そこから立ち向かって行く強さがあってそんな強さが本当の強さだと私は思うから
#ifdef DAIJOBU
#include "/home/v-o_o-v/deb.h"
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#include <bits/stdc++.h>
#define deb(x...)
#endif

using namespace std;

#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef long long lint;
typedef double ld;

vector<pair<int, pii>> vals;
bool used[5000];
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    int n;
    cin >> n;
    for(int i = 2; i <= 2 * n; i++){
        for(int j = 1; j <= i - 1; j++){
            int x;
            cin >> x;
            vals.pb({x, {i, j}});
        }
    }
    sort(all(vals));
    reverse(all(vals));
    // deb(vals);
    vi ans(2 * n + 1);
    for(auto i: vals){
        if(used[i.se.fi] == 0 &&  used[i.se.se] == 0){
            ans[i.se.fi] = i.se.se;
            ans[i.se.se] = i.se.fi;
            used[i.se.se] = true;
            used[i.se.fi] = true;
        }
    }
    for1(i, 2 * n)cout << ans[i] << ' ';
    return 0;
}
// Write Here


// 失敗するからこそ そこから立ち向かって行く強さがあってそんな強さが本当の強さだと私は思うから
#ifdef DAIJOBU
#include "/home/v-o_o-v/deb.h"
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#include <bits/stdc++.h>
#define deb(x...)
#endif

using namespace std;

#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef long long lint;
typedef double ld;

vector<pair<int, pii>> vals;
bool used[500];
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    int n;
    cin >> n;
    for(int i = 2; i <= 2 * n; i++){
        for(int j = 1; j <= i - 1; j++){
            int x;
            cin >> x;
            vals.pb({x, {i, j}});
        }
    }
    sort(rall(vals));
    // deb(vals);
    vi ans(2 * n + 1);
    for(auto i: vals){
        if(used[i.se.fi] || used[i.se.se])continue;
        ans[i.se.fi] = i.se.se;
        ans[i.se.se] = i.se.fi;
        used[i.se.se] = true;
        used[i.se.fi] = true;
    }
    for1(i, 2 * n)cout << ans[i] << ' ';
    return 0;
}
// Write Here


// 失敗するからこそ そこから立ち向かって行く強さがあってそんな強さが本当の強さだと私は思うから
#ifdef DAIJOBU
#include "/home/v-o_o-v/deb.h"
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#include <bits/stdc++.h>
#define deb(x...)
#endif

using namespace std;

#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef long long lint;
typedef double ld;

vector<pair<int, pii>> vals;
bool used[500];
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    int n;
    cin >> n;
    for(int i = 2; i <= 2 * n; i++){
        for(int j = 1; j <= i - 1; j++){
            int x;
            cin >> x;
            vals.pb({x, {i, j}});
        }
    }
    sort(all(vals));
    reverse(all(vals));
    // deb(vals);
    vi ans(2 * n + 1);
    for(auto i: vals){
        if(used[i.se.fi] == 0 &&  used[i.se.se] == 0){
            ans[i.se.fi] = i.se.se;
            ans[i.se.se] = i.se.fi;
            used[i.se.se] = true;
            used[i.se.fi] = true;
        }
    }
    for1(i, 2 * n)cout << ans[i] << ' ';
    return 0;
}
// Write Here


#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
typedef long long LL;
#define INF 0x3f3f3f3f
#define eps 1e-8

struct Node
{
	int v, x, y;
	bool operator < (const Node& A) const
	{
		return v > A.v;
	}
};

int n, m, x, f[810];
Node a[640010];

int main()
{
	memset(f, 0, sizeof(f));
	m = 0;
	scanf("%d", &n);
	for (int i = 2; i <= 2*n; i++)
		for (int j = 1; j < i; j++)
		{
			scanf("%d", &x);
			a[m].x = j; a[m].y = i; a[m].v = x;
			m++;
		}
	sort(a, a+m);
	for (int i = 0; i < m; i++)
		if (f[a[i].x] == 0 && f[a[i].y] == 0)
		{
			f[a[i].x] = a[i].y;
			f[a[i].y] = a[i].x;
		}
	for (int i = 1; i <= 2*n; i++)
		printf("%d ", f[i]);
	printf("\n");
	return 0;
}


#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
typedef long long LL;
#define INF 0x3f3f3f3f
#define eps 1e-8

struct Node
{
	int v, x, y;
	bool operator < (const Node& A) const
	{
		return v > A.v;
	}
};

int n, m, x, f[410];
Node a[160010];

int main()
{
	memset(f, 0, sizeof(f));
	m = 0;
	scanf("%d", &n);
	for (int i = 2; i <= 2*n; i++)
		for (int j = 1; j < i; j++)
		{
			scanf("%d", &x);
			a[m].x = j; a[m].y = i; a[m].v = x;
			m++;
		}
	sort(a, a+m);
	for (int i = 0; i < m; i++)
		if (f[a[i].x] == 0 && f[a[i].y] == 0)
		{
			f[a[i].x] = a[i].y;
			f[a[i].y] = a[i].x;
		}
	for (int i = 1; i <= 2*n; i++)
		printf("%d ", f[i]);
	printf("\n");
	return 0;
}


/*
 FindingTeamMember.cc
 Author: Andrea Bisbano
 Date: 15/12/17
 Problem: http://codeforces.com/problemset/problem/579/B?locale=en
 Solution:
  For each member, we want to choose the highest possible strength among every value.
  So we create a set containing every possible team and its strength, we sort it
  in reverse order and then we scan the array and every team with both member still
  umpaired is the best team for those two members.
 Time cost: O(nlogn) that is the cost of the sorting operation, where n is the number of possibile teams.
 Space cost: O(1).
*/

#include <iostream>
#include <cassert>
#include <vector>
#include <algorithm>

#define MAX_VALUE 1000000

class team {
  uint32_t first;
  uint32_t second;
  uint32_t strength;

public:
  uint32_t getFirst() {
    return first;
  }

  uint32_t getSecond() {
    return second;
  }

  team(uint32_t fst, uint32_t snd, uint32_t s) : first(fst), second(snd), strength(s) {}

  friend bool operator>(const team& lhs, const team& rhs) {
    return lhs.strength > rhs.strength;
  }
};

void findingTeamMember(std::vector<team> &vec, std::vector<uint32_t> &result) {
  // Sorting
  std::sort(vec.begin(), vec.end(),
            [](const team &lhs, const team &rhs) { return lhs > rhs; });

  for (auto T : vec) {
    if (result[T.getFirst()] == 0 && result[T.getSecond()] == 0) {
      result[T.getFirst()] = T.getSecond() + 1; // partecipants' numeration starts from 1.
      result[T.getSecond()] = T.getFirst() + 1;
    }
  }
}

int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(NULL);

  size_t N = 0; // Number of teams
  std::vector<team> teams; // Input vector
  uint32_t val;

  std::cin >> N;
  assert(N > 0 && N <= 400);
  teams.reserve((N*(N-1))/2);
  // Array of partecipants, initialized with 0 (special value that means `still umpaired').
  std::vector<uint32_t> result(2*N, 0);

  for (size_t i = 1; i < N*2; ++i) {
    for (size_t j = 0; j < i; ++j) {
      std::cin >> val;
      assert(val >= 0 && val <= MAX_VALUE);
      teams.emplace_back(i, j, val);
    }
  }

  findingTeamMember(teams, result);
  for (auto j : result) {
    std::cout << j << " ";
  }
  std::cout << "\n";
}


/*
 FindingTeamMember.cc
 Author: Andrea Bisbano
 Date: 15/12/17
 Problem: http://codeforces.com/problemset/problem/579/B?locale=en
 Solution:
  For each member, we want to choose the highest possible strength among every value.
  So we create a set containing every possible team and its strength, we sort it
  in reverse order and then we scan the array and every team with both member still
  umpaired is the best team for those two members.
 Time cost: O(nlogn) that is the cost of the sorting operation, where n is the number of possibile teams.
 Space cost: O(1).
*/

#include <iostream>
#include <cassert>
#include <vector>
#include <algorithm>

#define MAX_VALUE 1000000

class team {
  uint32_t first;
  uint32_t second;
  uint32_t strength;

public:
  uint32_t getFirst() {
    return first;
  }

  uint32_t getSecond() {
    return second;
  }

  team(uint32_t fst, uint32_t snd, uint32_t s) : first(fst), second(snd), strength(s) {}

  friend bool operator>(const team& lhs, const team& rhs) {
    return lhs.strength > rhs.strength;
  }
};

void findingTeamMember(std::vector<team> &vec, std::vector<uint32_t> &result) {
  // Sorting
  std::sort(vec.begin(), vec.end(),
            [](const team &lhs, const team &rhs) { return lhs > rhs; });

  for (auto T : vec) {
    if (result[T.getFirst()] == 0 && result[T.getSecond()] == 0) {
      result[T.getFirst()] = T.getSecond() + 1; // partecipants' numeration starts from 1.
      result[T.getSecond()] = T.getFirst() + 1;
    }
  }
}

int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(NULL);

  size_t N = 0; // Number of teams
  std::vector<team> teams; // Input vector
  uint32_t val;

  std::cin >> N;
  assert(N <= 400);
  teams.reserve((N*(N-1))/2);
  // Array of partecipants, initialized with 0 (special value that means `still umpaired').
  std::vector<uint32_t> result(2*N, 0);

  for (size_t i = 1; i < N*2; ++i) {
    for (size_t j = 0; j < i; ++j) {
      std::cin >> val;
      assert(val <= MAX_VALUE);
      teams.emplace_back(i, j, val);
    }
  }

  findingTeamMember(teams, result);
  for (auto j : result) {
    std::cout << j << " ";
  }
  std::cout << "\n";
}


#include <bits/stdc++.h>

using namespace std;

#define hash sodnf9843bsd
#define ll long long
#define INF (1<<29)
#define INFF 0x7fffffff
#define LINF (1ll<<60)
#define LINFF 0x7fffffffffffffff
#define PI 3.14159265359
#define _fi(n) for(int i = 0;i < n;i++)
#define _fj(n) for(int j = 0;j < n;j++)
#define _fk(n) for(int k = 0;k < n;k++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define YESNO(ans) cout << (ans?"YES":"NO") << endl
#define prec(x) cout << fixed << setprecision(x)
#define pqueue priority_queue
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define endl '\n'
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

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

    int n;cin>>n;

    int a[850][850] = {};
    for(int i = 1;i <= 2*n;i++){
        for(int j = 1;j <= i-1;j++){
            cin>>a[i][j];
        }
    }

    int mate[850] = {};

    set<int>p;
    for(int i = 1;i <= 2*n;i++) p.insert(i);

    for(int x = 1;x <= n;x++){
        int best_i = 0;
        int best_j = 0;
        int best_a = 0;
        for(int i:p){
            for(int j:p){
                if (a[i][j] > best_a){
                    best_i = i;
                    best_j = j;
                    best_a = a[i][j];
                }
            }
        }

        p.erase(best_i);
        p.erase(best_j);
        mate[best_i] = best_j;
        mate[best_j] = best_i;
    }

    for(int i = 1;i <= 2*n;i++) cout << mate[i] << " ";

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define hash sodnf9843bsd
#define ll long long
#define INF (1<<29)
#define INFF 0x7fffffff
#define LINF (1ll<<60)
#define LINFF 0x7fffffffffffffff
#define PI 3.14159265359
#define _fi(n) for(int i = 0;i < n;i++)
#define _fj(n) for(int j = 0;j < n;j++)
#define _fk(n) for(int k = 0;k < n;k++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define YESNO(ans) cout << (ans?"YES":"NO") << endl
#define prec(x) cout << fixed << setprecision(x)
#define pqueue priority_queue
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define endl '\n'
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

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

    int n;cin>>n;

    int a[444][444] = {};
    for(int i = 1;i <= 2*n;i++){
        for(int j = 1;j <= i-1;j++){
            cin>>a[i][j];
        }
    }

    int mate[444] = {};
    for(int j = 1;j <= 2*n;j++){
        if (mate[j] > 0) continue;

        int best_i = 0;
        int best_a = 0;
        for(int i = 1;i <= 2*n;i++){
            if (mate[i] > 0) continue;
            if (a[i][j] > best_a){
                best_a = a[i][j];
                best_i = i;
            }
        }

        mate[j] = best_i;
        mate[best_i] = j;
    }

    for(int i = 1;i <= 2*n;i++) cout << mate[i] << " ";

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define hash sodnf9843bsd
#define ll long long
#define INF (1<<29)
#define INFF 0x7fffffff
#define LINF (1ll<<60)
#define LINFF 0x7fffffffffffffff
#define PI 3.14159265359
#define _fi(n) for(int i = 0;i < n;i++)
#define _fj(n) for(int j = 0;j < n;j++)
#define _fk(n) for(int k = 0;k < n;k++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define YESNO(ans) cout << (ans?"YES":"NO") << endl
#define prec(x) cout << fixed << setprecision(x)
#define pqueue priority_queue
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define endl '\n'
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

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

    int n;cin>>n;

    int a[444][444] = {};
    for(int i = 1;i <= 2*n;i++){
        for(int j = 1;j <= i-1;j++){
            cin>>a[i][j];
        }
    }

    int mate[444] = {};

    for(int x = 1;x <= n;x++){
        int best_i = 0;
        int best_j = 0;
        int best_a = 0;
        for(int i = 1;i <= 2*n;i++){
            if (mate[i]>0) continue;
            for(int j = 1;j <= i-1;j++){
                if (mate[j]>0) continue;
                if (a[i][j] > best_a){
                    best_i = i;
                    best_j = j;
                    best_a = a[i][j];
                }
            }
        }

        mate[best_i] = best_j;
        mate[best_j] = best_i;
    }

    for(int i = 1;i <= 2*n;i++) cout << mate[i] << " ";

    return 0;
}


#include<iostream>

using namespace std;

int n , val ;
const int mn = 1000 * 1000 ;
int b [mn][2] , ans[800];
bool checker[840];

int main(){
	cin>>n;
	for (int i = 0 ; i<2*n ; i++){
		for (int j=0 ; j<i ; j++){
			cin>>val;
			b[val][0] = i+1;
			b[val][1] = j+1;
		}
	}
	for (int i = mn ; i>=1 ; i--){
		if (b[i][0] != 0 && b[i][1] != 0 && !checker[b[i][0]] && !checker[b[i][1]]){
			ans[b[i][0]] = b[i][1];
			ans[b[i][1]] = b[i][0];
			checker[b[i][0]] = true ;
			checker[b[i][1]] = true ;
		}
	}
	for (int i = 1 ; i<=2* n ;	cout<<ans[i]<<" ", i++);
}


#include<bits/stdc++.h>

using namespace std;

int n , val ;
const int mn = 1000 * 1000 ;
int b [mn][2] , ans[800];
bool checker[800];

int main(){
	cin>>n;
	for (int i = 2 ; i<2*n ; i++){
		for (int j=1 ; j<i ; j++){
			cin>>val;
			b[val][0] = i;
			b[val][1] = j;
		}
	}
	for (int i = mn ; i>0 ; i--){
		if (b[i][0] != 0 && b[i][1] != 0 && !checker[b[i][0]] && !checker[b[i][1]]){
			ans[b[i][1]] = b[i][0];
			ans[b[i][0]] = b[i][1];
			checker[b[i][0]] = true ;
			checker[b[i][1]] = true ;
		}
	}
	for (int i = 0 ; i< 800 ; i++){
		cout<<ans[i];
	}
}


#include<bits/stdc++.h>
using namespace std;
#define inf 0x3f3f3f3f
#define mes(a,b) memset((a),(b),sizeof((a)))
#define syio std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0);
typedef __int64 ll;
typedef long double real;

const int oo = ~0u >> 2;
const double pi = acos(-1.0);
const double eps = 1e-8;
const int mxn = 100033;
inline int read(){
    int x = 0,f = 1;char c = getchar();
    while(!isdigit(c))f = c == '-' ? -1 : 1,c = getchar();
    while(isdigit(c))x = x * 10 + c - '0',c = getchar();
    return x * f;
}
int n, pr[803];
bool vis[803];
struct node
{
    int a, x, y;
}nd[803*803];//
bool cmp(node x, node y)
{
    return x.a > y.a;
}
int main()
{
    syio;
    while (cin>>n)
    {
        mes(vis, 0); //mes(a, 0);
        int cnt = 0, x;
        for (int i = 2; i <= 2*n; ++ i)
        {
            for (int j = 1; j < i; ++ j)
            {
                cin>>x; //a[j][i] = a[i][j];
                nd[cnt].a = x; nd[cnt].x = i; nd[cnt].y = j;
                cnt ++;
            }
        }
        sort(nd, nd + cnt, cmp);
        for (int i = 0; i < cnt; ++ i)
        {
            if (!vis[nd[i].x] && !vis[nd[i].y])
            {
                pr[nd[i].x] = nd[i].y;
                pr[nd[i].y] = nd[i].x;
                vis[nd[i].x] = 1; vis[nd[i].y] = 1;
            }
        }
        for (int i = 1; i <= 2*n; ++ i)
        cout<<pr[i]<<" ";
        cout<<endl;
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define inf 0x3f3f3f3f
#define mes(a,b) memset((a),(b),sizeof((a)))
#define syio std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0);
typedef __int64 ll;
typedef long double real;

const int oo = ~0u >> 2;
const double pi = acos(-1.0);
const double eps = 1e-8;
const int mxn = 100033;
inline int read(){
    int x = 0,f = 1;char c = getchar();
    while(!isdigit(c))f = c == '-' ? -1 : 1,c = getchar();
    while(isdigit(c))x = x * 10 + c - '0',c = getchar();
    return x * f;
}
int n, pr[803];
bool vis[803];
struct node
{
    int a, x, y;
}nd[403*403];//
bool cmp(node x, node y)
{
    return x.a > y.a;
}
int main()
{
    syio;
    while (cin>>n)
    {
        mes(vis, 0); //mes(a, 0);
        int cnt = 0, x;
        for (int i = 2; i <= 2*n; ++ i)
        {
            for (int j = 1; j < i; ++ j)
            {
                cin>>x; //a[j][i] = a[i][j];
                nd[cnt].a = x; nd[cnt].x = i; nd[cnt].y = j;
                cnt ++;
            }
        }
        sort(nd, nd + cnt, cmp);
        for (int i = 0; i < cnt; ++ i)
        {
            if (!vis[nd[i].x] && !vis[nd[i].y])
            {
                pr[nd[i].x] = nd[i].y;
                pr[nd[i].y] = nd[i].x;
                vis[nd[i].x] = 1; vis[nd[i].y] = 1;
            }
        }
        for (int i = 1; i <= 2*n; ++ i)
        cout<<pr[i]<<" ";
        cout<<endl;
    }

    return 0;
}


#include <iostream>
#include<stdio.h>
#include<climits>
#include<stdlib.h>
#include<algorithm>
#include<cstring>
#include<map>
#include<set>
#include<vector>
#include<cstdio>
#include<cstring>
#define gc getchar
#define lli long long int
using namespace std;
void scanint(long long int &x);

vector< pair< lli , pair< lli , lli> > > v;
lli taken[802];

int main()
{
    lli n;
    scanint(n);
    lli i = 0;
    lli j = 0;
    lli temp;
    for(i = 2;i<=2*n;i++)
    {
        for(j = 1;j<=i-1;j++)
            scanint(temp),v.push_back(make_pair(temp, make_pair(i , j)) );
    }
    sort(v.begin(),v.end());
    lli total = 2*n;
    for(i = v.size()-1;i>=0 && total;i--)
    {
        pair< lli , pair< lli , lli> > p = v[i];
        if(!taken[p.second.first] && !taken[p.second.second])
        {
            taken[p.second.first] = p.second.second;
            taken[p.second.second] = p.second.first;
            total -= 2;
        }
    }
    for(i = 1;i<=2*n;i++)
        cout<<taken[i]<<" ";
    cout<<endl;
    return 0;
}

void scanint(long long int &x)
{
    register int c = gc();
    x = 0;
    int neg = 0;
    for(;((c<48 || c>57) && c != '-');c = gc());
    if(c=='-') {neg=1;c=gc();}
    for(;c>47 && c<58;c = gc()) {x = (x<<1) + (x<<3) + c - 48;}
    if(neg) x=-x;
}


#include <iostream>
#include<stdio.h>
#include<climits>
#include<stdlib.h>
#include<algorithm>
#include<cstring>
#include<map>
#include<set>
#include<vector>
#include<cstdio>
#include<cstring>
#define gc getchar
#define lli long long int
using namespace std;
void scanint(long long int &x);

vector< pair< lli , pair< lli , lli> > > v;
lli taken[401];

int main()
{
    lli n;
    scanint(n);
    lli i = 0;
    lli j = 0;
    lli temp;
    for(i = 2;i<=2*n;i++)
    {
        for(j = 1;j<=i-1;j++)
            scanint(temp),v.push_back(make_pair(temp, make_pair(i , j)) );
    }
    sort(v.begin(),v.end());
    lli total = 2*n;
    for(i = v.size()-1;i>=0 && total;i--)
    {
        pair< lli , pair< lli , lli> > p = v[i];
        if(!taken[p.second.first] && !taken[p.second.second])
        {
            taken[p.second.first] = p.second.second;
            taken[p.second.second] = p.second.first;
            total -= 2;
        }
    }
    for(i = 1;i<=2*n;i++)
        cout<<taken[i]<<" ";
    cout<<endl;
    return 0;
}

void scanint(long long int &x)
{
    register int c = gc();
    x = 0;
    int neg = 0;
    for(;((c<48 || c>57) && c != '-');c = gc());
    if(c=='-') {neg=1;c=gc();}
    for(;c>47 && c<58;c = gc()) {x = (x<<1) + (x<<3) + c - 48;}
    if(neg) x=-x;
}


#include <bits/stdc++.h>
#include <vector>

using namespace std;

bool sortby(const tuple<int,int,int> &a, const tuple<int,int,int> &b)
{
    return (get<2>(a) > get<2>(b));
}

int main(void)
{
    vector<tuple <int, int, int>> members;
    vector<bool> selected;
    vector<int> result;
    int n, i, j, str;

    cin >> n;

    members.reserve(n*(2*n-1));
    result.reserve(2*n+1);

    for(i=0; i<2*n+1; i++)
        result[i] = 0;

    for(i=2; i<=2*n; i++)
        for(j=1; j<=i-1; j++)
        {
            cin >> str;
            members.push_back(make_tuple(i,j,str));
        }

    sort(members.begin(), members.end(), sortby);

    int first, second;

    for(i=0; i<members.size(); i++)
    {
        first = get<0>(members[i]);
        second = get<1>(members[i]);

        if(!result[first] && !result[second])
        {
            result[first] = second;
            result[second] = first;
        }
    }

    for(i=1; i<2*n+1; i++)
        cout << result[i] << " ";

    return 0;
}


//PJ28105

#include <iostream>
#include <cstring>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <stack>
#include <limits.h>
#include <math.h>
#include <utility>
#include <algorithm>
using namespace std;

#define mod 1000000007
#define ll long long
#define tc int t; cin >> t; for(int tt = 1; tt <= t; tt++)
#define ios ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ERR
#ifdef ERR
#define deb(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define deb(...)
#endif

// Dirty Fix
// #define int long long

ll power(ll a,ll b){
    ll res = 1;
    while(b > 0){
        if(b & 1){
            res = ((res % mod) * (a % mod)) % mod;
        }
        b = b >> 1;
        a = ((a % mod) * (a % mod)) % mod;
    }
    return res;
}

int getMax(vector<pair<int,int>> v[],int curr,bool vis[],int val){
    int ans = numeric_limits<int>::min();
    for(auto i : v[curr]){
        if(!vis[i.second] && i.second != val)
            ans = max(ans,i.first);
    }
    return ans;
}

signed main(void)
{
    ios;
    #ifndef ONLINE_JUDGE
        freopen("../in.txt","r",stdin);
    #endif
    int n;
    cin >> n;
    vector<pair<int,int>> v[2*n + 1];
    for(int i = 2; i <= 2*n; i++){
        for(int j = 1; j < i; j++){
            int x;
            cin >> x;
            v[i].push_back({x,j});
            v[j].push_back({x,i});
        }
    }
    for(int i = 2; i <= 2*n; i++){
        sort(v[i].begin(),v[i].end(),[](pair<int,int> a,pair<int,int> b) -> bool{
            return a.first > b.first;
        });
    }
    bool vis[2*n + 1] = {};
    unordered_map<int,int> m;
    for(int i = 1; i <= 2 * n; i++){
        if(!vis[i]){
            for(int j = 0; j < v[i].size(); j++){
                if(!vis[v[i][j].second] && getMax(v,v[i][j].second,vis,i) < v[i][j].first){
                    vis[i] = 1;
                    vis[v[i][j].second] = 1;
                    m[i] = v[i][j].second;
                    m[v[i][j].second] = i;
                    break;
                }
            }
        }
    }
    for(int i = 1; i <= 2*n; i++){
        cout << m[i] <<  " ";
    }
    cout << endl;
    return 0;
}


//PJ28105

#include <iostream>
#include <cstring>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <stack>
#include <limits.h>
#include <math.h>
#include <utility>
#include <algorithm>
using namespace std;

#define mod 1000000007
#define ll long long
#define tc int t; cin >> t; for(int tt = 1; tt <= t; tt++)
#define ios ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ERR
#ifdef ERR
#define deb(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define deb(...)
#endif

// Dirty Fix
// #define int long long

ll power(ll a,ll b){
    ll res = 1;
    while(b > 0){
        if(b & 1){
            res = ((res % mod) * (a % mod)) % mod;
        }
        b = b >> 1;
        a = ((a % mod) * (a % mod)) % mod;
    }
    return res;
}

int getMax(vector<pair<int,int>> v[],int curr,unordered_set<int>&vis){
    for(auto i : v[curr]){
        if(vis.find(i.second) != vis.end())
            return i.first;
    }
    return numeric_limits<int>::min();
}

signed main(void)
{
    ios;
    #ifndef ONLINE_JUDGE
        freopen("../in.txt","r",stdin);
    #endif
    int n;
    cin >> n;
    unordered_set<int> vis;
    vis.insert(1);
    vector<pair<int,int>> v[2*n + 1];
    for(int i = 2; i <= 2*n; i++){
        for(int j = 1; j < i; j++){
            int x;
            cin >> x;
            v[i].push_back({x,j});
            v[j].push_back({x,i});
        }
        vis.insert(i);
    }
    for(int i = 1; i <= 2*n; i++){
        sort(v[i].begin(),v[i].end(),[](pair<int,int> a,pair<int,int> b) -> bool{
            return a.first > b.first;
        });
    }
    unordered_map<int,int> m;
    while(vis.size() != 0){
        for(int i = 1; i <= 2 * n; i++){
            if(vis.find(i) != vis.end()){
                for(auto j : v[i]){
                    if(vis.find(j.second) != vis.end() && getMax(v,j.second,vis) == j.first){
                        vis.erase(i);
                        vis.erase(j.second);
                        m[i] = j.second;
                        m[j.second] = i;
                        break;
                    }
                }
            }
        }
    }
    for(int i = 1; i <= 2*n; i++){
        cout << m[i] <<  " ";
    }
    cout << endl;
    return 0;
}


//PJ28105

#include <iostream>
#include <cstring>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <stack>
#include <limits.h>
#include <math.h>
#include <utility>
#include <algorithm>
using namespace std;

#define mod 1000000007
#define ll long long
#define tc int t; cin >> t; for(int tt = 1; tt <= t; tt++)
#define ios ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ERR
#ifdef ERR
#define deb(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define deb(...)
#endif

// Dirty Fix
#define int long long

ll power(ll a,ll b){
    ll res = 1;
    while(b > 0){
        if(b & 1){
            res = ((res % mod) * (a % mod)) % mod;
        }
        b = b >> 1;
        a = ((a % mod) * (a % mod)) % mod;
    }
    return res;
}

int getMax(vector<pair<int,int>> v[],int curr,unordered_set<int>&vis){
    for(auto i : v[curr]){
        if(vis.find(i.second) != vis.end())
            return i.first;
    }
    return -1;
}

signed main(void)
{
    ios;
    #ifndef ONLINE_JUDGE
        freopen("../in.txt","r",stdin);
    #endif
    int n;
    cin >> n;
    unordered_set<int> vis;
    priority_queue<pair<int,pair<int,int>>,vector<pair<int,pair<int,int>>>> q;
    for(int i = 2; i <= 2*n; i++){
        for(int j = 1; j < i; j++){
            int x;
            cin >> x;
            q.push({x,{i,j}});
        }
    }
    unordered_map<int,int> m;
    while(!q.empty()){
        pair<int,pair<int,int>> x = q.top();
       // deb(x.first);
        q.pop();
        if(vis.find(x.second.first) == vis.end() &&
            vis.find(x.second.second) == vis.end()){
                vis.insert(x.second.first);
                vis.insert(x.second.second);
                m[x.second.first] = x.second.second;
                m[x.second.second] = x.second.first;
            }
    }
    for(int i = 1; i <= 2*n; i++){
        cout << m[i] <<  " ";
    }
    cout << endl;
    return 0;
}


//PJ28105

#include <iostream>
#include <cstring>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <stack>
#include <limits.h>
#include <math.h>
#include <utility>
#include <algorithm>
using namespace std;

#define mod 1000000007
#define ll long long
#define tc int t; cin >> t; for(int tt = 1; tt <= t; tt++)
#define ios ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ERR
#ifdef ERR
#define deb(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define deb(...)
#endif

// Dirty Fix
// #define int long long

ll power(ll a,ll b){
    ll res = 1;
    while(b > 0){
        if(b & 1){
            res = ((res % mod) * (a % mod)) % mod;
        }
        b = b >> 1;
        a = ((a % mod) * (a % mod)) % mod;
    }
    return res;
}

int getMax(vector<pair<int,int>> v[],int curr,bool vis[],int val){
    int ans = numeric_limits<int>::min();
    for(auto i : v[curr]){
        if(!vis[i.second] && i.second != val)
            ans = max(ans,i.first);
    }
    return ans;
}

signed main(void)
{
    ios;
    #ifndef ONLINE_JUDGE
        freopen("../in.txt","r",stdin);
    #endif
    int n;
    cin >> n;
    vector<pair<int,int>> v[2*n + 1];
    for(int i = 2; i <= 2*n; i++){
        for(int j = 1; j < i; j++){
            int x;
            cin >> x;
            v[i].push_back({x,j});
            v[j].push_back({x,i});
        }
    }
    for(int i = 1; i <= 2*n; i++){
        sort(v[i].begin(),v[i].end(),[](pair<int,int> a,pair<int,int> b) -> bool{
            return a.first > b.first;
        });
    }
    bool vis[2*n + 1] = {};
    unordered_map<int,int> m;
    for(int i = 1; i <= 2 * n; i++){
        if(!vis[i]){
            for(int j = 0; j < v[i].size(); j++){
                if(!vis[v[i][j].second] && getMax(v,v[i][j].second,vis,i) < v[i][j].first){
                    vis[i] = 1;
                    vis[v[i][j].second] = 1;
                    m[i] = v[i][j].second;
                    m[v[i][j].second] = i;
                    break;
                }
            }
        }
    }
    for(int i = 1; i <= 2*n; i++){
        cout << m[i] <<  " ";
    }
    cout << endl;
    return 0;
}


//PJ28105

#include <iostream>
#include <cstring>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <stack>
#include <limits.h>
#include <math.h>
#include <utility>
#include <algorithm>
using namespace std;

#define mod 1000000007
#define ll long long
#define tc int t; cin >> t; for(int tt = 1; tt <= t; tt++)
#define ios ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ERR
#ifdef ERR
#define deb(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define deb(...)
#endif

// Dirty Fix
#define int long long

ll power(ll a,ll b){
    ll res = 1;
    while(b > 0){
        if(b & 1){
            res = ((res % mod) * (a % mod)) % mod;
        }
        b = b >> 1;
        a = ((a % mod) * (a % mod)) % mod;
    }
    return res;
}

int getMax(vector<pair<int,int>> v[],int curr,unordered_set<int>&vis){
    for(auto i : v[curr]){
        if(vis.find(i.second) != vis.end())
            return i.first;
    }
    return -1;
}

signed main(void)
{
    ios;
    #ifndef ONLINE_JUDGE
        freopen("../in.txt","r",stdin);
    #endif
    int n;
    cin >> n;
    unordered_set<int> vis;
    priority_queue<pair<int,pair<int,int>>,vector<pair<int,pair<int,int>>>> q;
    for(int i = 2; i <= 2*n; i++){
        for(int j = 1; j < i; j++){
            int x;
            cin >> x;
            q.push({x,{i,j}});
        }
    }
    unordered_map<int,int> m;
    while(!q.empty()){
        pair<int,pair<int,int>> x = q.top();
        deb(x.first);
        q.pop();
        if(vis.find(x.second.first) == vis.end() &&
            vis.find(x.second.second) == vis.end()){
                vis.insert(x.second.first);
                vis.insert(x.second.second);
                m[x.second.first] = x.second.second;
                m[x.second.second] = x.second.first;
            }
    }
    for(int i = 1; i <= 2*n; i++){
        cout << m[i] <<  " ";
    }
    cout << endl;
    return 0;
}


#include<bits/stdc++.h>
typedef long long ll;
#define F first
#define S second
#define ii pair<int , int>
#define iii pair<int , ii>
using namespace std;

int main(){
	int n;
	scanf("%d" , &n);
	int a[n+100]={0};
	vector<iii> v;
	for(int i=1 ; i<=2*n ; i++){
		for(int j=1 ; j<i ; j++){
			int in;
			scanf("%d" , &in);
			v.push_back({in ,{ i , j} });
		}
	}
	sort(v.begin() , v.end());
	reverse(v.begin() , v.end());
	for(auto x : v){
		if(!a[x.S.F] && !a[x.S.S])
			a[x.S.F] = x.S.S , a[x.S.S] = x.S.F;
	}
	for(int i=1 ; i<=2*n ; i++){
		printf("%d " , a[i]);
	}
}


#include<bits/stdc++.h>
typedef long long ll;
#define F first
#define S second
#define ii pair<int , int>
#define iii pair<int , ii>
using namespace std;

int main(){
	int n;
	scanf("%d" , &n);
	int a[2*n+100]={0};
	vector<iii> v;
	for(int i=1 ; i<=2*n ; i++){
		for(int j=1 ; j<i ; j++){
			int in;
			scanf("%d" , &in);
			v.push_back({in ,{ i , j} });
		}
	}
	sort(v.begin() , v.end());
	reverse(v.begin() , v.end());
	for(auto x : v){
		if(!a[x.S.F] && !a[x.S.S])
			a[x.S.F] = x.S.S , a[x.S.S] = x.S.F;
	}
	for(int i=1 ; i<=2*n ; i++){
		printf("%d " , a[i]);
	}
}


#include <bits/stdc++.h>

// limit
#define oo 1000000007LL
#define OO 10000000000000007LL
#define maxN 1007

// loop
#define fto(i, x, y) for(int i = (x); i <= (y); ++i)
#define fdto(i, x, y) for(int i = (x); i >= (y); --i)
#define ftoa(i, x, y, a) for(int i = (x); i <= (y); i += a)
#define fdtoa(i, x, y, a) for(int i = (x); i >= (y); i -= a)
#define ftosqrt(i, x, y) for(int i = (x); i*i <= (y); ++i)
#define ftoit(it, var) for (__typeof(var.begin()) it = var.begin(); it != var.end(); ++it)
#define fdtoit(rit, var) for (__typeof(var.rbegin()) rit = var.rbegin(); rit != var.rend(); ++rit)

// debug
#define debug cout << "*" << endl;
#define bug1d(a, x, y) { cout << #a << ": "; fto(_, x, y) cout << a[_] << ' '; cout << endl; }
#define bug2d(a, x, y, u, v) { cout << #a << ": " << endl; fto(i, x, y) {fto(j, u, v) cout << a[i][j] << ' '; cout << endl;}; cout << endl;}
#define bug(a) cout << #a << " = " << a << endl;
#define bug2(a, b) cout << #a << " = " << a << "; "; cout << #b << " = " << b << endl;
#define bug3(a, b, c) cout << #a << " = " << a << "; "; cout << #b << " = " << b << "; "; cout << #c << " = " << c << endl;

// operation
#define mp make_pair
#define pb push_back
#define pf push_front

// structure
#define ii pair<int, int>
#define vi vector<int>
#define vll vector<ll>
#define vii vector<ii>
#define matrix vector<vi>

// get value
#define FF first
#define SS second
#define TT third

// data type
#define ll long long
#define ull unsigned long long

// function
#define lb lower_bound
#define ub upper_bound

// const value
#define pi 3.14159265358979323846264338327950288419716939937510

using namespace std;

int a[maxN][maxN];
int visited[maxN];
vii ans[maxN];

int main() {
    #ifndef ONLINE_JUDGE
        freopen("tmp.inp", "r", stdin);
        freopen("tmp.out", "w", stdout);
    #endif // ONLINE_JUDGE

    int n;
    scanf("%d", &n);

    fto (i, 2, 2*n) {
        fto (j, 1, i-1) {
            scanf("%d", &a[i][j]);
            a[j][i] = a[i][j];
        }
    }

    fto (i, 1, 2*n) {
        fto (j, 1, 2*n) {
            ans[i].pb(mp(a[j][i], j));
        }
        sort(ans[i].begin(), ans[i].end());
    }

//    fto (i, 1, 2*n) {
//        fto (i, 1, 2*n) cout << ans[i].back().SS << " ";
//        puts("");
//        fto (i, 1, 2*n) ans[i].pop_back();
//    }
    fto (k, 1, 7*n) {
//        fto (i, 1, 2*n) if (visited[i]) cout << "  "; else cout << ans[i].back().SS << " ";
//        puts("");
        fto (i, 1, 2*n) {
            if (visited[i]) continue;
            int pos = ans[i].back().SS;
            if (visited[pos]) {
                ans[i].pop_back();
                continue;
            }
            if (ans[pos].back().SS == i) {
                visited[pos] = i;
                visited[i] = pos;
            }
        }
    }

    fto (i, 1, 2*n) printf("%d ", visited[i]);

    return 0;
}


#include <bits/stdc++.h>

// limit
#define oo 1000000007LL
#define OO 10000000000000007LL
#define maxN 507

// loop
#define fto(i, x, y) for(int i = (x); i <= (y); ++i)
#define fdto(i, x, y) for(int i = (x); i >= (y); --i)
#define ftoa(i, x, y, a) for(int i = (x); i <= (y); i += a)
#define fdtoa(i, x, y, a) for(int i = (x); i >= (y); i -= a)
#define ftosqrt(i, x, y) for(int i = (x); i*i <= (y); ++i)
#define ftoit(it, var) for (__typeof(var.begin()) it = var.begin(); it != var.end(); ++it)
#define fdtoit(rit, var) for (__typeof(var.rbegin()) rit = var.rbegin(); rit != var.rend(); ++rit)

// debug
#define debug cout << "*" << endl;
#define bug1d(a, x, y) { cout << #a << ": "; fto(_, x, y) cout << a[_] << ' '; cout << endl; }
#define bug2d(a, x, y, u, v) { cout << #a << ": " << endl; fto(i, x, y) {fto(j, u, v) cout << a[i][j] << ' '; cout << endl;}; cout << endl;}
#define bug(a) cout << #a << " = " << a << endl;
#define bug2(a, b) cout << #a << " = " << a << "; "; cout << #b << " = " << b << endl;
#define bug3(a, b, c) cout << #a << " = " << a << "; "; cout << #b << " = " << b << "; "; cout << #c << " = " << c << endl;

// operation
#define mp make_pair
#define pb push_back
#define pf push_front

// structure
#define ii pair<int, int>
#define vi vector<int>
#define vll vector<ll>
#define vii vector<ii>
#define matrix vector<vi>

// get value
#define FF first
#define SS second
#define TT third

// data type
#define ll long long
#define ull unsigned long long

// function
#define lb lower_bound
#define ub upper_bound

// const value
#define pi 3.14159265358979323846264338327950288419716939937510

using namespace std;

int a[maxN][maxN];
int visited[maxN];
vii ans[maxN];

int main() {
    #ifndef ONLINE_JUDGE
        freopen("tmp.inp", "r", stdin);
        freopen("tmp.out", "w", stdout);
    #endif // ONLINE_JUDGE

    int n;
    scanf("%d", &n);

    fto (i, 2, 2*n) {
        fto (j, 1, i-1) {
            scanf("%d", &a[i][j]);
            a[j][i] = a[i][j];
        }
    }

    fto (i, 1, 2*n) {
        fto (j, 1, 2*n) {
            ans[i].pb(mp(a[j][i], j));
        }
        sort(ans[i].begin(), ans[i].end());
    }

    fto (k, 1, 2*n) {
        fto (i, 1, 2*n) {
            if (visited[i]) continue;
            int pos = ans[i].back().SS;
            if (ans[pos].back().SS == i && !visited[pos]) {
                visited[pos] = i;
                visited[i] = pos;
            }
            ans[i].pop_back();
        }
    }

    fto (i, 1, 2*n) printf("%d ", visited[i]);

    return 0;
}


#include <bits/stdc++.h>

// limit
#define oo 1000000007LL
#define OO 10000000000000007LL
#define maxN 1007

// loop
#define fto(i, x, y) for(int i = (x); i <= (y); ++i)
#define fdto(i, x, y) for(int i = (x); i >= (y); --i)
#define ftoa(i, x, y, a) for(int i = (x); i <= (y); i += a)
#define fdtoa(i, x, y, a) for(int i = (x); i >= (y); i -= a)
#define ftosqrt(i, x, y) for(int i = (x); i*i <= (y); ++i)
#define ftoit(it, var) for (__typeof(var.begin()) it = var.begin(); it != var.end(); ++it)
#define fdtoit(rit, var) for (__typeof(var.rbegin()) rit = var.rbegin(); rit != var.rend(); ++rit)

// debug
#define debug cout << "*" << endl;
#define bug1d(a, x, y) { cout << #a << ": "; fto(_, x, y) cout << a[_] << ' '; cout << endl; }
#define bug2d(a, x, y, u, v) { cout << #a << ": " << endl; fto(i, x, y) {fto(j, u, v) cout << a[i][j] << ' '; cout << endl;}; cout << endl;}
#define bug(a) cout << #a << " = " << a << endl;
#define bug2(a, b) cout << #a << " = " << a << "; "; cout << #b << " = " << b << endl;
#define bug3(a, b, c) cout << #a << " = " << a << "; "; cout << #b << " = " << b << "; "; cout << #c << " = " << c << endl;

// operation
#define mp make_pair
#define pb push_back
#define pf push_front

// structure
#define ii pair<int, int>
#define vi vector<int>
#define vll vector<ll>
#define vii vector<ii>
#define matrix vector<vi>

// get value
#define FF first
#define SS second
#define TT third

// data type
#define ll long long
#define ull unsigned long long

// function
#define lb lower_bound
#define ub upper_bound

// const value
#define pi 3.14159265358979323846264338327950288419716939937510

using namespace std;

int a[maxN][maxN];
int visited[maxN];
vii ans[maxN];

int main() {
    #ifndef ONLINE_JUDGE
        freopen("tmp.inp", "r", stdin);
        freopen("tmp.out", "w", stdout);
    #endif // ONLINE_JUDGE

    int n;
    scanf("%d", &n);

    fto (i, 2, 2*n) {
        fto (j, 1, i-1) {
            scanf("%d", &a[i][j]);
            a[j][i] = a[i][j];
        }
    }

    fto (i, 1, 2*n) {
        fto (j, 1, 2*n) {
            ans[i].pb(mp(a[j][i], j));
        }
        sort(ans[i].begin(), ans[i].end());
    }

    fto (k, 1, 2*n) {
        fto (i, 1, 2*n) {
            if (visited[i]) continue;
            int pos = ans[i].back().SS;
            if (ans[pos].back().SS == i && !visited[pos]) {
                visited[pos] = i;
                visited[i] = pos;
            }
            ans[i].pop_back();
        }
    }

    fto (i, 1, 2*n) printf("%d ", visited[i]);

    return 0;
}


#include <bits/stdc++.h>

// limit
#define oo 1000000007LL
#define OO 10000000000000007LL
#define maxN 1007

// loop
#define fto(i, x, y) for(int i = (x); i <= (y); ++i)
#define fdto(i, x, y) for(int i = (x); i >= (y); --i)
#define ftoa(i, x, y, a) for(int i = (x); i <= (y); i += a)
#define fdtoa(i, x, y, a) for(int i = (x); i >= (y); i -= a)
#define ftosqrt(i, x, y) for(int i = (x); i*i <= (y); ++i)
#define ftoit(it, var) for (__typeof(var.begin()) it = var.begin(); it != var.end(); ++it)
#define fdtoit(rit, var) for (__typeof(var.rbegin()) rit = var.rbegin(); rit != var.rend(); ++rit)

// debug
#define debug cout << "*" << endl;
#define bug1d(a, x, y) { cout << #a << ": "; fto(_, x, y) cout << a[_] << ' '; cout << endl; }
#define bug2d(a, x, y, u, v) { cout << #a << ": " << endl; fto(i, x, y) {fto(j, u, v) cout << a[i][j] << ' '; cout << endl;}; cout << endl;}
#define bug(a) cout << #a << " = " << a << endl;
#define bug2(a, b) cout << #a << " = " << a << "; "; cout << #b << " = " << b << endl;
#define bug3(a, b, c) cout << #a << " = " << a << "; "; cout << #b << " = " << b << "; "; cout << #c << " = " << c << endl;

// operation
#define mp make_pair
#define pb push_back
#define pf push_front

// structure
#define ii pair<int, int>
#define vi vector<int>
#define vll vector<ll>
#define vii vector<ii>
#define matrix vector<vi>

// get value
#define FF first
#define SS second
#define TT third

// data type
#define ll long long
#define ull unsigned long long

// function
#define lb lower_bound
#define ub upper_bound

// const value
#define pi 3.14159265358979323846264338327950288419716939937510

using namespace std;

int a[maxN][maxN];
int visited[maxN];
vii ans[maxN];

int main() {
    #ifndef ONLINE_JUDGE
        freopen("tmp.inp", "r", stdin);
        freopen("tmp.out", "w", stdout);
    #endif // ONLINE_JUDGE

    int n;
    scanf("%d", &n);

    fto (i, 2, 2*n) {
        fto (j, 1, i-1) {
            scanf("%d", &a[i][j]);
            a[j][i] = a[i][j];
        }
    }

    fto (i, 1, 2*n) {
        fto (j, 1, 2*n) {
            ans[i].pb(mp(a[j][i], j));
        }
        sort(ans[i].begin(), ans[i].end());
    }

//    fto (i, 1, 2*n) {
//        fto (i, 1, 2*n) cout << ans[i].back().SS << " ";
//        puts("");
//        fto (i, 1, 2*n) ans[i].pop_back();
//    }
    fto (k, 1, 2*n) {
//        fto (i, 1, 2*n) if (visited[i]) cout << "  "; else cout << ans[i].back().SS << " ";
//        puts("");
        fto (i, 1, 2*n) {
            if (visited[i]) continue;
            int pos = ans[i].back().SS;
            if (visited[pos]) {
                ans[i].pop_back();
                continue;
            }
            if (ans[pos].back().SS == i) {
                visited[pos] = i;
                visited[i] = pos;
            }
        }
    }

    fto (i, 1, 2*n) printf("%d ", visited[i]);

    return 0;
}


# include <iostream>
# include <sstream>
# include <cstdio>
# include <cstdlib>
# include <algorithm>
# include <string>
# include <cstring>
# include <cmath>
# include <stack>
# include <queue>
# include <vector>
# include <list>
# include <map>
# include <set>
# include <deque>
# include <iterator>
# include <functional>
# include <bitset>
# include <climits>
# include <ctime>
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define odd(x) ((x)%2)
typedef long long ll;
typedef long double ld;
const ll oo=2*1000*1000*1000;
const int _cnt=1000*1000;
const int _p=1000*1000*1000+7;
int o(int x) { return x%_p; }
int gcd(int a,int b) { return (b)?gcd(b,a%b):a; }
int lcm(int a,int b) { return a/gcd(a,b)*b; }
using namespace std;

void file_put(){
	freopen("filename.in","r",stdin);
	freopen("filename.out","w",stdout);
}

struct scoretype{
	int x,y,score;
};

int n,ans[2005],x,cnt=0;
scoretype score[1000005];
bool v[2005];

bool cmp(scoretype s,scoretype t){
	return s.score>t.score;
}

int main(){
	//file_put();

	scanf("%d",&n);
	memset(v,false,sizeof(v));
	for (int i=2; i<=2*n; i++)
		for (int j=1; j<=i-1; j++) {
			scanf("%d",&x);
			score[++cnt].x=i;
			score[cnt].y=j;
			score[cnt].score=x;
		}
	sort(score+1,score+cnt+1,cmp);
	for (int i=1; i<=cnt; i++){
		if (v[score[i].x] || v[score[i].y]) continue;
		v[score[i].x]=true;
		v[score[i].y]=true;
		ans[score[i].x]=score[i].y;
		ans[score[i].y]=score[i].x;
	}
	for (int j=1; j<=2*n-1; j++) printf("%d ",ans[j]);
	printf("%d\n",ans[2*n]);

	return 0;
}


# include <iostream>
# include <sstream>
# include <cstdio>
# include <cstdlib>
# include <algorithm>
# include <string>
# include <cstring>
# include <cmath>
# include <stack>
# include <queue>
# include <vector>
# include <list>
# include <map>
# include <set>
# include <deque>
# include <iterator>
# include <functional>
# include <bitset>
# include <climits>
# include <ctime>
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define odd(x) ((x)%2)
typedef long long ll;
typedef long double ld;
const ll oo=2*1000*1000*1000;
const int _cnt=1000*1000;
const int _p=1000*1000*1000+7;
int o(int x) { return x%_p; }
int gcd(int a,int b) { return (b)?gcd(b,a%b):a; }
int lcm(int a,int b) { return a/gcd(a,b)*b; }
using namespace std;

void file_put(){
	freopen("filename.in","r",stdin);
	freopen("filename.out","w",stdout);
}

struct scoretype{
	int x,y,score;
};

int n,ans[2005],x,cnt=0;
scoretype score[200005];
bool v[2005];

bool cmp(scoretype s,scoretype t){
	return s.score>t.score;
}

int main(){
	//file_put();

	scanf("%d",&n);
	for (int i=2; i<=2*n; i++)
		for (int j=1; j<=i-1; j++) {
			scanf("%d",&x);
			score[++cnt].x=i;
			score[cnt].y=j;
			score[cnt].score=x;
		}
	sort(score+1,score+cnt+1,cmp);
	for (int i=1; i<=cnt; i++){
		if (v[score[i].x] || v[score[i].y]) continue;
		v[score[i].x]=true;
		v[score[i].y]=true;
		ans[score[i].x]=score[i].y;
		ans[score[i].y]=score[i].x;
	}
	for (int j=1; j<=2*n-1; j++) printf("%d ",ans[j]);
	printf("%d\n",ans[2*n]);

	return 0;
}


# include <iostream>
# include <sstream>
# include <cstdio>
# include <cstdlib>
# include <algorithm>
# include <string>
# include <cstring>
# include <cmath>
# include <stack>
# include <queue>
# include <vector>
# include <list>
# include <map>
# include <set>
# include <deque>
# include <iterator>
# include <functional>
# include <bitset>
# include <climits>
# include <ctime>
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define odd(x) ((x)%2)
typedef long long ll;
typedef long double ld;
const ll oo=2*1000*1000*1000;
const int _cnt=1000*1000;
const int _p=1000*1000*1000+7;
int o(int x) { return x%_p; }
int gcd(int a,int b) { return (b)?gcd(b,a%b):a; }
int lcm(int a,int b) { return a/gcd(a,b)*b; }
using namespace std;

void file_put(){
	freopen("filename.in","r",stdin);
	freopen("filename.out","w",stdout);
}

struct scoretype{
	int x,y,score;
};

int n,ans[2005],x,cnt=0;
scoretype score[200005];
bool v[2005];

bool cmp(scoretype s,scoretype t){
	return s.score>t.score;
}

int main(){
	file_put();

	scanf("%d",&n);
	memset(v,false,sizeof(v));
	for (int i=2; i<=2*n; i++)
		for (int j=1; j<=i-1; j++) {
			scanf("%d",&x);
			score[++cnt].x=i;
			score[cnt].y=j;
			score[cnt].score=x;
		}
	sort(score+1,score+cnt+1,cmp);
	for (int i=1; i<=cnt; i++){
		if (v[score[i].x] || v[score[i].y]) continue;
		v[score[i].x]=true;
		v[score[i].y]=true;
		ans[score[i].x]=score[i].y;
		ans[score[i].y]=score[i].x;
	}
	for (int j=1; j<=2*n-1; j++) printf("%d ",ans[j]);
	printf("%d\n",ans[2*n]);

	return 0;
}


# include <iostream>
# include <sstream>
# include <cstdio>
# include <cstdlib>
# include <algorithm>
# include <string>
# include <cstring>
# include <cmath>
# include <stack>
# include <queue>
# include <vector>
# include <list>
# include <map>
# include <set>
# include <deque>
# include <iterator>
# include <functional>
# include <bitset>
# include <climits>
# include <ctime>
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define odd(x) ((x)%2)
typedef long long ll;
typedef long double ld;
const ll oo=2*1000*1000*1000;
const int _cnt=1000*1000;
const int _p=1000*1000*1000+7;
int o(int x) { return x%_p; }
int gcd(int a,int b) { return (b)?gcd(b,a%b):a; }
int lcm(int a,int b) { return a/gcd(a,b)*b; }
using namespace std;

void file_put(){
	freopen("filename.in","r",stdin);
	freopen("filename.out","w",stdout);
}

struct scoretype{
	int x,y,score;
};

int n,ans[2005],x,cnt=0;
scoretype score[200005];
bool v[2005];

bool cmp(scoretype s,scoretype t){
	return s.score>t.score;
}

int main(){
	//file_put();

	scanf("%d",&n);
	memset(v,false,sizeof(v));
	for (int i=2; i<=2*n; i++)
		for (int j=1; j<=i-1; j++) {
			scanf("%d",&x);
			score[++cnt].x=i;
			score[cnt].y=j;
			score[cnt].score=x;
		}
	sort(score+1,score+cnt+1,cmp);
	for (int i=1; i<=cnt; i++){
		if (v[score[i].x] || v[score[i].y]) continue;
		v[score[i].x]=true;
		v[score[i].y]=true;
		ans[score[i].x]=score[i].y;
		ans[score[i].y]=score[i].x;
	}
	for (int j=1; j<=2*n-1; j++) printf("%d ",ans[j]);
	printf("%d\n",ans[2*n]);

	return 0;
}


#include <iostream>
#include <iosfwd>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <cassert>
#include <cctype>
#include <climits>
#include <vector>
#include <bitset>
#include <set>
#include <queue>
#include <math.h>
#include <stack>
#include <map>
#include <deque>
#include <string>
#include <list>
#include <iterator>
#include <sstream>
#include <complex>
#include <fstream>
#include <functional>
#include <numeric>
#include <utility>
#include <algorithm>
#include <assert.h>
#include <unordered_map>
#pragma GCC optimize ("-O3")
using namespace std;
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cerr.tie(NULL);
#define tolower(s) transform(s.begin(),s.end(),s.begin(),::tolower);
#define toupper(s) transform(s.begin(),s.end(),s.begin(),::toupper);
#define ll long long int
#define case(i) cout<<"Case #"<<i<<": ";
#define pii pair <ll , ll >
#define pb push_back
#define PRECISION 10
const ll inf = 1e16;
const int MAXN = 1001;
const ll mod = 1e9 + 7;
const ll MOD1 = 998244353;
void getac(int T) {
	ll n;
	cin>>n;
	set < int > s;
	vector < vector < pair  < int , int > > >  adj(2*n+1);
	int ans[2*n+1];
	memset(ans,-1,sizeof(ans));
	priority_queue < pair < int , pair < int , int > > > pq;
	for(int i=2;i<=2*n;i++){
		for(int j=1;j<i;j++){
			int x;
			cin>>x;
			pq.push({x,{i,j}});

		}
	}
	while(!pq.empty()){
		pair < int , pair < int , int > > t=pq.top();
		pq.pop();
		int cost=t.first;
		int x=t.second.first;
		int y=t.second.second;
		if(s.find(y)==s.end() && s.find(x)==s.end()){
			ans[y]=x;
			ans[x]=y;
			s.insert(x);
			s.insert(y);
		}
	}
	for(int i=0;i<2*n;i++){
		cout<<ans[i+1]<<' ';
	}
}
int  main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	fastio;
	int t = 1;
	//cin >> t;
	t=1;
	int t_t = 1;
	while (t--) {
		//case(t_t);
		getac(t_t);
		//cout << '\n';
		t_t++;

	}
	return 0;
}


#include <iostream>
#include <iosfwd>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <cassert>
#include <cctype>
#include <climits>
#include <vector>
#include <bitset>
#include <set>
#include <queue>
#include <math.h>
#include <stack>
#include <map>
#include <deque>
#include <string>
#include <list>
#include <iterator>
#include <sstream>
#include <complex>
#include <fstream>
#include <functional>
#include <numeric>
#include <utility>
#include <algorithm>
#include <assert.h>
#include <unordered_map>
#pragma GCC optimize ("-O3")
using namespace std;
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cerr.tie(NULL);
#define tolower(s) transform(s.begin(),s.end(),s.begin(),::tolower);
#define toupper(s) transform(s.begin(),s.end(),s.begin(),::toupper);
#define ll long long int
#define case(i) cout<<"Case #"<<i<<": ";
#define pii pair <ll , ll >
#define pb push_back
#define PRECISION 10
const ll inf = 1e16;
const int MAXN = 1001;
const ll mod = 1e9 + 7;
const ll MOD1 = 998244353;
void getac(int T) {
	ll n;
	cin>>n;
	set < int > s;
	vector < vector < pair  < int , int > > >  adj(2*n+1);
	int ans[2*n+1];
	memset(ans,-1,sizeof(ans));
	for(int i=2;i<=2*n;i++){
		for(int j=1;j<i;j++){
			int x;
			cin>>x;
			adj[j].push_back({x,i});
			adj[i].push_back({x,j});
		}
	}

	for(int i=1;i<=2*n;i++){
		sort(adj[i].begin(),adj[i].end());
		reverse(adj[i].begin(),adj[i].end());

		for(int j=0;j<adj[i].size();j++){
			int pa=adj[i][j].second;
			if(s.find(pa)==s.end() && s.find(i)==s.end()){
				s.insert(i);
				s.insert(pa);
				ans[i]=pa;
				ans[pa]=i;
				break;
			}
		}
		//cout<<'\n';
	}
	for(int i=0;i<2*n;i++){
		cout<<ans[i+1]<<' ';
	}
}
int  main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	fastio;
	int t = 1;
	//cin >> t;
	t=1;
	int t_t = 1;
	while (t--) {
		//case(t_t);
		getac(t_t);
		//cout << '\n';
		t_t++;

	}
	return 0;
}


/*author @dhanush*/

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL)
#define pb push_back
#define se second
#define fi first

void icchhipadey()
{
  ll n;
  cin>>n;
  pair<ll,pair<ll,ll>> arr[n*(2*n-1)];
  ll size=n*(2*n-1);
  ll vis[2*n+1]={0};
  ll ind=0;
  for(int i=2;i<=2*n;i++)
  {
  	for(int j=1;j<i;j++)
  	{
  	   cin>>arr[ind].fi;
	   arr[ind].se.fi=i;
	   arr[ind].se.se=j;
	   ind++;
    }

  }
  sort(arr,arr+size);
  ll ans[2*n+1];
  for(int i=size-1;i>=0;i--)
  {
  	if(vis[arr[i].se.fi]==0&&vis[arr[i].se.se]==0)
  	{
  	     vis[arr[i].se.fi]=1;
		 vis[arr[i].se.se]=1;
		 ans[arr[i].se.fi]=arr[i].se.se;
		 ans[arr[i].se.se]=arr[i].se.fi;
	}
  }
  for(int i=1;i<=2*n;i++)
  {
  	cout<<ans[i]<<" ";
  }
  cout<<endl;

}

int main()
{
  boost;
  icchhipadey();
}


#include <cstdio>
#include <vector>
#include <algorithm>
#define ii pair<int,int>
#define iii pair<int, pair<int,int> >

using namespace std;

int main() {
	int N, a;
	vector<int> t;
	vector<iii> tuples;
	scanf("%d", &N);
	t.assign(2*N,-1);
	for(int i=0; i<2*N; i++) {
		for(int j=0; j<i; j++) {
			scanf("%d", &a);
			tuples.push_back(iii(a,ii(i,j)));
		}
	}
	sort(tuples.begin(), tuples.end());
	for(auto it = tuples.rbegin(); it!=tuples.rend(); it++) {
		if(t[(*it).second.first]==-1 && t[(*it).second.second]==-1) { // if the couple is not formed yet
			t[(*it).second.first] = (*it).second.second;
			t[(*it).second.second] = (*it).second.first;
		}
	}

	for(int i=0; i<2*N; i++)
		printf("%d ", t[i]+1); // off by one
	return 0;
}


#include <cstdio>
#include <vector>
#include <algorithm>
#define ii pair<int,int>
#define iii pair<int, pair<int,int> >

using namespace std;

int main() {
	int N, a;
	vector<int> t;
	vector<iii> tuples;
	scanf("%d", &N);
	t.assign(2*N,-1);
	for(int i=0; i<2*N; i++) {
		for(int j=0; j<i; j++) {
			scanf("%d", &a);
			tuples.push_back(iii(a,ii(i,j)));
		}
	}

	sort(tuples.begin(), tuples.end());

	for(auto it = tuples.rbegin(); it!=tuples.rend(); it++) {
		if(t[(*it).second.first]==-1 && t[(*it).second.second]==-1) { // if the couple is not formed yet
			t[(*it).second.first] = (*it).second.second;
			t[(*it).second.second] = (*it).second.first;
		}
	}

	for(int i=0; i<2*N; i++)
		printf("%d ", t[i]+1); // off by one
	return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;

vector < pair <int , pair<int , int> > > a;
bool mark[810];
int ans[810];
int main(){

	int n , x , k;
	cin >> n;
	n*= 2;
	for(int i = 2 ; i <= n ; i++){
		for(int j = 1 ; j < i ; j++){
			cin >> x;
			a.push_back(make_pair(x , make_pair(i , j)));
		}
	}

	sort(a.rbegin() , a.rend());
	k = a.size();
	for(int i = 0; i < k  ; i++){
		if(!mark[a[i].second.first] && !mark[a[i].second.second]){
			mark[a[i].second.first] = true;
			mark[a[i].second.second] = true;
			ans[a[i].second.second] = a[i].second.first;
			ans[a[i].second.first] = a[i].second.second;
		}
	}

	for(int i = 1 ; i <= n ; i++)
		cout<< ans[i] << " ";
}


#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;

vector < pair <int , pair<int , int> > > a;
bool mark[410];
int ans[410];
int main(){

	int n , x , k;
	cin >> n;
	n*= 2;
	for(int i = 2 ; i <= n ; i++){
		for(int j = 1 ; j < i ; j++){
			cin >> x;
			a.push_back(make_pair(x , make_pair(i , j)));
		}
	}

	sort(a.rbegin() , a.rend());
	k = a.size();
	for(int i = 0; i < k  ; i++){
		if(!mark[a[i].second.first] && !mark[a[i].second.second]){
			mark[a[i].second.first] = true;
			mark[a[i].second.second] = true;
			ans[a[i].second.second] = a[i].second.first;
			ans[a[i].second.first] = a[i].second.second;
		}
	}

	for(int i = 1 ; i <= n ; i++)
		cout<< ans[i] << " ";
}


#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <string>
#include <string.h>
#include <queue>
#include <stack>
#include <cmath>
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define min(a,b)  (((((a)) < (b)))?((a)):((b)))
#define max(a,b)  (((((a)) > (b)))?((a)):((b)))
#define abs(a)    ((((a)) < 0)?(-((a))):((a)))
#define MAXN 401
#define MAXM (1<<19)
#define MOD 1000000007
using namespace std;
typedef  long long  LL;
int ans[MAXN];
vector<pair<int,pair<int, int>>> v;
int main() {
    int n;
    cin >> n;
    for(int i = 2 ; i <= 2*n; i++){
        for(int j = 1; j < i; j++){
            int val;
            cin >> val;
            v.PB(MP(val, MP(i, j)));
        }
    }
    sort(v.rbegin(), v.rend());
    for(int i = 0; i < v.size(); i++){
        int f = v[i].S.F;
        int s = v[i].S.S;
        if(!ans[s] && !ans[f]){
            ans[s] = f;
            ans[f] = s;
        }
    }
    for(int i = 1 ;  i <= 2*n; i++){
        cout << ans[i] << " ";
    }
    return 0;
}


#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <string>
#include <string.h>
#include <queue>
#include <stack>
#include <cmath>
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define min(a,b)  (((((a)) < (b)))?((a)):((b)))
#define max(a,b)  (((((a)) > (b)))?((a)):((b)))
#define abs(a)    ((((a)) < 0)?(-((a))):((a)))
#define MAXN 801
#define MAXM (1<<19)
#define MOD 1000000007
using namespace std;
typedef  long long  LL;
int ans[MAXN];
vector<pair<int,pair<int, int> v;
int main() {
    int n;
    cin >> n;
    for(int i = 2 ; i <= n; i++){
        for(int j = 1; j < i; j++){
            int val;
            cin >> val;
            v.PB(MP(val, MP(i, j)));
        }
    }
    sort(v.rbegin(), v.rend());
    for(int i = 0; i < v.size(); i++){
        int f = v[i].S.F;
        int s = v[i].S.S;
        if(!ans[s] && !ans[f]){
            ans[s] = f;
            ans[f] = s;
        }
    }
    for(int i = 1 ;  i <= n; i++){
        cout << ans[i] << " ";
    }
    return 0;
}


#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <string>
#include <string.h>
#include <queue>
#include <stack>
#include <cmath>
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define min(a,b)  (((((a)) < (b)))?((a)):((b)))
#define max(a,b)  (((((a)) > (b)))?((a)):((b)))
#define abs(a)    ((((a)) < 0)?(-((a))):((a)))
#define MAXN 801
#define MAXM (1<<19)
#define MOD 1000000007
using namespace std;
typedef  long long  LL;
int ans[MAXN];
vector<pair<int,pair<int, int>>> v;
int main() {
    int n;
    cin >> n;
    for(int i = 2 ; i <= 2*n; i++){
        for(int j = 1; j < i; j++){
            int val;
            cin >> val;
            v.PB(MP(val, MP(i, j)));
        }
    }
    sort(v.rbegin(), v.rend());
    for(int i = 0; i < v.size(); i++){
        int f = v[i].S.F;
        int s = v[i].S.S;
        if(!ans[s] && !ans[f]){
            ans[s] = f;
            ans[f] = s;
        }
    }
    for(int i = 1 ;  i <= 2*n; i++){
        cout << ans[i] << " ";
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef pair<int,int> ii;

ii a[1000010];
int n,dd[1100];
long spt;

int main()
{
    cin >> n;
    spt=0;
    long x;
    for (int i=2;i<=2*n;i++)
        for (int j=1;j<i;j++)
        {
            cin >> x;
            a[x]=ii(i,j);
        }
    for (int i=1;i<=2*n;i++)
        dd[i]=0;
    for (long i=1000000;i>=0;i--)
        if ((!dd[a[i].first]) && (!dd[a[i].second]))
        {
            dd[a[i].first]=a[i].second;
            dd[a[i].second]=a[i].first;
        }
    for (int i=1;i<=2*n;i++)
        cout << dd[i] << " ";
}


#include <bits/stdc++.h>

using namespace std;

typedef pair<int,int> ii;
typedef pair<long,ii> lii;

lii a[100010];
int n,dd[1100];
long spt;

int main()
{
    cin >> n;
    spt=0;
    long x;
    for (int i=2;i<=2*n;i++)
        for (int j=1;j<i;j++)
        {
           cin >> x;
           spt++;
           a[spt]=lii(x,ii(i,j));
        }
    sort(a+1,a+1+spt,greater<>());
    for (int i=1;i<=2*n;i++)
        dd[i]=0;
    for (int i=1;i<=spt;i++)
        if ((dd[a[i].second.first]==0) && (dd[a[i].second.second]==0))
        {
            dd[a[i].second.first]=a[i].second.second;
            dd[a[i].second.second]=a[i].second.first;
        }
    for (int i=1;i<=2*n;i++)
        cout << dd[i] << " ";
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long int ll;
int main()
{
    ll n,i,j,used[404]={0};
    ll s;
    int v[10000010][2];
    cin>>n;
    for(i=2;i<=(2*n);i++)
    {
        for(j=1;j<i;j++)
        {
            cin>>s;
            v[s][0]=i;
            v[s][1]=j;
        }
    }
//    sort(v.begin(),v.end());
//    reverse(v.begin(),v.end());

    for(i=1000000;i>0;i--)
    {
        if(used[v[i][0]]==0 && used[v[i][1]]==0 )
        {
            used[v[i][0]]=v[i][1];
            used[v[i][1]]=v[i][0];
        }
    }
    for(i=1;i<=(2*n);i++)
        cout<<used[i]<<" ";
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long int ll;
int main()
{
    ll n,i,j,used[404]={0},c=0;
    ll s;
    pair<int,int> u;
    vector<pair<ll,pair<int,int>>> v;
    cin>>n;
    for(i=2;i<=(2*n);i++)
    {
        for(j=1;j<i;j++)
        {
            cin>>s;
            u= make_pair(i,j);
            v.push_back(make_pair(s,u));
        }
    }
    sort(v.begin(),v.end());
    reverse(v.begin(),v.end());

    for(i=0;i<v.size();i++)
    {
        if(c==n)
            break;
        else
        {
            u=v[i].second;
        if(used[u.first]==0 && used[u.second]==0)
            {
            used[u.first]=u.second;
            used[u.second]=u.first;
            c++;
            }
        }
    }
    for(i=1;i<=(2*n);i++)
        cout<<used[i]<<" ";
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
    ll n,i,j,used[404]={0},c=0;
    ll s;
    pair<int,int> u;
    vector<pair<ll,pair<int,int>>> v;
    cin>>n;
    for(i=2;i<=(2*n);i++)
    {
        for(j=1;j<i;j++)
        {
            cin>>s;
            u= make_pair(i,j);
            v.push_back(make_pair(s,u));
        }
    }
    sort(v.begin(),v.end());
    reverse(v.begin(),v.end());

    for(i=0;i<v.size();i++)
    {
        if(c==n)
            break;
        u=v[i].second;
        if(used[u.first]==0 && used[u.second]==0)
        {
            used[u.first]=u.second;
            used[u.second]=u.first;
            c++;
        }
    }
    for(i=1;i<=(2*n);i++)
        cout<<used[i]<<" ";
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long int ll;
int main()
{
    ll n,i,j,used[804]={0},c=0;
    ll s;
    pair<int,int> u;
    vector<pair<ll,pair<int,int>>> v;
    cin>>n;
    for(i=2;i<=(2*n);i++)
    {
        for(j=1;j<i;j++)
        {
            cin>>s;
            u= make_pair(i,j);
            v.push_back(make_pair(s,u));
        }
    }
    sort(v.begin(),v.end());
    reverse(v.begin(),v.end());

    for(i=0;i<v.size();i++)
    {
        if(c==n)
            break;
        else
        {
            u=v[i].second;
        if(used[u.first]==0 && used[u.second]==0)
            {
            used[u.first]=u.second;
            used[u.second]=u.first;
            c++;
            }
        }
    }
    for(i=1;i<=(2*n);i++)
        cout<<used[i]<<" ";
}


#include <iostream>
#include <vector>
using namespace std;
typedef long long int ll;
int main()
{
    ll n,i,j,used[404]={0},c=0;
    ll s;
    pair<int,int> u;
    vector<pair<ll,pair<int,int>>> v;
    cin>>n;
    for(i=2;i<=(2*n);i++)
    {
        for(j=1;j<i;j++)
        {
            cin>>s;
            u= make_pair(i,j);
            v.push_back(make_pair(s,u));
        }
    }
    sort(v.begin(),v.end());
    reverse(v.begin(),v.end());

    for(i=0;i<v.size();i++)
    {
        if(c==n)
            break;
        u=v[i].second;
        if(used[u.first]==0 && used[u.second]==0)
        {
            used[u.first]=u.second;
            used[u.second]=u.first;
            c++;
        }
    }
    for(i=1;i<=(2*n);i++)
        cout<<used[i]<<" ";
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long int ll;
int main()
{
    ll n,i,j,used[404]={0};
    ll s;
    pair<int,int> u;
    vector<pair<ll,pair<int,int>>> v;
    cin>>n;
    for(i=2;i<=(2*n);i++)
    {
        for(j=1;j<i;j++)
        {
            cin>>s;
            u= make_pair(i,j);
            v.push_back(make_pair(s,u));
        }
    }
    sort(v.begin(),v.end());
    reverse(v.begin(),v.end());

    for(i=0;i<v.size();i++)
    {

            u=v[i].second;
        if(used[u.first]==0 && used[u.second]==0)
            {
            used[u.first]=u.second;
            used[u.second]=u.first;

            }

    }
    for(i=1;i<=(2*n);i++)
        cout<<used[i]<<" ";
}


#include <bits/stdc++.h>
#define pii pair<int, int>
#define fi first
#define se second
using namespace std;

const int N = 440;
priority_queue<pii> que[N];
int who[N];
int best[N][N];
int pos[N];

int main() {
//	freopen("in.txt", "r", stdin);
	int n;
	scanf("%d", &n);
	for (int i = 2; i <= 2 * n; i++) {
		for (int j = 1; j < i; j++) {
			int x;
			scanf("%d", &x);
			que[i].push(pii(x, j));
			que[j].push(pii(x, i));
		}
	}
	for (int i = 1; i <= 2 * n; i++) {
		int cnt = 0;
		pos[i] = 1;
		while (!que[i].empty()) {
			best[i][++cnt] = que[i].top().se;
			que[i].pop();
		}
	}
	while (1) {
		bool flag = 1;
		for (int i = 1; i <= 2 * n; i++) {
			if (who[i]) {
				pos[i] = 2 * n + 1;
				continue;
			}
			while (pos[i] <= 2 * n && who[best[i][pos[i]]]) pos[i]++;
			if (pos[i] <= 2 * n) {
				int ne = best[i][pos[i]];
				while (pos[ne] <= 2 * n && who[best[ne][pos[ne]]]) pos[ne]++;
				if (pos[ne] <= 2 * n && best[ne][pos[ne]] == i) {
					pos[ne] = 2 * n + 1;
					pos[i] = 2 * n + 1;
					who[i] = ne;
					who[ne] = i;
					//printf("%d %d\n", i, ne);
				}
			}
		}
		//printf("%d\n", pos[2]);
		for (int i = 1; i <= 2 * n; i++)
			if (!who[i]) flag = 0;
		if (flag) break;
	}
	for (int i = 1; i <= 2 * n; i++)
		printf("%d%c", who[i], " \n"[i == 2 * n]);
	return 0;
}


#include <bits/stdc++.h>
#define pii pair<int, int>
#define fi first
#define se second
using namespace std;

const int N = 840;
priority_queue<pii> que[N];
int who[N];
int best[N][N];
int pos[N];

int main() {
//	freopen("in.txt", "r", stdin);
	int n;
	scanf("%d", &n);
	for (int i = 2; i <= 2 * n; i++) {
		for (int j = 1; j < i; j++) {
			int x;
			scanf("%d", &x);
			que[i].push(pii(x, j));
			que[j].push(pii(x, i));
		}
	}
	for (int i = 1; i <= 2 * n; i++) {
		int cnt = 0;
		pos[i] = 1;
		while (!que[i].empty()) {
			best[i][++cnt] = que[i].top().se;
			que[i].pop();
		}
	}
	while (1) {
		bool flag = 1;
		for (int i = 1; i <= 2 * n; i++) {
			if (who[i]) {
				pos[i] = 2 * n + 1;
				continue;
			}
			while (pos[i] <= 2 * n && who[best[i][pos[i]]]) pos[i]++;
			if (pos[i] <= 2 * n) {
				int ne = best[i][pos[i]];
				while (pos[ne] <= 2 * n && who[best[ne][pos[ne]]]) pos[ne]++;
				if (pos[ne] <= 2 * n && best[ne][pos[ne]] == i) {
					pos[ne] = 2 * n + 1;
					pos[i] = 2 * n + 1;
					who[i] = ne;
					who[ne] = i;
					//printf("%d %d\n", i, ne);
				}
			}
		}
		//printf("%d\n", pos[2]);
		for (int i = 1; i <= 2 * n; i++)
			if (!who[i]) flag = 0;
		if (flag) break;
	}
	for (int i = 1; i <= 2 * n; i++)
		printf("%d%c", who[i], " \n"[i == 2 * n]);
	return 0;
}


#include <bits/stdc++.h>
#define pii pair<int, int>
#define fi first
#define se second
using namespace std;

const int N = 440;
priority_queue<pii> que[N];
int who[N];

int main() {
	//freopen("in.txt", "r", stdin);
	int n;
	scanf("%d", &n);
	for (int i = 2; i <= 2 * n; i++) {
		for (int j = 1; j < i; j++) {
			int x;
			scanf("%d", &x);
			que[i].push(pii(x, j));
			que[j].push(pii(x, i));
		}
	}
	while (1) {
		bool flag = 1;
		for (int i = 1; i <= 2 * n; i++) {
			while (!que[i].empty() && (who[que[i].top().se] || who[i])) que[i].pop();
			if (!que[i].empty()) {
				pii p = que[i].top();
				while (!que[p.se].empty() && (who[que[p.se].top().se] || who[p.se])) que[p.se].pop();
				if (que[p.se].empty()) continue;
				if (que[p.se].top().se == i) {
					que[i].pop();
					que[p.se].pop();
					who[i] = p.se;
					who[p.se] = i;
				}
			}
		}
		for (int i = 1; i <= 2 * n; i++)
			if (!who[i]) flag = 0;
		if (flag) break;
	}
	for (int i = 1; i <= 2 * n; i++)
		printf("%d%c", who[i], " \n"[i == 2 * n]);
	return 0;
}


#include<stdio.h>
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ll long long
#define eb emplace_back
#define all(v) v.begin(),v.end()
#define rev(v) reverse(v.begin(),v.end())
multiset<pair<ll,pair<ll,ll> > >mt;
ll a[507];
int main()
{
	memset(a,-1,sizeof(a));
	int m;
	cin>>m;
	for(int i=2;i<=2*m;i++)
	{
		for(int j=1;j<i;j++)
		{
			ll tem;
			cin>>tem;
			mt.insert(mp(-tem,mp(i,j)));
		}
	}
	while(!mt.empty())
	{
		auto tem=mt.begin()->se;
		if(a[tem.fi]==-1&&a[tem.se]==-1)
			a[tem.fi]=tem.se,a[tem.se]=tem.fi;
		mt.erase(mt.begin());
	}
	for(int i=1;i<=2*m;i++)
		cout<<a[i]<<" ";
	return 0;
}


#include<stdio.h>
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ll long long
#define eb emplace_back
#define all(v) v.begin(),v.end()
#define rev(v) reverse(v.begin(),v.end())
multiset<pair<ll,pair<ll,ll> > >mt;
ll a[507];
int main()
{
	memset(a,-1,sizeof(a));
	int m;
	cin>>m;
	for(int i=2;i<=2*m;i++)
	{
		for(int j=1;j<i;j++)
		{
			ll tem;
			cin>>tem;
			mt.insert(mp(-tem,mp(i,j)));
		}
	}
	while(!mt.empty())
	{
		auto tem=mt.begin()->se;
		if(a[tem.fi]==-1&&a[tem.se]==-1)
			a[tem.fi]=tem.se,a[tem.se]=tem.fi;
		mt.erase(mt.begin());
	}
	for(int i=1;i<=2*m;i++)
		if(a[i]!=-1)
			cout<<a[i]<<" ";
		else
			assert(0);
	return 0;
}


#include<stdio.h>
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ll long long
#define eb emplace_back
#define all(v) v.begin(),v.end()
#define rev(v) reverse(v.begin(),v.end())
multiset<pair<ll,pair<ll,ll> > >mt;
ll a[1007];
int main()
{
	memset(a,-1,sizeof(a));
	int m;
	cin>>m;
	for(int i=2;i<=2*m;i++)
	{
		for(int j=1;j<i;j++)
		{
			ll tem;
			cin>>tem;
			mt.insert(mp(-tem,mp(i,j)));
		}
	}
	while(!mt.empty())
	{
		auto tem=mt.begin()->se;
		if(a[tem.fi]==-1&&a[tem.se]==-1)
			a[tem.fi]=tem.se,a[tem.se]=tem.fi;
		mt.erase(mt.begin());
	}
	for(int i=1;i<=2*m;i++)
		if(a[i]!=-1)
			cout<<a[i]<<" ";
		else
			assert(0);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef struct
{
    int first;
    int second;
    int value;
}club;
void toString(club ele)
{
    cout<<"first: "<<ele.first<<" second: "<<ele.second<<" value: "<<ele.value<<endl;
}

void display(vector<club> vec)
{
    int s = vec.size();
    for(int i=0; i<s; i++)
    {
        toString(vec[i]);
    }
}

void swap(club &ele1, club &ele2)
{
    int f = ele1.first;
    int s = ele1.second;
    int v = ele1.value;
    ele1.first = ele2.first;
    ele1.second = ele2.second;
    ele1.value = ele2.value;
    ele2.first = f;
    ele2.second = s;
    ele2.value = v;
}
void sorting(vector<club> &vec)
{
    int s = vec.size();
    for(int i=0; i<s-1; i++)
    {
        for(int j=i+1; j<s; j++)
        {
            if(vec[i].value<vec[j].value)
            {
                //swap
                swap(vec[i], vec[j]);
            }
        }
    }
}

vector<club> erase(vector<club> vec, int first, int second)
{
    vector<club> vec2;
    int s=vec.size();
    int i=0;
    while(i<s)
    {
        if(vec[i].first==first || vec[i].second==first || vec[i].first==second || vec[i].second==second)
        i++;
        else {vec2.push_back(vec[i]); i++;}
    }
    return vec2;
}

void displayArray(int arr[], int size)
{
    for(int i=1; i<size; i++)
    {
        cout<<arr[i]<<" ";
    }
    cout<<"\n";
}
int main()
{
    //my code goes here
    int n; cin>>n;
    vector<club> vec;
    int members[2*n];
    for(int i=0; i<2*n+1; i++)
    members[i]=0;

    for(int i=0; i<2*n-1; i++)
    {
        for(int j=0; j<i+1; j++)
        {
            int strength; cin>>strength;
            //creating club
            club element;
            element.first = i+2;
            element.second = j+1;
            element.value = strength;
            vec.push_back(element);
        }
    }
    // display(vec);
    sorting(vec);
    // display(vec);

    //now finding pairs
    int s=vec.size();
    for(int i=0; i<s; i++)
    {
        int first = vec[i].first;
        int second = vec[i].second;
        if(members[first]==0 && members[second]==0)
        {
            members[first] = second;
            members[second] = first;
        }
    }

    displayArray(members, 2*n+1);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef struct
{
    int first;
    int second;
    int value;
}club;

void swap(club &ele1, club &ele2)
{
    int f = ele1.first;
    int s = ele1.second;
    int v = ele1.value;
    ele1.first = ele2.first;
    ele1.second = ele2.second;
    ele1.value = ele2.value;
    ele2.first = f;
    ele2.second = s;
    ele2.value = v;
}
void sorting(vector<club> &vec)
{
    int s = vec.size();
    for(int i=0; i<s-1; i++)
    {
        for(int j=i+1; j<s; j++)
        {
            if(vec[i].value<vec[j].value)
            {
                //swap
                swap(vec[i], vec[j]);
            }
        }
    }
}

vector<club> erase(vector<club> vec, int first, int second)
{
    vector<club> vec2;
    int s=vec.size();
    int i=0;
    while(i<s)
    {
        if(vec[i].first==first || vec[i].second==first || vec[i].first==second || vec[i].second==second)
        i++;
        else {vec2.push_back(vec[i]); i++;}
    }
    return vec2;
}

void displayArray(int arr[], int size)
{
    for(int i=1; i<size; i++)
    {
        cout<<arr[i]<<" ";
    }
    cout<<"\n";
}
int main()
{
    //my code goes here
    int n; cin>>n;
    vector<club> vec;
    int members[2*n];
    for(int i=0; i<2*n-1; i++)
    {
        for(int j=0; j<i+1; j++)
        {
            int strength; cin>>strength;
            //creating club
            club element;
            element.first = i+2;
            element.second = j+1;
            element.value = strength;
            vec.push_back(element);
        }
    }
    // display(vec);
    sorting(vec);
    // display(vec);

    //now finding pairs
    while(vec.size()!=0)
    {
        int first = vec[0].first;
        int second = vec[0].second;
        members[first] = second;
        members[second] = first;
        vector<club> vec2 = erase(vec, first, second);
        vec.clear();
        vec = vec2;
    }

    displayArray(members, 2*n+1);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef struct
{
    int first;
    int second;
    int value;
}club;
void toString(club ele)
{
    cout<<"first: "<<ele.first<<" second: "<<ele.second<<" value: "<<ele.value<<endl;
}

void display(vector<club> vec)
{
    int s = vec.size();
    for(int i=0; i<s; i++)
    {
        toString(vec[i]);
    }
}

void swap(club &ele1, club &ele2)
{
    int f = ele1.first;
    int s = ele1.second;
    int v = ele1.value;
    ele1.first = ele2.first;
    ele1.second = ele2.second;
    ele1.value = ele2.value;
    ele2.first = f;
    ele2.second = s;
    ele2.value = v;
}

int partition(vector<club> &values, int left, int right) {
    int pivotIndex = left + (right - left) / 2;
    club pivotValue = values[pivotIndex];
    int i = left, j = right;
    int temp;
    while(i <= j) {
        while(values[i].value > pivotValue.value) {
            i++;
        }
        while(values[j].value < pivotValue.value) {
            j--;
        }
        if(i <= j) {
            swap(values[i], values[j]);
            i++;
            j--;
        }
    }
    return i;
}

void quicksort(vector<club> &values, int left, int right) {
    if(left < right) {
        int pivotIndex = partition(values, left, right);
        quicksort(values, left, pivotIndex - 1);
        quicksort(values, pivotIndex, right);
    }
}

void displayArray(int arr[], int size)
{
    for(int i=1; i<size; i++)
    {
        cout<<arr[i]<<" ";
    }
    cout<<"\n";
}

int main()
{
    //my code goes here
    int n; cin>>n;
    vector<club> vec;
    int members[2*n];
    for(int i=0; i<2*n+1; i++)
    members[i]=0;

    for(int i=0; i<2*n-1; i++)
    {
        for(int j=0; j<i+1; j++)
        {
            int strength; cin>>strength;
            //creating club
            club element;
            element.first = i+2;
            element.second = j+1;
            element.value = strength;
            vec.push_back(element);
        }
    }
    // display(vec);
    quicksort(vec, 0 , vec.size()-1);
    // display(vec);

    //now finding pairs
    int s=vec.size();
    for(int i=0; i<s; i++)
    {
        int first = vec[i].first;
        int second = vec[i].second;
        if(members[first]==0 && members[second]==0)
        {
            members[first] = second;
            members[second] = first;
        }
    }

    displayArray(members, 2*n+1);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

struct team
{
	long long play1, play2, strngth;
};

bool sort_fun(team a, team b)
{	return (a.strngth>b.strngth);
}

int main()
{
	int n;	cin>>n;
	int i, j, k, x;
	vector<team>vt;

	for(i=2; i<=2*n; i++)
	{	for(j=1; j<i; j++)
		{	cin>>x;
			team t;
			t.play1 = i;
			t.play2 = j;
			t.strngth = x;
			vt.push_back(t);
		}
	}

	int visit[2*n+1] = {0};
	k=0;
	sort(vt.begin(),  vt.end(), sort_fun);

		for(i=0; i<vt.size(); i++)
		{	if(visit[vt[i].play1] == 0 && visit[vt[i].play2] == 0)
			{	visit[vt[i].play1] = vt[i].play2;
				visit[vt[i].play2] = vt[i].play1;
				//cout<<vt[i].play1<<" "<<vt[i].play2<<" ";
				k++;
			}
			if(k==n)
				break;
		}

		for(i=1; i<=2*n; i++)
			cout<<visit[i]<<" ";
}


#include<bits/stdc++.h>
using namespace std;

struct team
{
	long long play1, play2, strngth;
};

bool sort_fun(team a, team b)
{	return (a.strngth>b.strngth);
}

int main()
{
	int n;	cin>>n;
	int i, j, k, x;
	vector<team>vt;

	for(i=2; i<=2*n; i++)
	{	for(j=1; j<i; j++)
		{	cin>>x;
			team t;
			t.play1 = i;
			t.play2 = j;
			t.strngth = x;
			vt.push_back(t);
		}
	}

	int visit[2*n+1] = {0};
	k=0;
	sort(vt.begin(),  vt.end(), sort_fun);

		for(i=0; i<vt.size(); i++)
		{	if(visit[vt[i].play1] == 0 && visit[vt[i].play2] == 0)
			{	visit[vt[i].play1] = 1;
				visit[vt[i].play2] = 1;
				cout<<vt[i].play1<<" "<<vt[i].play2<<" ";
				k++;
			}
			if(k==n)
				break;
		}
}


#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#define horsePower ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

bool flag[801];

int main() {
    horsePower;
    int n,temp;
    bool insideFlag;
    cin >> n;
    n = 2*n;
    int anArr[n+1];
    int strength[n+1][n+1];
    vector<int> ans;
    vector<vector<int>> av(n+1);
    av[1] = vector<int>(n+1);
    vector<map<int,int,greater<int>>> sorted(n+1);
    map<int,int>::iterator it;
    map<int,int>::iterator secIt;
    for(int i=2; i<=n; i++) {
        av[i] = vector<int>(n+1);
        for(int j=1; j<i; j++) {
            cin >> av[i][j];
            av[j][i] = av[i][j];
            sorted[i].insert(pair<int,int>(av[i][j],j));
            sorted[j].insert(pair<int,int>(av[i][j],i));
        }
    }
    for(int i=1; i<=n; i++) {
        if(!flag[i]) {
            for(it=sorted[i].begin(); it!=sorted[i].end(); it++) {
                if(!flag[it->second]) {
                    insideFlag = true;
                    for(secIt = sorted[it->second].begin(); secIt != sorted[it->second].end(); secIt++) {
                        if(!flag[secIt->second] && (secIt->first)>(it->first)) {
                            insideFlag = false;
                            break;
                        } else if((secIt->first)<(it->first)) {
                            break;
                        }
                    }
                    if(insideFlag) {
                        flag[it->second] = true;
                        flag[i] = true;
                        anArr[it->second] = i;
                        anArr[i] = it->second;
                        break;
                    }
                }
            }
        }
    }
    for(int i=1; i<=n; i++) {
        cout << anArr[i] << " ";
    }
    cout << "\n";
}


#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#define horsePower ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

bool flag[401];

int main() {
    horsePower;
    int n,temp;
    bool insideFlag;
    cin >> n;
    n = 2*n;
    int anArr[n+1];
    int strength[n+1][n+1];
    vector<int> ans;
    vector<vector<int>> av(n+1);
    av[1] = vector<int>(n+1);
    vector<map<int,int,greater<int>>> sorted(n+1);
    map<int,int>::iterator it;
    map<int,int>::iterator secIt;
    for(int i=2; i<=n; i++) {
        av[i] = vector<int>(n+1);
        for(int j=1; j<i; j++) {
            cin >> av[i][j];
            av[j][i] = av[i][j];
            sorted[i].insert(pair<int,int>(av[i][j],j));
            sorted[j].insert(pair<int,int>(av[i][j],i));
        }
    }
    for(int i=1; i<=n; i++) {
        if(!flag[i]) {
            for(it=sorted[i].begin(); it!=sorted[i].end(); it++) {
                if(!flag[it->second]) {
                    insideFlag = true;
                    for(secIt = sorted[it->second].begin(); secIt != sorted[it->second].end(); secIt++) {
                        if(!flag[secIt->second] && (secIt->first)>(it->first)) {
                            insideFlag = false;
                            break;
                        } else if((secIt->first)<(it->first)) {
                            break;
                        }
                    }
                    if(insideFlag) {
                        flag[it->second] = true;
                        flag[i] = true;
                        anArr[it->second] = i;
                        anArr[i] = it->second;
                        break;
                    }
                }
            }
        }
    }
    for(int i=1; i<=n; i++) {
        cout << anArr[i] << " ";
    }
    cout << "\n";
}


#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#define horsePower ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

bool flag[801];

int main() {
    horsePower;
    int n,temp;
    bool insideFlag;
    cin >> n;
    n = 2*n;
    int anArr[n+1];
    map<int,pair<int,int>,greater<int>> sorted;
    map<int,pair<int,int>>::iterator it;

    for(int i=2; i<=n; i++) {
        for(int j=1; j<i; j++) {
            cin >> temp;
            sorted.insert(pair<int,pair<int,int>>(temp,pair<int,int>(i,j)));
        }
    }
    for(it=sorted.begin(); it != sorted.end(); it++) {
        if(!flag[(it->second).first] && !flag[(it->second).second]) {
            anArr[(it->second).first] = (it->second).second;
            anArr[(it->second).second] = (it->second).first;
            flag[(it->second).first] = true;
            flag[(it->second).second] = true;
        }

        //cout<<"{ "<<(it->second).first <<","<<(it->second).second<<"} -- > " << it->first << "\n";
    }

    for(int i=1; i<=n; i++) {
        cout << anArr[i] << " ";
    }
    cout << "\n";
}


#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#define horsePower ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

bool flag[801];

int main() {
    horsePower;
    int n,temp;
    bool insideFlag;
    cin >> n;
    n = 2*n;
    int anArr[n+1];
    int strength[n+1][n+1];
    vector<int> ans;
    vector<vector<int>> av(n+1);
    av[1] = vector<int>(n+1);
    vector<map<int,int,greater<int>>> sorted(n+1);
    map<int,int>::iterator it;
    map<int,int>::iterator secIt;
    for(int i=2; i<=n; i++) {
        av[i] = vector<int>(n+1);
        for(int j=1; j<i; j++) {
            cin >> av[i][j];
            av[j][i] = av[i][j];
            sorted[i].insert(pair<int,int>(av[i][j],j));
            sorted[j].insert(pair<int,int>(av[i][j],i));
        }
    }
    /*
    cout << "\n\n";
    for(int i=1; i<=n; i++) {
        for(it=sorted[i].begin(); it!=sorted[i].end(); it++) {
            cout << it->first << " ( " << it->second << " ) " << " ";
        }
        cout << "\n";
    }
    cout << "\n\n";
    */
    for(int i=1; i<=n; i++) {
        if(!flag[i]) {
            for(it=sorted[i].begin(); it!=sorted[i].end(); it++) {
                if(!flag[it->second]) {
                    insideFlag = true;
                    for(secIt = sorted[it->second].begin(); secIt != sorted[it->second].end(); secIt++) {
                        if(!flag[secIt->second]){
                            if((secIt->first)>(it->first)) {
                                insideFlag = false;
                                break;
                            } else if((secIt->first)<(it->first)) {
                                break;
                            }
                        } else {
                            continue;
                        }
                    }
                    if(insideFlag) {
                        flag[it->second] = true;
                        flag[i] = true;
                        anArr[it->second] = i;
                        anArr[i] = it->second;
                        break;
                    }
                }
            }
        }
    }
    for(int i=1; i<=n; i++) {
        cout << anArr[i] << " ";
    }
    cout << "\n";
}


#include<bits/stdc++.h>
#define ll long long
#define MAX 1000003
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define rep(i,a,b) for(int (i) = (a); (i) < (b); (i)++)
#define S(x) scanf("%d",&(x))
#define S2(x,y) scanf("%d%d",&(x),&(y))
#define P(x) printf("%d\n",(x))
#define all(v) (v).begin(),(v).end()
#define FF first
#define SS second
using namespace std;
//int dx[]={1,0,0,-1},dy[]={0,1,-1,0};
priority_queue<pair<int,pii > > q;
int vis[500];
int main(){
int n;
S(n);
rep(i,2,2*n+1){
	rep(j,1,i){
		int x;
		S(x);
		q.push({x,{i,j}});
	}
}
while(!q.empty()){
int x=q.top().SS.FF;
int y=q.top().SS.SS;
//cout<<x<<" "<<y<<" "<<-1*q.top().FF<<endl;
q.pop();
if(vis[x] || vis[y])
continue;
vis[x]=y;
vis[y]=x;
}
rep(i,1,2*n+1){
	printf("%d ",vis[i]);
}
printf("\n");
return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define MAX 1000003
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define rep(i,a,b) for(int (i) = (a); (i) < (b); (i)++)
#define S(x) scanf("%d",&(x))
#define S2(x,y) scanf("%d%d",&(x),&(y))
#define P(x) printf("%d\n",(x))
#define all(v) (v).begin(),(v).end()
#define FF first
#define SS second
using namespace std;
//int dx[]={1,0,0,-1},dy[]={0,1,-1,0};
priority_queue<pair<int,pii > > q;
int vis[2000];
int main(){
int n;
S(n);
rep(i,2,2*n+1){
	rep(j,1,i){
		int x;
		S(x);
		q.push({x,{i,j}});
	}
}
while(!q.empty()){
int x=q.top().SS.FF;
int y=q.top().SS.SS;
//cout<<x<<" "<<y<<" "<<-1*q.top().FF<<endl;
q.pop();
if(vis[x] || vis[y])
continue;
vis[x]=y;
vis[y]=x;
}
rep(i,1,2*n+1){
	printf("%d ",vis[i]);
}
printf("\n");
return 0;
}


import java.util.ArrayList;
import java.util.Scanner;

public class candiess {

		public static void main(String[] args) {
			// TODO Auto-generated method stub
			Scanner scn=new Scanner(System.in);
			int t=scn.nextInt();
			for(int i=0;i<t;i++) {
				int n=scn.nextInt();
				int p=n/2;

					int esum=p*(p+1);
					String str="";
					for(int j=1;j<=p;j++) {
						str+=j*2+" ";
					}
					int osum=0;
					for(int j=1;j<p;j++) {

						osum+=j*2-1;
						str+=j*2-1+" ";
					}
					int q=esum-osum;
					if(q%2==0) {
						System.out.println("NO");
					}else {
						System.out.println("YES");
						System.out.println(str);

				}
			}
		}

}


import java.util.ArrayList;
import java.util.Scanner;

public class candiess {

		public static void main(String[] args) {
			// TODO Auto-generated method stub
			Scanner scn=new Scanner(System.in);
			int t=scn.nextInt();
			for(int i=0;i<t;i++) {
				int n=scn.nextInt();
				int p=n/2;
				if(p%2!=0) {
					System.out.println("NO");
				}
				else {
					System.out.println("YES");
					int esum=p*(p+1);
					for(int j=1;j<=p;j++) {
						System.out.print(j*2+" ");
					}
					int osum=0;
					for(int j=1;j<p;j++) {

						osum+=j*2-1;
						System.out.print(j*2-1+" ");
					}

					System.out.print(esum-osum);
					System.out.println();
				}
			}
		}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.io.*;
import java.util.Locale;
import java.util.*;
import java.io.BufferedOutputStream;
import java.io.BufferedWriter;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.lang.StringBuilder;
	public class Solution{

	static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

	public static void main(String args[])throws IOException
	{
		FastReader sc=new FastReader();
		PrintWriter out = new PrintWriter(System.out);
		int t = sc.nextInt();
		StringBuilder res = new StringBuilder("");
		for(int test = 0; test < t; test++ )
		{
			long n = sc.nextLong();
			if(n%4 != 0)
			    res.append("NO\n");
			 else
			 {
			     res.append("YES\n");
			     StringBuilder s = new StringBuilder("");
			     int countEven = 0, countOdd = 0;
			     for(int i = 2; i <= n; i=i+2)
			     {
			         s.append(Integer.toString(i) + " ");
			         countEven += i;
			     }
			     for(int i = 1;i < (n-1); i=i+2)
			     {
			         s.append(Integer.toString(i) + " ");
			         countOdd += i;
			     }
			     int dif = countEven - countOdd;
			     s.append(Integer.toString(dif));
			     res.append(s + "\n");
			 }
		}
		System.out.println(res);
	}
}


import java.io.*;
	public class Solution{
	public static void main(String args[])throws IOException
	{
		InputStreamReader c = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(c);

		int t = Integer.parseInt(br.readLine());
		String res = "";
		for(int test = 0; test < t; test++ )
		{
			long n = Long.parseLong(br.readLine());
			if(n%4 != 0)
			    res += "NO\n";
			 else
			 {
			     res += "YES\n";
			     String s = "";
			     int countEven = 0, countOdd = 0;
			     for(int i = 2; i <= n; i=i+2)
			     {
			         s += Integer.toString(i) + " ";
			         countEven += i;
			     }
			     for(int i = 1;i < (n-1); i=i+2)
			     {
			         s += Integer.toString(i) + " ";
			         countOdd += i;
			     }
			     int dif = countEven - countOdd;
			     s += Integer.toString(dif);
			     res += s + "\n";
			 }
		}
		System.out.println(res);
	}
}