T = gets.to_i target = 'helloworld' T.times do n = gets.to_i s = gets.chomp best_idx = -1 (n - 10).downto(0) do |i| ok = true idx = 0 while ok && idx < 10 if target[idx] == s[i + idx] || s[i + idx] == '?' # NOOP else ok = false end idx += 1 end if ok best_idx = i break end end if best_idx != -1 10.times do |i| if s[best_idx + i] == '?' s[best_idx + i] = target[i] end end s.tr!('?', 'a') puts s else puts -1 end end