#include <bits/stdc++.h>
#define N 100000
using namespace std;
int a[N+3],x[N+3], pos[N+3];
int n;
int TL[N+3], TR[N+3];
int L[N+3], R[N+3];
int get(int k, int *T)
{
int s = 0;
for (; k > 0; k -= k & (-k)) s += T[k];
return s;
}
void update(int k, int val, int *T)
{
for (; k <= n; k += k & (-k)) T[k] += val;
}
int main()
{
freopen("sapxep.inp","r",stdin);
freopen("sapxep.out","w",stdout);
cin >> n;
for (int i=1; i<=n; i++)
{
cin >> a[i];
pos[a[i]] = i;
}
int d = 0;
for (int i=1; i<=n/2; i++)
{
x[pos[i]] = ++d;
x[pos[n-i+1]] = ++d;
}
for (int i=1; i<=n; i++)
{
if (n % 2 == 1 && a[i] == n/2 + 1) continue;
L[i] = get(x[i] - 1, TL);
update(x[i],1,TL);
}
for (int i=n; i>0; i--)
{
if (n % 2 == 1 && a[i] == n/2 + 1) continue;
R[i] = get(x[i] - 1, TR);
update(x[i],1,TR);
}
for (int i=1; i<=n/2; i++)
{
int j = pos[i];
if (a[j] <= n/2) cout << j - 1 - L[j] << '\n';
else cout << n - j - R[j] << '\n';
j = pos[n-i+1];
if (a[j] <= n/2) cout << j - 1 - L[j] << '\n';
else cout << n - j - R[j] << '\n';
}
if (n % 2 == 1) cout << 0;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNkZWZpbmUgTiAxMDAwMDAKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKaW50IGFbTiszXSx4W04rM10sIHBvc1tOKzNdOwppbnQgbjsKaW50IFRMW04rM10sIFRSW04rM107CmludCBMW04rM10sIFJbTiszXTsKCmludCBnZXQoaW50IGssIGludCAqVCkKewogICAgaW50IHMgPSAwOwogICAgZm9yICg7IGsgPiAwOyBrIC09IGsgJiAoLWspKSBzICs9IFRba107CiAgICByZXR1cm4gczsKfQoKdm9pZCB1cGRhdGUoaW50IGssIGludCB2YWwsIGludCAqVCkKewogICAgZm9yICg7IGsgPD0gbjsgayArPSBrICYgKC1rKSkgVFtrXSArPSB2YWw7Cn0KaW50IG1haW4oKQp7CiAgICBmcmVvcGVuKCJzYXB4ZXAuaW5wIiwiciIsc3RkaW4pOwogICAgZnJlb3Blbigic2FweGVwLm91dCIsInciLHN0ZG91dCk7CiAgICBjaW4gPj4gbjsKICAgIGZvciAoaW50IGk9MTsgaTw9bjsgaSsrKQogICAgewogICAgICAgIGNpbiA+PiBhW2ldOwogICAgICAgIHBvc1thW2ldXSA9IGk7CiAgICB9CiAgICBpbnQgZCA9IDA7CiAgICBmb3IgKGludCBpPTE7IGk8PW4vMjsgaSsrKQogICAgewogICAgICAgIHhbcG9zW2ldXSA9ICsrZDsKICAgICAgICB4W3Bvc1tuLWkrMV1dID0gKytkOwogICAgfQogICAgZm9yIChpbnQgaT0xOyBpPD1uOyBpKyspCiAgICB7CiAgICAgICAgaWYgKG4gJSAyID09IDEgJiYgYVtpXSA9PSBuLzIgKyAxKSBjb250aW51ZTsKICAgICAgICBMW2ldID0gZ2V0KHhbaV0gLSAxLCBUTCk7CiAgICAgICAgdXBkYXRlKHhbaV0sMSxUTCk7CiAgICB9CiAgICBmb3IgKGludCBpPW47IGk+MDsgaS0tKQogICAgewogICAgICAgIGlmIChuICUgMiA9PSAxICYmIGFbaV0gPT0gbi8yICsgMSkgY29udGludWU7CiAgICAgICAgUltpXSA9IGdldCh4W2ldIC0gMSwgVFIpOwogICAgICAgIHVwZGF0ZSh4W2ldLDEsVFIpOwogICAgfQogICAgZm9yIChpbnQgaT0xOyBpPD1uLzI7IGkrKykKICAgIHsKICAgICAgICBpbnQgaiA9IHBvc1tpXTsKICAgICAgICBpZiAoYVtqXSA8PSBuLzIpIGNvdXQgPDwgaiAtIDEgLSBMW2pdIDw8ICdcbic7CiAgICAgICAgZWxzZSBjb3V0IDw8IG4gLSBqIC0gUltqXSA8PCAnXG4nOwogICAgICAgIGogPSBwb3Nbbi1pKzFdOwogICAgICAgIGlmIChhW2pdIDw9IG4vMikgY291dCA8PCBqIC0gMSAtIExbal0gPDwgJ1xuJzsKICAgICAgICBlbHNlIGNvdXQgPDwgbiAtIGogLSBSW2pdIDw8ICdcbic7CiAgICB9CiAgICBpZiAobiAlIDIgPT0gMSkgY291dCA8PCAwOwogICAgcmV0dXJuIDA7Cn0K