#include <bits/stdc++.h>
using namespace std;
const int N = 1000000007;
vector<vector<int> > graph;
int main() {
  int n;
  cin >> n;
  vector<int> v1, v2;
  int arr[100010];
  memset(arr, 0, sizeof(arr));
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    v1.push_back(x);
    v2.push_back(y);
    arr[x]++;
  }
  for (int i = 0; i < n; i++) {
    int home = n - 1, away = n - 1;
    home = home + arr[v2[i]];
    away = away - arr[v2[i]];
    cout << home << " " << away << endl;
  }
}
