#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vl = vector<ll>; using vvl = vector<vl>;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
const ll INF = 9223372036854775807;

int main() {
  int n;cin >> n;
  int a = 0;
  int b = 0;
  int c = 0;
  int d = 0;
  rep(i,n) {
    string s;cin >> s;
    if(s == "AC") a++;
    if(s == "WA") b++;
    if(s == "TLE") c++;
    if(s == "RE") d++;
  }
  cout << "AC" << " " << x << " " << a << endl;
  cout << "WA" << " " << x << " " << b << endl;
  cout << "TLE" << " " << x << " " << c << endl;
  cout << "RE" << " " << x << " " << d << endl;
}