#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  unordered_map<char, int> mapa;
  while (n--) {
    string s;
    cin >> s;
    ++mapa[s[0]];
  }
  cout << "AC x " << mapa['A'] << '\n';
  cout << "WA x " << mapa['W'] << '\n';
  cout << "TLW x " << mapa['T'] << '\n';
  cout << "RE x " << mapa['R'] << '\n';
  return 0;
}
