#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
struct node{
	int pos,x;
}s[110];
int cmp(node a,node b)
{
	return a.x <b.x ;
}
int main()
{
	int n,i;
	while(scanf("%d",&n)!=EOF)
	{
		for(i=0;i<n;i++)
	{
	   scanf("%d",&s[i].x );
		s[i].pos =i+1;
	}	
	sort(s,s+n,cmp);
	for(i=0;i<n/2;i++)
	printf("%d %d\n",s[i].pos ,s[n-i-1].pos );
	}
	return 0;
}