#include<bits/stdc++.h>
using namespace std;
const int N=1e5+10;
int n,p[N],a[N];
int main()
{
	scanf("%d",&n);
	for (int i=1;i<=n;i++) scanf("%d",&p[i]),a[p[i]]=i;
	for (int i=1;i<=n;i++) printf("%d ",i*n);
	for (int i=1;i<=n;i++) printf("%d\n",(n-i+1)*n+a[i]);
	return 0;
}