#include <iostream>
#include <string>
using namespace std;
int a[4], b[4];
int main()
{
    string L, R;
    while (cin >> L >> R) {
        int l = (L[0]-'0')*10 + L[2]-'0';
        int r = (R[0]-'0')*10 + R[2]-'0';
        if (l >= 11) a[0]++;
        else if (l >= 6) a[1]++;
        else if (l >= 2) a[2]++;
        else a[3]++;
        if (r >= 11) b[0]++;
        else if (r >= 6) b[1]++;
        else if (r >= 2) b[2]++;
        else b[3]++;
    }
    for (int i=0; i<4; ++i) cout << a[i] << " " << b[i] << endl;
    return 0;
}