#include <bits/stdc++.h>
using namespace std;
using uint = unsigned;
using lint = long long;
using ulint = unsigned long long;
using ldouble = long double;
using point = complex<double>;
using doublex = complex<ldouble>;
const double E = 1e-9, pi = 2 * acos(0);
const ldouble PI = 2 * acosl(0);
struct State {
  int g, h, r, s;
  bool operator<(const State &that) const {
    if (g != that.g) return g < that.g;
    if (h != that.h) return h < that.h;
    if (r != that.r) return r < that.r;
    return s < that.s;
  }
};
int min(State &s) { return min({s.g, s.h, s.r, s.s}); }
bool solve(int testNumber) {
  int n;
  if (!(cin >> n)) return false;
  string str;
  cin >> str;
  set<State> states;
  states.insert({0, 0, 0, 0});
  for (char c : str) {
    set<State> S;
    for (State s : states) {
      if (c == 'G') {
        s.g++;
        S.insert(s);
      } else if (c == 'H') {
        s.h++;
        S.insert(s);
      } else if (c == 'R') {
        s.r++;
        S.insert(s);
      } else if (c == 'S') {
        s.s++;
        S.insert(s);
      } else {
        int mini = min(s);
        if (s.g == mini) {
          s.g++;
          S.insert(s);
          s.g--;
        }
        if (s.h == mini) {
          s.h++;
          S.insert(s);
          s.h--;
        }
        if (s.r == mini) {
          s.r++;
          S.insert(s);
          s.r--;
        }
        if (s.s == mini) {
          s.s++;
          S.insert(s);
          s.s--;
        }
      }
    }
    states = S;
  }
  vector<bool> ans(4);
  for (State s : states) {
    int mini = min(s);
    if (s.g == mini) ans[0] = true;
    if (s.h == mini) ans[1] = true;
    if (s.r == mini) ans[2] = true;
    if (s.s == mini) ans[3] = true;
  }
  if (ans[0]) printf("Gryffindor\n");
  if (ans[1]) printf("Hufflepuff\n");
  if (ans[2]) printf("Ravenclaw\n");
  if (ans[3]) printf("Slytherin\n");
  return true;
}
void init() {}
int main() {
  init();
  for (int i = 1; solve(i); i++)
    ;
  return 0;
}
