#include <bits/stdc++.h>
using namespace std;
set<pair<int, pair<int, int> > > S[10002];
string h[4] = {"Gryffindor", "Hufflepuff", "Ravenclaw", "Slytherin"};
char s[10003];
string H = "GHRS";
int have[4];
int main() {
  int n, i, j, a[4], k, l;
  scanf("%d\n", &n);
  gets(s);
  S[0].insert(pair<int, pair<int, int> >(0, pair<int, int>(0, 0)));
  s[n] = '?';
  for (i = 0; i <= n; i++) {
    j = H.find(s[i]);
    for (set<pair<int, pair<int, int> > >::iterator it = S[i].begin();
         it != S[i].end(); it++) {
      a[0] = it->first;
      a[1] = it->second.first;
      a[2] = it->second.second;
      a[3] = i - a[0] - a[1] - a[2];
      if (j != -1) {
        a[j]++;
        S[i + 1].insert(
            pair<int, pair<int, int> >(a[0], pair<int, int>(a[1], a[2])));
      } else {
        l = 0;
        for (k = 1; k < 4; k++)
          if (a[k] < a[l]) l = k;
        for (k = 0; k < 4; k++)
          if (a[k] == a[l]) {
            a[k]++;
            if (i == n) {
              have[k] = 1;
            } else {
              S[i + 1].insert(
                  pair<int, pair<int, int> >(a[0], pair<int, int>(a[1], a[2])));
            }
            a[k]--;
          }
      }
    }
  }
  for (k = 0; k < 4; k++)
    if (have[k]) cout << h[k] << endl;
  return 0;
}
