#include <bits/stdc++.h>
using namespace std;
string s;
map<vector<pair<int, char> >, bool> used[100][11000], dp[100][11000];
bool legal(vector<pair<int, char> > tem, char tar, int in) {
  sort(tem.begin(), tem.end());
  if (used[tar][in][tem]) return dp[tar][in][tem];
  used[tar][in][tem] = true;
  int i;
  if (in == (int)s.size()) {
    for (i = 0; i <= 3; i++)
      if (tem[i].second == tar && tem[i].first == tem[0].first) {
        dp[tar][in][tem] = true;
        return true;
      }
    return false;
  }
  for (i = 0; i <= 3; i++)
    if (tem[i].second == s[in]) {
      tem[i].first++;
      if (legal(tem, tar, in + 1)) {
        dp[tar][in][tem] = true;
        return true;
      }
      return false;
    }
  int mi = tem[0].first;
  for (i = 0; i <= 3 && tem[i].first == mi; i++)
    if (tem[i].second != tar) {
      tem[i].first++;
      if (legal(tem, tar, in + 1)) {
        dp[tar][in][tem] = true;
        return true;
      }
      tem[i].first--;
    }
  for (i = 0; i <= 3 && tem[i].first == mi; i++)
    if (tem[i].second == tar) {
      tem[i].first++;
      dp[tar][in][tem] = legal(tem, tar, in + 1);
      return dp[tar][in][tem];
    }
  return false;
}
int main() {
  int n;
  vector<pair<int, char> > ocu;
  ocu.push_back(make_pair(0, 'G'));
  ocu.push_back(make_pair(0, 'H'));
  ocu.push_back(make_pair(0, 'R'));
  ocu.push_back(make_pair(0, 'S'));
  while (cin >> n) {
    cin >> s;
    if (legal(ocu, 'G', 0)) printf("Gryffindor\n");
    if (legal(ocu, 'H', 0)) printf("Hufflepuff\n");
    if (legal(ocu, 'R', 0)) printf("Ravenclaw\n");
    if (legal(ocu, 'S', 0)) printf("Slytherin\n");
  }
  return 0;
}
