#include <bits/stdc++.h>
long kit[100005][2], cnt[100005];
int main() {
  long n, i, j, home, away;
  scanf("%ld", &n);
  for (i = 0; i < n; i++) {
    scanf("%ld %ld", &kit[i][0], &kit[i][1]);
    cnt[kit[i][0]]++;
  }
  for (i = 0; i < n; i++) {
    home = n - 1;
    home += cnt[kit[i][1]];
    away = 2 * (n - 1) - home;
    printf("%ld %ld\n", home, away);
  }
  return 0;
}
