#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n), b(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  sort(a.begin(), a.end());
  int c[n];
  for (int i = 0; i < n; i++) {
    c[i] = upper_bound(a.begin(), a.end(), b[i]) -
           lower_bound(a.begin(), a.end(), b[i]);
  }
  for (int i = 0; i < n; i++) {
    cout << n - 1 + c[i] << " " << n - 1 - c[i] << "\n";
  }
  return 0;
}
