#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int x[n + 1], y[n + 1], cnt[100000 + 8] = {0};
  for (int i = 0; i < n; ++i) cin >> x[i] >> y[i], cnt[x[i]]++;
  for (int i = 0; i < n; ++i) {
    int in = 0;
    in += n - 1;
    in += cnt[y[i]];
    cout << in << " " << (n * 2) - 2 - in << endl;
  }
}
