#include <bits/stdc++.h>
using namespace std;
const int SIZE = 1e5 + 3;
int n, x[SIZE], y[SIZE], home[SIZE], away[SIZE];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  memset(home, 0, sizeof home);
  memset(away, 0, sizeof away);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
    home[x[i]]++;
    away[y[i]]++;
  }
  for (int i = 0; i < n; i++) {
    int result = n - 1, desconto = home[y[i]];
    cout << result + desconto << " " << result - desconto << "\n";
  }
  return 0;
}
