#include <bits/stdc++.h>
using namespace std;
int n, ans = 0;
map<float, vector<int> > cnt;
map<int, float> now;
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    char a;
    float c, d, e;
    cin >> a >> c >> a >> d >> a >> a >> e;
    cnt[(c + d) / e].push_back(i);
    now[i] = (c + d) / e;
  }
  for (int i = 1; i <= n; ++i) cout << cnt[now[i]].size() << ' ';
  return 0;
}
