#include <bits/stdc++.h>
using namespace std;
int t, n, a[5], ans[5], f1[19491001], cxk, f2[19491001];
int mod1 = 19260817, mod2 = 233317;
string s;
inline int Read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 3) + (x << 1) + ch - '0';
    ch = getchar();
  }
  return x * f;
}
void Write(int x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x > 9) Write(x / 10);
  putchar(x % 10 + '0');
}
inline int HAsh1() {
  long long last = 0;
  for (int i = 1; i <= 4; ++i) {
    last = last * 13331 + a[i];
    last %= mod1;
  }
  return last;
}
inline int HAsh2() {
  long long last = 0;
  for (int i = 1; i <= 4; ++i) {
    last = last * 13331 + a[i];
    last %= mod2;
  }
  return last;
}
void dfs(int k, int now) {
  if (f1[HAsh1()] && f2[HAsh2()]) return;
  f1[HAsh1()] = f2[HAsh2()] = 1;
  if (cxk) return;
  if (k == n + 1) {
    int minn = 2147482647;
    for (register int i = 1; i <= 4; ++i) {
      if (minn > a[i]) minn = a[i];
    }
    for (register int i = 1; i <= 4; ++i) {
      if (a[i] == minn) {
        ans[i] = 1;
      }
    }
    int flag = 1;
    for (register int i = 1; i <= 4; ++i)
      if (!ans[i]) flag = 0;
    if (flag) cxk = 1;
    return;
  }
  if (s[k - 1] == 'G') {
    a[1]++;
    dfs(k + 1, 1);
  } else if (s[k - 1] == 'H') {
    a[2]++;
    dfs(k + 1, 2);
  } else if (s[k - 1] == 'R') {
    a[3]++;
    dfs(k + 1, 3);
  } else if (s[k - 1] == 'S') {
    a[4]++;
    dfs(k + 1, 4);
  } else {
    int minn = 2147482647;
    for (register int i = 1; i <= 4; ++i) {
      if (minn > a[i]) minn = a[i];
    }
    for (register int i = 1; i <= 4; ++i) {
      if (a[i] == minn) {
        int a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4];
        a[i]++;
        dfs(k + 1, i);
        a[1] = a1, a[2] = a2, a[3] = a3, a[4] = a4;
      }
    }
  }
}
int main() {
  n = Read();
  cin >> s;
  memset(a, 0, sizeof(a));
  memset(ans, 0, sizeof(ans));
  memset(f1, 0, sizeof(f1));
  memset(f2, 0, sizeof(f2));
  cxk = 0;
  dfs(1, 0);
  if (ans[1]) puts("Gryffindor");
  if (ans[2]) puts("Hufflepuff");
  if (ans[3]) puts("Ravenclaw");
  if (ans[4]) puts("Slytherin");
  putchar('\n');
}
