#include <bits/stdc++.h>
using namespace std;
int n, arr[26];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    arr[s[0] - 'A']++;
  }
  cout << "AC x " << arr['A' - 'A'] << " \n";
  cout << "WA x " << arr['W' - 'A'] << " \n";
  cout << "TLE x " << arr['T' - 'A'] << " \n";
  cout << "RE x " << arr['E' - 'A'] << " \n";
}
