using System; using System.Linq; class I { static void Main() => Console.WriteLine(Solve()); static object Solve() { var n = int.Parse(Console.ReadLine()); var s = Console.ReadLine(); if (s.Count(c => c == 'Q') == 1 && !s.Contains('H')) return s; return -1; } }