#include <bits/stdc++.h>
using namespace std;
int n, f, r[4];
char names[4][16] = {"Gryffindor", "Hufflepuff", "Ravenclaw", "Slytherin"};
int main() {
  scanf("%d", &n);
  vector<vector<int> > v;
  v.push_back(vector<int>(4));
  for (int k = 0; k < (int)(n); k++) {
    char op;
    scanf(" %c", &op);
    ((void)0);
    if (op != '?') {
      for (int i = 0; i < (int)(4); i++)
        if (op == names[i][0]) {
          for (int j = 0; j < (int)(v.size()); j++) v[j][i]++;
        }
    } else {
      vector<vector<int> > nv;
      for (int j = 0; j < (int)(v.size()); j++) {
        int mx = 1 << 30;
        for (int i = 0; i < (int)(4); i++) mx = min(mx, v[j][i]);
        for (int i = 0; i < (int)(4); i++)
          if (v[j][i] == mx) {
            nv.push_back(v[j]);
            nv.back()[i]++;
          }
      }
      sort(nv.begin(), nv.end());
      nv.erase(unique(nv.begin(), nv.end()), nv.end());
      v = nv;
    }
  }
  for (int i = 0; i < (int)(v.size()); i++) {
    int mx = 1 << 30;
    for (int j = 0; j < (int)(4); j++) mx = min(mx, v[i][j]);
    for (int j = 0; j < (int)(4); j++)
      if (v[i][j] == mx) r[j] = 1;
  }
  for (int i = 0; i < (int)(4); i++)
    if (r[i]) puts(names[i]);
  return 0;
}
