#include <bits/stdc++.h>
using namespace std;
const int MAXN = 11111;
struct node {
  int a[4];
  node() {}
  node(int x = 0, int y = 0, int z = 0, int w = 0) {
    a[0] = x, a[1] = y, a[2] = z, a[3] = w;
  }
  void inc(int x) { ++a[x]; }
  void dec(int x) { --a[x]; }
  void print() {
    for (int i = 0; i < 4; ++i) printf("%d ", a[i]);
    puts("");
  }
};
string h[] = {"Gryffindor", "Hufflepuff", "Ravenclaw", "Slytherin"};
string house = "GHRS";
char s[MAXN];
set<node> f[MAXN];
set<node>::iterator it;
bool in[4] = {false, false, false, false};
inline bool operator<(node x, node y) {
  for (int i = 0; i < 4; ++i)
    if (x.a[i] != y.a[i]) return x.a[i] < y.a[i];
}
int main() {
  int i, j, k, t;
  int m, n;
  int a[4];
  scanf("%d", &n);
  scanf("%s", s);
  s[n] = '?';
  f[0].insert(node(0, 0, 0, 0));
  for (i = 0; i <= n; ++i) {
    for (it = f[i].begin(); it != f[i].end(); ++it) {
      j = house.find(s[i]);
      for (k = 0; k < 4; ++k) a[k] = it->a[k];
      if (j != -1) {
        ++a[j];
        f[i + 1].insert(node(a[0], a[1], a[2], a[3]));
      } else {
        t = 0;
        for (k = 1; k < 4; ++k)
          if (a[k] < a[t]) t = k;
        for (k = 0; k < 4; ++k) {
          if (a[k] == a[t]) {
            ++a[k];
            if (i == n)
              in[k] = true;
            else
              f[i + 1].insert(node(a[0], a[1], a[2], a[3]));
            --a[k];
          }
        }
      }
    }
  }
  for (i = 0; i < 4; ++i)
    if (in[i]) puts(h[i].c_str());
  return 0;
}
