#include <bits/stdc++.h>
using namespace std;
struct stt {
  int hse[4];
  long long id;
  void set(int a, int b, int c, int d) {
    hse[0] = a, hse[1] = b, hse[2] = c, hse[3] = d;
  }
};
struct cmp {
  bool operator()(const stt &a, const stt &b) { return a.id < b.id; }
};
int N;
char inp[10005];
int a[10005];
set<stt, cmp> dp[10005];
bool place[4];
char house[4][20] = {"Gryffindor", "Hufflepuff", "Ravenclaw", "Slytherin"};
int main() {
  scanf("%d\n", &N);
  scanf("%s\n", &inp);
  for (int i = 0; i < N; i++) {
    if (inp[i] == 'G') a[i] = 0;
    if (inp[i] == 'H') a[i] = 1;
    if (inp[i] == 'R') a[i] = 2;
    if (inp[i] == 'S') a[i] = 3;
    if (inp[i] == '?') a[i] = -1;
  }
  for (int i = 0; i < N; i++) {
    if (i == 0) {
      stt tmp;
      if (a[i] == 0)
        tmp.set(1, 0, 0, 0), tmp.id = (1ll << 0), dp[i + 1].insert(tmp);
      else if (a[i] == 1)
        tmp.set(0, 1, 0, 0), tmp.id = (1ll << 16), dp[i + 1].insert(tmp);
      else if (a[i] == 2)
        tmp.set(0, 0, 1, 0), tmp.id = (1ll << 32), dp[i + 1].insert(tmp);
      else if (a[i] == 3)
        tmp.set(0, 0, 0, 1), tmp.id = (1ll << 48), dp[i + 1].insert(tmp);
      else {
        tmp.set(1, 0, 0, 0), tmp.id = (1ll << 0), dp[i + 1].insert(tmp);
        tmp.set(0, 1, 0, 0), tmp.id = (1ll << 16), dp[i + 1].insert(tmp);
        tmp.set(0, 0, 1, 0), tmp.id = (1ll << 32), dp[i + 1].insert(tmp);
        tmp.set(0, 0, 0, 1), tmp.id = (1ll << 48), dp[i + 1].insert(tmp);
      }
    } else {
      set<stt, cmp>::iterator ii;
      for (ii = dp[i].begin(); ii != dp[i].end(); ii++) {
        stt tmp = *ii;
        int c[4];
        c[0] = tmp.hse[0], c[1] = tmp.hse[1], c[2] = tmp.hse[2],
        c[3] = tmp.hse[3];
        if (a[i] != -1) {
          tmp.hse[a[i]]++;
          tmp.id += (1 << (a[i] * 16));
          dp[i + 1].insert(tmp);
        } else {
          int minhse = min(min(c[0], c[1]), min(c[2], c[3]));
          for (int j = 0; j < 4; j++) {
            stt tmp2 = tmp;
            if (c[j] == minhse) {
              tmp2.hse[j]++;
              tmp2.id += (1ll << (j * 16));
              dp[i + 1].insert(tmp2);
            }
          }
        }
      }
    }
  }
  set<stt, cmp>::iterator ii;
  for (ii = dp[N].begin(); ii != dp[N].end(); ii++) {
    stt tmp = *ii;
    int c[4];
    c[0] = tmp.hse[0], c[1] = tmp.hse[1], c[2] = tmp.hse[2], c[3] = tmp.hse[3];
    int minhse = min(min(c[0], c[1]), min(c[2], c[3]));
    for (int j = 0; j < 4; j++) {
      if (c[j] == minhse) place[j] = 1;
    }
  }
  for (int i = 0; i < 4; i++) {
    if (place[i]) printf("%s\n", house[i]);
  }
  return 0;
}
