#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a = 0, b = 0, c = 0, d = 0;
  string p = "AC", q = "WA", r = "TLE", s1 = "TLE";
  while (n--) {
    string s;
    cin >> s;
    if (s.compare(p) == 0)
      a++;
    else if (s.compare(q) == 0)
      b++;
    else if (s.compare(r) == 0)
      c++;
    else
      d++;
  }
  cout << p << " x " << a << "\n";
  cout << q << " x " << b << "\n";
  cout << r << " x " << c << "\n";
  cout << s1 << " x " << d << "\n";
}
