#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long *x = new long long[n];
  long long *y = new long long[n];
  for (long long i = 0; i < n; i++) {
    cin >> x[i];
    cin >> y[i];
  }
  long long *count = new long long[100009];
  for (long long i = 0; i < 100009; i++) {
    count[i] = 0;
  }
  for (long long i = 0; i < n; i++) {
    long long k = x[i];
    count[k]++;
  }
  for (long long i = 0; i < n; i++) {
    long long home = n - 1;
    long long away = n - 1;
    long long change = count[y[i]];
    home += change;
    away -= change;
    cout << home << " " << away << endl;
  }
  return 0;
}
