n = int(input()) S = input() if 'Hello, World!' in S or '99 bottles of beer on the wall, 99 bottles of beer.' in S: n -= S.count('Hello, World!') * (len('Hello, World!')-1) S = S.replace('Hello, World!', 'H') n -= S.count('99 bottles of beer on the wall, 99 bottles of beer.') * (len('99 bottles of beer on the wall, 99 bottles of beer.')-1) S = S.replace('99 bottles of beer on the wall, 99 bottles of beer.', '9') if (set(S) == {'H'} or set(S) == {'9'} or set(S) == {'H', '9'} or set(S) == {'9', 'H'}) and len(S) == n: print(S) else: print(-1) elif 'H' not in S and '9' not in S and 'Q' in S: print(S) else: print(-1)