#include using namespace std; int main() { int N; string S; cin >> N; cin.ignore(); getline(cin,S); if(S[N-1] == 'Q') { cout << S.substr(0,N-1) << 'Q' << endl; } else if(N%13 == 0) { for(int i = 0; i < N/13; i++) { cout << "H"; } cout << endl; } else { cout << -1 << endl; } }