#include <bits/stdc++.h>
using namespace std;
struct cua {
  int a, b, c, d, pos;
  cua(int x = 0, int y = 0, int z = 0, int w = 0, int p = 0) {
    a = x;
    b = y;
    c = z;
    d = w;
    pos = p;
  }
  bool operator<(const cua& B) const {
    return a != B.a   ? a < B.a
           : b != B.b ? b < B.b
           : c != B.c ? c < B.c
                      : d < B.d;
  }
};
set<cua> seen[20000];
char s[20000];
queue<cua> q;
inline void normaliza(int a, int b, int c, int d, int pos) {
  int mini = min(a, min(b, min(c, d)));
  cua next(a - mini, b - mini, c - mini, d - mini, pos);
  if (seen[pos].count(next)) return;
  seen[pos].insert(next);
  q.push(next);
}
int main() {
  int n;
  cin >> n;
  scanf("%s", s);
  cua first;
  q.push(first);
  int poss = 0;
  while (!q.empty()) {
    cua c = q.front();
    q.pop();
    int pos = c.pos;
    if (pos == n) {
      if (c.a == 0) poss |= 1;
      if (c.b == 0) poss |= 2;
      if (c.c == 0) poss |= 4;
      if (c.d == 0) poss |= 8;
    } else {
      if (s[pos] == 'G')
        (normaliza(c.a + 1, c.b, c.c, c.d, pos + 1));
      else if (s[pos] == 'S')
        (normaliza(c.a, c.b + 1, c.c, c.d, pos + 1));
      else if (s[pos] == 'R')
        (normaliza(c.a, c.b, c.c + 1, c.d, pos + 1));
      else if (s[pos] == 'H')
        (normaliza(c.a, c.b, c.c, c.d + 1, pos + 1));
      else {
        if (c.a == 0) (normaliza(c.a + 1, c.b, c.c, c.d, pos + 1));
        if (c.b == 0) (normaliza(c.a, c.b + 1, c.c, c.d, pos + 1));
        if (c.c == 0) (normaliza(c.a, c.b, c.c + 1, c.d, pos + 1));
        if (c.d == 0) (normaliza(c.a, c.b, c.c, c.d + 1, pos + 1));
      }
    }
  }
  if (poss & 1) cout << "Gryffindor" << endl;
  if (poss & 8) cout << "Hufflepuff" << endl;
  if (poss & 4) cout << "Ravenclaw" << endl;
  if (poss & 2) cout << "Slytherin" << endl;
}
