#include <bits/stdc++.h>
using namespace std;
int main(){
int n,m,a[1000]={0},b[1000],c;
scanf("%d",&n);
for(int i=1;i<=n;i++){
scanf("%d",&a[i]);
b[i]=i;
}
for(int j = 1; j <= n; j++){
for(int i=1;i<=n-1;i++){
if(a[i]<a[i+1]){
c=a[i];
a[i]=a[i+1];
a[i+1]=c;
c=b[i];
b[i]=b[i+1];
b[i+1]=c;
}
}
}
for(int i=1;i<=n;i++){
printf("%d %d %d\n",i,a[i],b[i]);
}
return 0;
}