#include <bits/stdc++.h>
using lint = long int;
using llint = long long int;
using namespace std;
int main() {
  (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false));
  int n;
  cin >> n;
  map<string, int> mp;
  for (auto judge : {"AC", "WA", "TLE", "RE"}) {
    mp[judge] = 0;
  }
  for (int _ = 0; _ < (n); ++_) {
    string judge;
    cin >> judge;
    mp[judge] += 1;
  }
  for (auto el : mp) {
    cout << el.first << " x " << el.second << endl;
  }
}
