#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000002;
const long long INFLL = 100000000000000000ll;
const long long MOD = 1000000007;
int I[256], N;
queue<pair<pair<int, int>, pair<int, int>>> Q;
unordered_set<long long> Seen;
string Name[4], S;
long long get_hash(int a1, int a2, int a3, int a4) {
  long long p4 = 1;
  long long p3 = p4 * 10000;
  long long p2 = p3 * 10000;
  long long p1 = p2 * 10000;
  return p1 * a1 + p2 * a2 + p3 * a3 + p4 * a4;
}
int main() {
  I['G'] = 0;
  I['R'] = 1;
  I['H'] = 2;
  I['S'] = 3;
  Name[0] = "Gryffindor";
  Name[1] = "Ravenclaw";
  Name[2] = "Hufflepuff";
  Name[3] = "Slytherin";
  cin >> N >> S;
  N++;
  S += '?';
  Q.push({{0, 0}, {0, 0}});
  Seen.insert(0);
  unordered_set<int> ans;
  int a[4];
  while (!Q.empty()) {
    pair<pair<int, int>, pair<int, int>> p = Q.front();
    Q.pop();
    a[0] = p.first.first;
    a[1] = p.first.second;
    a[2] = p.second.first;
    a[3] = p.second.second;
    int i = a[0] + a[1] + a[2] + a[3];
    if (S[i] == '?') {
      int m = N + 1;
      vector<int> mins;
      for (int x = (0); x <= (3); x++) {
        if (a[x] < m) mins.clear(), m = a[x];
        if (a[x] == m) mins.push_back(x);
      }
      if (i == N - 1)
        for (int k : mins) ans.insert(k);
      else
        for (int k : mins) {
          a[k]++;
          if (Seen.find(get_hash(a[0], a[1], a[2], a[3])) == Seen.end()) {
            Seen.insert(get_hash(a[0], a[1], a[2], a[3]));
            Q.push({{a[0], a[1]}, {a[2], a[3]}});
          }
          a[k]--;
        }
    } else {
      int k = I[S[i]];
      a[k]++;
      if (Seen.find(get_hash(a[0], a[1], a[2], a[3])) == Seen.end()) {
        Seen.insert(get_hash(a[0], a[1], a[2], a[3]));
        Q.push({{a[0], a[1]}, {a[2], a[3]}});
      }
      a[k]--;
    }
  }
  vector<string> names;
  for (int k : ans) names.push_back(Name[k]);
  sort(names.begin(), names.end());
  for (string s : names) cout << s << "\n";
}
