#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<string> a = {"AC", "WA", "TLE", "RE"};
  int c = 0, c1 = 0, c2 = 0, c3 = 0;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    if (s == a[0]) ++c;
    if (s == a[1]) ++c1;
    if (s == a[2]) ++c2;
    if (s == a[3]) ++c3;
  }
  cout << a[0] << "x" << c << endl;
  cout << a[1] << "x" << c1 << endl;
  cout << a[2] << "x" << c2 << endl;
  cout << a[3] << "x" << c3 << endl;
}
