#include <bits/stdc++.h>
using namespace std;
struct Fast {
  Fast() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} fast;
int main() {
  int n, a, c = 0, gra = 0, br = 0, gre = 0, cy = 0, bl = 0, ye = 0, o = 0,
            re = 0, sp = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (0 < a && a < 400 && gra < 1) {
      c++;
      gra++;
    }
    if (400 < a && a < 800 && br < 1) {
      c++;
      br++;
    }
    if (800 < a && a < 1200 && gre < 1) {
      c++;
      gre++;
    }
    if (1200 < a && a < 1600 && cy < 1) {
      c++;
      cy++;
    }
    if (1600 < a && a < 2000 && bl < 1) {
      c++;
      bl++;
    }
    if (2000 < a && a < 2400 && ye < 1) {
      c++;
      ye++;
    }
    if (2400 < a && a < 2800 && o < 1) {
      c++;
      o++;
    }
    if (2800 < a && a < 3200 && re < 1) {
      c++;
      re++;
    }
    if (a > 3199) {
      sp++;
    }
    if (sp + c > 8) {
      cout << c << ' ' << 8 << endl;
    } else {
      cout << c << ' ' << c + sp << endl;
    }
  }
}
