#include <bits/stdc++.h>
using namespace std;
long long cnt[4];
int main() {
  long long n;
  cin >> n;
  string s[n];
  for (int i = 0; i < (n); i++) cin >> s[i];
  ;
  for (int i = 0; i < (n); i++) {
    if (s[i][0] == 'A')
      cnt[0]++;
    else if (s[i][0] == 'W')
      cnt[1]++;
    else if (s[i][0] == 'T')
      cnt[2]++;
    else
      cnt[3]++;
  }
  cout << "AC x " << cnt[0] << endl;
  cout << "WA × " << cnt[1] << endl;
  cout << "TLE x " << cnt[2] << endl;
  cout << "RE × " << cnt[3] << endl;
}
