#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-13;
const long long INFF = 1e18;
const int INF = 1e9;
const int mod = 1e9 + 7;
const int MAX = 1e5 + 7;
char s[MAX];
int n;
string ans[5];
int ck[5];
int rsum[MAX][5];
int gd[5];
void go(int p) {
  int cnt[5];
  memset(cnt, 0, sizeof(cnt));
  ;
  for (int j = (1); j < (n + 1); ++j) {
    if (s[j] == 'G')
      cnt[1]++;
    else if (s[j] == 'H')
      cnt[2]++;
    else if (s[j] == 'R')
      cnt[3]++;
    else if (s[j] == 'S')
      cnt[4]++;
    else {
      memset(ck, 0, sizeof(ck));
      ;
      int num = 0, mn = n;
      for (int i = (1); i < (5); ++i)
        if (cnt[i] < mn) mn = cnt[i];
      for (int i = (1); i < (5); ++i)
        if (cnt[i] == mn) ck[i] = 1, num++;
      if (num == 1) {
        for (int i = (1); i < (5); ++i)
          if (ck[i]) cnt[i]++;
      } else {
        vector<int> tmp;
        for (int i = (1); i < (5); ++i)
          if (ck[i]) {
            tmp.push_back(i);
          }
        cnt[tmp[rand() % ((int)tmp.size())]]++;
      }
    }
  }
  memset(ck, 0, sizeof(ck));
  ;
  int mn = n;
  for (int i = (1); i < (5); ++i)
    if (cnt[i] < mn) mn = cnt[i];
  for (int i = (1); i < (5); ++i)
    if (cnt[i] == mn) gd[i] = 1;
}
void ok(int p) {
  int cnt[5];
  memset(cnt, 0, sizeof(cnt));
  ;
  for (int j = (1); j < (n + 1); ++j) {
    if (s[j] == 'G')
      cnt[1]++;
    else if (s[j] == 'H')
      cnt[2]++;
    else if (s[j] == 'R')
      cnt[3]++;
    else if (s[j] == 'S')
      cnt[4]++;
    else {
      memset(ck, 0, sizeof(ck));
      ;
      int num = 0, mn = n;
      for (int i = (1); i < (5); ++i)
        if (cnt[i] < mn) mn = cnt[i];
      for (int i = (1); i < (5); ++i)
        if (cnt[i] == mn) ck[i] = 1, num++;
      if (num == 1) {
        for (int i = (1); i < (5); ++i)
          if (ck[i]) cnt[i]++;
      } else {
        int pos, val = n;
        for (int i = (1); i < (5); ++i)
          if (ck[i] && i != p) {
            if (rsum[j][i] < val) {
              pos = i;
              val = rsum[j][i];
            }
          }
        cnt[pos]++;
      }
    }
  }
  memset(ck, 0, sizeof(ck));
  ;
  int mn = n;
  for (int i = (1); i < (5); ++i)
    if (cnt[i] < mn) mn = cnt[i];
  for (int i = (1); i < (5); ++i)
    if (cnt[i] == mn) gd[i] = 1;
}
void build() {
  for (int j = n; j >= 1; --j) {
    for (int i = (1); i < (5); ++i) rsum[j][i] = rsum[j + 1][i];
    if (s[j] == 'G')
      rsum[j][1]++;
    else if (s[j] == 'H')
      rsum[j][2]++;
    else if (s[j] == 'R')
      rsum[j][3]++;
    else if (s[j] == 'S')
      rsum[j][4]++;
  }
}
int main(void) {
  scanf("%d", &n);
  scanf("%s", s + 1);
  build();
  ans[1] = "Gryffindor";
  ans[2] = "Hufflepuff";
  ans[3] = "Ravenclaw";
  ans[4] = "Slytherin";
  for (int i = (1); i < (5); ++i) {
    for (int j = (1); j < (100); ++j) go(i);
    ok(i);
  }
  for (int i = (1); i < (5); ++i)
    if (gd[i]) cout << ans[i] << endl;
  return 0;
}
