#include <bits/stdc++.h>
using namespace std;
const int mxN = 2e5;
const int MOD = 1e9 + 7;
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  vector<string> v;
  while (n--) {
    string s;
    cin >> s;
    v.push_back(s);
  }
  cout << "AC"
       << "x" << count(v.begin(), v.end(), "AC") << "\n";
  cout << "WA"
       << "x" << count(v.begin(), v.end(), "WA") << "\n";
  cout << "TLE"
       << "x" << count(v.begin(), v.end(), "TLE") << "\n";
  cout << "RE"
       << "x" << count(v.begin(), v.end(), "RE") << "\n";
}
