#include <bits/stdc++.h>
using namespace std;
struct node {
  int a[4];
  inline bool operator<(const node &B) const {
    for (int i = 0, _y = 3; i <= _y; i++)
      if (a[i] != B.a[i]) return a[i] < B.a[i];
    return 0;
  }
} b[10010], a;
struct Node {
  int x;
  node y;
  inline bool operator<(const Node &B) const {
    if (x == B.x)
      return y < B.y;
    else
      return x < B.x;
  }
};
bool flag, ans[4];
int m;
set<Node> s;
void dfs(int x, node now) {
  if (flag || s.find((Node){x, now}) != s.end()) return;
  s.insert((Node){x, now});
  int mn = 1e9;
  for (int i = 0, _y = 3; i <= _y; i++)
    if ((now.a[i] += b[x].a[i]) < mn) mn = now.a[i];
  if (x == m) {
    bool f = 1;
    for (int i = 0, _y = 3; i <= _y; i++) {
      if (now.a[i] == mn) ans[i] = 1;
      if (!ans[i]) f = 0;
    }
    flag = f;
    return;
  }
  for (int i = 0, _y = 3; i <= _y; i++)
    if (now.a[i] == mn) now.a[i]++, dfs(x + 1, now), now.a[i]--;
}
int T, n;
char str[10010];
int main() {
  scanf("%d%s", &n, str + 1);
  flag = 0;
  m = 0;
  for (int i = 0, _y = 3; i <= _y; i++) a.a[i] = ans[i] = 0;
  s.clear();
  for (int i = 1, _y = n; i <= _y; i++) {
    if (str[i] == '?') {
      b[++m] = a;
      for (int j = 0, _y = 3; j <= _y; j++) a.a[j] = 0;
    } else if (str[i] == 'G')
      a.a[0]++;
    else if (str[i] == 'H')
      a.a[1]++;
    else if (str[i] == 'R')
      a.a[2]++;
    else if (str[i] == 'S')
      a.a[3]++;
  }
  b[++m] = a;
  for (int i = 0, _y = 3; i <= _y; i++) a.a[i] = 0;
  dfs(1, a);
  if (ans[0]) puts("Gryffindor");
  if (ans[1]) puts("Hufflepuff");
  if (ans[2]) puts("Ravenclaw");
  if (ans[3]) puts("Slytherin");
}
