#include <bits/stdc++.h>
using namespace std;
typedef struct {
  int home, away, Hcounter, Acounter;
} team;
int main() {
  int n, i, j;
  scanf("%d", &n);
  team T[n];
  vector<int> Hom;
  for (i = 0; i < 100000; i++) Hom.push_back(0);
  for (i = 0; i < n; i++) {
    scanf("%d%d", &T[i].home, &T[i].away);
    T[i].Hcounter = 0;
    T[i].Acounter = 0;
  }
  for (i = 0; i < n; i++) {
    Hom[T[i].home - 1]++;
  }
  for (i = 0; i < n; i++) {
    T[i].Acounter = n - 1;
    T[i].Hcounter = n - 1;
    T[i].Acounter -= Hom[T[i].away - 1];
    T[i].Hcounter += Hom[T[i].away - 1];
  }
  for (i = 0; i < n; i++) printf("%d %d\n", T[i].Hcounter, T[i].Acounter);
  return 0;
}
