#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 10000 + 10;
set<vector<int> > dp[MAX_N];
string names = "GRSH";
int main() {
  vector<int> init(4, 0);
  int n;
  string input;
  cin >> n;
  cin >> input;
  dp[0].insert(init);
  for (int cur = 0; cur < n; ++cur) {
    if (input[cur] != '?') {
      int id = names.find(input[cur]);
      for (__typeof(dp[cur].begin()) e = dp[cur].begin(); e != dp[cur].end();
           ++e) {
        vector<int> am = *e;
        am[id]++;
        dp[cur + 1].insert(am);
      }
    } else {
      for (__typeof(dp[cur].begin()) e = dp[cur].begin(); e != dp[cur].end();
           ++e) {
        vector<int> am = *e;
        int mc = INT_MAX;
        for (__typeof(am.begin()) e2 = am.begin(); e2 != am.end(); ++e2)
          mc = min(mc, *e2);
        for (int ch = 0; ch < 4; ++ch) {
          if (am[ch] == mc) {
            am[ch]++;
            dp[cur + 1].insert(am);
            am[ch]--;
          }
        }
      }
    }
  }
  bool can[4] = {};
  for (__typeof(dp[n].begin()) e = dp[n].begin(); e != dp[n].end(); ++e) {
    vector<int> am = *e;
    int mc = INT_MAX;
    for (__typeof(am.begin()) e2 = am.begin(); e2 != am.end(); ++e2)
      mc = min(mc, *e2);
    for (int which = 0; which < 4; ++which) {
      if (am[which] == mc) can[which] = true;
    }
  }
  string names[] = {"Gryffindor", "Ravenclaw", "Slytherin", "Hufflepuff"};
  vector<string> ans;
  for (int i = 0; i < 4; ++i) {
    if (can[i]) ans.push_back(names[i]);
  }
  sort(ans.begin(), ans.end());
  for (__typeof(ans.begin()) e = ans.begin(); e != ans.end(); ++e)
    cout << *e << endl;
}
