import sys #input = sys.stdin.readline #input = sys.stdin.buffer.readline #文字列はダメ #sys.setrecursionlimit(1000000) import math import bisect #import itertools #import random #from heapq import heapify, heappop, heappush from collections import defaultdict from collections import deque import copy #DeepCopy: hoge = [_[:] for _ in hogehoge] #from functools import lru_cache #@lru_cache(maxsize=None) #MOD = pow(10,9) + 7 MOD = 998244353 dx = [1,0,-1,0] dy = [0,1,0,-1] #dx8 = [1,1,0,-1,-1,-1,0,1] #dy8 = [0,1,1,1,0,-1,-1,-1] base1 = 1007; base2 = 2009 mod1 = 1000000007; mod2 = 1000000009 class RollingHash(): def __init__(self, s, base, mod): self.mod = mod self.pw = pw = [1]*(len(s)+1) l = len(s) self.h = h = [0]*(l+1) v = 0 for i in range(l): h[i+1] = v = (v * base + ord(s[i])) % mod v = 1 for i in range(l): pw[i+1] = v = v * base % mod def get(self, l, r): #S[l:r]indexでいうl文字目からr-1文字目。r-l文字。 return (self.h[r] - self.h[l] * self.pw[r-l]) % self.mod def get_hash(s,base,mod): ns = len(s) ret = 0 v = 0 for i in range(ns): v = (v * base + ord(s[i])) % mod ret += v ret %= mod return ret def main(): word = "helloworld" ok1 = set([]); ok2 = set([]) n = len(word) for i in range(1<>j)&1 == 1: temp += '?' else: temp += word[j] RH1 = RollingHash(temp,base1,mod1) RH2 = RollingHash(temp,base2,mod2) ok1.add(RH1.get(0,10)) ok2.add(RH2.get(0,10)) # if i == 0: # print(temp) # print(RH1.get(0,10)) T = int(input()) for _ in range(T): N = int(input()) S = input() RH1 = RollingHash(S,base1,mod1) RH2 = RollingHash(S,base2,mod2) ans = [] # print(RH1.get(0,0+10)) last = [] for i in range(N-9): if RH1.get(i,i+10) in ok1 and RH2.get(i,i+10) in ok2: last.append(i) if len(last) == 0: print(-1) continue L = [] for l in last: idx = 0 while idx < N: if idx != l: if S[idx] == '?': ans.append('a') else: ans.append(S[idx]) idx += 1 else: ans.append("helloworld") idx += 10 t = "".join(ans) # print(t) if len(L) == 0: L.append("".join(ans)) else: if L[0] > t: L[0] = t print(L[0]) if __name__ == '__main__': main()