#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string a = "AC", w = "WA", t = "TLE", r = "RE";
  long long int A = 0, W = 0, T = 0, R = 0;
  long long int tt;
  cin >> tt;
  while (tt--) {
    long long int n, m, q, f = 1, d, k, x, y, sum = 0, b;
    string str;
    cin >> str;
    if (a == str)
      A++;
    else if (w == str)
      W++;
    else if (t == str)
      T++;
    else
      R++;
  }
  cout << a << " x " << A << '\n';
  cout << w << " x " << W << '\n';
  cout << T << " x " << T << '\n';
  cout << r << " x " << R << '\n';
  return 0;
}
