#include <bits/stdc++.h>
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
#define REP(i,a,b) for (int i = a; i <= b; i++)
#define F first
#define S second
#define PB push_back
#define MP make_pair
using namespace std;

typedef long long ll;
using pi = pair<int, int>;

int main() {
  int N;
  cin >> N;
  int arr[4]={0};
  string in;
  while(N--) {
    cin >> in;
    if(in == "AC") arr[0]++;
    else if(in == "WA") arr[1]++;
    else if(in == "TLE") arr[2]++;
    else if(int == "RE") arr[3]++;
  }
  cout << "AC x " << arr[0] << endl;
  cout << "WA x " << arr[1] << endl;
  cout << "TLE x " << arr[2] << endl;
  cout << "RE x " << arr[3] << endl;
  return 0;
}
