#include <bits/stdc++.h>
using namespace std;
bool isPrime(long long n);
long long modular_pow(long long base, long long exponent, long long modulus);
long long gcd(long long a, long long b);
long long lcm(long long a, long long b);
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  long long t = 1;
  while (t--) {
    long long n;
    cin >> n;
    vector<pair<long long, long long>> v;
    long long home[100001] = {0};
    long long away[100001] = {0};
    long long a, b;
    for (long long i = 0; i < n; i++) {
      cin >> a >> b;
      v.push_back({a, b});
      home[a]++;
    }
    for (long long i = 0; i < n; i++) {
      cout << home[v[i].second] + (n - 1) << " ";
      cout << (2 * n - 2) - (home[v[i].second] + (n - 1)) << " ";
      cout << endl;
    }
  }
}
bool isPrime(long long n) {
  if (n == 1) return false;
  if (n == 2) return true;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
long long modular_pow(long long base, long long exponent, long long modulus) {
  long long result = 1;
  while (exponent > 0) {
    if (exponent % 2 == 1) result = (result * base) % modulus;
    exponent = exponent >> 1;
    base = (base * base) % modulus;
  }
  return result;
}
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  } else {
    return gcd(b, a % b);
  }
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
