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