#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  map<string, long long int> m;
  m["AC"] = 0;
  m["WA"] = 0;
  m["TLE"] = 0;
  m["RE"] = 0;
  for (long long int i = 0; i < n; i++) {
    string s;
    cin >> s;
    m[s]++;
  }
  for (auto x : m) {
    cout << x.first << " x " << x.second << endl;
  }
  return 0;
}
