#include <bits/stdc++.h>
using namespace std;
int t[6], n, v[100010], ans[6], T;
string s[6];
set<long long> vis;
int kd(char a) {
  if (a == 'G') return 1;
  if (a == 'H') return 2;
  if (a == 'R') return 3;
  if (a == 'S') return 4;
  return 0;
}
void Get() {
  int mina = min(t[1], min(t[2], min(t[3], t[4])));
  if (t[1] == mina) ans[1]++;
  if (t[2] == mina) ans[2]++;
  if (t[3] == mina) ans[3]++;
  if (t[4] == mina) ans[4]++;
}
long long GET() {
  long long res = 0;
  for (int i = 1; i <= 4; i++) res = res * 2333 + (long long)t[i];
  return res;
}
void dfs(int k) {
  if (k == n + 1) {
    Get();
    return;
  }
  if (ans[1] && ans[2] && ans[3] && ans[4]) return;
  long long o = GET();
  if (vis.count(o)) return;
  vis.insert(o);
  if (v[k] == 0) {
    int mina = min(t[1], min(t[2], min(t[3], t[4])));
    if (t[1] == mina) t[1]++, dfs(k + 1), t[1]--;
    if (t[2] == mina) t[2]++, dfs(k + 1), t[2]--;
    if (t[3] == mina) t[3]++, dfs(k + 1), t[3]--;
    if (t[4] == mina) t[4]++, dfs(k + 1), t[4]--;
  } else
    t[v[k]]++, dfs(k + 1), t[v[k]]--;
}
int main() {
  s[1] = "Gryffindor";
  s[2] = "Hufflepuff";
  s[3] = "Ravenclaw";
  s[4] = "Slytherin";
  scanf("%d", &n);
  for (int i = 0; i <= 5; i++) v[i] = t[i] = ans[i] = 0;
  for (int i = 1; i <= n; i++) {
    char ch;
    ch = getchar();
    while (ch == '\n' || ch == ' ') ch = getchar();
    v[i] = kd(ch);
  }
  dfs(1);
  for (int i = 1; i <= 4; i++)
    if (ans[i]) cout << s[i] << '\n';
  return 0;
}
