#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a[100001], x[100001], y[100001];
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x[i] >> y[i];
    a[x[i]]++;
  }
  int home, away;
  for (int i = 1; i <= n; i++) {
    home = (n - 1);
    away = (n - 1);
    home += a[y[i]];
    away -= a[y[i]];
    cout << home << " " << away << endl;
  }
}
