#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, mat[2][100005], idx, ans;
  int home[100005] = {};
  int away[100005] = {};
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> mat[0][i] >> mat[1][i];
    home[mat[0][i]]++;
    away[mat[1][i]]++;
  }
  for (int i = 0; i < n; i++) {
    idx = mat[1][i];
    ans = (n - 1) + home[idx];
    cout << ans << " " << 2 * (n - 1) - ans << endl;
  }
  return 0;
}
