#include <bits/stdc++.h>
using namespace std;
struct S {
  int g, h, r, s;
  S() {}
  S(int g, int h, int r, int s) : g(g), h(h), r(r), s(s) {}
  bool operator<(const S &rhs) const {
    if (g == rhs.g) {
      if (h == rhs.h) {
        if (r == rhs.r) return s < rhs.s;
        return r < rhs.r;
      }
      return h < rhs.h;
    }
    return g < rhs.g;
  }
};
int n;
string house;
bool ans[4];
string names[] = {"Gryffindor", "Hufflepuff", "Ravenclaw", "Slytherin"};
map<S, bool> seen;
void dfs(int idx, int g, int h, int r, int s) {
  S node(g, h, r, s);
  if (seen[node]) return;
  seen[node] = true;
  int mn = min(g, min(h, min(r, s)));
  if (idx == n) {
    if (mn == g) ans[0] = true;
    if (mn == h) ans[1] = true;
    if (mn == r) ans[2] = true;
    if (mn == s) ans[3] = true;
    return;
  }
  if (house[idx] == '?') {
    if (mn == g) dfs(idx + 1, g + 1, h, r, s);
    if (mn == h) dfs(idx + 1, g, h + 1, r, s);
    if (mn == r) dfs(idx + 1, g, h, r + 1, s);
    if (mn == s) dfs(idx + 1, g, h, r, s + 1);
  } else {
    if (house[idx] == 'G') dfs(idx + 1, g + 1, h, r, s);
    if (house[idx] == 'H') dfs(idx + 1, g, h + 1, r, s);
    if (house[idx] == 'R') dfs(idx + 1, g, h, r + 1, s);
    if (house[idx] == 'S') dfs(idx + 1, g, h, r, s + 1);
  }
}
int main() {
  while (cin >> n >> house) {
    memset(ans, 0, sizeof(ans));
    seen.clear();
    dfs(0, 0, 0, 0, 0);
    for (int i = 0; i < (int)(4); i++)
      if (ans[i]) puts(names[i].c_str());
  }
  return 0;
}
