#include #include using namespace std; #define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i=i##_begin_;i--) #define REP(i, n) FOR(i,0,n) #define IREP(i, n) IFOR(i,0,n) const string target = "helloworld"; string solve(string S) { const int N = S.size(); string candidate; candidate += (char)('z' + 1); IREP(i, N - int(target.size()) + 1) { bool good = true; REP(j, target.size()) { if (S.at(i + j) == '?') continue; if (S.at(i + j) != target.at(j)) good = false; } if (good) { string T = S; REP(j, target.size()) T.at(i + j) = target.at(j); for (auto &c : T) if (c == '?') c = 'a'; candidate = min(candidate, T); } } if (candidate.size() <= 1) return "-1"; return candidate; } int main() { cin.tie(nullptr), ios::sync_with_stdio(false); int T; cin >> T; while (T--) { int N; string S; cin >> N >> S; cout << solve(S) << '\n'; } }