#include<bits/stdc++.h>
using namespace std;
long long n;
long long a[100005];
int main() {
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int i = 0; i < n; i++) {
int cnt1 = 0, cnt2 = 0;
for (int j = 0; j < i; j++) {
if (a[j] < a[i]) cnt1++;
}
for (int j = i + 1; j < n; j++) {
if (a[j] > a[i]) cnt2++;
}
cout << cnt1 << " " << cnt2 << endl;
}
return 0;
}