#include <bits/stdc++.h>
using namespace std;
const int MAXN = 10010;
char s[MAXN];
set<vector<int>> dp[MAXN];
string beg = "GRSH";
string names[] = {"Gryffindor", "Ravenclaw", "Slytherin", "Hufflepuff"};
int main() {
  int n;
  scanf("%d", &n);
  scanf("%s", s);
  vector<int> base(4, 0);
  dp[0].insert(base);
  for (int i = 0; i < n; i++) {
    if (s[i] != '?') {
      int id = beg.find(s[i]);
      for (auto &t : dp[i]) {
        vector<int> temp = t;
        temp[id]++;
        dp[i + 1].insert(temp);
      }
    } else {
      for (auto &t : dp[i]) {
        vector<int> temp = t;
        int mn = INT_MAX;
        for (auto u : temp) mn = min(mn, u);
        for (int id = 0; id < 4; id++) {
          if (temp[id] == mn) {
            temp[id]++;
            dp[i + 1].insert(temp);
            temp[id]--;
          }
        }
      }
    }
  }
  vector<int> ans(4);
  for (auto &t : dp[n]) {
    vector<int> temp = t;
    int mn = INT_MAX;
    for (auto u : temp) mn = min(mn, u);
    for (int id = 0; id < 4; id++) {
      if (temp[id] == mn) {
        ans[id] = 1;
      }
    }
  }
  vector<string> res;
  for (int i = 0; i < 4; i++) {
    if (ans[i]) res.push_back(names[i]);
  }
  sort(res.begin(), res.end());
  for (auto t : res) {
    cout << t << endl;
  }
  return 0;
}
