#include <bits/stdc++.h>
using namespace std;
int n;
char s[10005];
string name[4] = {"Gryffindor", "Hufflepuff", "Ravenclaw", "Slytherin"};
struct Node {
  int a[4], idx;
  bool operator<(const Node b) const {
    if (idx == b.idx) {
      for (int i = 0; i < 4; i++) {
        if (b.a[i] != a[i]) {
          return a[i] < b.a[i];
        }
      }
      return false;
    }
    return idx < b.idx;
  }
  bool operator==(const Node b) const {
    if (idx == b.idx) {
      for (int i = 0; i < 4; i++) {
        if (b.a[i] != a[i]) {
          return false;
        }
      }
      return true;
    }
    return false;
  }
  Node(int x1, int x2, int x3, int x4, int ii) {
    a[0] = x1, a[1] = x2, a[2] = x3, a[3] = x4;
    idx = ii;
  }
  Node(int x[], int ii) {
    for (int i = 0; i < 4; i++) {
      a[i] = x[i];
    }
    idx = ii;
  }
  void deb() {
    for (int i = 0; i < 4; i++) {
      cout << a[i] << ' ';
    }
    cout << idx << endl;
  }
};
int visited[5];
int cc = 0;
set<Node> se;
void reset(Node *x) {
  int mi = 1e9;
  for (int i = 0; i < 4; i++) {
    mi = min(mi, x->a[i]);
  }
  for (int i = 0; i < 4; i++) {
    x->a[i] = x->a[i] - mi;
  }
}
void dfs(Node now) {
  if (cc >= 4) {
    return;
  }
  if (se.count(now) > 0) {
    return;
  }
  se.insert(now);
  if (now.idx >= n) {
    int mi = 1e9;
    for (int i = 0; i < 4; i++) {
      mi = min(mi, now.a[i]);
    }
    for (int i = 0; i < 4; i++) {
      if (mi == now.a[i]) {
        if (visited[i] == 0) {
          cc++;
          visited[i] = 1;
        }
      }
    }
    return;
  }
  if (s[now.idx] != '?') {
    if (s[now.idx] == 'G') {
      now.a[0]++;
    } else if (s[now.idx] == 'H') {
      now.a[1]++;
    } else if (s[now.idx] == 'R') {
      now.a[2]++;
    } else {
      now.a[3]++;
    }
    reset(&now);
    now.idx += 1;
    dfs(now);
  } else {
    int mi = 1e9;
    for (int i = 0; i < 4; i++) {
      mi = min(mi, now.a[i]);
    }
    now.idx += 1;
    for (int i = 0; i < 4; i++) {
      if (mi == now.a[i]) {
        now.a[i]++;
        reset(&now);
        dfs(now);
        now.a[i]--;
        reset(&now);
      }
    }
  }
  return;
}
int main() {
  scanf("%d", &n);
  scanf("%s", s);
  dfs(Node(0, 0, 0, 0, 0));
  for (int i = 0; i < 4; i++) {
    if (visited[i]) {
      cout << name[i] << endl;
    }
  }
  return 0;
}
