#int(input()) #map(int, input().split()) #list(map(int, input().split())) N = int(input()) S = [0] * N for i in range(N): S[i] = input() d = dict() ans = [0] * N def check(x, y): if len(x) != len(y): return 0 dif = [] for i in range(len(x)): if x[i] != y[i]: dif.append(i) if len(dif) == 0: return 1 elif len(dif) == 2: u = dif[0] v = dif[1] if u + 1 == v and x[u] == y[v] and x[v] and y[u]: return 1 else: return 0 else: return 0 for i in range(N): a = [] u, v = divmod(len(S[i]), 2) u += v for j in range(u): s = S[i][2*j:2*j+2] if len(s) == 1: a.append(s) continue if s[0] < s[1]: a.append(s) else: a.append(s[1] + s[0]) t = tuple(a) if t not in d: d[t] = [i] else: for x in d[t]: if check(S[i], S[x]): ans[i] = 1 break d[t].append(i) d = dict() for i in range(N): if ans[i] == 1: continue a = [S[i][0]] u, v = divmod(len(S[i]), 2) for j in range(u): s = S[i][2*j+1:2*j+3] if len(s) == 1: a.append(s) continue if s[0] < s[1]: a.append(s) else: a.append(s[1] + s[0]) t = tuple(a) if t not in d: d[t] = [i] else: for x in d[t]: if check(S[i], S[x]): ans[i] = 1 break d[t].append(i) for i in range(N): if ans[i] == 1: print("Yes") else: print("No")