#include <iostream>

using namespace std;

void out (string s, int num) {
  cout << s << " x " << num << endl;
}

int main () {
  int count;
  cin >> count;
  int ac= 0,wa =0,tle =0,re=0;
  for (int i = 0; i < count ; ++i) {
    string s;
    cin >> s;
    if (s =="AC") {
    	++ac;
    }
    else if (s == "WA") {
      ++wa;
    }
    else if (s =="TLE") {
      ++tle;
    }
    else if (s =="RE") {
      ++re;
    }
  }
  out("AC",ac);
  out("WA",wa);
  out("TLE",tle);
  out("RE",re);
  
}#include <iostream>

using namespace std;

void out (string s, int num) {
  cout << s << " x " << num << endl;
}

int main () {
  int count;
  cin >> count;
  int ac= 0,wa =0,tle =0,re=0;
  for (int i = 0; i < count ; ++i) {
    string s;
    cin >> s;
    if (s =="AC") {
    	++ac;
    }
    else if (s == "WA") {
      ++wa;
    }
    else if (s =="TLE") {
      ++tle;
    }
    else if (s =="RE") {
      ++re;
    }
  }
  out("AC",ac);
  out("WA",wa);
  out("TLE",tle);
  out("RE",re);
  
}