#include <bits/stdc++.h>
using namespace std;
int x[100005];
int y[100005];
int homeCount[100005];
int awayCount[100005];
int main() {
  int N;
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) scanf("%d %d", &x[i], &y[i]);
  for (int i = 1; i <= N; i++) homeCount[i] = awayCount[i] = N - 1;
  sort(x + 1, x + 1 + N);
  for (int i = 1; i <= N; i++) {
    int Count = (int)(upper_bound(x + 1, x + 1 + N, y[i]) -
                      lower_bound(x + 1, x + 1 + N, y[i]));
    homeCount[i] += Count;
    awayCount[i] -= Count;
  }
  for (int i = 1; i <= N; i++) printf("%d %d\n", homeCount[i], awayCount[i]);
  return 0;
}
