#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string input;
  cin >> n;
  cin >> input;
  map<char, int> m;
  m['G'] = 0;
  m['H'] = 1;
  m['R'] = 2;
  m['S'] = 3;
  m['?'] = 4;
  set<vector<int> > s;
  s.insert(vector<int>(4, 0));
  for (int i = 0; i < n; i++) {
    set<vector<int> > snext;
    int caracter = m[input[i]];
    for (set<vector<int> >::iterator it = s.begin(); it != s.end(); it++) {
      vector<int> v = *it;
      if (caracter == 4) {
        int minim = v[0];
        for (int i = 1; i < 4; i++) minim = min(minim, v[i]);
        for (int i = 0; i < 4; i++) {
          if (v[i] == minim) {
            v[i]++;
            snext.insert(v);
            v[i]--;
          }
        }
      } else {
        v[caracter]++;
        snext.insert(v);
      }
    }
    s = snext;
  }
  vector<bool> posmin(4, false);
  for (set<vector<int> >::iterator it = s.begin(); it != s.end(); it++) {
    vector<int> v = *it;
    int minim = v[0];
    for (int i = 1; i < 4; i++) minim = min(minim, v[i]);
    for (int i = 0; i < 4; i++) {
      if (v[i] == minim) posmin[i] = true;
    }
  }
  char buff[4][20] = {"Gryffindor", "Hufflepuff", "Ravenclaw", "Slytherin"};
  for (int i = 0; i < 4; i++)
    if (posmin[i]) cout << buff[i] << endl;
}
