n = int(input()) S = input() if 'Hello, World!' in S: S = S.replace('Hello, World!', 'H') if set(S) == {'H'}: print(S) else: print(-1) elif 'H' not in S and '9' not in S and 'Q' in S: print(S) else: print(-1)