#include <bits/stdc++.h>
using namespace std;
struct state {
  int g, h, r, s;
  bool operator<(const state b) const;
  state();
};
state::state() : g(0), h(0), r(0), s(0) {}
int min4(int a, int b, int c, int d) { return min(a, min(b, min(c, d))); }
bool state::operator<(const state b) const {
  return g < b.g || (g == b.g && h < b.h) ||
         (g == b.g && h == b.h && r < b.r) ||
         (g == b.g && h == b.h && r == b.r && s < b.s);
}
void incG(set<state>& states) {
  set<state> sc = states;
  for (set<state>::iterator i = sc.begin(); i != sc.end(); i++) {
    state st = *i;
    states.erase(*i);
    st.g++;
    states.insert(st);
  }
}
void incH(set<state>& states) {
  set<state> sc = states;
  for (set<state>::iterator i = sc.begin(); i != sc.end(); i++) {
    state st = *i;
    states.erase(*i);
    st.h++;
    states.insert(st);
  }
}
void incR(set<state>& states) {
  set<state> sc = states;
  for (set<state>::iterator i = sc.begin(); i != sc.end(); i++) {
    state st = *i;
    states.erase(*i);
    st.r++;
    states.insert(st);
  }
}
void incS(set<state>& states) {
  set<state> sc = states;
  for (set<state>::iterator i = sc.begin(); i != sc.end(); i++) {
    state st = *i;
    states.erase(*i);
    st.s++;
    states.insert(st);
  }
}
void incMin(set<state>& states) {
  set<state> sc = states;
  for (set<state>::iterator i = sc.begin(); i != sc.end(); i++) {
    state st = *i;
    states.erase(*i);
    if (st.s == min4(st.s, st.h, st.g, st.r)) {
      st.s++;
      states.insert(st);
      st.s--;
    }
    if (st.g == min4(st.g, st.h, st.s, st.r)) {
      st.g++;
      states.insert(st);
      st.g--;
    }
    if (st.h == min4(st.g, st.h, st.s, st.r)) {
      st.h++;
      states.insert(st);
      st.h--;
    }
    if (st.r == min4(st.g, st.h, st.s, st.r)) {
      st.r++;
      states.insert(st);
      st.r--;
    }
  }
}
int main() {
  int n;
  cin >> n;
  string str;
  cin >> str;
  set<state> states;
  states.insert(state());
  for (int i = 0; i < str.length(); i++) switch (str[i]) {
      case 'G':
        incG(states);
        break;
      case 'H':
        incH(states);
        break;
      case 'R':
        incR(states);
        break;
      case 'S':
        incS(states);
        break;
      default:
        incMin(states);
        break;
    }
  bool g = false, h = false, r = false, s = false;
  for (set<state>::iterator i = states.begin(); i != states.end(); i++) {
    if (i->g == min4(i->g, i->h, i->r, i->s)) g = true;
    if (i->h == min4(i->g, i->h, i->r, i->s)) h = true;
    if (i->r == min4(i->g, i->h, i->r, i->s)) r = true;
    if (i->s == min4(i->g, i->h, i->r, i->s)) s = true;
    if (h && g && r && s) break;
  }
  if (g) cout << "Gryffindor\n";
  if (h) cout << "Hufflepuff\n";
  if (r) cout << "Ravenclaw\n";
  if (s) cout << "Slytherin\n";
  return 0;
}
