// 提出時にassertはオフ #ifndef DEBUG #ifndef NDEBUG #define NDEBUG #endif #endif #include using namespace std; using ll = long long; #define ALL(x) (x).begin(), (x).end() template using vec = vector; string solve(){ int N; string S; cin >> N >> S; // 後ろからhelloworldの一致を試して、残りはaを詰め込む const string helloworld = "helloworld"; const int size = helloworld.size(); string ans = "{}"; for(int i = N - size; i >= 0; i--){ bool matched = true; for(int j = 0; j < size; j++){ if(S[i + j] != '?' && S[i + j] != helloworld[j]) { matched = false; break; } } if(matched){ string T = S; for(int j = 0; j < size; j++) { T[i + j] = helloworld[j]; } for(char &x : T){ if(x == '?') x = 'a'; } if(T < ans) ans = T; } } if(ans == "{}") return "-1"; return ans; } int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int T; cin >> T; for(int i = 0; i < T; i++){ cout << solve() << "\n"; } }