#include <bits/stdc++.h>
using namespace std;
const int N = 110;
const int M = 15;
const int INF = 1 << 30;
struct node {
  int dta[4];
  node() { dta[0] = dta[1] = dta[2] = dta[3] = 0; }
  node(int aa, int bb, int cc, int dd) {
    dta[0] = aa;
    dta[1] = bb;
    dta[2] = cc;
    dta[3] = dd;
  }
};
bool operator<(node x, node y) {
  for (int i = 0; i <= 3; i++)
    if (x.dta[i] != y.dta[i]) return x.dta[i] < y.dta[i];
  return 0;
}
bool operator==(node x, node y) {
  for (int i = 0; i <= 3; i++)
    if (x.dta[i] != y.dta[i]) return 0;
  return 1;
}
const char ch[] = {'G', 'H', 'R', 'S'};
const string house[] = {"Gryffindor", "Hufflepuff", "Ravenclaw ", "Slytherin"};
int pos[32] = {0};
int n;
string s;
bool init() {
  for (int i = 0; i <= 3; i++) pos[ch[i] - 'A'] = i;
  if (cin >> n >> s) return 1;
  return 0;
}
node res[2][M];
int cnt[2];
set<node> have[2];
void insert(int f, int p, node x) {
  node y = x;
  y.dta[p]++;
  if (have[f].count(y)) return;
  cnt[f]++;
  res[f][cnt[f]] = x;
  res[f][cnt[f]].dta[p]++;
  have[f].insert(y);
}
void solve() {
  res[0][1] = node(0, 0, 0, 0);
  cnt[0] = 1;
  bool f = 0;
  for (int i = 0; i < n; i++) {
    cnt[f ^ 1] = 0;
    have[f ^ 1].clear();
    if (s[i] != '?') {
      int p = pos[s[i] - 'A'];
      for (int j = 1; j <= cnt[f]; j++) {
        node tmp = res[f][j];
        insert(f ^ 1, p, tmp);
      }
    } else {
      for (int j = 1; j <= cnt[f]; j++) {
        node tmp = res[f][j];
        int Min = INF;
        vector<int> mid;
        for (int k = 0; k <= 3; k++) Min = min(Min, tmp.dta[k]);
        for (int k = 0; k <= 3; k++)
          if (Min == tmp.dta[k]) mid.push_back(k);
        for (int k = 0; k < mid.size(); k++) {
          insert(f ^ 1, mid[k], tmp);
        }
      }
    }
    f ^= 1;
  }
  bool ans[5] = {0};
  f ^= 1;
  for (int i = 1; i <= cnt[f ^ 1]; i++) {
    int Min = INF;
    for (int j = 0; j <= 3; j++) Min = min(Min, res[f ^ 1][i].dta[j]);
    for (int j = 0; j <= 3; j++)
      if (Min == res[f ^ 1][i].dta[j]) ans[j] = 1;
  }
  for (int i = 0; i <= 3; i++)
    if (ans[i]) printf("%s\n", house[i].c_str());
}
int main() {
  while (init()) {
    solve();
  }
}
