You are given a string, consisting of lowercase Latin letters.

A pair of neighbouring letters in a string is considered ugly if these letters are also neighbouring in a alphabet. For example, string "abaca" contains ugly pairs at positions $(1, 2)$ — "ab" and $(2, 3)$ — "ba". Letters 'a' and 'z' aren't considered neighbouring in a alphabet.

Can you rearrange the letters of a given string so that there are no ugly pairs? You can choose any order of the letters of the given string but you can't add any new letters or remove the existing ones. You can also leave the order the same.

If there are multiple answers, print any of them.

You also have to answer $T$ separate queries.


-----Input-----

The first line contains a single integer $T$ ($1 \le T \le 100$) — the number of queries.

Each of the next $T$ lines contains string $s$ $(1 \le |s| \le 100)$ — the string for the next query. It is guaranteed that it contains only lowercase Latin letters.

Note that in hacks you have to set $T = 1$.


-----Output-----

Print $T$ lines. The $i$-th line should contain the answer to the $i$-th query.

If the answer for the $i$-th query exists, then print such a rearrangment of letters of the given string that it contains no ugly pairs. You can choose any order of the letters of the given string but you can't add any new letters or remove the existing ones. You can also leave the order the same.

If there are multiple answers, print any of them.

Otherwise print "No answer" for that query.


-----Example-----
Input
4
abcd
gg
codeforces
abaca

Output
cadb
gg
codfoerces
No answer



-----Note-----

In the first example answer "bdac" is also correct.

The second example showcases the fact that only neighbouring in alphabet letters are not allowed. The same letter is ok.

There are lots of valid answers for the third example.

Source: codeforces | Difficulty: MEDIUM_HARD
Tags: Graph traversal

String algorithms

Sorting

Implementation

Greedy algorithms


Solutions:
def is_all_zero(l):
	for i in l:
		if i != 0:
			return False
	return True

def main():
	n = int(input())
	for _ in range(n):
		l = [0] * 26
		s = input()
		for i in s:
			l[ord(i) - ord('a')] += 1
		pr = []
		l1 = l[::2]
		l2 = l[1::2]
		if is_all_zero(l1):
			for i in range(13):
				for j in range(l2[i]):
					pr.append(chr(ord('a') + 2 * i + 1))
			print(''.join(pr))
			continue
		if is_all_zero(l2):
			for i in range(13):
				for j in range(l1[i]):
					pr.append(chr(ord('a') + 2 * i))
			print(''.join(pr))
			continue
		res = (-1, -1)
		for i in range(13):
			for j in range(13):
				if not (i - j in (0, 1) or l[2 * i] * l[2 * j + 1] == 0):
					res = (i, j)
		if res == (-1, -1):
			print('No answer')
		else:
			for i in range(13):
				if i != res[0]:
					for j in range(l1[i]):
						pr.append(chr(ord('a') + 2 * i))
			for j in range(l1[res[0]]):
				pr.append(chr(ord('a') + 2 * res[0]))
			for j in range(l2[res[1]]):
				pr.append(chr(ord('a') + 2 * res[1] + 1))
			for i in range(13):
				if i != res[1]:
					for j in range(l2[i]):
						pr.append(chr(ord('a') + 2 * i + 1))
			print(''.join(pr))
	return
main()


t = int(input())

def good(s):
	for i in range(1, len(s)):
		if abs(ord(s[i]) - ord(s[i - 1])) == 1:
			return False
	return True
for i in range(t):
	s = input()
	count = {}
	for c in s:
		if c not in count:
			count[c] = 0
		count[c] += 1
	out = ''
	alpha = 'abcdefghijklmnopqrstuvwxyz'
	a1 = alpha[::2] + alpha[1::2]
	a2 = alpha[1::2] + alpha[::2]
	s1 = ''
	s2 = ''
	for c in a1:
		if c in count:
			s1 += count[c] * c
	for c in a2:
		if c in count:
			s2 += count[c] * c
	if good(s1):
		print(s1)
	elif good(s2):
		print(s2)
	else:
		print('No answer')


t = int(input())
while t > 0:
	s = input()
	l1 = []
	l2 = []
	l3 = []
	for i in range(len(s)):
		if ord(s[i]) % 2 == 0:
			l1.append(s[i])
		else:
			l2.append(s[i])
	l1.sort()
	l2.sort()
	l3 = l2 + l1
	l1 = l1 + l2
	flag = 0
	for i in range(1, len(l1)):
		if abs(ord(l1[i]) - ord(l1[i - 1])) == 1:
			flag = 1
		else:
			continue
	flag1 = 0
	for i in range(1, len(l3)):
		if abs(ord(l3[i]) - ord(l3[i - 1])) == 1:
			flag1 = 1
		else:
			continue
	s1 = ''
	if flag == 1 and flag1 == 1:
		print('No answer')
	elif flag == 0:
		for i in range(len(l1)):
			s1 += l1[i]
		print(s1)
	else:
		for i in range(len(l3)):
			s1 += l3[i]
		print(s1)
	t -= 1


t = int(input())
for i in range(t):
	string = input()
	odd = []
	even = []
	a = ord('a')
	for j in range(len(string)):
		if (ord(string[j]) - a) % 2 == 0:
			even.append(string[j])
		else:
			odd.append(string[j])
	even = sorted(even)
	odd = sorted(odd)
	if len(even) == 0:
		s = ''
		for j in range(len(odd)):
			s = s + odd[j]
		print(s)
	elif len(odd) == 0:
		s = ''
		for j in range(len(even)):
			s = s + even[j]
		print(s)
	elif abs(ord(even[0]) - ord(odd[-1])) != 1:
		s = ''
		for j in range(len(odd)):
			s = s + odd[j]
		for j in range(len(even)):
			s = s + even[j]
		print(s)
	elif abs(ord(even[-1]) - ord(odd[0])) != 1:
		s = ''
		for j in range(len(even)):
			s = s + even[j]
		for j in range(len(odd)):
			s = s + odd[j]
		print(s)
	else:
		print('No answer')


a = int(input())
from collections import *

def check(g1, g2):
	t = g2[0]
	m = g1[-1]
	if abs(ord(t) - ord(m)) == 1:
		return 0
	return 1

def printer(g1, g2, al):
	ans = []
	for i in range(len(g1)):
		for j in range(al[g1[i]]):
			ans.append(g1[i])
	for i in range(len(g2)):
		for j in range(al[g2[i]]):
			ans.append(g2[i])
	print(''.join(ans))
for t in range(a):
	s = input()
	al = defaultdict(int)
	for i in range(len(s)):
		al[s[i]] += 1
	g1 = []
	g2 = []
	for i in al:
		if ord(i) % 2 == 1:
			g1.append(i)
		else:
			g2.append(i)
	g1.sort()
	g2.sort()
	if len(g1) == 0 or len(g2) == 0:
		printer(g1, g2, al)
		continue
	m1 = g1[::-1]
	m2 = g2[::-1]
	if check(g1, g2):
		printer(g1, g2, al)
		continue
	if check(g1, m2):
		printer(g1, m2, al)
		continue
	if check(m1, g2):
		printer(m1, g2, al)
		continue
	if check(m1, m2):
		printer(m1, m2, al)
		continue
	print('No answer')


t = int(input())
for i in range(t):
	s = input()
	a = [0 for j in range(26)]
	c = []
	for x in s:
		a[ord(x) - 97] += 1
	for j in range(len(a)):
		if a[j] != 0:
			c.append(j)
	b = len(c)
	d = b // 2
	if b == 1:
		print(s)
	elif b == 2:
		flag = True
		for j in range(len(a) - 1):
			if a[j] > 0 and a[j + 1] > 0:
				print('No answer')
				flag = False
				break
		if flag:
			print(s)
	elif b == 3:
		flag = True
		memo = -1
		for j in range(len(a) - 2):
			if a[j] > 0 and a[j + 1] > 0 and (a[j + 2] > 0):
				print('No answer')
				flag = False
				break
			if a[j] > 0 and a[j + 1] > 0:
				memo = j
		if flag:
			if memo < 0:
				print(s)
			else:
				print(chr(c[1] + 97) * a[c[1]], end='')
				if c[1] - c[0] == 1:
					print(chr(c[2] + 97) * a[c[2]], end='')
					print(chr(c[0] + 97) * a[c[0]], end='')
				else:
					print(chr(c[0] + 97) * a[c[0]], end='')
					print(chr(c[2] + 97) * a[c[2]], end='')
				print('')
	else:
		for j in range(d):
			print(chr(c[d + j] + 97) * a[c[d + j]], end='')
			print(chr(c[j] + 97) * a[c[j]], end='')
		if b % 2 == 1:
			print(chr(c[-1] + 97) * a[c[-1]], end='')
		print('')


from collections import Counter

def solve(s):
	c = Counter(s)
	a = sorted(c.keys())
	n = len(a)
	if n == 3 and ord(a[0]) + 1 == ord(a[1]):
		a.reverse()
	res = []
	for i in range(n):
		if i % 2 == 0:
			ch = a[n // 2 + i // 2]
		else:
			ch = a[i // 2]
		res.append(ch * c[ch])
	return ''.join(res)
t = int(input())
for _ in range(t):
	res = solve(input())
	if all((abs(ord(x) - ord(y)) != 1 for (x, y) in zip(res, res[1:]))):
		print(res)
	else:
		print('No answer')


a = int(input())
for i in range(a):
	s = input()
	lp = []
	li = []
	for c in s:
		if ord(c) % 2 == 0:
			lp.append(ord(c))
		else:
			li.append(ord(c))
	lp.sort()
	li.sort()
	linova = []
	linova2 = []
	for i in range(len(li)):
		linova.append(li[i])
	for i in range(len(lp)):
		linova2.append(lp[i])
	for i in range(len(li)):
		linova2.append(li[i])
	for i in range(len(lp)):
		linova.append(lp[i])
	flag = False
	flag2 = False
	for i in range(len(linova) - 1):
		if abs(linova[i] - linova[i + 1]) == 1:
			flag = True
		if abs(linova2[i] - linova2[i + 1]) == 1:
			flag2 = True
		if flag2 and flag:
			print('No answer')
			break
	else:
		if flag:
			for i in range(len(linova2)):
				print(chr(linova2[i]), end='')
			print()
		else:
			for i in range(len(linova)):
				print(chr(linova[i]), end='')
			print()


t = int(input())
for i in range(t):
	str = input().strip()
	ascii_a = ord('a')
	nums = [0] * 26
	for char in str:
		nums[ord(char) - ascii_a] += 1
	n = 0
	oddStr = ''
	evenStr = ''
	for i in range(len(nums)):
		num = nums[i]
		if num != 0:
			if n % 2 == 0:
				evenStr += chr(ascii_a + i) * num
			else:
				oddStr += chr(ascii_a + i) * num
			n += 1
	if n == 1:
		print(str)
	elif (ord(oddStr[0]) - ord(evenStr[-1])) ** 2 != 1:
		print(evenStr + oddStr)
	elif (ord(oddStr[-1]) - ord(evenStr[0])) ** 2 != 1:
		print(oddStr + evenStr)
	else:
		print('No answer')


from sys import stdin
input = stdin.readline
t = int(input())
for _ in range(t):
	s = list(input().rstrip())
	even = []
	odd = []
	for c in s:
		if ord(c) % 2 == 0:
			even.append(c)
		else:
			odd.append(c)
	even.sort()
	odd.sort()
	if even == [] or odd == []:
		print(*s, sep='')
		continue
	if abs(ord(even[0]) - ord(odd[-1])) != 1:
		ans = odd + even
		print(*ans, sep='')
		continue
	if abs(ord(even[-1]) - ord(odd[0])) != 1:
		ans = even + odd
		print(*ans, sep='')
		continue
	print('No answer')


def valid(s):
	n = len(s)
	if n == 1:
		return True
	for i in range(1, n):
		if abs(ord(s[i]) - ord(s[i - 1])) == 1:
			return False
	return True

def solve():
	result = []
	for _ in range(int(input())):
		s = sorted(input())
		half1 = []
		half2 = []
		turn = 1
		i = 0
		while i < len(s):
			j = i
			while j < len(s) and s[j] == s[i]:
				j += 1
			if j == i:
				j += 1
			if turn == 1:
				half1 += s[i:j]
				turn = 2
			else:
				half2 += s[i:j]
				turn = 1
			i += j - i
		ans = 'No answer'
		if not half2:
			if valid(half2):
				ans = ''.join(half1)
		elif valid(half1) and valid(half2):
			if abs(ord(half1[-1]) - ord(half2[0])) != 1:
				ans = ''.join(half1 + half2)
			elif abs(ord(half1[0]) - ord(half2[-1])) != 1:
				ans = ''.join(half2 + half1)
		result.append(ans)
	print('\n'.join(result))
solve()


from collections import deque
import sys

def input():
	return sys.stdin.readline().rstrip()

def to_int(char):
	return ord(char) - ord('a')

def to_char(integer):
	return chr(ord('a') + integer)

def slv():
	s = list(input())
	n = len(s)
	chars = list(map(to_int, s))
	if all((char % 2 == 0 for char in chars)):
		print(''.join(s))
		return
	elif all((char % 2 == 0 for char in chars)):
		print(''.join(s))
		return
	C = [0] * 30
	for char in chars:
		C[char] += 1
	for i in range(30):
		for j in range(i + 1, 30):
			if i % 2 != j % 2:
				stack = deque([i] * C[i] + [j] * C[j])
				for k in range(30):
					if k not in [i, j]:
						if i % 2 != k % 2:
							for _ in range(C[k]):
								stack.append(k)
						else:
							for _ in range(C[k]):
								stack.appendleft(k)
				assert len(stack) == n
				if all((abs(stack[itr] - stack[itr + 1]) != 1 for itr in range(len(stack) - 1))):
					ans = ''.join(list(map(to_char, stack)))
					print(ans)
					return
	print('No answer')
	return

def main():
	t = int(input())
	for i in range(t):
		slv()
	return
main()


ii = lambda : int(input())
mi = lambda : map(int, input().split())
li = lambda : list(mi())
si = lambda : input()
n = ii()
o = []
c = 0

def check(s1, s2):
	ss = s1 + s2
	for i in range(len(ss)):
		if i != len(ss) - 1:
			if ord(ss[i]) + 1 == ord(ss[i + 1]) or ord(ss[i]) - 1 == ord(ss[i + 1]):
				return False
	return True
for i in range(n):
	be = ''
	bo = ''
	flag = False
	ts = si()
	for j in range(len(ts)):
		if ord(ts[j]) % 2 == 0:
			be += ts[j]
		else:
			bo += ts[j]
	be = ''.join(sorted(be))
	bo = ''.join(sorted(bo))
	if check(be, bo):
		print(be + bo)
	elif check(bo, be):
		print(bo + be)
	elif check(bo[::-1], be):
		print(bo[::-1] + be)
	elif check(bo, be[::-1]):
		print(bo + be[::-1])
	else:
		print('No answer')
for i in o:
	print(i)


def parse():
	n = int(input())
	inp = []
	for _ in range(n):
		inp.append(input())
	return inp

def recurse(prev, s):
	s = ''.join(s)
	if len(s) == 1:
		if not prev or abs(ord(prev) - ord(s)) != 1:
			return s
		else:
			return None
	for l in s:
		if not prev or abs(ord(prev) - ord(l)) != 1:
			r = recurse(l, s.replace(l, ''))
			if r:
				return l + r
	return None

def main():
	inp = parse()
	for w in inp:
		s = list(set(list(w)))
		ret = recurse(None, s)
		if ret:
			for l in ret:
				print(l * w.count(l), end='')
			print()
		else:
			print('No answer')
main()


import sys
T = int(input())
for t in range(T):
	q = True
	s = input()
	n = len(s)
	a = []
	b = []
	x = []
	for i in range(n):
		o = ord(s[i])
		if o % 2 == 0:
			a.append(o)
		else:
			b.append(o)
	if len(a) == 0 or len(b) == 0:
		print(s)
		q = False
	if q:
		a.sort()
		b.sort()
		if abs(a[-1] - b[0]) != 1:
			q = False
			x = a + b
		if abs(b[-1] - a[0]) != 1:
			q = False
			x = b + a
		if q:
			print('No answer')
		else:
			s = ''
			for i in range(n):
				s += chr(x[i])
			print(s)


from collections import Counter as C
check = lambda x, y: abs(ord(x) - ord(y)) == 1
for TT in range(1, int(input()) + 1):
	l = sorted(input())
	s = sorted(set(l))
	c = C(l)
	if len(s) == 2:
		if check(s[0], s[1]):
			print('No answer')
			continue
	elif len(s) == 3:
		if check(s[0], s[1]) and check(s[1], s[2]):
			print('No answer')
			continue
	a = []
	for e in s[::2]:
		a.append(e * c[e])
	b = []
	for e in s[1::2]:
		b.append(e * c[e])
	if b:
		if not check(a[0][0], b[-1][0]):
			res = a[::-1] + b[::-1]
		elif not check(a[-1][0], b[-1][0]):
			res = a + b[::-1]
		elif not check(a[-1][0], b[0][0]):
			res = a + b
		elif not check(a[0][0], b[0][0]):
			res = a[::-1] + b
		else:
			print('No answer')
			continue
	else:
		res = a
	print(''.join(res))


for _ in range(int(input())):
	s = sorted(input())
	a = b = ''
	for e in s:
		if ord(e) % 2:
			a += e
		else:
			b += e
	f = 0
	p = '0'
	for e in a + b:
		if abs(ord(e) - ord(p)) == 1:
			f |= 1
		p = e
	p = '0'
	for e in b + a:
		if abs(ord(e) - ord(p)) == 1:
			f |= 2
		p = e
	if f == 3:
		s = 'No answer'
	elif f == 1:
		s = b + a
	else:
		s = a + b
	print(s)


from collections import Counter
t = int(input())
for _ in range(t):
	s = list(input())
	gap = ord(max(s)) - ord(min(s))
	if gap == 0:
		print(''.join(s))
	elif gap == 1:
		print('No answer')
	elif gap == 2:
		if len(set(s)) == 3:
			print('No answer')
		else:
			print(''.join(sorted(s)))
	else:
		n = len(set(s))
		c = Counter(s)
		s_set_sorted = sorted(set(s))
		ans = []
		if n == 3:
			if ord(s_set_sorted[1]) - ord(s_set_sorted[0]) > 1:
				ind_list = [1, 0, 2]
			else:
				ind_list = [0, 2, 1]
			for i in ind_list:
				ans += [s_set_sorted[i]] * c[s_set_sorted[i]]
		elif n == 4:
			ind_list = [1, 3, 0, 2]
			for i in ind_list:
				ans += [s_set_sorted[i]] * c[s_set_sorted[i]]
		else:
			for i in range(0, n, 2):
				ans += [s_set_sorted[i]] * c[s_set_sorted[i]]
			for i in range(1, n, 2):
				ans += [s_set_sorted[i]] * c[s_set_sorted[i]]
		print(''.join(ans))


t = int(input())
for _ in range(t):
	s = sorted(input())
	(odd, even) = ('', '')
	for c in s:
		if ord(c) % 2 == 0:
			even += c
		else:
			odd += c
	if len(odd) == 0:
		print(even)
	elif len(even) == 0:
		print(odd)
	elif abs(ord(even[-1]) - ord(odd[0])) > 1:
		print(even + odd)
	elif abs(ord(odd[-1]) - ord(even[0])) > 1:
		print(odd + even)
	else:
		print('No answer')


import collections
import time
import os
import sys
import bisect
import heapq
from typing import List

def dfs(chs, perm):
	if not chs:
		return perm
	for v in chs:
		if not perm or abs(ord(v) - ord(perm[-1])) > 1:
			a = dfs(chs - {v}, perm + [v])
			if a:
				return a
	return []

def rearrange(s):
	wc = collections.Counter(s)
	chs = set(wc.keys())
	p = dfs(chs, [])
	if p:
		ans = ''
		for v in p:
			ans += v * wc[v]
		return ans
	return 'No answer'
N = int(input())
ans = []
for i in range(N):
	s = input()
	ans.append(rearrange(s))
print('\n'.join(ans))


mod = 1000000007
eps = 10 ** (-9)

def main():
	import sys
	from collections import Counter
	input = sys.stdin.readline
	for _ in range(int(input())):
		S = input().rstrip('\n')
		C = Counter(S)
		if len(C) == 1:
			print(S)
		elif len(C) == 2:
			s_list = sorted(list(C.keys()))
			if ord(s_list[1]) - ord(s_list[0]) == 1:
				print('No answer')
			else:
				print(S)
		elif len(C) == 3:
			s_list = sorted(list(C.keys()))
			(s0, s1, s2) = s_list
			if ord(s1) - ord(s0) == 1 and ord(s2) - ord(s1) == 1:
				print('No answer')
			elif ord(s1) - ord(s0) != 1:
				print(''.join([s1 * C[s1], s0 * C[s0], s2 * C[s2]]))
			else:
				print(''.join([s1 * C[s1], s2 * C[s2], s0 * C[s0]]))
		else:
			ans = []
			L = len(C)
			s_list = sorted(list(C.keys()))
			for i in range(L):
				if i * 2 + 1 >= L:
					break
				ans.append(s_list[i * 2 + 1] * C[s_list[i * 2 + 1]])
			for i in range(L):
				if i * 2 >= L:
					break
				ans.append(s_list[i * 2] * C[s_list[i * 2]])
			print(''.join(ans))
main()


def check_condition(string):
	flag = 0
	for i in range(len(string) - 1):
		diff = abs(ord(string[i]) - ord(string[i + 1]))
		if diff == 1:
			flag = 1
			break
	return flag
t = int(input())
for i in range(t):
	even = ''
	odd = ''
	string = input()
	for c in string:
		if ord(c) % 2 == 0:
			even = even + c
		else:
			odd = odd + c
	even = ''.join(sorted(even))
	odd = ''.join(sorted(odd))
	ans1 = even + odd
	ans2 = odd + even
	flag1 = check_condition(ans1)
	flag2 = check_condition(ans2)
	if flag1 == 0:
		print(ans1)
	elif flag2 == 0:
		print(ans2)
	else:
		print('No answer')


def solve(s):
	ans = []
	c_count = [0] * 26
	for c in s:
		c_count[ord(c) - ord('a')] += 1
	conflicts = [c_count[i - 1] + c_count[(i + 1) % len(c_count)] for i in range(len(c_count))]
	conflicts[0] -= c_count[-1]
	conflicts[-1] -= c_count[0]
	last = max(range(len(conflicts)), key=lambda i: 200 * conflicts[i] + c_count[i] if c_count[i] else 0)
	ans.append(chr(ord('a') + last))
	c_count[last] -= 1
	if last > 0:
		conflicts[last - 1] -= 1
	if last < len(conflicts) - 1:
		conflicts[last + 1] -= 1
	while any(c_count):
		new = max(range(len(conflicts)), key=lambda i: 200 * conflicts[i] + c_count[i] if c_count[i] and abs(i - last) != 1 else 0)
		if not c_count[new] or abs(new - last) == 1:
			print('No answer')
			return
		last = new
		c_count[last] -= 1
		if last > 0:
			conflicts[last - 1] -= 1
		if last < len(conflicts) - 1:
			conflicts[last + 1] -= 1
		ans.append(chr(ord('a') + last))
	print(''.join(ans))
t = int(input())
for _ in range(t):
	solve(input())


t = int(input())
for _ in range(t):
	s = input()
	s1 = s2 = ''
	for i in s:
		if ord(i) % 2 == 0:
			s1 += i
		else:
			s2 += i
	s1 = sorted(s1)
	s2 = sorted(s2)
	if len(s1) == 0:
		print(''.join(s2))
	elif len(s2) == 0:
		print(''.join(s1))
	elif abs(ord(s1[-1]) - ord(s2[0])) == 1 and abs(ord(s1[0]) - ord(s2[-1])) == 1:
		print('No answer')
	elif abs(ord(s1[-1]) - ord(s2[0])) == 1:
		print(''.join(s2 + s1))
	else:
		print(''.join(s1 + s2))


import string
a = string.ascii_lowercase
dic = {}

def main():
	t = int(input())
	for _ in range(t):
		s = str(input())
		n = len(s)
		ll = []
		for i in s:
			ll.append(i)
		ll.sort()
		dic = {}
		tem = ll[0]
		c = 0
		for i in ll:
			if i == tem:
				c += 1
			else:
				dic.update({tem: c})
				tem = i
				c = 1
			if i == ll[-1]:
				dic.update({tem: c})
		l = []
		for i in dic.keys():
			l.append(i)
		kq = ''
		if len(l) > 3 or len(l) == 1:
			for i in range(1, len(l), 2):
				kq += l[i] * dic[l[i]]
			for i in range(0, len(l), 2):
				kq += l[i] * dic[l[i]]
			print(kq)
		elif len(l) == 3:
			if a.index(l[0]) != a.index(l[1]) - 1:
				kq = l[1] * dic[l[1]] + l[0] * dic[l[0]] + l[2] * dic[l[2]]
				print(kq)
			elif a.index(l[0]) == a.index(l[1]) - 1:
				if a.index(l[1]) != a.index(l[2]) - 1:
					kq = l[1] * dic[l[1]] + l[2] * dic[l[2]] + l[0] * dic[l[0]]
					print(kq)
				else:
					print('No answer')
		elif len(l) == 2:
			if a.index(l[0]) != a.index(l[1]) - 1:
				print(l[1] * dic[l[1]] + l[0] * dic[l[0]])
			else:
				print('No answer')
main()


numQueries = int(input())
inputArray = []
for i in range(numQueries):
	inputArray.append(input())

def f(ordNumber, repetition):
	return chr(ordNumber + 96) * repetition

def resultOfQuery(string):
	numberOfRepitition = {}
	for c in string:
		ordC = ord(c) - 96
		if ordC in numberOfRepitition:
			numberOfRepitition[ordC] += 1
		else:
			numberOfRepitition[ordC] = 1
	characters = []
	for c in numberOfRepitition:
		characters.append(c)
	characters = sorted(characters)
	if len(characters) == 2:
		if abs(characters[0] - characters[1]) == 1:
			return 'No answer'
		else:
			return f(characters[0], numberOfRepitition[characters[0]]) + f(characters[1], numberOfRepitition[characters[1]])
	elif len(characters) == 3:
		if characters[2] - characters[0] == 2:
			return 'No answer'
		elif characters[2] - characters[1] == 1:
			return f(characters[2], numberOfRepitition[characters[2]]) + f(characters[0], numberOfRepitition[characters[0]]) + f(characters[1], numberOfRepitition[characters[1]])
		else:
			return f(characters[0], numberOfRepitition[characters[0]]) + f(characters[2], numberOfRepitition[characters[2]]) + f(characters[1], numberOfRepitition[characters[1]])
	else:
		length = len(characters)
		if len(characters) == 4:
			if characters[2] - characters[1] == 1:
				return f(characters[2], numberOfRepitition[characters[2]]) + f(characters[0], numberOfRepitition[characters[0]]) + f(characters[3], numberOfRepitition[characters[3]]) + f(characters[1], numberOfRepitition[characters[1]])
		if len(characters) % 2 != 0:
			result = f(characters[len(characters) - 1], numberOfRepitition[characters[len(characters) - 1]])
			characters = characters[:len(characters) - 1]
		else:
			result = ''
		if length != 5:
			for j in range(len(characters) // 2):
				result += f(characters[j], numberOfRepitition[characters[j]]) + f(characters[j + len(characters) // 2], numberOfRepitition[characters[j + len(characters) // 2]])
		else:
			result += f(characters[2], numberOfRepitition[characters[2]]) + f(characters[0], numberOfRepitition[characters[0]]) + f(characters[3], numberOfRepitition[characters[3]]) + f(characters[1], numberOfRepitition[characters[1]])
		return result
for string in inputArray:
	print(resultOfQuery(string))


q = int(input())
b = []
c = []
for p in range(q):
	b = []
	c = []
	e = []
	a = list(input())
	for i in range(len(a)):
		if a[i] == 'a':
			a[i] = 1
		if a[i] == 'b':
			a[i] = 2
		if a[i] == 'c':
			a[i] = 3
		if a[i] == 'd':
			a[i] = 4
		if a[i] == 'e':
			a[i] = 5
		if a[i] == 'f':
			a[i] = 6
		if a[i] == 'g':
			a[i] = 7
		if a[i] == 'h':
			a[i] = 8
		if a[i] == 'i':
			a[i] = 9
		if a[i] == 'j':
			a[i] = 10
		if a[i] == 'k':
			a[i] = 11
		if a[i] == 'l':
			a[i] = 12
		if a[i] == 'm':
			a[i] = 13
		if a[i] == 'n':
			a[i] = 14
		if a[i] == 'o':
			a[i] = 15
		if a[i] == 'p':
			a[i] = 16
		if a[i] == 'q':
			a[i] = 17
		if a[i] == 'r':
			a[i] = 18
		if a[i] == 's':
			a[i] = 19
		if a[i] == 't':
			a[i] = 20
		if a[i] == 'u':
			a[i] = 21
		if a[i] == 'v':
			a[i] = 22
		if a[i] == 'w':
			a[i] = 23
		if a[i] == 'x':
			a[i] = 24
		if a[i] == 'y':
			a[i] = 25
		if a[i] == 'z':
			a[i] = 26
	d = sorted(a)
	for j in range(len(d)):
		if d[j] % 2 == 0:
			c.append(d[j])
		else:
			b.append(d[j])
	if not b:
		e = c[:]
	elif not c:
		e = b[:]
	elif abs(c[-1] - b[0]) != 1:
		e = c[:] + b[:]
	elif abs(b[-1] - c[0]) != 1:
		e = b[:] + c[:]
	else:
		print('No answer')
		continue
	for i in range(len(e)):
		if e[i] == 1:
			e[i] = 'a'
		if e[i] == 2:
			e[i] = 'b'
		if e[i] == 3:
			e[i] = 'c'
		if e[i] == 4:
			e[i] = 'd'
		if e[i] == 5:
			e[i] = 'e'
		if e[i] == 6:
			e[i] = 'f'
		if e[i] == 7:
			e[i] = 'g'
		if e[i] == 8:
			e[i] = 'h'
		if e[i] == 9:
			e[i] = 'i'
		if e[i] == 10:
			e[i] = 'j'
		if e[i] == 11:
			e[i] = 'k'
		if e[i] == 12:
			e[i] = 'l'
		if e[i] == 13:
			e[i] = 'm'
		if e[i] == 14:
			e[i] = 'n'
		if e[i] == 15:
			e[i] = 'o'
		if e[i] == 16:
			e[i] = 'p'
		if e[i] == 17:
			e[i] = 'q'
		if e[i] == 18:
			e[i] = 'r'
		if e[i] == 19:
			e[i] = 's'
		if e[i] == 20:
			e[i] = 't'
		if e[i] == 21:
			e[i] = 'u'
		if e[i] == 22:
			e[i] = 'v'
		if e[i] == 23:
			e[i] = 'w'
		if e[i] == 24:
			e[i] = 'x'
		if e[i] == 25:
			e[i] = 'y'
		if e[i] == 26:
			e[i] = 'z'
	if len(e) > 0:
		print(*e, sep='')


import itertools
t = int(input())
for tt in range(t):
	s = input()
	h = {}
	for c in s:
		if c in h:
			h[c] += 1
		else:
			h[c] = 1
	res = ''
	ss = sorted(list(set(s)))
	l = ss[0:len(ss) // 2]
	r = ss[len(ss) // 2:len(ss)]
	l_c = 0
	r_c = 0
	if len(ss) == 2 and ord(ss[0]) + 1 == ord(ss[1]):
		print('No answer')
		continue
	if len(ss) == 3 and ord(l[0]) + 1 == ord(r[0]):
		if ord(r[0]) + 1 == ord(r[1]):
			print('No answer')
			continue
		else:
			print(r[0] * h[r[0]] + r[1] * h[r[1]] + l[0] * h[l[0]])
			continue
	while True:
		ok = False
		if r_c < len(r):
			res += h[r[r_c]] * r[r_c]
			r_c += 1
			ok = True
		if l_c < len(l):
			res += h[l[l_c]] * l[l_c]
			l_c += 1
			ok = True
		if not ok:
			break
	print(res)


def solve(s):
	odd = ''
	even = ''
	x = []
	y = []
	for char in s:
		if ord(char) % 2 == 1:
			x.append(char)
		else:
			y.append(char)
	x = sorted(x)
	y = sorted(y)
	x.reverse()
	y.reverse()
	odd = ''.join(x)
	even = ''.join(y)
	if len(x) == 0:
		return even
	if len(y) == 0:
		return odd
	if abs(ord(x[len(x) - 1]) - ord(y[0])) == 1 and abs(ord(y[len(y) - 1]) - ord(x[0])) == 1:
		return 'No answer'
	elif abs(ord(y[len(y) - 1]) - ord(x[0])) == 1:
		return odd + even
	else:
		return even + odd
n = int(input())
for i in range(n):
	print(solve(input()))


from sys import stdin, stdout
from math import *

def test(astr):
	for i in range(1, len(astr)):
		if abs(ord(astr[i - 1]) - ord(astr[i])) == 1:
			return False
	return True
selected = set()
avail = set()
perm = []

def attempt(i):
	global avail, selected, perm
	if i == len(perm):
		return True
	for x in avail:
		if x not in selected:
			if i > 0:
				if abs(ord(x) - ord(perm[i - 1])) <= 1:
					continue
			perm[i] = x
			selected.add(x)
			if attempt(i + 1) == True:
				return True
			selected.remove(x)
	return False

def checkAllPermut(chars):
	global perm, selected, avail
	chars.sort()
	selected = set()
	perm = [' '] * len(chars)
	avail = set(chars)
	if len(chars) <= 3:
		if attempt(0) == True:
			return perm
	else:
		perm = [[], []]
		for i in range(len(chars)):
			perm[i % 2].append(chars[i])
		perm = perm[1] + perm[0]
		if test(perm):
			return perm
	return None

def main():
	nTest = int(stdin.readline())
	global perm
	for test in range(nTest):
		s = stdin.readline().strip()
		cnt = {}
		for c in s:
			cnt[c] = cnt.get(c, 0) + 1
		chars = list(cnt.keys())
		if checkAllPermut(chars) == None:
			stdout.write('No answer\n')
		else:
			stdout.write('%s\n' % ''.join([''.join([x] * cnt[x]) for x in perm]))
	return 0
main()


from collections import Counter
Q = int(input())
Query = []
for _ in range(Q):
	S = list(input())
	Query.append(S)
alp = [chr(i) for i in range(97, 97 + 26)]
for S in Query:
	C = Counter(S)
	A = sorted(C.keys())
	B1 = []
	B2 = []
	for (i, a) in enumerate(A):
		if i % 2 == 0:
			B2.append(a)
		else:
			B1.append(a)
	if not B1:
		D = B2
	elif abs(alp.index(B1[-1]) - alp.index(B2[0])) != 1:
		D = B1 + B2
	elif abs(alp.index(B1[0]) - alp.index(B2[-1])) != 1:
		D = B2 + B1
	else:
		D = []
	if not D:
		print('No answer')
	else:
		ans = ''
		for d in D:
			ans += d * C[d]
		print(ans)


import collections

def add1(c):
	return chr(ord(c) + 1)

def sv():
	m = collections.defaultdict(int)
	for c in input():
		m[c] += 1
	m = list(m.items())
	m.sort()
	if len(m) == 2 and add1(m[0][0]) == m[1][0]:
		return False
	if len(m) == 3:
		if add1(m[0][0]) != m[1][0]:
			pass
		elif add1(m[1][0]) != m[2][0]:
			(m[0], m[2]) = (m[2], m[0])
		else:
			return False
	for i in range(1, len(m), 2):
		print(m[i][0] * m[i][1], end='')
	for i in range(0, len(m), 2):
		print(m[i][0] * m[i][1], end='')
	print()
	return True
TC = int(input())
for tc in range(TC):
	if not sv():
		print('No answer')


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[1]

def sort2(l):
	return sorted(l, key=getKey, reverse=True)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def ceil(x, y):
	if x % y == 0:
		return x // y
	else:
		return x // y + 1

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def main():
	for _ in range(ii()):
		s = si()
		n = len(s)
		p = 0
		ff = 0
		while p < n:
			ans = [s[p]]
			f = [0] * n
			f[p] = 1
			while True:
				g = f[:]
				for i in range(n):
					if f[i]:
						continue
					if abs(abd[ans[-1]] - abd[s[i]]) != 1:
						f[i] = 1
						ans.append(s[i])
					elif abs(abd[ans[0]] - abd[s[i]]) != 1:
						f[i] = 1
						ans.insert(0, s[i])
				if g == f:
					break
			flag = 1
			for i in range(n):
				if f[i] == 0:
					flag = 0
					break
			p += 1
			if flag:
				ff = 1
				print(''.join(ans))
				break
		if ff == 0:
			print('No answer')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


def do(s):
	if len(s) == 1:
		print(s[0])
		return
	start = 0
	while start < len(s):
		if start == len(s) - 2:
			break
		if abs(ord(s[start + 1]) - ord(s[start])) == 1:
			start += 1
			toreplace = len(s) - 1
			s.insert(start, s[toreplace])
			del s[len(s) - 1]
		else:
			start += 1
	x = len(s)
	for i in range(len(s) - 1, 0, -1):
		if abs(ord(s[i - 1]) - ord(s[i])) == 1:
			x = i
	if x < len(s):
		while abs(ord(s[x - 1]) - ord(s[x])) <= 1:
			s.insert(0, s[len(s) - 1])
			del s[len(s) - 1]
			x += 1
			if x == len(s):
				break
	for i in range(len(s) - 1):
		if abs(ord(s[i + 1]) - ord(s[i])) == 1:
			print('No answer')
			return
	print(''.join(s))
n = int(input())
for i in range(n):
	s = sorted(list(input()))
	do(s)


def check(s):
	return all((ord(s[i]) != ord(s[i - 1]) + 1 and ord(s[i]) != ord(s[i - 1]) - 1 for i in range(1, len(s))))
for _ in range(int(input())):
	s = input()
	n = len(s)
	s = sorted(s)
	s1 = ''
	s2 = ''
	for i in s:
		if ord(i) - 97 & 1:
			s1 += i
		else:
			s2 += i
	if check(s1 + s2):
		print(s1 + s2)
	elif check(s2 + s1):
		print(s2 + s1)
	else:
		print('No answer')


import io, sys, atexit, os
import math as ma
from sys import exit
from decimal import Decimal as dec
from itertools import permutations
from random import randint as rand

def li():
	return list(map(int, input().split()))

def num():
	return map(int, input().split())

def nu():
	return int(input())

def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def lcm(x, y):
	gg = find_gcd(x, y)
	return x * y // gg
mm = 1000000007
yp = 0

def solve():
	t = nu()
	for _ in range(t):
		s = list(input())
		s.sort()
		a = [0] * 26
		for i in range(len(s)):
			a[ord(s[i]) - ord('a')] += 1
		xp = ''
		op = ''
		for i in range(26):
			if a[i] == 0:
				continue
			if i % 2 == 0:
				for j in range(a[i]):
					op += chr(i + ord('a'))
			else:
				for j in range(a[i]):
					xp += chr(i + ord('a'))
		fl1 = True
		fl2 = True
		g1 = xp + op
		g2 = op + xp
		for i in range(len(s) - 1):
			if abs(ord(g1[i + 1]) - ord(g1[i])) == 1:
				fl1 = False
				break
		for i in range(len(s) - 1):
			if abs(ord(g2[i + 1]) - ord(g2[i])) == 1:
				fl2 = False
				break
		if fl1 == False and fl2 == False:
			print('No answer')
		else:
			if fl1 == True:
				print(g1)
				continue
			if fl2 == True:
				print(g2)
				continue
solve()


n = int(input())
for _ in range(n):
	s = input()
	ans = []
	thing = {}
	for i in s:
		ans.append(i)
	ans.sort()
	chars = []
	for i in ans:
		if i in thing:
			thing[i] += 1
		else:
			thing[i] = 1
			chars.append(i)
	if len(thing) == 2 and ord(ans[0]) == ord(ans[-1]) - 1:
		print('No answer')
		continue
	if len(thing) == 3 and ord(ans[0]) == ord(ans[-1]) - 2:
		print('No answer')
		continue
	ans2 = []
	if len(thing) == 3 and ord(chars[0]) == ord(chars[1]) - 1:
		for i in range(thing[chars[0]]):
			ans2.append(chars[0])
		for i in range(thing[chars[2]]):
			ans2.append(chars[2])
		for i in range(thing[chars[1]]):
			ans2.append(chars[1])
	elif len(thing) == 3 and ord(chars[1]) == ord(chars[2]) - 1:
		for i in range(thing[chars[1]]):
			ans2.append(chars[1])
		for i in range(thing[chars[0]]):
			ans2.append(chars[0])
		for i in range(thing[chars[2]]):
			ans2.append(chars[2])
	elif len(thing) == 4:
		for i in range(thing[chars[2]]):
			ans2.append(chars[2])
		for i in range(thing[chars[0]]):
			ans2.append(chars[0])
		for i in range(thing[chars[3]]):
			ans2.append(chars[3])
		for i in range(thing[chars[1]]):
			ans2.append(chars[1])
	else:
		for i in range(0, len(thing), 2):
			for j in range(thing[chars[i]]):
				ans2.append(chars[i])
		for i in range(0, len(thing) - 1, 2):
			for j in range(thing[chars[i + 1]]):
				ans2.append(chars[i + 1])
	print(''.join(ans2))


import sys
import random
from collections import Counter
sys.setrecursionlimit(10 ** 5 + 1)
inf = int(10 ** 20)
max_val = inf
min_val = -inf
RW = lambda : sys.stdin.readline().strip()
RI = lambda : int(RW())
RMI = lambda : [int(x) for x in sys.stdin.readline().strip().split()]
RWI = lambda : [x for x in sys.stdin.readline().strip().split()]
nb_test = RI()
for _ in range(nb_test):
	curr = sorted(input())
	odds = ''
	evens = ''
	for x in curr:
		if ord(x) % 2:
			odds += x
		else:
			evens += x
	ans = 'No answer'
	if len(odds) == 0:
		ans = evens
	if len(evens) == 0:
		ans = odds
	if odds and evens:
		if abs(ord(odds[-1]) - ord(evens[0])) != 1:
			ans = odds + evens
		if abs(ord(odds[0]) - ord(evens[-1])) != 1:
			ans = evens + odds
	print(ans)


import sys

def unique(lst):
	return dict(((o, o) for o in lst)).values()

class Main:

	def __init__(self):
		self.buff = None
		self.index = 0

	def next(self):
		if self.buff is None or self.index == len(self.buff):
			self.buff = self.next_line()
			self.index = 0
		val = self.buff[self.index]
		self.index += 1
		return val

	def next_line(self, _map=str):
		return list(map(_map, sys.stdin.readline().split()))

	def next_int(self):
		return int(self.next())

	def solve(self):
		t = self.next_int()
		for _ in range(0, t):
			s = sorted([x for x in self.next()])
			us = sorted(unique(s))
			if len(us) == 1:
				print(''.join(s))
			elif len(us) == 2:
				if ord(us[0]) + 1 == ord(us[1]):
					print('No answer')
				else:
					print(''.join(s))
			elif len(us) == 3:
				if ord(us[0]) + 1 == ord(us[1]) and ord(us[0]) + 2 == ord(us[2]):
					print('No answer')
				elif ord(us[1]) + 1 != ord(us[2]):
					print(''.join([us[0]] * s.count(us[0]) + [us[2]] * s.count(us[2]) + [us[1]] * s.count(us[1])))
				elif ord(us[0]) + 1 != ord(us[1]):
					print(''.join([us[1]] * s.count(us[1]) + [us[0]] * s.count(us[0]) + [us[2]] * s.count(us[2])))
			else:
				rr = [us[1]] * s.count(us[1]) + [us[3]] * s.count(us[3]) + [us[0]] * s.count(us[0]) + [us[2]] * s.count(us[2])
				for i in range(4, len(us)):
					if i % 2 == 0:
						rr = rr + [us[i]] * s.count(us[i])
					else:
						rr = [us[i]] * s.count(us[i]) + rr
				print(''.join(rr))
Main().solve()


dic = {}
tem = 'abcdefghijklmnopqrstuvwxyz'
for i in range(26):
	dic[tem[i]] = i
for _ in range(int(input())):
	st = list(input())
	fre = {}
	for i in st:
		if i in fre:
			fre[i] += 1
		else:
			fre[i] = 1
	se = set(st)
	se = list(se)
	se.sort()
	le = len(se)
	flag = True
	if le == 1:
		print(''.join(st))
	elif le == 2:
		if dic[se[1]] - dic[se[0]] == 1:
			print('No answer')
		else:
			print(''.join(st))
	else:
		if le == 3:
			if dic[se[1]] - dic[se[0]] == 1 and dic[se[2]] - dic[se[1]] == 1:
				print('No answer')
				flag = False
			else:
				ans = se[0]
				if dic[se[1]] - dic[se[0]] != 1:
					ans += se[1]
					ans = se[2] + ans
				else:
					ans = se[1] + se[2] + ans
		else:
			ans = se[1] + se[3] + se[0] + se[2]
			for i in range(4, le):
				if i % 2 != 0:
					ans += se[i]
				else:
					ans = se[i] + ans
		if flag:
			for i in ans:
				print(i * fre[i], end='')
			print('')


T = int(input())
for _ in range(T):
	s = input()
	d = {}
	for i in s:
		d[i] = d.get(i, 0) + 1
	k = sorted(list(d.keys()))
	n = len(k)
	if n == 2:
		if abs(ord(k[0]) - ord(k[1])) == 1:
			ans = 'No answer'
		else:
			ans = s
	elif n == 3:
		if abs(ord(k[0]) - ord(k[2])) == 2:
			ans = 'No answer'
		elif abs(ord(k[0]) - ord(k[1])) == 1:
			ans = k[0] * d[k[0]] + k[2] * d[k[2]] + k[1] * d[k[1]]
		else:
			ans = k[2] * d[k[2]] + k[0] * d[k[0]] + k[1] * d[k[1]]
	else:
		ans = ''
		for i in range(n // 2):
			j = n // 2 + i
			ans += k[j] * d[k[j]] + k[i] * d[k[i]]
		if n % 2 == 1:
			ans += k[n - 1] * d[k[n - 1]]
	print(ans)


import math
import random
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
import sys
import threading
from collections import defaultdict
mod = 10 ** 9 + 7
mod1 = 998244353
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class TreeNode:

	def __init__(self, k, v):
		self.key = k
		self.value = v
		self.left = None
		self.right = None
		self.parent = None
		self.height = 1
		self.num_left = 1
		self.num_total = 1

class AvlTree:

	def __init__(self):
		self._tree = None

	def add(self, k, v):
		if not self._tree:
			self._tree = TreeNode(k, v)
			return
		node = self._add(k, v)
		if node:
			self._rebalance(node)

	def _add(self, k, v):
		node = self._tree
		while node:
			if k < node.key:
				if node.left:
					node = node.left
				else:
					node.left = TreeNode(k, v)
					node.left.parent = node
					return node.left
			elif node.key < k:
				if node.right:
					node = node.right
				else:
					node.right = TreeNode(k, v)
					node.right.parent = node
					return node.right
			else:
				node.value = v
				return

	@staticmethod
	def get_height(x):
		return x.height if x else 0

	@staticmethod
	def get_num_total(x):
		return x.num_total if x else 0

	def _rebalance(self, node):
		n = node
		while n:
			lh = self.get_height(n.left)
			rh = self.get_height(n.right)
			n.height = max(lh, rh) + 1
			balance_factor = lh - rh
			n.num_total = 1 + self.get_num_total(n.left) + self.get_num_total(n.right)
			n.num_left = 1 + self.get_num_total(n.left)
			if balance_factor > 1:
				if self.get_height(n.left.left) < self.get_height(n.left.right):
					self._rotate_left(n.left)
				self._rotate_right(n)
			elif balance_factor < -1:
				if self.get_height(n.right.right) < self.get_height(n.right.left):
					self._rotate_right(n.right)
				self._rotate_left(n)
			else:
				n = n.parent

	def _remove_one(self, node):
		replacement = node.left or node.right
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = replacement
			else:
				node.parent.right = replacement
			replacement.parent = node.parent
			node.parent = None
		else:
			self._tree = replacement
			replacement.parent = None
		node.left = None
		node.right = None
		node.parent = None
		self._rebalance(replacement)

	def _remove_leaf(self, node):
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = None
			else:
				node.parent.right = None
			self._rebalance(node.parent)
		else:
			self._tree = None
		node.parent = None
		node.left = None
		node.right = None

	def remove(self, k):
		node = self._get_node(k)
		if not node:
			return
		if AvlTree._is_leaf(node):
			self._remove_leaf(node)
			return
		if node.left and node.right:
			nxt = AvlTree._get_next(node)
			node.key = nxt.key
			node.value = nxt.value
			if self._is_leaf(nxt):
				self._remove_leaf(nxt)
			else:
				self._remove_one(nxt)
			self._rebalance(node)
		else:
			self._remove_one(node)

	def get(self, k):
		node = self._get_node(k)
		return node.value if node else -1

	def _get_node(self, k):
		if not self._tree:
			return None
		node = self._tree
		while node:
			if k < node.key:
				node = node.left
			elif node.key < k:
				node = node.right
			else:
				return node
		return None

	def get_at(self, pos):
		x = pos + 1
		node = self._tree
		while node:
			if x < node.num_left:
				node = node.left
			elif node.num_left < x:
				x -= node.num_left
				node = node.right
			else:
				return (node.key, node.value)
		raise IndexError('Out of ranges')

	@staticmethod
	def _is_left(node):
		return node.parent.left and node.parent.left == node

	@staticmethod
	def _is_leaf(node):
		return node.left is None and node.right is None

	def _rotate_right(self, node):
		if not node.parent:
			self._tree = node.left
			node.left.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.left
			node.left.parent = node.parent
		else:
			node.parent.right = node.left
			node.left.parent = node.parent
		bk = node.left.right
		node.left.right = node
		node.parent = node.left
		node.left = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	def _rotate_left(self, node):
		if not node.parent:
			self._tree = node.right
			node.right.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.right
			node.right.parent = node.parent
		else:
			node.parent.right = node.right
			node.right.parent = node.parent
		bk = node.right.left
		node.right.left = node
		node.parent = node.right
		node.right = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	@staticmethod
	def _get_next(node):
		if not node.right:
			return node.parent
		n = node.right
		while n.left:
			n = n.left
		return n

class SegmentTree1:

	def __init__(self, data, default=300006, func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: max(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

def powm(a, n, m):
	if a == 1 or n == 0:
		return 1
	if n % 2 == 0:
		s = powm(a, n // 2, m)
		return s * s % m
	else:
		return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z

def product(l):
	por = 1
	for i in range(len(l)):
		por *= l[i]
	return por

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] <= key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def binary(x, length):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] >= k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater

class TrieNode:

	def __init__(self):
		self.children = [None] * 26
		self.isEndOfWord = False

class Trie:

	def __init__(self):
		self.root = self.getNode()

	def getNode(self):
		return TrieNode()

	def _charToIndex(self, ch):
		return ord(ch) - ord('a')

	def insert(self, key):
		pCrawl = self.root
		length = len(key)
		for level in range(length):
			index = self._charToIndex(key[level])
			if not pCrawl.children[index]:
				pCrawl.children[index] = self.getNode()
			pCrawl = pCrawl.children[index]
		pCrawl.isEndOfWord = True

	def search(self, key):
		pCrawl = self.root
		length = len(key)
		for level in range(length):
			index = self._charToIndex(key[level])
			if not pCrawl.children[index]:
				return False
			pCrawl = pCrawl.children[index]
		return pCrawl != None and pCrawl.isEndOfWord

class Node:

	def __init__(self, data):
		self.data = data
		self.count = 0
		self.left = None
		self.right = None

class BinaryTrie:

	def __init__(self):
		self.root = Node(0)

	def insert(self, pre_xor):
		self.temp = self.root
		for i in range(31, -1, -1):
			val = pre_xor & 1 << i
			if val:
				if not self.temp.right:
					self.temp.right = Node(0)
				self.temp = self.temp.right
				self.temp.count += 1
			if not val:
				if not self.temp.left:
					self.temp.left = Node(0)
				self.temp = self.temp.left
				self.temp.count += 1
		self.temp.data = pre_xor

	def query(self, xor):
		self.temp = self.root
		for i in range(31, -1, -1):
			val = xor & 1 << i
			if not val:
				if self.temp.left and self.temp.left.count > 0:
					self.temp = self.temp.left
				elif self.temp.right:
					self.temp = self.temp.right
			elif self.temp.right and self.temp.right.count > 0:
				self.temp = self.temp.right
			elif self.temp.left:
				self.temp = self.temp.left
			self.temp.count -= 1
		return xor ^ self.temp.data
for ik in range(int(input())):
	s = input()
	f = 0
	for i in range(len(s)):
		if abs(ord(s[i]) - ord(s[i - 1])) == 1:
			f = 1
			break
	if f == 0:
		print(s)
		continue
	d = defaultdict(int)
	n = len(s)
	for i in range(n):
		d[s[i]] += 1
	l = []
	cou = []
	for i in sorted(d):
		l.append(i)
		cou.append(d[i])
	if len(l) == 2:
		if ord(l[0]) - ord(l[1]) == -1:
			print('No answer')
		else:
			print(s)
	elif len(l) == 3:
		if ord(l[0]) - ord(l[1]) == -1 and ord(l[1]) - ord(l[2]) == -1:
			print('No answer')
		elif ord(l[0]) - ord(l[1]) == -1:
			print(l[0] * cou[0] + l[2] * cou[2] + l[1] * cou[1])
		elif ord(l[1]) - ord(l[2]) == -1:
			print(l[2] * cou[2] + l[0] * cou[0] + l[1] * cou[1])
		else:
			print(s)
	elif len(l) == 1:
		print(s)
	else:
		ans = ''
		ans1 = ''
		f = 0
		for i in range(0, len(l), 2):
			ans += l[i] * cou[i]
		for i in range(1, len(l), 2):
			ans += l[i] * cou[i]
		for i in range(1, len(l), 2):
			ans1 += l[i] * cou[i]
		for i in range(0, len(l), 2):
			ans1 += l[i] * cou[i]
		for i in range(len(ans)):
			if abs(ord(ans[i]) - ord(ans[i - 1])) == 1:
				f = 1
				break
		if f == 0:
			print(ans)
		else:
			print(ans1)


from collections import Counter

def check(s):
	for i in range(1, len(s)):
		if ord(s[i]) == ord(s[i - 1]) + 1 or ord(s[i]) + 1 == ord(s[i - 1]):
			return False
	return True
for nt in range(int(input())):
	s = list(input())
	c = Counter(s)
	s = list(set(s))
	n = len(s)
	s.sort()
	if n == 1:
		print(s[0] * c[s[0]])
		continue
	new = []
	for i in range(n // 2):
		new.append(s[i])
		new.append(s[n - i - 1])
	if n % 2:
		new.append(s[n // 2])
	if ord(new[-1]) == ord(new[-2]) + 1 or ord(new[-1]) + 1 == ord(new[-2]):
		new = [new[-1]] + new[:-1]
	if check(new):
		ans = []
		for i in new:
			ans.extend([i] * c[i])
		print(''.join(ans))
	else:
		print('No answer')


from itertools import permutations
n = int(input())
for _ in range(n):
	s = list(input())
	x = list(set(s))
	x.sort()
	if len(x) < 5:
		for p in permutations(x):
			for (i, j) in zip(p, p[1:]):
				if abs(ord(j) - ord(i)) == 1:
					break
			else:
				break
		else:
			print('No answer')
			continue
	else:
		p = x[::2] + x[1::2]
	for c in p:
		print(c * s.count(c), end='')
	print()


import os
import sys
from io import BytesIO, IOBase
from collections import Counter
import math as mt
import inspect, re

def varname(p):
	for line in inspect.getframeinfo(inspect.currentframe().f_back)[3]:
		m = re.search('\\bvarname\\s*\\(\\s*([A-Za-z_][A-Za-z0-9_]*)\\s*\\)', line)
		if m:
			return m.group(1)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def lcm(a, b):
	return a * b / gcd(a, b)
mod = int(1000000000.0) + 7

def power(k, n):
	if n == 0:
		return 1
	if n % 2:
		return power(k, n - 1) * k % mod
	t = power(k, n // 2)
	return t * t % mod

def totalPrimeFactors(n):
	count = 0
	if n % 2 == 0:
		count += 1
		while n % 2 == 0:
			n //= 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			count += 1
			while n % i == 0:
				n //= i
		i += 2
	if n > 2:
		count += 1
	return count

def answer_bata_lavde(a, b):
	for i in a:
		print(i, end='')
	for i in b:
		print(i, end='')
	print('')

def main():
	for _ in range(int(input())):
		S = input()
		s = []
		o = []
		e = []
		for i in S:
			if ord('a') <= ord(i) <= ord('z'):
				if ord(i) % 2:
					o.append(i)
				else:
					e.append(i)
		o.sort()
		e.sort()
		if len(o) == 0:
			answer_bata_lavde([], e)
		elif len(e) == 0:
			answer_bata_lavde(o, [])
		elif abs(ord(o[-1]) - ord(e[0])) > 1:
			answer_bata_lavde(o, e)
		elif abs(ord(o[-1]) - ord(e[-1])) > 1:
			answer_bata_lavde(o, e[::-1])
		elif abs(ord(o[0]) - ord(e[0])) > 1:
			answer_bata_lavde(o[::-1], e)
		elif abs(ord(o[0]) - ord(e[-1])) > 1:
			answer_bata_lavde(o[::-1], e[::-1])
		else:
			print('No answer')
	return
main()


from itertools import groupby

def solve(ltr):
	if len(ltr) == 1:
		print(ltr[0][0] * ltr[0][1])
	elif len(ltr) == 2:
		if ord(ltr[1][0]) == ord(ltr[0][0]) + 1:
			print('No answer')
		else:
			print(ltr[0][0] * ltr[0][1], end='')
			print(ltr[1][0] * ltr[1][1])
	elif len(ltr) == 3:
		if ord(ltr[1][0]) != ord(ltr[0][0]) + 1:
			print(ltr[1][0] * ltr[1][1], end='')
			print(ltr[0][0] * ltr[0][1], end='')
			print(ltr[2][0] * ltr[2][1])
		elif ord(ltr[2][0]) != ord(ltr[1][0]) + 1:
			print(ltr[1][0] * ltr[1][1], end='')
			print(ltr[2][0] * ltr[2][1], end='')
			print(ltr[0][0] * ltr[0][1])
		else:
			print('No answer')
	elif len(ltr) == 4:
		print(ltr[2][0] * ltr[2][1], end='')
		print(ltr[0][0] * ltr[0][1], end='')
		print(ltr[3][0] * ltr[3][1], end='')
		print(ltr[1][0] * ltr[1][1])
	else:
		half = (len(ltr) + 1) // 2
		for i in range(len(ltr)):
			if i % 2 == 0:
				print(ltr[i // 2][0] * ltr[i // 2][1], end='')
			else:
				print(ltr[half + i // 2][0] * ltr[half + i // 2][1], end='')
		print()
T = int(input())
for t in range(T):
	S = sorted(input().strip())
	ltr = []
	for c in S:
		if ltr and c == ltr[-1][0]:
			ltr[-1][1] += 1
		else:
			ltr.append([c, 1])
	solve(ltr)


t = int(input())
while t > 0:
	t = t - 1
	A = input()
	st1 = ''
	st2 = ''
	arr = [0] * 26
	for i in range(len(A)):
		ind = ord(A[i]) - ord('a')
		arr[ind] += 1
	for i in range(0, 26, 2):
		st1 += chr(ord('a') + i) * arr[i]
	for i in range(1, 26, 2):
		st2 += chr(ord('a') + i) * arr[i]
	if len(st1) == 0:
		print(st2)
	elif len(st2) == 0:
		print(st1)
	elif abs(ord(st1[-1]) - ord(st2[0])) != 1:
		print(st1 + st2)
	elif abs(ord(st2[-1]) - ord(st1[0])) != 1:
		print(st2 + st1)
	else:
		print('No answer')


T = int(input())
for i in range(0, T):
	s = input()
	temp = 0
	pos = [0] * 26
	for j in range(0, len(s)):
		pos[ord(s[j]) - 97] = pos[ord(s[j]) - 97] + 1
	st = ''
	L1 = []
	L2 = []
	for j in range(0, len(pos), 2):
		if pos[j] != 0:
			L1.append((chr(j + 97), pos[j]))
	for j in range(1, len(pos), 2):
		if pos[j] != 0:
			L2.append((chr(j + 97), pos[j]))
	ptr1 = -1
	ptr2 = -1
	flag = 1
	for j in range(0, len(L1)):
		for k in range(0, len(L2)):
			if abs(ord(L1[j][0]) - ord(L2[k][0])) != 1:
				ptr1 = j
				ptr2 = k
				flag = 0
				break
	if flag == 1 and len(L1) != 0 and (len(L2) != 0):
		print('No answer')
	elif len(L1) == 0:
		for j in range(0, len(L2)):
			st = st + L2[j][0] * L2[j][1]
		print(st)
	elif len(L2) == 0:
		for j in range(0, len(L1)):
			st = st + L1[j][0] * L1[j][1]
		print(st)
	else:
		for j in range(0, len(L1)):
			if j != ptr1:
				st = st + L1[j][0] * L1[j][1]
		st = st + L1[ptr1][0] * L1[ptr1][1]
		st = st + L2[ptr2][0] * L2[ptr2][1]
		for j in range(0, len(L2)):
			if j != ptr2:
				st = st + L2[j][0] * L2[j][1]
		for j in range(1, len(st)):
			if abs(ord(st[j]) - ord(st[j - 1])) == 1:
				temp = 1
				break
		if temp == 1:
			print('No answer')
		else:
			print(st)


from collections import Counter

def go(s):
	c = Counter(s)
	if len(c) == 1:
		for x in c:
			return x * c[x]
	if len(c) == 2:
		(x1, x2) = list(c.keys())
		if abs(ord(x1) - ord(x2)) == 1:
			return 'No answer'
		else:
			return x1 * c[x1] + x2 * c[x2]
	if len(c) == 3:
		(x1, x2, x3) = sorted(c.keys())
		if ord(x3) - ord(x2) == 1 and ord(x2) - ord(x1) == 1:
			return 'No answer'
		elif ord(x3) - ord(x2) != 1:
			return x1 * c[x1] + x3 * c[x3] + x2 * c[x2]
		else:
			return x2 * c[x2] + x1 * c[x1] + x3 * c[x3]
	x = sorted(c.keys())
	q = ''.join((x[i] * c[x[i]] for i in range(0, len(x), 2)))
	q = ''.join((x[i] * c[x[i]] for i in range(1, len(x), 2))) + q
	return q
T = int(input())
print('\n'.join((go(input()) for _ in range(T))))


def check(odd, even):
	count = 0
	arr = odd + even
	for i in range(len(arr) - 1):
		if abs(ord(arr[i]) - ord(arr[i + 1])) == 1:
			count += 1
	return count
q = int(input())
for i in range(q):
	arr1 = []
	arr2 = []
	a = input()
	for h in a:
		if ord(h) % 2 == 0:
			arr1.append(h)
		else:
			arr2.append(h)
	arr1.sort()
	arr2.sort()
	a1 = check(arr1, arr2)
	a2 = check(arr2, arr1)
	if a1 == 0:
		print(''.join(arr1 + arr2))
	elif a2 == 0:
		print(''.join(arr2 + arr1))
	else:
		print('No answer')


from sys import stdin
input = lambda : stdin.readline().strip()
lin = lambda : list(map(int, input().split()))
iin = lambda : int(input())
main = lambda : map(int, input().split())
from math import ceil, sqrt, factorial, log
from collections import deque
from bisect import bisect_left

def solve():
	s = list(input())
	d = {}
	for i in s:
		if i in d:
			d[i] += 1
		else:
			d[i] = 1
	s = sorted(set(s))
	n = len(s)
	t = ceil(n / 2)
	ans1 = []
	ans2 = []
	t += 1
	for i in range(0, n, 2):
		ans1.append(s[i])
	for i in range(1, n, 2):
		ans2.append(s[i])
	if len(ans1) > 0 and len(ans2) > 0:
		if abs(ord(ans1[0]) - ord(ans2[-1])) != 1:
			ans = ans2 + ans1
		elif abs(ord(ans1[0]) - ord(ans2[0])) != 1:
			ans2.reverse()
			ans = ans2 + ans1
		elif abs(ord(ans1[-1]) - ord(ans2[-1])) != 1:
			ans2.reverse()
			ans = ans1 + ans2
		else:
			ans = ans1 + ans2
	else:
		ans = ans1 + ans2
	for i in range(1, len(ans)):
		if abs(ord(ans[i]) - ord(ans[i - 1])) == 1:
			print('No answer')
			return
	for i in range(len(ans)):
		ans[i] = ans[i] * d[ans[i]]
	print(''.join(ans))
qwe = 1
qwe = int(input())
for _ in range(qwe):
	solve()


import string
char_map = {c: i for (i, c) in enumerate(list(string.ascii_lowercase))}

def uglypairs(s):
	odd = []
	even = []
	for c in s:
		if char_map[c] % 2 == 0:
			even.append(c)
		else:
			odd.append(c)
	odd = sorted(odd)
	even = sorted(even)
	if len(odd) == 0 or len(even) == 0:
		print(''.join(odd) + ''.join(even))
	elif abs(char_map[odd[-1]] - char_map[even[0]]) != 1:
		print(''.join(odd) + ''.join(even))
	elif abs(char_map[odd[0]] - char_map[even[-1]]) != 1:
		print(''.join(even) + ''.join(odd))
	else:
		print('No answer')
t = int(input())
for i in range(t):
	s = input().strip(' ')
	uglypairs(s)


for k in range(int(input())):
	a = sorted(input())
	s1 = ''
	s2 = ''
	for i in a:
		if ord(i) % 2:
			s1 += i
		else:
			s2 += i
	ans1 = s1 + s2
	ans2 = s2 + s1
	flag = 0
	for i in range(1, len(ans1)):
		if abs(ord(ans1[i]) - ord(ans1[i - 1])) == 1:
			flag = 1
			break
	if flag:
		flag = 0
		ans1 = ans2
		for i in range(1, len(ans1)):
			if abs(ord(ans1[i]) - ord(ans1[i - 1])) == 1:
				flag = 1
				break
		if flag:
			print('No answer')
		else:
			print(ans1)
	else:
		print(ans1)


t = int(input())
for test in range(t):
	S = input()
	L = list(S)
	Noanswer = 0
	L1 = [ord(k) for k in L]
	D = [[x, L1.count(x)] for x in set(L1)]
	D.sort(key=lambda x: x[0])
	if len(D) > 4:
		Dleft = []
		Dright = []
		for k in range(len(D)):
			if k % 2 == 0:
				Dleft.append(D[k])
			else:
				Dright.append(D[k])
		D1 = Dleft + Dright
	elif len(D) == 4:
		D1 = [D[2], D[0], D[3], D[1]]
	elif len(D) == 3:
		if D[2][0] - D[1][0] == 1 and D[1][0] - D[0][0] == 1:
			Noanswer = 1
		elif D[1][0] - D[0][0] == 1:
			D1 = [D[0], D[2], D[1]]
		else:
			D1 = [D[1], D[0], D[2]]
	elif len(D) == 2:
		if D[1][0] - D[0][0] == 1:
			Noanswer = 1
		else:
			D1 = D
	elif len(D) == 1:
		D1 = D
	if Noanswer == 0:
		H = ''
		for k in D1:
			for j in range(k[1]):
				H = H + chr(k[0])
		print(H)
	else:
		print('No answer')


def check(s):
	for i in range(0, len(s) - 1):
		if abs(ord(s[i]) - ord(s[i + 1])) == 1:
			return False
	return True
t = int(input())
m = 'acegikmoqsuwybdfhjlnprtvxz'
n = 'bdfhjlnprtvxzacegikmoqsuwy'
while t > 0:
	s = input()
	cnt = dict()
	ans = ''
	for i in s:
		cnt[i] = s.count(i)
	for i in m:
		if cnt.__contains__(i):
			for j in range(0, cnt[i]):
				ans = ans + i
	if check(ans):
		print(ans)
	else:
		ans = ''
		for i in n:
			if cnt.__contains__(i):
				for j in range(0, cnt[i]):
					ans = ans + i
		if check(ans):
			print(ans)
		else:
			print('No answer')
	t = t - 1


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	s = list(input().rstrip())
	n = len(s)
	a = []
	b = []
	for i in range(n):
		if ord(s[i]) % 2 == 1:
			a.append(s[i])
		else:
			b.append(s[i])
	a.sort()
	b.sort()
	if len(a) == 0 or len(b) == 0:
		print(''.join(a + b))
		continue
	if not abs(ord(a[-1]) - ord(b[0])) == 1:
		print(''.join(a + b))
		continue
	if not abs(ord(b[-1]) - ord(a[0])) == 1:
		print(''.join(b + a))
		continue
	print('No answer')


n = int(input())
for _ in range(n):
	s = input()
	a = [ord(x) for x in s]
	a.sort()
	letter = [a[0]]
	count = [0]
	for c in a:
		if c == letter[-1]:
			count[-1] = count[-1] + 1
		else:
			letter.append(c)
			count.append(1)
	if len(letter) == 1:
		print(s)
		continue
	if len(letter) == 2:
		if letter[0] + 1 < letter[1]:
			print(s)
		else:
			print('No answer')
		continue
	if len(letter) == 3:
		if letter[0] + 1 == letter[1] and letter[1] + 1 == letter[2]:
			print('No answer')
			continue
	ans = chr(letter[0]) * count[0]
	if letter[0] + 1 == letter[1]:
		letter.append(letter[1])
		count.append(count[1])
	else:
		ans = ans + chr(letter[1]) * count[1]
	for y in range(2, len(letter)):
		if letter[y] == ord(ans[-1]) + 1 or letter[y] == ord(ans[-1]) - 1:
			ans = chr(letter[y]) * count[y] + ans
		else:
			ans = ans + chr(letter[y]) * count[y]
	print(ans)


import math
import collections

def check(a, deq):
	while len(a) > 0:
		if abs(ord(a[-1]) - ord(deq[0])) != 1:
			deq.appendleft(a[-1])
			a.pop()
		elif abs(ord(a[-1]) - ord(deq[-1])) != 1:
			deq.append(a[-1])
			a.pop()
		else:
			break
read = lambda : map(int, input().split())
t = int(input())
for tt in range(t):
	ss = input()
	s = []
	for i in ss:
		s.append(i)
	s.sort()
	deq = collections.deque()
	stack = []
	for ss in s:
		if len(deq) == 0:
			deq.appendleft(ss)
		else:
			check(stack, deq)
			if abs(ord(ss) - ord(deq[0])) != 1:
				deq.appendleft(ss)
			elif abs(ord(ss) - ord(deq[-1])) != 1:
				deq.append(ss)
			else:
				stack.append(ss)
			check(stack, deq)
	if len(stack) > 0:
		print('No answer')
		continue
	else:
		for s in deq:
			print(s, end='')
		print()


n = int(input())

def ind_max(array, i):
	flg = 0
	if i == None:
		m = max(array)
		k = 0
		while k < 26:
			if (array[k] == m) & (digits[k] > 0):
				flg = 1
				break
			else:
				k += 1
	else:
		m = array[i]
		for j in range(len(array)):
			if abs(i - j) != 1:
				if array[j] > m:
					m = array[j]
		k = 0
		while k < 26:
			if (array[k] == m) & (abs(k - i) != 1) & (digits[k] > 0):
				flg = 1
				break
			else:
				k += 1
	if flg == 0:
		return -1
	else:
		return k

def in_order(digits, friends):
	result = []
	ind = None
	for i in range(sum(digits)):
		ind = ind_max(friends, ind)
		if ind == -1:
			return print('No answer')
		result.append(chr(ind + 97))
		digits[ind] -= 1
		if ind > 0:
			friends[ind - 1] -= 1
		if ind < 25:
			friends[ind + 1] -= 1
		if digits[ind] == 0:
			friends[ind] = 0
	return print(''.join(result))
ss = []
for i in range(n):
	s = input()
	ss.append(s)
for s in ss:
	digits = [0 for i in range(26)]
	friends = [0 for i in range(26)]
	for ch in s:
		k = ord(ch) - 97
		digits[k] += 1
		if k > 0:
			friends[k - 1] += 1
		if k < 25:
			friends[k + 1] += 1
	for j in range(26):
		if digits[j] == 0:
			friends[j] = 0
	in_order(digits, friends)


alpha = list('abcdefghijklmnopqrstuvwxyz')
d = {alpha[i]: i for i in range(26)}

def isok(string):
	L = len(string)
	if any((abs(d[string[i]] - d[string[i + 1]]) == 1 for i in range(L - 1))):
		return False
	return True

def solve():
	s = list(input())
	odd = []
	even = []
	for (i, v) in enumerate(s):
		if d[v] % 2 == 0:
			even.append(v)
		else:
			odd.append(v)
	odd.sort()
	even.sort()
	ans1 = ''.join(odd + even)
	ans2 = ''.join(even + odd)
	if isok(ans1):
		print(ans1)
		return
	if isok(ans2):
		print(ans2)
		return
	print('No answer')
	return

def main():
	t = int(input())
	for i in range(t):
		solve()
	return
main()


T = int(input())
for i in range(T):
	counter = {}
	string = input().strip()
	for char in string:
		counter[char] = counter.get(char, 0) + 1
	chars = list(counter.keys())
	chars.sort()
	if len(chars) == 2 and abs(ord(chars[0]) - ord(chars[1])) == 1:
		print('No answer')
	elif len(chars) == 3 and abs(ord(chars[0]) - ord(chars[1])) == 1 and (abs(ord(chars[1]) - ord(chars[2])) == 1):
		print('No answer')
	elif len(chars) == 3:
		if abs(ord(chars[0]) - ord(chars[1])) == 1:
			print(counter[chars[0]] * chars[0] + counter[chars[2]] * chars[2] + counter[chars[1]] * chars[1])
		else:
			print(counter[chars[2]] * chars[2] + counter[chars[0]] * chars[0] + counter[chars[1]] * chars[1])
	else:
		ans = []
		if len(chars) > 1:
			for idx in range(1, len(chars), 2):
				ans.append(chars[idx] * counter[chars[idx]])
		for idx in range(0, len(chars), 2):
			ans.append(chars[idx] * counter[chars[idx]])
		print(''.join(ans))


import sys
from collections import defaultdict
t = int(sys.stdin.readline())
for _ in range(t):
	s = sys.stdin.readline()[:-1]
	arr = [0] * 26
	n = len(s)
	for i in range(n):
		arr[ord(s[i]) - 97] += 1
	stack = []
	ans = []
	(l, r) = (-2, -2)
	nums = []
	for i in range(26):
		if arr[i] != 0:
			nums.append(i)
	check = [nums[0]]
	n = len(nums)
	z = True
	(l, r) = (nums[0], nums[0])
	stack = [i for i in nums[1:]]
	vis = defaultdict(int)
	cnt = 1
	for i in range(1, n):
		if vis[nums[i]] != 0:
			continue
	while cnt < n:
		add = True
		for j in range(1, n):
			if vis[nums[j]] == 0:
				if abs(nums[j] - r) != 1:
					check.append(nums[j])
					vis[nums[j]] = 1
					r = nums[j]
					add = False
					break
				if abs(nums[j] - l) != 1:
					check = [nums[j]] + check
					vis[nums[j]] = 1
					l = nums[j]
					add = False
					break
		if not add:
			cnt += 1
		if add:
			z = False
			break
	if not z:
		print('No answer')
	else:
		n = len(s)
		ans = [0 for x in range(n)]
		m = len(check)
		ind = 0
		for i in range(m):
			while arr[check[i]] > 0:
				ans[ind] = chr(check[i] + 97)
				ind += 1
				arr[check[i]] -= 1
		print(''.join((x for x in ans)))


for _ in range(int(input())):
	s = [0] * 26
	for i in input():
		s[ord(i) - 97] += 1
	n = 26 - s.count(0)
	l = sum(s)

	def chkMask(mask, n, s, l):
		p = 0
		for i in range(26):
			if s[i] > 0:
				for j in range(n):
					if mask[j] == p:
						mask[j] = -i
				p += 1
		rs = ''
		for i in mask:
			c = -i
			rs += ''.join((chr(c + 97) for _ in range(s[c])))
		for i in range(1, l):
			if abs(ord(rs[i]) - ord(rs[i - 1])) == 1:
				return 'No answer'
		return rs
	if n == 1:
		print(chkMask([0], n, s, l))
	elif n == 2:
		print(chkMask([0, 1], n, s, l))
	elif n == 3:
		s1 = chkMask([1, 0, 2], n, s, l)
		s2 = chkMask([0, 2, 1], n, s, l)
		if s1 != 'No answer':
			print(s1)
		elif s2 != 'No answer':
			print(s2)
		else:
			print(s1)
	elif n == 4:
		print(chkMask([2, 0, 3, 1], n, s, l))
	else:
		mask = [2, 0, 3, 1]
		tmp = 4
		while tmp < n:
			if tmp & 1:
				mask = [tmp] + mask
			else:
				mask = mask + [tmp]
			tmp += 1
		print(chkMask(mask, n, s, l))


T = int(input())
for i in range(T):
	s = input()
	d = {}
	for c in s:
		if c in d:
			d[c] += 1
		else:
			d[c] = 1
	a = list(d.keys())
	a = sorted(a)
	if len(a) == 1:
		print(a[0] * d[a[0]])
		continue
	if len(a) == 2:
		if ord(a[1]) - ord(a[0]) == 1:
			print('No answer')
			continue
	if len(a) == 3:
		if ord(a[1]) - ord(a[0]) == 1 and ord(a[2]) - ord(a[1]) == 1:
			print('No answer')
			continue
		if ord(a[1]) - ord(a[0]) == 1:
			print(a[0] * d[a[0]] + a[2] * d[a[2]] + a[1] * d[a[1]])
			continue
	odd = ''
	even = ''
	for j in range(len(a)):
		if j % 2 == 0:
			even += a[j] * d[a[j]]
		else:
			odd += a[j] * d[a[j]]
	print(odd + even)


t = int(input())
for i in range(t):
	x = list(input())
	y = {f: x.count(f) for f in x}
	z = sorted(y.keys())
	n = len(z)
	rer = [''] * n
	if n == 3:
		rer = z
		j = 0
		k = 1
		if abs(ord(z[1]) - ord(z[2])) != 1:
			j = 1
			k = 2
		aide = rer[j]
		rer[j] = rer[k]
		rer[k] = aide
	else:
		j = 0
		k = 1
		while k < n:
			rer[k] = z[j]
			j += 1
			k += 2
		j = n - 1
		k = n - 2 + n % 2
		while k >= 0 and j >= 0:
			rer[k] = z[j]
			j -= 1
			k -= 2
	yes = True
	m = len(x)
	out = [''] * m
	kk = 0
	for j in range(n):
		for k in range(y[rer[j]]):
			out[kk] = rer[j]
			kk += 1
	for j in range(1, m):
		if abs(ord(out[j]) - ord(out[j - 1])) == 1:
			print('No answer')
			yes = False
			break
	if yes == True:
		print(''.join(out))


T = int(input())
for i in range(T):
	s = list(input())
	s.sort()
	k = len(s)
	s1 = []
	s3 = []
	s2 = [0] * 150
	pro = True
	for j in range(k):
		s2[ord(s[j])] += 1
	for j in range(97, 123, 2):
		if s2[j] > 0:
			s3 += [chr(j)] * s2[j]
	for j in range(98, 123, 2):
		if s2[j] > 0:
			s3 += [chr(j)] * s2[j]
	for j in range(98, 123, 2):
		if s2[j] > 0:
			s1 += [chr(j)] * s2[j]
	for j in range(97, 123, 2):
		if s2[j] > 0:
			s1 += [chr(j)] * s2[j]
	for j in range(k - 1):
		if abs(ord(s1[j]) - ord(s1[j + 1])) == 1:
			pro = False
			break
	if pro:
		print(*s1, sep='')
	else:
		pro = True
		for j in range(k - 1):
			if abs(ord(s3[j]) - ord(s3[j + 1])) == 1:
				pro = False
		if pro:
			print(*s3, sep='')
		else:
			print('No answer')


gi = lambda : list(map(int, input().strip().split()))
for k in range(gi()[0]):
	s = list(input())
	ans = []
	s.sort()
	ans.append(s.pop(0))
	flag = False
	while s:
		flag = True
		for j in range(len(s)):
			if abs(ord(s[j]) - ord(ans[-1])) != 1:
				ans.append(s.pop(j))
				flag = False
				break
			if abs(ord(s[j]) - ord(ans[0])) != 1:
				ans.insert(0, s.pop(j))
				flag = False
				break
			for i in range(1, len(ans)):
				if abs(ord(ans[i]) - ord(s[j])) != 1 and abs(ord(ans[i - 1]) - ord(s[j])) != 1:
					ans.insert(i, s.pop(j))
					flag = False
					break
		if flag:
			break
	if flag:
		print('No answer')
	else:
		print(''.join(ans))


from collections import *
from math import *
t = int(input())
for y in range(t):
	a = [0 for i in range(26)]
	l = list(input())
	for i in l:
		ind = ord(i) - ord('a')
		a[ind] += 1
	l = []
	r = []
	for i in range(26):
		ch = chr(i + ord('a'))
		if i % 2 == 0:
			l.extend([ch] * a[i])
		else:
			r.extend([ch] * a[i])
	if len(r) > 0 and len(l) > 0:
		if abs(ord(r[-1]) - ord(l[0])) == 1 and abs(ord(l[-1]) - ord(r[0])) == 1:
			print('No answer')
		elif abs(ord(r[-1]) - ord(l[0])) != 1:
			print(''.join(r), end='')
			print(''.join(l))
		else:
			print(''.join(l), end='')
			print(''.join(r))
	else:
		print(''.join(r), end='')
		print(''.join(l))


for _ in range(int(input())):
	s = sorted(input())
	a = []
	b = []
	for e in s:
		w = ord(e)
		if w % 2:
			a += [w]
		else:
			b += [w]
	f = p = 0
	for e in a + b:
		if abs(e - p) == 1:
			f |= 1
		p = e
	p = 0
	for e in b + a:
		if abs(e - p) == 1:
			f |= 2
		p = e
	s = a + b if f == 2 else b + a
	r = ''
	if f == 3:
		print('No answer')
	else:
		print(*map(chr, s), sep='')


for _ in range(int(input())):
	x = input().strip()
	c = [0] * 26
	for i in x:
		c[ord(i) - ord('a')] += 1
	i = 0
	s = ''
	for i in range(0, 26, 2):
		s += chr(i + ord('a')) * c[i]
	tf = ''
	for i in range(1, 26, 2):
		tf += chr(i + ord('a')) * c[i]
	if len(tf) == 0:
		print(s)
		continue
	if len(s) == 0:
		print(tf)
		continue
	for t in [tf, tf[::-1]]:
		for s in [s, s[::-1]]:
			if abs(ord(s[-1]) - ord(t[0])) != 1:
				print(s + t)
				break
		else:
			continue
		break
	else:
		print('No answer')


for _ in range(int(input())):
	line = input()
	items = sorted([x * line.count(x) for x in set(line)])
	for start in range(len(items)):
		copy = items[:]
		string = copy.pop(start)
		while copy:
			for i in range(len(copy)):
				if abs(ord(copy[i][0]) - ord(string[-1])) != 1:
					string += copy.pop(i)
					break
			else:
				break
		if copy:
			continue
		else:
			print(string)
			break
	else:
		print('No answer')


n = int(input())
s = [input() for i in range(n)]
alph = 'abcdefghijklmnopqrstuvwxyz'
to_int = {}
to_char = {}
for i in range(26):
	to_int[alph[i]] = i
for i in range(n):
	memo = {}
	for j in s[i]:
		if to_int[j] not in memo:
			memo[to_int[j]] = 1
		else:
			memo[to_int[j]] += 1
	if len(memo) == 1:
		print(s[i])
	elif len(memo) == 2:
		ans = []
		for j in memo:
			ans.append(j)
		ans = sorted(ans)
		if ans[0] + 1 == ans[1]:
			print('No answer')
		else:
			print(s[i])
	elif len(memo) == 3:
		ans = []
		for j in memo:
			ans.append(j)
		ans = sorted(ans)
		if ans[0] + 1 == ans[1] and ans[1] + 1 == ans[2]:
			print('No answer')
		elif ans[0] + 1 != ans[1]:
			print(memo[ans[1]] * alph[ans[1]] + memo[ans[0]] * alph[ans[0]] + memo[ans[2]] * alph[ans[2]])
		else:
			print(memo[ans[0]] * alph[ans[0]] + memo[ans[2]] * alph[ans[2]] + memo[ans[1]] * alph[ans[1]])
	else:
		ans = []
		for j in memo:
			ans.append(j)
		ans = sorted(ans)
		ans1 = ans[0:len(ans) // 2]
		ans2 = ans[len(ans) // 2:]
		tmp = []
		for i in range(len(ans)):
			if i % 2 == 0:
				tmp.append(ans2[i // 2])
			else:
				tmp.append(ans1[i // 2])
		ans = []
		for i in tmp:
			ans.append(memo[i] * alph[i])
		print(''.join(map(str, ans)))


from itertools import groupby as gb
Q = int(input())
for _ in range(Q):
	s = input()
	g = gb(sorted(list(s)))
	l = [0] * 26
	for (k, v) in g:
		l[ord(k) - ord('a')] = len(list(v))
	(p, q) = ('', '')
	for (i, j) in enumerate(l[1::2]):
		p += chr(ord('a') + i * 2 + 1) * j
	for (i, j) in enumerate(l[::2]):
		q += chr(ord('a') + i * 2) * j
	s1 = p + q
	s2 = q + p
	for (i, j) in zip(s1, s1[1:]):
		if abs(ord(i) - ord(j)) == 1:
			break
	else:
		print(s1)
		continue
	for (i, j) in zip(s2, s2[1:]):
		if abs(ord(i) - ord(j)) == 1:
			break
	else:
		print(s2)
		continue
	print('No answer')


from string import ascii_lowercase
zyx = ascii_lowercase[::-1]

def main():
	for _ in range(int(input())):
		s = input()
		odd = [letter for letter in s if ord(letter) % 2 == 1]
		even = [letter for letter in s if ord(letter) % 2 == 0]
		if len(odd) == 0 or len(even) == 0:
			print(s)
		else:
			odd.sort()
			even.sort()
			connect1 = odd[-1] + even[0]
			connect2 = even[-1] + odd[0]
			if connect1 not in ascii_lowercase and connect1 not in zyx:
				print(''.join(odd + even))
			elif connect2 not in ascii_lowercase and connect2 not in zyx:
				print(''.join(even + odd))
			else:
				print('No answer')
main()


alp = list('abcdefghijklmnopqrstuvwxyz')
t = int(input())
for i in range(t):
	s = list(input())
	dic = {}
	for item in s:
		if item not in dic:
			dic[item] = 1
		else:
			dic[item] += 1
	tot = [0] * len(s)
	tot = []
	for j in range(0, 26, 2):
		if alp[j] in dic:
			for x in range(dic[alp[j]]):
				tot.append(alp[j])
	if len(tot) > 0:
		index1 = alp.index(tot[-1])
		index2 = alp.index(tot[0])
	else:
		index1 = index2 = -2
	tot2 = []
	for j in range(1, 26, 2):
		if alp[j] in dic:
			for x in range(dic[alp[j]]):
				tot2.append(alp[j])
	if len(tot2) > 0:
		index3 = alp.index(tot2[0])
		index4 = alp.index(tot2[-1])
	else:
		index3 = index4 = -4
	if abs(index1 - index3) != 1:
		print(*tot + tot2, sep='')
	elif abs(index2 - index4) != 1:
		print(*tot2 + tot, sep='')
	else:
		print('No answer')


T = int(input().strip())
for y in range(T):
	st = input().strip()
	l = []
	for k in range(26):
		l.append(0)
	for i in range(0, len(st)):
		l[ord(st[i]) - ord('a')] += 1
	nlist = []
	for k in range(26):
		x = 0
		if l[k]:
			nlist.append(k)
	if len(nlist) == 1:
		print(st)
	elif len(nlist) == 2:
		if nlist[1] - nlist[0] == 1:
			print('No answer')
		else:
			print(st)
	elif len(nlist) == 3:
		if nlist[1] - nlist[0] == 1 and nlist[2] - nlist[1] == 1:
			print('No answer')
		else:
			if nlist[1] - nlist[0] == 1:
				sr = chr(nlist[-2] + ord('a')) * l[nlist[-2]] + chr(nlist[-1] + ord('a')) * l[nlist[-1]] + chr(nlist[-3] + ord('a')) * l[nlist[-3]]
			else:
				sr = chr(nlist[-2] + ord('a')) * l[nlist[-2]] + chr(nlist[-3] + ord('a')) * l[nlist[-3]] + chr(nlist[-1] + ord('a')) * l[nlist[-1]]
			print(sr)
	else:
		sr = ''
		q = 0
		for i in range(0, len(nlist) // 4):
			sr1 = ''
			sr1 = sr1 + chr(nlist[4 * i + 2] + ord('a')) * l[nlist[4 * i + 2]]
			sr1 = sr1 + chr(nlist[4 * i] + ord('a')) * l[nlist[4 * i]]
			sr1 = sr1 + chr(nlist[4 * i + 3] + ord('a')) * l[nlist[4 * i + 3]]
			sr1 = sr1 + chr(nlist[4 * i + 1] + ord('a')) * l[nlist[4 * i + 1]]
			sr = sr + sr1
		if len(nlist) % 4 == 1:
			sr = sr + chr(nlist[-1] + ord('a')) * l[nlist[-1]]
		elif len(nlist) % 4 == 2:
			sr = chr(nlist[-1] + ord('a')) * l[nlist[-1]] + sr + chr(nlist[-2] + ord('a')) * l[nlist[-2]]
		elif len(nlist) % 4 == 3:
			sr = chr(nlist[-2] + ord('a')) * l[nlist[-2]] + sr + chr(nlist[-1] + ord('a')) * l[nlist[-1]] + chr(nlist[-3] + ord('a')) * l[nlist[-3]]
		print(sr)


from collections import Counter

def is_consecutive(c1, c2):
	return abs(ord(c1) - ord(c2)) == 1
T = int(input())
for t in range(1, T + 1):
	count = Counter()
	s = input()
	for c in s:
		count[c] += 1
	pairs = list(count.items())
	pairs.sort()
	order = []
	possible = True
	if len(pairs) == 1:
		order = [0]
	elif len(pairs) == 2:
		if is_consecutive(pairs[0][0], pairs[1][0]):
			possible = False
		else:
			order = [0, 1]
	elif len(pairs) == 3:
		if is_consecutive(pairs[0][0], pairs[1][0]):
			if is_consecutive(pairs[1][0], pairs[2][0]):
				possible = False
			else:
				order = [0, 2, 1]
		else:
			order = [1, 0, 2]
	elif len(pairs) == 4:
		order = [1, 3, 0, 2]
	else:
		order = [0]
		for i in range(2, len(pairs)):
			if i % 2:
				order.append(i)
			else:
				order.insert(0, i)
		order.append(1)
	if possible:
		for i in order:
			char = pairs[i][0]
			amount = pairs[i][1]
			print(char * amount, end='')
		print()
	else:
		print('No answer')


n = int(input())

def ok(a, b):
	if abs(ord(a[len(a) - 1]) - ord(b[0])) == 1:
		return False
	else:
		return True
for i in range(n):
	s = input()
	par = []
	nepar = []
	for j in s:
		if ord(j) % 2 == 0:
			par.append(j)
		else:
			nepar.append(j)
	par.sort()
	nepar.sort()
	if len(par) > 0 and len(nepar) > 0:
		if ok(par, nepar):
			for i in par:
				print(i, end='')
			for i in nepar:
				print(i, end='')
			print()
		elif ok(nepar, par):
			for i in nepar:
				print(i, end='')
			for i in par:
				print(i, end='')
			print()
		else:
			print('No answer')
	else:
		for i in max(par, nepar):
			print(i, end='')
		print()


t = int(input())
a = []
for i in range(t):
	a.append(input())
for i in a:
	c = []
	for j in i:
		c.append(j)
	k = list(set(c))
	k.sort()
	s = ''
	t = ''
	for j in range(len(k)):
		if j % 2 == 0:
			s += k[j] * c.count(k[j])
		else:
			t += k[j] * c.count(k[j])
	if len(k) == 2:
		if ord(k[-1]) - ord(k[0]) == 1:
			print('No answer')
		else:
			print(s[::-1] + t[::-1])
	elif len(k) == 3:
		if ord(k[-1]) - ord(k[0]) == 2:
			print('No answer')
		elif ord(k[1]) - ord(k[0]) == 1:
			print(s + t)
		elif ord(k[2]) - ord(k[1]) == 1:
			print(s[::-1] + t)
		else:
			print(s + t)
	else:
		print(s[::-1] + t[::-1])


import sys
T = int(sys.stdin.readline().strip())
for t in range(0, T):
	s = sys.stdin.readline().strip()
	x = [0] * 26
	y = ord('a')
	for l in s:
		i = ord(l) - y
		x[i] = x[i] + 1
	n = 0
	s1 = ''
	s2 = ''
	for i in range(0, 26):
		if x[i] != 0:
			if n % 2 == 0:
				s1 = s1 + x[i] * chr(i + y)
			else:
				s2 = s2 + x[i] * chr(i + y)
			n = n + 1
	if n == 1:
		print(s)
	elif (ord(s1[0]) - ord(s2[-1])) ** 2 != 1:
		print(s2 + s1)
	elif (ord(s2[0]) - ord(s1[-1])) ** 2 != 1:
		print(s1 + s2)
	else:
		print('No answer')


from collections import Counter as C

def stoi(s):
	return ord(s) - 97

def calc(s):
	N = len(s)
	c = C(s)
	sorteds = sorted(s)
	sets = sorted(list(set(s)))
	E = []
	O = []
	for t in sets:
		if stoi(t) % 2:
			E.append(t)
		else:
			O.append(t)
	if len(c) == 1:
		return s
	if len(c) == 2:
		if abs(stoi(sets[1]) - stoi(sets[0])) == 1:
			return 'No answer'
		return ''.join(sorteds)
	if len(c) >= 3:
		if len(E) * len(O) == 0:
			return s
		(e0, o0) = ('', '')
		for e in E:
			for o in O:
				if abs(stoi(e) - stoi(o)) > 1:
					e0 = e
					o0 = o
					break
			if len(e0):
				break
		if len(e0) == 0:
			return 'No answer'
		ans = []
		for e in E:
			if e != e0:
				ans.append(e * c[e])
		ans.append(e0 * c[e0])
		ans.append(o0 * c[o0])
		for o in O:
			if o != o0:
				ans.append(o * c[o])
		return ''.join(ans)
T = int(input())
for _ in range(T):
	print(calc(input()))


alphabetlist = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
dic = {i: e for (e, i) in enumerate(alphabetlist)}
for _ in range(int(input())):
	S = input()
	used = [0] * 26
	for i in range(len(S)):
		id = dic[S[i]]
		used[id] += 1
	s = -1
	t = -1
	for i in range(0, 26, 2):
		for j in range(1, 26, 2):
			if abs(i - j) != 1 and used[i] and used[j]:
				(s, t) = (i, j)
				break
		else:
			continue
		break
	else:
		checko = False
		checke = False
		for i in range(0, 26, 2):
			checko |= used[i]
		for i in range(1, 26, 2):
			checke |= used[i]
		if checko and checke:
			print('No answer')
		else:
			print(S)
		continue
	anso = [alphabetlist[s]] * used[s]
	for i in range(0, 26, 2):
		if i != s:
			for j in range(used[i]):
				anso.append(alphabetlist[i])
	anso = anso[::-1]
	anse = [alphabetlist[t]] * used[t]
	for i in range(1, 26, 2):
		if i != t:
			for j in range(used[i]):
				anse.append(alphabetlist[i])
	ans = anso + anse
	print(''.join(ans))


t = int(input())
al = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
hash = {}
for i in range(26):
	hash[al[i]] = i
for i in range(t):
	s = list(input())
	s.sort()
	ans = ''
	ans1 = ''
	for i in range(len(s)):
		if hash[s[i]] % 2 == 0:
			ans += s[i]
		else:
			ans1 += s[i]
	c1 = ''.join(sorted(list(ans)))
	c2 = ''.join(sorted(list(ans1)))
	k = c1 + c2
	k1 = c2 + c1
	flag = 0
	flag1 = 0
	for i in range(len(s) - 1):
		if abs(hash[k[i]] - hash[k[i + 1]]) == 1:
			flag = 1
		if abs(hash[k1[i]] - hash[k1[i + 1]]) == 1:
			flag1 = 1
	if flag == 0:
		print(k)
	elif flag1 == 0:
		print(k1)
	else:
		print('No answer')


for _ in range(int(input())):
	s = input()
	a = [ch for ch in s if ord(ch) % 2 == 1]
	b = [ch for ch in s if ord(ch) % 2 == 0]
	a.sort()
	b.sort()
	if len(a) == 0 or len(b) == 0:
		print(''.join(a + b))
	else:
		ax = [a, a[::-1]]
		bx = [b, b[::-1]]
		done = 0
		for x in ax:
			for y in bx:
				if abs(ord(x[-1]) - ord(y[0])) != 1 and done == 0:
					done = 1
					print(''.join(x + y))
		if not done:
			print('No answer')


for _ in range(int(input())):
	s = input()
	x = list(map(lambda t: ord(t) - ord('a'), list(s)))
	if len(set([i % 2 for i in x])) == 1:
		print(s)
		continue
	odd = [i for i in x if i % 2 == 0]
	even = [i for i in x if i % 2 == 1]
	odd.sort()
	even.sort()
	if abs(odd[-1] - even[0]) > 1:
		ans = odd + even
	elif abs(odd[0] - even[-1]) > 1:
		ans = odd[::-1] + even[::-1]
	else:
		print('No answer')
		continue
	print(''.join([chr(i + ord('a')) for i in ans]))


from itertools import groupby
IMP = 'No answer'
for _ in range(int(input())):
	s = input()
	s1 = [''.join(x[1]) for x in groupby(sorted(s), lambda c: c)]
	if len(s1) >= 4:
		print(''.join(s1[1::2] + s1[::2]))
	elif len(s1) == 1:
		print(*s1)
	else:
		s2 = [ord(c1[0]) for c1 in s1]
		if s2 != [s2[0] + i for i in range(len(s2))]:
			if len(s1) == 2:
				print(s)
			else:
				(c2, c3, c4) = s1
				(c5, c6, c7) = s2
				if c5 + 1 == c6:
					print(c2 + c4 + c3)
				else:
					print(c3 + c2 + c4)
		else:
			print(IMP)


def check(str):
	for i in range(0, len(str) - 1):
		if ord(str[i]) + 1 == ord(str[i + 1]) or (i > 0 and ord(str[i - 1]) == ord(str[i]) + 1):
			return False
	return ord(str[-2]) != ord(str[-1]) + 1

def solve_for(str):
	if len(str) == 1:
		return str
	(odd, even) = ([], [])
	for ch in str:
		if ord(ch) % 2:
			odd.append(ch)
		else:
			even.append(ch)
	odd = ''.join(sorted(odd))
	even = ''.join(sorted(even))
	if check(odd + even):
		return odd + even
	elif check(even + odd):
		return even + odd
	return 'No answer'
cases = int(input())
for case in range(cases):
	str_in = input()
	print(solve_for(str_in))


n = int(input())
for _ in range(n):
	word = sorted(input())
	(odd_part, even_part) = ('', '')
	for i in word:
		if ord(i) % 2 == 0:
			even_part += i
		else:
			odd_part += i
	previous = '0'
	output = 0
	for i in odd_part + even_part:
		if abs(ord(i) - ord(previous)) == 1:
			output |= 1
		previous = i
	previous = '0'
	for i in even_part + odd_part:
		if abs(ord(i) - ord(previous)) == 1:
			output |= 2
		previous = i
	if output == 3:
		print('No answer')
	elif output == 1:
		print(even_part + odd_part)
	else:
		print(odd_part + even_part)


from os import path
from io import BytesIO, IOBase
import sys
from heapq import heappush, heappop
from functools import cmp_to_key as ctk
from collections import deque, Counter, defaultdict as dd
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from itertools import permutations
from datetime import datetime
from math import ceil, sqrt, log, gcd

def ii():
	return int(input())

def si():
	return input().rstrip()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def bo(i):
	return ord(i) - ord('0')
file = 1

def ceil(a, b):
	return (a + b - 1) // b

def solve():
	for _ in range(ii()):
		s = si()
		s1 = list(set(s))
		s1.sort()
		if len(s1) == 1:
			print(s)
		elif len(s1) == 2:
			if ord(s1[0]) + 1 != ord(s1[1]):
				print(s)
			else:
				print('No answer')
		elif len(s1) == 3:
			if ord(s1[0]) + 2 == ord(s1[1]) + 1 == ord(s1[2]):
				print('No answer')
			else:
				s = list(s)
				if ord(s1[0]) + 1 == ord(s1[1]):
					print(s1[0] * s.count(s1[0]) + s1[2] * s.count(s1[2]) + s1[1] * s.count(s1[1]))
				else:
					print(s1[2] * s.count(s1[2]) + s1[0] * s.count(s1[0]) + s1[1] * s.count(s1[1]))
		else:
			s = list(s)
			l = 0
			r = len(s1) - 1
			idx = (r - l + 1) // 2
			f = 0
			res = s1[idx] * s.count(s1[idx])
			s1.remove(s1[idx])
			r -= 1
			while l <= r:
				if f == 0:
					res += s1[l] * s.count(s1[l])
					l += 1
				else:
					res += s1[r] * s.count(s1[r])
					r -= 1
				f ^= 1
			print(res)
if file:
	if path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	else:
		input = sys.stdin.readline
solve()


def ok(k):
	t = True
	for i in range(len(k) - 1):
		t &= abs(ord(k[i]) - ord(k[i + 1])) != 1
	return t
n = int(input())
for i in range(n):
	f = list(input())
	odd = []
	even = []
	h = len(f)
	for i in range(h):
		if ord(f[i]) % 2 != 0:
			odd.append(f[i])
		else:
			even.append(f[i])
	odd.sort()
	even.sort()
	if ok(odd + even):
		print(''.join(odd + even))
	elif ok(even + odd):
		print(''.join(even + odd))
	else:
		print('No answer')


import bisect
import decimal
from decimal import Decimal
import os
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq
from math import sqrt
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations
from io import BytesIO, IOBase
from itertools import accumulate
decimal.getcontext().prec = 46

def primeFactors(n):
	prime = set()
	while n % 2 == 0:
		prime.add(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			prime.add(i)
			n = n // i
	if n > 2:
		prime.add(n)
	return list(prime)

def getFactors(n):
	factors = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				factors.append(i)
			else:
				factors.append(i)
				factors.append(n // i)
		i = i + 1
	return factors

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	num = []
	for p in range(2, n + 1):
		if prime[p]:
			num.append(p)
	return num

def lcm(a, b):
	return a * b // math.gcd(a, b)

def sort_dict(key_value):
	return sorted(key_value.items(), key=lambda kv: (kv[1], kv[0]))

def list_input():
	return list(map(int, input().split()))

def num_input():
	return map(int, input().split())

def string_list():
	return list(input())

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def binaryToDecimal(n):
	return int(n, 2)

def DFS(n, s, adj):
	visited = [False for i in range(n + 1)]
	stack = []
	stack.append(s)
	while len(stack):
		s = stack[-1]
		stack.pop()
		if not visited[s]:
			visited[s] = True
		for node in adj[s]:
			if not visited[node]:
				stack.append(node)

def solve():
	s = list(input())
	n = len(s)
	s.sort()
	i = 0
	ans = '*'
	remain = []
	while i < n:
		if abs(ord(ans[-1]) - ord(s[i])) != 1:
			if ans == '*':
				ans = ''
			ans += s[i]
			j = i + 1
			while j < n and s[i] == s[j]:
				ans += s[i]
				j += 1
			i = j
		else:
			temp = s[i]
			j = i + 1
			while j < n and s[i] == s[j]:
				temp += s[i]
				j += 1
			i = j
			if i == n:
				if abs(ord(temp[0]) - ord(ans[0])) == 1:
					print('No answer')
					return
				ans = temp + ans
			else:
				second = s[i]
				j = i + 1
				while j < n and s[i] == s[j]:
					second += s[i]
					j += 1
				if abs(ord(second[0]) - ord(temp[0])) != 1:
					ans += second + temp
				elif abs(ord(ans[0]) - ord(temp[0])) != 1:
					ans = temp + ans + second
				else:
					ans = second + ans
					remain.append(temp)
				i = j
	for temp in remain:
		if abs(ord(ans[-1]) - ord(temp[0])) != 1:
			ans += temp
		elif abs(ord(ans[0]) - ord(temp[0])) != 1:
			ans = temp + ans
		else:
			print('No answer')
			return
	print(ans)
t = int(input())
for _ in range(t):
	solve()


q = int(input())
for _ in range(q):
	word = input()
	dic = {}
	for l in word:
		if l in dic:
			dic[l] += 1
		else:
			dic[l] = 1
	if len(dic) == 1:
		print(word)
	elif len(dic) == 2:
		k = list(dic.keys())
		k.sort()
		if ord(k[0]) + 1 == ord(k[1]):
			print('No answer')
		else:
			print(word)
	elif len(dic) == 3:
		k = list(dic.keys())
		k.sort()
		if ord(k[0]) + 1 == ord(k[1]) and ord(k[1]) + 1 == ord(k[2]):
			print('No answer')
		elif ord(k[0]) + 1 == ord(k[1]):
			print(k[0] * dic[k[0]] + k[2] * dic[k[2]] + k[1] * dic[k[1]])
		else:
			print(k[2] * dic[k[2]] + k[0] * dic[k[0]] + k[1] * dic[k[1]])
	else:
		l = len(dic)
		w = l - l % 2
		ans = ''
		k = list(dic.keys())
		k.sort()
		for i in range(l // 2):
			ans += k[l // 2 + i] * dic[k[l // 2 + i]]
			ans += k[i] * dic[k[i]]
		if l & 1:
			ans += k[w] * dic[k[w]]
		print(ans)


testcase = int(input())
for i in range(testcase):
	string = [int(ord(i)) for i in input()]
	string.sort()
	even = []
	odd = []
	for i in string:
		if (i - 96) % 2 == 1:
			odd.append(i)
		else:
			even.append(i)
	if len(odd) == 0:
		print(''.join(map(chr, even)))
	elif len(even) == 0:
		print(''.join(map(chr, odd)))
	elif abs(even[len(even) - 1] - odd[0]) != 1:
		print(''.join(map(chr, even + odd)))
	elif abs(odd[len(odd) - 1] - even[0]) != 1:
		print(''.join(map(chr, odd + even)))
	else:
		print('No answer')


a = int(input())
for i in range(a):
	A = []
	b = input()
	for j in range(len(b)):
		A.append(ord(b[j]) - 96)
	A.sort()
	B = []
	C = []
	q = 1
	B.append(A[0])
	for j in range(1, len(b)):
		if A[j] != A[j - 1]:
			q *= -1
		if q == 1:
			B.append(A[j])
		else:
			C.append(A[j])
	S = C + B
	w = ''
	k = True
	w += chr(S[0] + 96)
	for j in range(1, len(S)):
		if k == True:
			if abs(S[j] - S[j - 1]) != 1:
				w += chr(S[j] + 96)
			else:
				k = False
	V = B + C
	e = chr(V[0] + 96)
	l = True
	for j in range(1, len(V)):
		if l == True:
			if abs(V[j] - V[j - 1]) != 1:
				e += chr(V[j] + 96)
			else:
				l = False
	if k == True:
		print(w)
	elif l == True:
		print(e)
	else:
		print('No answer')


T = int(input())
for _ in range(T):
	s = list(input())
	s.sort()
	groups = []
	letter = s[0]
	count = 1
	for c in s[1:]:
		if letter == c:
			count += 1
		else:
			groups.append((ord(letter), count))
			letter = c
			count = 1
	groups.append((ord(letter), count))
	last = groups[0]
	i = 1
	while i < len(groups):
		g = groups[i]
		if abs(g[0] - last[0]) == 1:
			if i + 1 == len(groups) or abs(groups[i + 1][0] - last[0]) == 1:
				z = groups[0]
				groups.remove(z)
				groups.insert(i - 1, z)
				last = z
				if abs(z[0] - g[0]) != 1:
					i -= 1
			else:
				groups.remove(g)
				groups.append(g)
				i -= 1
		else:
			last = g
		i += 1
	failed = False
	last = groups[0]
	for i in range(1, len(groups)):
		if abs(last[0] - groups[i][0]) == 1:
			print('No answer')
			failed = True
			break
		last = groups[i]
	if not failed:
		s = ''
		for g in groups:
			s += chr(g[0]) * g[1]
		print(s)


import math
import cmath

def main():
	n = int(input())
	for u in range(n):
		(a, b, tst) = ('', '', '')
		freq = [0] * 26
		tst = str(input())
		for x in tst:
			freq[ord(x) - ord('a')] += 1
		for i in range(0, 25, 2):
			while freq[i] != 0:
				a += chr(ord('a') + i)
				freq[i] -= 1
		for i in range(1, 26, 2):
			while freq[i] != 0:
				b += chr(ord('a') + i)
				freq[i] -= 1
		if len(a) == 0 or len(b) == 0:
			print(a + b)
		elif abs(ord(a[0]) - ord(b[-1])) != 1:
			print(b + a)
		elif abs(ord(b[0]) - ord(a[-1])) != 1:
			print(a + b)
		else:
			print('No answer')
main()


t = int(input())
for i in range(t):
	s = input()
	ch = []
	nec = []
	for i in range(len(s)):
		if (ord(s[i]) - ord('a')) % 2 == 0:
			ch.append(ord(s[i]) - ord('a'))
		else:
			nec.append(ord(s[i]) - ord('a'))
	ch.sort()
	nec.sort()
	a = len(ch)
	b = len(nec)
	ans = ''
	if a == 0 or b == 0:
		print(s)
		continue
	if abs(ch[a - 1] - nec[b - 1]) == 1 and abs(ch[0] - nec[b - 1]) == 1 and (abs(ch[a - 1] - nec[0]) == 1) and (abs(ch[0] - nec[0]) == 1):
		print('No answer')
	elif abs(ch[a - 1] - nec[b - 1]) != 1:
		for i in range(a):
			ans += chr(ch[i] + ord('a'))
		for i in range(b - 1, -1, -1):
			ans += chr(nec[i] + ord('a'))
		print(ans)
	elif abs(ch[0] - nec[0]) != 1:
		for i in range(a - 1, -1, -1):
			ans += chr(ch[i] + ord('a'))
		for i in range(b):
			ans += chr(nec[i] + ord('a'))
		print(ans)
	elif abs(ch[a - 1] - nec[0]) != 1:
		for i in range(a):
			ans += chr(ch[i] + ord('a'))
		for i in range(b):
			ans += chr(nec[i] + ord('a'))
		print(ans)
	else:
		for i in range(b):
			ans += chr(nec[i] + ord('a'))
		for i in range(a):
			ans += chr(ch[i] + ord('a'))
		print(ans)


from sys import stdin, stdout
import cProfile, math
from collections import Counter, defaultdict, deque
from bisect import bisect_left, bisect, bisect_right
import itertools
from copy import deepcopy
from fractions import Fraction
import sys, threading
import operator as op
from functools import reduce
sys.setrecursionlimit(10 ** 6)
threading.stack_size(2 ** 27)
fac_warmup = False
printHeap = str()
memory_constrained = False
P = 10 ** 9 + 7
import sys

class merge_find:

	def __init__(self, n):
		self.parent = list(range(n))
		self.size = [1] * n
		self.num_sets = n
		self.lista = [[_] for _ in range(n)]

	def find(self, a):
		to_update = []
		while a != self.parent[a]:
			to_update.append(a)
			a = self.parent[a]
		for b in to_update:
			self.parent[b] = a
		return self.parent[a]

	def merge(self, a, b):
		a = self.find(a)
		b = self.find(b)
		if a == b:
			return
		if self.size[a] < self.size[b]:
			(a, b) = (b, a)
		self.num_sets -= 1
		self.parent[b] = a
		self.size[a] += self.size[b]
		self.lista[a] += self.lista[b]

	def set_size(self, a):
		return self.size[self.find(a)]

	def __len__(self):
		return self.num_sets

def display(string_to_print):
	stdout.write(str(string_to_print) + '\n')

def primeFactors(n):
	factors = dict()
	for i in range(2, math.ceil(math.sqrt(n)) + 1):
		while n % i == 0:
			if i in factors:
				factors[i] += 1
			else:
				factors[i] = 1
			n = n // i
	if n > 2:
		factors[n] = 1
	return factors

def all_factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def fibonacci_modP(n, MOD):
	if n < 2:
		return 1
	return (cached_fn(fibonacci_modP, (n + 1) // 2, MOD) * cached_fn(fibonacci_modP, n // 2, MOD) + cached_fn(fibonacci_modP, (n - 1) // 2, MOD) * cached_fn(fibonacci_modP, (n - 2) // 2, MOD)) % MOD

def factorial_modP_Wilson(n, p):
	if p <= n:
		return 0
	res = p - 1
	for i in range(n + 1, p):
		res = res * cached_fn(InverseEuler, i, p) % p
	return res

def binary(n, digits=20):
	b = bin(n)[2:]
	b = '0' * (digits - len(b)) + b
	return b

def isprime(n):
	if n < 4:
		return True
	if n % 2 == 0:
		return False
	if n % 3 == 0:
		return False
	i = 5
	w = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += w
		w = 6 - w
	return True
factorial_modP = []

def warm_up_fac(MOD):
	global factorial_modP, fac_warmup
	if fac_warmup:
		return
	factorial_modP = [1 for _ in range(fac_warmup_size + 1)]
	for i in range(2, fac_warmup_size):
		factorial_modP[i] = factorial_modP[i - 1] * i % MOD
	fac_warmup = True

def InverseEuler(n, MOD):
	return pow(n, MOD - 2, MOD)

def nCr(n, r, MOD):
	global fac_warmup, factorial_modP
	if not fac_warmup:
		warm_up_fac(MOD)
		fac_warmup = True
	return factorial_modP[n] * (pow(factorial_modP[r], MOD - 2, MOD) * pow(factorial_modP[n - r], MOD - 2, MOD) % MOD) % MOD

def test_print(*args):
	if testingMode:
		print(args)

def display_list(list1, sep=' '):
	stdout.write(sep.join(map(str, list1)) + '\n')

def display_2D_list(li):
	for i in li:
		print(i)

def prefix_sum(li):
	sm = 0
	res = []
	for i in li:
		sm += i
		res.append(sm)
	return res

def get_int():
	return int(stdin.readline().strip())

def get_tuple():
	return map(int, stdin.readline().split())

def get_list():
	return list(map(int, stdin.readline().split()))
import heapq, itertools
pq = []
entry_finder = {}
REMOVED = '<removed-task>'

def add_task(task, priority=0):
	if task in entry_finder:
		remove_task(task)
	count = next(counter)
	entry = [priority, count, task]
	entry_finder[task] = entry
	heapq.heappush(pq, entry)

def remove_task(task):
	entry = entry_finder.pop(task)
	entry[-1] = REMOVED

def pop_task():
	while pq:
		(priority, count, task) = heapq.heappop(pq)
		if task is not REMOVED:
			del entry_finder[task]
			return task
	raise KeyError('pop from an empty priority queue')
memory = dict()

def clear_cache():
	global memory
	memory = dict()

def cached_fn(fn, *args):
	global memory
	if args in memory:
		return memory[args]
	else:
		result = fn(*args)
		memory[args] = result
		return result

def ncr(n, r):
	return math.factorial(n) / (math.factorial(n - r) * math.factorial(r))

def binary_serach(i, li):
	fn = lambda x: li[x] - x // i
	x = -1
	b = len(li)
	while b >= 1:
		while b + x < len(li) and fn(b + x) > 0:
			x += b
		b = b // 2
	return x
TestCases = True
testingMode = False
fac_warmup_size = 10 ** 5 + 100
optimiseForReccursion = True
from math import factorial

def main():
	st = list(input())
	counts = Counter(st)
	st = list(sorted(set(st)))
	ts = []
	ts.append(list(reversed([a for (i, a) in enumerate(st) if i % 2 == 0])) + list(reversed([a for (i, a) in enumerate(st) if i % 2 == 1])))
	ts.append(list([a for (i, a) in enumerate(st) if i % 2 == 0]) + list(reversed([a for (i, a) in enumerate(st) if i % 2 == 1])))
	ts.append(list(reversed([a for (i, a) in enumerate(st) if i % 2 == 0])) + list([a for (i, a) in enumerate(st) if i % 2 == 1]))
	ts.append(list([a for (i, a) in enumerate(st) if i % 2 == 0]) + list([a for (i, a) in enumerate(st) if i % 2 == 1]))
	for st in ts:
		exited = False
		for i in range(1, len(st)):
			if abs(ord(st[i]) - ord(st[i - 1])) <= 1:
				exited = True
		if not exited:
			res = [x * counts[x] for x in st]
			display_list(res, '')
			return
	print('No answer')
if TestCases:
	for i in range(get_int()):
		cProfile.run('main()') if testingMode else main()
else:
	(cProfile.run('main()') if testingMode else main()) if not optimiseForReccursion else threading.Thread(target=main).start()


for _ in range(int(input())):
	st = str(input())
	st = sorted(st)
	odd = ''
	even = ''
	for i in st:
		if ord(i) % 2:
			even += i
		else:
			odd += i
	if not len(even):
		print(odd)
	elif not len(odd):
		print(even)
	elif abs(ord(even[-1]) - ord(odd[0])) != 1:
		print(even + odd)
	elif abs(ord(odd[-1]) - ord(even[0])) != 1:
		print(odd + even)
	else:
		print('No answer')


for case in range(int(input())):
	str = sorted(input())
	x = ''
	y = ''
	for char in str:
		if ord(char) % 2 == 0:
			x += char
		else:
			y += char
	if len(y) == 0:
		print(x)
		continue
	if len(x) == 0:
		print(y)
		continue
	if abs(ord(x[len(x) - 1]) - ord(y[0])) == 1 and abs(ord(y[len(y) - 1]) - ord(x[0])) == 1:
		print('No answer')
	elif abs(ord(y[len(y) - 1]) - ord(x[0])) == 1:
		print(x + y)
	else:
		print(y + x)


import random
from collections import Counter
n = int(input())

def isugly(s, n):
	for i in range(1, n):
		if abs(ord(s[i]) - ord(s[i - 1])) == 1:
			return True
	return False
for _ in range(n):
	count = Counter(input())
	candidate = list(count.keys())
	valid = 'No answer'
	for _ in range(100):
		random.shuffle(candidate)
		if not isugly(candidate, len(candidate)):
			valid = ''.join([count[x] * x for x in candidate])
			break
	print(valid)


from sys import setcheckinterval, setrecursionlimit, stdout, stdin
setcheckinterval(1000)
setrecursionlimit(10 ** 6)
from collections import defaultdict
from bisect import bisect
iin = lambda : int(stdin.readline())
lin = lambda : list(map(int, stdin.readline().split()))
for _ in range(iin()):
	a = list(input())
	a.sort()
	ans1 = [a[0]]
	ans2 = []
	for i in range(1, len(a)):
		if abs(ord(a[i]) - ord(ans1[-1])) == 1:
			ans2.append(a[i])
		else:
			ans1.append(a[i])
	sol = []
	if ans2 and abs(ord(ans1[-1]) - ord(ans2[0])) != 1:
		sol = ans1 + ans2
	else:
		sol = ans2 + ans1
	try:
		for i in range(len(sol) - 1):
			if abs(ord(sol[i]) - ord(sol[i + 1])) == 1:
				print('No answer')
				raise ValueError
	except:
		continue
	print(''.join(sol))


import math
import bisect
import heapq
from collections import defaultdict

def egcd(a, b):
	if a == 0:
		return (b, 0, 1)
	else:
		(g, x, y) = egcd(b % a, a)
		return (g, y - b // a * x, x)

def mulinv(b, n):
	(g, x, _) = egcd(b, n)
	if g == 1:
		return x % n
primes = []

def isprime(n):
	for d in range(2, int(math.sqrt(n)) + 1):
		if n % d == 0:
			return False
	return True

def argsort(ls):
	return sorted(range(len(ls)), key=ls.__getitem__)

def f(p=0):
	if p == 1:
		return map(int, input().split())
	elif p == 2:
		return list(map(int, input().split()))
	else:
		return int(input())
n = f()

def check(a, b):
	return abs(ord(a) - ord(b)) == 1
for i in range(n):
	s = input()
	kl = len(s)
	s = sorted(s)
	center = s[0]
	queue = []
	left = center
	right = center
	res = center
	for j in range(1, kl):
		st = True
		if check(left, s[j]):
			if check(right, s[j]):
				queue.append(s[j])
				st = False
			else:
				res = res + s[j]
				right = s[j]
		else:
			res = s[j] + res
			left = s[j]
		k = 0
		while k < len(queue):
			if check(left, queue[k]):
				if not check(right, queue[k]):
					res = res + queue[k]
					right = queue[k]
					del queue[k]
					k -= 1
			else:
				res = queue[k] + res
				left = queue[k]
				del queue[k]
				k -= 1
			k += 1
	if len(res) == kl:
		print(res)
	else:
		print('No answer')


import sys
import string
from random import randint
from collections import Counter
fin = sys.stdin.readline
T = int(fin())
s_list = [fin().rstrip('\n') for _ in range(T)]
for s in s_list:
	ctr_s = Counter(s)
	if len(ctr_s) == 2:
		(c1, c2) = sorted(ctr_s.keys())
		if ord(c2) - ord(c1) == 1:
			print('No answer')
			continue
	elif len(ctr_s) == 3:
		(c1, c2, c3) = sorted(ctr_s.keys())
		if ord(c3) - ord(c2) == 1 and ord(c2) - ord(c1) == 1:
			print('No answer')
			continue
	existing_chars = sorted(ctr_s.keys())
	result = []
	if len(existing_chars) == 3:
		(c1, c2, c3) = existing_chars
		if ord(c2) - ord(c1) == 1:
			result.append(c1 * ctr_s[c1])
			result.append(c3 * ctr_s[c3])
			result.append(c2 * ctr_s[c2])
		else:
			result.append(c2 * ctr_s[c2])
			result.append(c1 * ctr_s[c1])
			result.append(c3 * ctr_s[c3])
	else:
		for i in reversed(range(0, len(existing_chars), 2)):
			char = existing_chars[i]
			result.append(char * ctr_s[char])
		for i in reversed(range(1, len(existing_chars), 2)):
			char = existing_chars[i]
			result.append(char * ctr_s[char])
	print(''.join(result))


n = int(input())
ss = []
for i in range(n):
	ss.append(input())
for i in range(n):
	s = ss[i]
	f = [ord(a) for a in s]
	s_even = sorted([x for x in f if x % 2 == 0])
	s_odd = sorted([x for x in f if x % 2 == 1])
	if s_even == []:
		print(''.join(map(chr, s_odd)))
	elif s_odd == []:
		print(''.join(map(chr, s_even)))
	elif s_even[-1] - s_odd[0] == 1 or s_even[-1] - s_odd[0] == -1:
		if s_odd[-1] - s_even[0] == 1 or s_odd[-1] - s_even[0] == -1:
			print('No answer')
		else:
			print(''.join(map(chr, s_odd + s_even)))
	else:
		print(''.join(map(chr, s_even + s_odd)))


def func(a):
	l = len(a)
	odd = []
	even = []
	for i in range(l):
		x = ord(a[i]) - 65
		if x % 2 == 0:
			even.append(a[i])
		else:
			odd.append(a[i])
	even.sort()
	odd.sort()
	a1 = ''.join(even) + ''.join(odd)
	a2 = ''.join(odd) + ''.join(even)
	flag = 0
	for i in range(l - 1):
		x = ord(a1[i]) - 97
		y = ord(a1[i + 1]) - 97
		if abs(y - x) == 1:
			flag = 1
	if flag == 0:
		return a1
	else:
		for i in range(l - 1):
			x = ord(a2[i]) - 97
			y = ord(a2[i + 1]) - 97
			if abs(y - x) == 1:
				return 'No answer'
		return a2
t = int(input())
for i in range(t):
	a = str(input())
	print(func(a))


def solve():
	s = input()
	s = sorted(s)
	kol = [0] * 26
	for i in s:
		kol[ord(i) - ord('a')] += 1
	st = set()
	for i in s:
		st.add(ord(i) - ord('a'))
	v = list(st)
	v = sorted(v)
	if viv:
		print('Sorted', v)
	n = len(v)
	v2 = list()
	for i in range(1, n, 2):
		v2.append(v[i])
	for i in range(0, n, 2):
		v2.append(v[i])
	if len(v2) == 3:
		if v[0] + 1 == v[1]:
			v2 = [v[0], v[2], v[1]]
		else:
			v2 = [v[1], v[0], v[2]]
	if viv:
		print('Look at it:', v2)
	ans = ''
	for i in v2:
		ans += ('' + chr(ord('a') + i)) * kol[i]
	for i in range(len(ans) - 1):
		if abs(ord(ans[i]) - ord(ans[i + 1])) == 1:
			print('No answer')
			return
	print(ans)
viv = False
t = int(input())
while t:
	solve()
	t -= 1


def getn():
	return int(input())

def getns():
	return [int(x) for x in input().split()]
t = getn()
for _ in range(t):
	mp = [[i, 0] for i in range(26)]
	s = input()
	for c in s:
		mp[ord(c) - ord('a')][1] += 1
	mp = [x for x in mp if x[1] > 0]
	lt = [x[0] for x in mp if x[1] > 0]
	if len(mp) > 3:
		i = 1
		while i < len(mp):
			print(chr(ord('a') + mp[i][0]) * mp[i][1], end='')
			i += 2
		i = 0
		while i < len(mp):
			print(chr(ord('a') + mp[i][0]) * mp[i][1], end='')
			i += 2
		print()
	elif len(mp) == 3:
		if max(lt) - min(lt) == 2:
			print('No answer')
		else:
			if lt[1] - lt[0] == 1:
				mp = [mp[1], mp[2], mp[0]]
			else:
				mp = [mp[1], mp[0], mp[2]]
			print(chr(ord('a') + mp[0][0]) * mp[0][1] + chr(ord('a') + mp[1][0]) * mp[1][1] + chr(ord('a') + mp[2][0]) * mp[2][1])
	elif len(mp) == 2:
		if max(lt) - min(lt) == 1:
			print('No answer')
		else:
			print(chr(ord('a') + mp[0][0]) * mp[0][1] + chr(ord('a') + mp[1][0]) * mp[1][1])
	else:
		print(chr(ord('a') + mp[0][0]) * mp[0][1])


def check(s):
	for i in range(1, len(s)):
		if abs(ord(s[i]) - ord(s[i - 1])) == 1:
			return False
	return True

def main():
	t = int(input())
	for _ in range(t):
		s = input()
		(odd_str, even_str) = ([], [])
		for c in s:
			if ord(c) % 2:
				odd_str.append(c)
			else:
				even_str.append(c)
		odd_str.sort()
		even_str.sort()
		odd_str = ''.join(odd_str)
		even_str = ''.join(even_str)
		if check(odd_str + even_str):
			print(odd_str + even_str)
		elif check(even_str + odd_str):
			print(even_str + odd_str)
		else:
			print('No answer')
main()


import math
import bisect
from collections import defaultdict
from collections import OrderedDict
from itertools import combinations
for _ in range(int(input())):
	p = '0123456789'
	n = list(input())
	ans = ''
	freq = {}
	n.sort()
	l = len(n)
	for i in n:
		if i in freq:
			freq[i] += 1
		else:
			freq[i] = 1
	f = []
	for i in freq.keys():
		f.append([i, freq[i]])
	ans1 = ''
	for i in range(0, len(f), 2):
		ans += f[i][0] * f[i][1]
	for j in range(1, len(f), 2):
		ans1 += f[j][0] * f[j][1]
	ans_e = ans + ans1
	ans_o = ans1 + ans

	def chk(ans):
		l = len(ans)
		for i in range(l - 1):
			if ord(ans[i]) + 1 == ord(ans[i + 1]) or ord(ans[i]) == ord(ans[i + 1]) + 1:
				return False
		return True
	if chk(ans_e) == True:
		print(ans_e)
	elif chk(ans_o) == True:
		print(ans_o)
	else:
		print('No answer')


n = int(input())
s1 = ''
for i in range(n):
	s = input()
	s1 = ''
	for o in range(ord('b'), ord('z') + 1, 2):
		s1 = s1 + chr(o) * s.count(chr(o))
	for o in range(ord('a'), ord('z') + 1, 2):
		s1 = s1 + chr(o) * s.count(chr(o))
	good = True
	for o in range(ord('b'), ord('z') + 1):
		if s1.find(chr(o - 1) + chr(o)) > -1 or s1.find(chr(o) + chr(o - 1)) > -1:
			good = False
	if not good:
		s1 = ''
		for o in range(ord('a'), ord('z') + 1, 2):
			s1 = s1 + chr(o) * s.count(chr(o))
		for o in range(ord('b'), ord('z') + 1, 2):
			s1 = s1 + chr(o) * s.count(chr(o))
	good = True
	for o in range(ord('b'), ord('z') + 1):
		if s1.find(chr(o - 1) + chr(o)) > -1 or s1.find(chr(o) + chr(o - 1)) > -1:
			good = False
	if not good:
		s1 = 'No answer'
	print(s1)


import random
import collections

def ugly(s, n):
	for i in range(1, n):
		if abs(ord(s[i]) - ord(s[i - 1])) == 1:
			return True
	return False
T = int(input())
for _ in range(T):
	counter = collections.Counter(input())
	s = list(counter.keys())
	n = len(s)
	tryCount = 0
	while ugly(s, n) and tryCount < 1000:
		random.shuffle(s)
		tryCount += 1
	if ugly(s, n):
		print('No answer')
	else:
		print(''.join([counter[c] * c for c in s]))


from fractions import gcd
from collections import Counter

def main():
	n = int(input())
	for itest in range(n):
		s = input().strip()
		c = Counter(s)
		A = list(c.items())
		A.sort()
		if len(A) == 1:
			print(s)
		elif len(A) == 2:
			if abs(ord(A[0][0]) - ord(A[1][0])) == 1:
				print('No answer')
			else:
				print(s)
		else:
			n = len(A)
			visited = [0] * n
			B = [0] * (n + 1)
			D = [ord(A[i][0]) for i in range(n)]

			def dfs(i, n):
				if i > n:
					return True
				for j in range(n):
					if not visited[j] and abs(D[j] - B[i - 1]) != 1:
						B[i] = D[j]
						visited[j] = True
						if dfs(i + 1, n):
							return True
						else:
							visited[j] = False
				return False
			if dfs(1, n):
				res = ''
				for i in range(1, n + 1):
					x = chr(B[i])
					res += x * c[x]
				print(res)
			else:
				print('No answer')
main()


def check(s):
	for i in range(len(s) - 1):
		if abs(ord(s[i]) - ord(s[i + 1])) == 1:
			return 0
	return 1
t = int(input())
for _ in range(t):
	o = list()
	e = list()
	s = input()
	for i in range(len(s)):
		if ord(s[i]) % 2 == 1:
			o.append(s[i])
		else:
			e.append(s[i])
	o.sort()
	e.sort()
	if check(o + e):
		print(''.join(o) + ''.join(e))
	elif check(e + o):
		print(''.join(e) + ''.join(o))
	else:
		print('No answer')


import sys
input = sys.stdin.readline
from collections import Counter
T = int(input())
Q = [input().strip() for i in range(T)]
for S in Q:
	C = Counter(S)
	ANS = []
	if len(C) == 1:
		print(S)
		continue
	LI = list(C.keys())
	LI.sort()
	L = len(LI)
	i = 0
	NOW = '0'
	while max(C.values()):
		for j in range(1, L):
			if abs(ord(NOW) - ord(LI[(i + j) % L])) > 1 and C[LI[(i + j) % L]] > 0:
				i = (i + j) % L
				break
		else:
			print('No answer')
			break
		while C[LI[i]] > 0:
			ANS.append(LI[i])
			C[LI[i]] -= 1
		NOW = LI[i]
	else:
		print(''.join(ANS))


raw = '\nвходные данныеСкопировать\n4\nabcd\ngg\ncodeforces\nabaca\nвыходные данныеСкопировать\ncadb\ngg\nrfdsooeecc\nNo answer\n'
from collections import Counter as cu
ii = lambda *args, t=int: t(input()) if args else tuple(map(t, input().split()))

def first(s):
	for x in s:
		return x

def ans(*args):
	print(*args)
	exit(0)

def solve():

	def dfs(x, mark):
		not_seen.discard(x)
		marks[x - 1] = mark
		for y in rels[x]:
			if y in not_seen:
				dfs(y, mark)

	def near(x, y):
		return abs(ord(x) - ord(y)) == 1
	n = ii(0)
	for _ in range(n):
		arr = input()
		d = cu(arr)
		if len(d) == 1:
			print(arr)
		elif len(d) == 2:
			(x, y) = d
			if near(x, y):
				print('No answer')
			else:
				print(arr)
		elif len(d) == 3:
			(x, y, z) = sorted(d)
			if near(x, y) & near(z, y):
				print('No answer')
			elif near(x, y):
				print(x * d[x] + z * d[z] + y * d[y])
			else:
				print(z * d[z] + x * d[x] + y * d[y])
		else:
			arr_ = sorted(d, reverse=True)
			(p1, p2) = (''.join((k * d[k] for k in arr_ if ord(k) % 2 == 0)), ''.join((k * d[k] for k in arr_ if ord(k) % 2)))
			print(p2 + p1 if near(p1[-1], p2[0]) else p1 + p2)
solve()


import sys
n = int(input())
lines = sys.stdin.readlines()
res = []
for line in lines:
	line = line.strip()
	odd = dict()
	even = dict()
	s = []
	fail = False
	for c in line:
		if (ord(c) - ord('a')) % 2 == 0:
			if not even.get(c):
				even[c] = 0
			even[c] += 1
		else:
			if not odd.get(c):
				odd[c] = 0
			odd[c] += 1
	even_keys = sorted(list(even.keys()))
	odd_keys = sorted(list(odd.keys()))
	if len(even_keys) > 0 and len(odd_keys) > 0:
		bad = [abs(ord(even_keys[-1]) - ord(odd_keys[0])) == 1, abs(ord(even_keys[-1]) - ord(odd_keys[-1])) == 1, abs(ord(even_keys[0]) - ord(odd_keys[0])) == 1, abs(ord(even_keys[0]) - ord(odd_keys[-1])) == 1]
		if bad[0] and bad[1] and (not bad[2]):
			(even_keys[0], even_keys[-1]) = (even_keys[-1], even_keys[0])
		elif bad[0] and bad[1] and (not bad[3]):
			(even_keys[0], even_keys[-1]) = (even_keys[-1], even_keys[0])
			(odd_keys[0], odd_keys[-1]) = (odd_keys[-1], odd_keys[0])
		elif bad[0] and (not bad[1]):
			(odd_keys[0], odd_keys[-1]) = (odd_keys[-1], odd_keys[0])
		elif bad[0] and bad[1] and bad[2] and bad[3]:
			res.append('No answer')
			continue
	for k in even_keys:
		s.append(k * even[k])
	for k in odd_keys:
		s.append(k * odd[k])
	res.append(''.join(s))
print('\n'.join(res))


def isNotUgly(s):
	for _ in range(1, len(s)):
		if abs(ord(s[_]) - ord(s[_ - 1])) == 1:
			return False
	return True

def solve():
	s = input()
	even = []
	odd = []
	for _ in s:
		if ord(_) % 2 == 0:
			even.append(_)
		else:
			odd.append(_)
	even.sort()
	odd.sort()
	a = ''.join(even)
	b = ''.join(odd)
	fin1 = a + b
	fin2 = b + a
	if isNotUgly(fin1):
		print(fin1)
	elif isNotUgly(fin2):
		print(fin2)
	else:
		print('No answer')
for __ in range(int(input())):
	solve()


for _ in range(int(input())):
	s = input()
	s = sorted(s)
	a = ''
	b = ''
	for i in s:
		if ord(i) % 2:
			a = a + i
		else:
			b = b + i
	if len(a) == 0:
		print(b)
	elif len(b) == 0:
		print(a)
	elif abs(ord(a[-1]) - ord(b[0])) != 1:
		print(a + b)
	elif abs(ord(b[-1]) - ord(a[0])) != 1:
		print(b + a)
	else:
		print('No answer')


from collections import Counter
t = int(input())
for _ in range(t):
	A = input()
	cA = Counter(A)
	if len(cA) == 1:
		print(''.join(cA.elements()))
	elif len(cA) == 2:
		(a, b) = sorted(cA.items())
		if ord(a[0]) + 1 == ord(b[0]):
			print('No answer')
		else:
			print(''.join(cA.elements()))
	elif len(cA) == 3:
		(a, b, c) = sorted(cA.items())
		if ord(a[0]) + 1 == ord(b[0]) and ord(a[0]) + 2 == ord(c[0]):
			print('No answer')
		elif ord(a[0]) + 1 != ord(b[0]):
			print(c[0] * c[1] + a[0] * a[1] + b[0] * b[1])
		else:
			print(b[0] * b[1] + c[0] * c[1] + a[0] * a[1])
	else:
		lcA = sorted(cA.items())
		result = ''
		cA_len = len(lcA)
		(i, j) = (0, cA_len // 2)
		while i < cA_len // 2 or j < cA_len:
			if j < cA_len:
				result += lcA[j][0] * lcA[j][1]
				j += 1
			if i < cA_len // 2:
				result += lcA[i][0] * lcA[i][1]
				i += 1
		print(result)


from collections import Counter
t = int(input())
for i in range(t):
	s = [str(i) for i in input()]
	ctr = Counter(s)
	st = sorted(list(set(s)))
	ans = ''
	if len(st) < 4:
		if len(st) == 1:
			ans += st[0] * ctr[st[0]]
			print(ans)
		elif len(st) == 2:
			if abs(ord(st[0]) - ord(st[1])) == 1:
				print('No answer')
			else:
				print(''.join(s))
		elif len(st) == 3:
			if abs(ord(st[0]) - ord(st[1])) == 1 and abs(ord(st[1]) - ord(st[2])) == 1:
				print('No answer')
				continue
			elif abs(ord(st[0]) - ord(st[1])) == 1:
				ans += st[0] * ctr[st[0]] + st[2] * ctr[st[2]] + st[1] * ctr[st[1]]
			else:
				ans += st[2] * ctr[st[2]] + st[0] * ctr[st[0]] + st[1] * ctr[st[1]]
			print(ans)
	else:
		t1 = ''
		t2 = ''
		cnt = 1
		for i in st:
			if cnt % 2:
				t1 += i * ctr[i]
				cnt += 1
			else:
				t2 += i * ctr[i]
				cnt += 1
		ans += t1[::-1]
		ans += t2[::-1]
		print(ans)


from sys import stdin
inp = lambda : stdin.readline().strip()
t = int(inp())
for _ in range(t):
	s = inp()
	alpha = [0] * 26
	for i in s:
		alpha[ord(i) - 97] += 1
	current = 0
	flag = False
	for i in range(26):
		ans = []
		ansLen = 0
		if alpha[i] > 0:
			current = i
			alphaC = alpha[:]
			while True:
				ans.append(f'{chr(97 + current)}' * alphaC[current])
				ansLen += alphaC[current]
				alphaC[current] = 0
				if ansLen == len(s):
					print(''.join(ans))
					flag = True
					break
				for i in range(26):
					if i == current - 1 or i == current + 1:
						continue
					elif alphaC[i] > 0:
						current = i
						break
				else:
					break
			if flag:
				break
	else:
		print('No answer')


abc = 'abcdefghijklmnopqrstuvwxyz'
abc2 = abc
zyx2 = abc2[::-1]
t = int(input())
for query in range(t):
	s = input()
	odd = [letter for letter in s if ord(letter) % 2 == 1]
	even = [letter for letter in s if ord(letter) % 2 == 0]
	if len(odd) == 0 or len(even) == 0:
		print(s)
	else:
		odd.sort()
		even.sort()
		conect1 = odd[-1] + even[0]
		conect2 = even[-1] + odd[0]
		if conect1 not in abc2 and conect1 not in zyx2:
			print(''.join(odd + even))
		elif conect2 not in abc2 and conect2 not in zyx2:
			print(''.join(even + odd))
		else:
			print('No answer')


def check(s):
	for i in range(len(s) - 1):
		if abs(ord(s[i]) - ord(s[i + 1])) == 1:
			return False
	return True
query = int(input())
while query > 0:
	raw = input()
	sorted_str = ''.join(sorted(raw))
	new1 = ''
	l = 0
	r = len(sorted_str) - 1
	while l <= r:
		i = l
		while i < len(sorted_str) and sorted_str[i] == sorted_str[l]:
			new1 += sorted_str[i]
			i += 1
		l = i
		if l > r:
			break
		j = r
		while j > 0 and sorted_str[j] == sorted_str[r]:
			new1 += sorted_str[j]
			j -= 1
		r = j
	if check(new1):
		print(new1)
	else:
		new2 = ''
		j = len(new1) - 1
		while j >= 1 and new1[j] == new1[-1]:
			j -= 1
		if j == 0:
			new2 = new1
		else:
			new2 = new1[j + 1:] + new1[:j + 1]
		if check(new2):
			print(new2)
		else:
			print('No answer')
	query -= 1


import math

def correct(per):
	for i in range(1, len(per)):
		if ord(per[i]) == ord(per[i - 1]) + 1 or ord(per[i]) == ord(per[i - 1]) - 1:
			return False
	return True

def do(arr):
	odd = []
	even = []
	for c in arr:
		if ord(c) % 2 == 0:
			even.append(c)
		else:
			odd.append(c)
	odd.sort()
	even.sort()
	s = ''.join(odd + even)
	if correct(s):
		return s
	s = ''.join(even + odd)
	if correct(s):
		return s
	return 'No answer'
n = int(input())
for _ in range(n):
	print(do(input()))


def solve(s):
	cs = [x for x in s]
	cs.sort()
	(r1, r2) = ('', '')
	alpha1 = [chr(x) for x in range(ord('a'), ord('z') + 2, 2)]
	alpha2 = [chr(x) for x in range(ord('b'), ord('z') + 2, 2)]
	for c in alpha1:
		if s.count(c) != 0:
			r1 += str(c) * s.count(c)
	for c in alpha2:
		if s.count(c) != 0:
			r2 += str(c) * s.count(c)
	if len(r1) == 0:
		return r2
	if len(r2) == 0:
		return r1
	if abs(ord(r1[-1]) - ord(r2[0])) != 1:
		return r1 + r2
	if abs(ord(r2[-1]) - ord(r1[0])) != 1:
		return r2 + r1
	return 'No answer'
T = int(input())
for _ in range(T):
	s = input()
	print(solve(s))


from collections import defaultdict as dd
t = int(input())
while t:
	t -= 1
	l = list(input().strip())
	n1 = len(l)
	l.sort()
	d = dd(int)
	for i in range(n1):
		d[l[i]] += 1
	l1 = list(set(l))
	l1.sort()
	n = len(l1)
	ct = 0
	for i in range(1, n):
		ct += ord(l1[i]) - ord(l1[i - 1])
	if n == 2 and ct == 1 or (n == 3 and ct == 2):
		print('No answer')
		continue
	else:
		if n == 4:
			print(l1[2] * d[l1[2]], l1[0] * d[l1[0]], l1[3] * d[l1[3]], l1[1] * d[l1[1]], sep='')
			continue
		elif n == 3:
			a1 = ord(l1[1]) - ord(l1[0])
			a2 = ord(l1[2]) - ord(l1[1])
			if a1 == 1:
				print(l1[0] * d[l1[0]], l1[2] * d[l1[2]], l1[1] * d[l1[1]], sep='')
				continue
			elif a2 == 1:
				print(l1[1] * d[l1[1]], l1[0] * d[l1[0]], l1[2] * d[l1[2]], sep='')
				continue
		for i in range(0, n, 2):
			print(l1[i] * d[l1[i]], end='')
		for i in range(1, n, 2):
			print(l1[i] * d[l1[i]], end='')
	print()


import sys
readline = sys.stdin.buffer.readline
read = sys.stdin.read
ns = lambda : readline().rstrip()
ni = lambda : int(readline().rstrip())
nm = lambda : map(int, readline().split())
nl = lambda : list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

def solve():
	s = list(ns())
	o = list()
	e = list()
	s.sort()
	for x in s:
		if x & 1:
			o.append(x)
		else:
			e.append(x)
	for g in (o + e, e + o):
		for (x, y) in zip(g, g[1:]):
			if abs(x - y) == 1:
				break
		else:
			print(''.join(map(chr, g)))
			return
	print('No answer')
	return
T = ni()
for _ in range(T):
	solve()


t = int(input())
for _ in range(t):
	s = str(input())

	def check(s):
		n = len(s)
		for i in range(n - 1):
			if abs(ord(s[i]) - ord(s[i + 1])) == 1:
				return False
		else:
			return True
	odd = []
	even = []
	for c in s:
		i = ord(c) - ord('a')
		if i % 2 == 0:
			even.append(c)
		else:
			odd.append(c)
	odd.sort()
	even.sort()
	s1 = ''.join(odd + even)
	s2 = ''.join(even + odd)
	if check(s1):
		print(s1)
	elif check(s2):
		print(s2)
	else:
		print('No answer')


t = int(input())
c = 26
for _ in range(t):
	s = list(input())
	s.sort()
	n = len(s)
	u = [0] * c
	for i in range(n):
		u[ord(s[i]) - ord('a')] += 1
	w = 0
	d = []
	p = []
	for i in range(c):
		if u[i] != 0:
			w += 1
			d.append(chr(i + ord('a')))
			p.append(u[i])
	if w > 4:
		for i in range(w // 2):
			r = (w - 1) // 2 + 1
			print(d[i] * p[i] + d[i + r] * p[i + r], end='')
		if w % 2 == 1:
			print(d[w // 2] * p[w // 2], end='')
		print()
	elif w == 4:
		print(d[2] * p[2] + d[0] * p[0] + d[3] * p[3] + d[1] * p[1])
	elif w == 1:
		print(d[0] * p[0])
	elif w == 2:
		if abs(ord(d[0]) - ord(d[1])) == 1:
			print('No answer')
		else:
			print(d[0] * p[0] + d[1] * p[1])
	elif ord(d[1]) - ord(d[0]) == 1 and ord(d[2]) - ord(d[1]) == 1:
		print('No answer')
	elif ord(d[1]) - ord(d[0]) > 1:
		print(d[2] * p[2] + d[0] * p[0] + d[1] * p[1])
	else:
		print(d[0] * p[0] + d[2] * p[2] + d[1] * p[1])


n = int(input())
ss = []
for i in range(n):
	ss.append(input())
from collections import Counter

def helper(s):
	cnt = Counter(s)
	lst = list(cnt.keys())
	lst.sort()
	if len(cnt) == 1:
		print(s)
	elif len(cnt) == 2:
		if ord(lst[1]) - ord(lst[0]) == 1:
			print('No answer')
		else:
			print(lst[0] * cnt[lst[0]] + lst[1] * cnt[lst[1]])
	elif len(cnt) == 3:
		if ord(lst[2]) - ord(lst[1]) == 1 and ord(lst[1]) - ord(lst[0]) == 1:
			print('No answer')
		elif ord(lst[2]) - ord(lst[1]) == 1:
			print(lst[1] * cnt[lst[1]] + lst[0] * cnt[lst[0]] + lst[2] * cnt[lst[2]])
		elif ord(lst[1]) - ord(lst[0]) == 1:
			print(lst[0] * cnt[lst[0]] + lst[2] * cnt[lst[2]] + lst[1] * cnt[lst[1]])
		else:
			print(lst[0] * cnt[lst[0]] + lst[2] * cnt[lst[2]] + lst[1] * cnt[lst[1]])
	else:
		(odd, even) = (lst[1:len(lst):2], lst[0:len(lst):2])
		res = ''
		for o in odd:
			res += o * cnt[o]
		for e in even:
			res += e * cnt[e]
		print(res)
for s in ss:
	helper(s)


from collections import deque
for _ in range(int(input())):
	s = input()
	letterCount = [0] * 26
	for elem in s:
		letterCount[ord(elem) - ord('a')] += 1
	waitList = []
	ansList = []
	for i in range(26):
		if letterCount[i] != 0:
			waitList.append(i)
	if len(waitList) >= 4:
		for i in range(1, len(waitList), 2):
			ansList.append(waitList[i])
		for i in range(0, len(waitList), 2):
			ansList.append(waitList[i])
	elif len(waitList) == 3:
		if waitList[0] + 1 == waitList[1] and waitList[1] + 1 == waitList[2]:
			print('No answer')
			continue
		elif waitList[0] + 1 != waitList[1]:
			ansList.append(waitList[1])
			ansList.append(waitList[0])
			ansList.append(waitList[2])
		else:
			ansList.append(waitList[1])
			ansList.append(waitList[2])
			ansList.append(waitList[0])
	elif len(waitList) == 2:
		if waitList[0] + 1 == waitList[1]:
			print('No answer')
			continue
		else:
			ansList.append(waitList[1])
			ansList.append(waitList[0])
	else:
		ansList.append(waitList[0])
	ans = ''
	for elem in ansList:
		ans += chr(ord('a') + elem) * letterCount[elem]
	print(ans)


t = int(input())
for i in range(t):
	s = input()
	n = len(s)
	d = dict()
	for j in range(26):
		d[j] = ''
	for j in range(n):
		d[ord(s[j]) - ord('a')] += s[j]
	(s1, s2) = ('', '')
	for j in range(0, 26, 2):
		s1 += d[j]
	for j in range(1, 26, 2):
		s2 += d[j]
	if s1 == '' or s2 == '':
		print(s1 + s2)
		continue
	if abs(ord(s1[-1]) - ord(s2[0])) != 1:
		print(s1 + s2)
	elif abs(ord(s2[-1]) - ord(s1[0])) != 1:
		print(s2 + s1)
	else:
		print('No answer')


for _ in range(int(input())):
	s = input().strip()
	arr = [0 for __ in range(26)]
	for c in s:
		arr[ord(c) - ord('a')] += 1
	s = ''
	for i in range(26):
		if arr[i]:
			s += chr(i + ord('a'))
		else:
			s += ' '
	srr = s.split()
	if len(srr) == 1 and 2 <= len(srr[0]) <= 3:
		print('No answer')
		continue
	result = ''
	srr.sort(key=lambda x: len(x), reverse=True)
	for i in range(len(srr)):
		s = srr[i]
		if len(s) == 1:
			result += s[0] * arr[ord(s[0]) - ord('a')]
			srr[i] = ''
			continue
		for j in range(1, len(s), 2):
			result += s[j] * arr[ord(s[j]) - ord('a')]
		ss = ''
		for j in range(0, len(s), 2):
			ss += s[j]
		srr[i] = ss
	for i in range(len(srr)):
		s = srr[i]
		for c in s:
			result += c * arr[ord(c) - ord('a')]
	print(result)
	for i in range(1, len(result)):
		c1 = result[i - 1]
		c2 = result[i]
		if abs(ord(c1) - ord(c2)) == 1:
			print('No')


n = int(input())
strings = [list(map(lambda e: ord(e), list(input()))) for _ in range(n)]

def main(element):
	result = []
	even = []
	odd = []
	for tt in sorted(element):
		if tt % 2 == 0:
			even.append(tt)
		else:
			odd.append(tt)
	if len(odd) == 0 or len(even) == 0:
		result.append(odd + even)
	elif abs(odd[-1] - even[0]) != 1:
		result.append(odd + even)
	elif abs(odd[0] - even[-1]) != 1:
		result.append(even + odd)
	else:
		print('No answer')
		return
	final = list(map(lambda e: chr(e), result[0]))
	print(''.join(final))
for element in strings:
	main(element)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import Counter
import heapq
from collections import Counter

def valid(s):
	for i in range(len(s) - 1):
		if abs(ord(s[i]) - ord(s[i + 1])) == 1:
			return False
	return True
for _ in range(int(input())):
	s = input()
	odd = []
	even = []
	for i in s:
		if ord(i) % 2 == 0:
			even += [str(i)]
		else:
			odd += [i]
	odd.sort()
	even.sort()
	l1 = odd
	l2 = even
	if valid(''.join(l1) + ''.join(l2)):
		print(''.join(l1) + ''.join(l2))
	elif valid(''.join(l2) + ''.join(l1)):
		print(''.join(l2) + ''.join(l1))
	else:
		print('No answer')


from collections import Counter
import string

def valid(o):
	for (x, y) in zip(o, o[1:]):
		if abs(ord(x) - ord(y)) == 1:
			return False
	return True

def create(c, o):
	res = []
	for x in o:
		for j in range(c[x]):
			res.append(x)
	return res
T = int(input())
for _ in range(T):
	c = Counter(input())
	o = []
	o1 = string.ascii_lowercase[1::2] + string.ascii_lowercase[::2]
	o2 = string.ascii_lowercase[::2] + string.ascii_lowercase[1::2]
	s1 = create(c, o1)
	s2 = create(c, o2)
	if valid(s1):
		print(''.join(s1))
	elif valid(s2):
		print(''.join(s2))
	else:
		print('No answer')


from collections import Counter
T = int(input())
for _ in range(T):
	s = input()
	ss = sorted(s)
	c = Counter(s)
	cc = sorted(c.keys())
	sc = list(map(ord, sorted(c.keys())))

	def k(a):
		return cc[a] * c[cc[a]]
	if len(c) == 1:
		print(s)
	elif len(c) == 2:
		if sc[1] - sc[0] == 1:
			print('No answer')
		else:
			print(s)
	elif len(c) == 3:
		if sc[1] - sc[0] == 1 and sc[2] - sc[1] == 1:
			print('No answer')
		elif sc[1] - sc[0] == 1:
			print(cc[0] * c[cc[0]] + cc[2] * c[cc[2]] + cc[1] * c[cc[1]])
		else:
			print(cc[1] * c[cc[1]] + cc[0] * c[cc[0]] + cc[2] * c[cc[2]])
	else:
		acc = ''
		i = 1
		while i < len(cc):
			acc += k(i)
			i += 2
		i = 0
		while i < len(cc):
			acc += k(i)
			i += 2
		print(acc)


for _ in range(int(input())):
	no_ans = False
	ans = []
	s = input()
	c = list(sorted(set(s)))
	if len(c) == 1:
		ans = [c[0]]
	elif len(c) == 2:
		if ord(c[1]) - ord(c[0]) == 1:
			no_ans = True
		else:
			ans = [c[0], c[1]]
	elif len(c) == 3:
		if ord(c[2]) - ord(c[0]) == 2:
			no_ans = True
		elif ord(c[1]) - ord(c[0]) > 1:
			ans = [c[2], c[0], c[1]]
		else:
			ans = [c[0], c[2], c[1]]
	else:
		ans = list(reversed(c[0:-1:2])) + [c[-1]] + c[1:-1:2]
	res = ''.join([ch * s.count(ch) for ch in ans])
	print('No answer' if no_ans else res)


dic = {}
te = 'abcdefghijklmnopqrstuvwxyz'
for i in range(1, 27):
	dic[te[i - 1]] = i
for _ in range(int(input())):
	st = input()
	dicount = {}
	for i in st:
		dicount[i] = dicount.get(i, 0) + 1
	ke = list(dicount.keys())
	ke.sort()
	le = len(ke)
	if le == 1:
		print(ke[0] * dicount[ke[0]])
	elif le == 2:
		if dic[ke[1]] - dic[ke[0]] == 1:
			print('No answer')
		else:
			print(ke[0] * dicount[ke[0]] + ke[1] * dicount[ke[1]])
	elif le == 3:
		if dic[ke[2]] - dic[ke[1]] == 1 and dic[ke[1]] - dic[ke[0]] == 1:
			print('No answer')
		elif dic[ke[2]] - dic[ke[1]] == 1 and dic[ke[1]] - dic[ke[0]] != 1:
			print(ke[1] * dicount[ke[1]] + ke[0] * dicount[ke[0]] + ke[2] * dicount[ke[2]])
		else:
			print(ke[0] * dicount[ke[0]] + ke[2] * dicount[ke[2]] + ke[1] * dicount[ke[1]])
	else:
		ans = ke[1] * dicount[ke[1]] + ke[3] * dicount[ke[3]] + ke[0] * dicount[ke[0]] + ke[2] * dicount[ke[2]]
		for i in range(4, le):
			if i % 2 == 0:
				ans += ke[i] * dicount[ke[i]]
			else:
				ans = ke[i] * dicount[ke[i]] + ans
		print(ans)


def check(s):
	s = list(s)
	s.sort()
	a1 = []
	a2 = []
	c = 0
	cur = s[0]
	for i in range(len(s)):
		if s[i] != cur:
			c ^= 1
			cur = s[i]
		if c == 0:
			a1.append(s[i])
		else:
			a2.append(s[i])
	a = ''.join(a1[::-1] + a2[::-1])
	for i in range(1, len(a)):
		if abs(ord(a[i]) - ord(a[i - 1])) == 1:
			return 0
	return a

def check2(s):
	s = list(s)
	s.sort()
	a1 = []
	a2 = []
	c = 0
	cur = s[0]
	for i in range(len(s)):
		if s[i] != cur:
			c ^= 1
			cur = s[i]
		if c == 0:
			a1.append(s[i])
		else:
			a2.append(s[i])
	a = ''.join(a1 + a2)
	for i in range(1, len(a)):
		if abs(ord(a[i]) - ord(a[i - 1])) == 1:
			return 0
	return a
t = int(input())
for i in range(t):
	s = input()
	if check(s):
		print(check(s))
	elif check2(s):
		print(check2(s))
	else:
		print('No answer')


t = int(input())
for i in range(t):
	s = input()
	s = sorted(s)
	t = s[0]
	k = len(s) - 1
	j = 0
	cnt = 0
	k = 0
	asd = len(s)
	while cnt < asd:
		if j + 1 >= len(s):
			break
		if s[j + 1] == t[-1]:
			t = t + s[j + 1]
			j += 1
			k = 0
			cnt += 1
			continue
		if k % 2 == 0:
			t = t + s[-1]
			s = s[:-1]
			while t[-1] == s[-1]:
				t = t + s[-1]
				s = s[:-1]
				cnt += 1
			k += 1
		else:
			t = t + s[1 + j]
			j += 1
			k += 1
		cnt += 1
	l = list(t)
	cnt = 0
	while abs(ord(t[0]) - ord(t[-1])) != 1 and cnt < len(t):
		t = t[-1] + t
		t = t[:-1]
		cnt += 1
	ch = 0
	l = list(t)
	for i in range(1, len(t)):
		if abs(ord(l[i]) - ord(l[i - 1])) == 1:
			ch = 1
	if ch == 1:
		print('No answer')
	else:
		print(t)


import sys
input = sys.stdin.readline
from collections import Counter
t = int(input())
for _ in range(t):
	s = input().rstrip()
	c = Counter(s)
	ls = list(c)
	ls = [ord(i) for i in ls]
	ls.sort()
	if len(ls) == 2:
		if ls[0] + 1 == ls[1]:
			print('No answer')
			continue
	if len(ls) == 3:
		if ls[0] + 2 == ls[1] + 1 == ls[2]:
			print('No answer')
			continue
	ans = []
	ans2 = []
	for i in range(97, 97 + 26, 2):
		if c[chr(i)]:
			ans.append(chr(i) * c[chr(i)])
	for i in range(98, 98 + 26, 2):
		if c[chr(i)]:
			ans2.append(chr(i) * c[chr(i)])
	if ans and ans2 and (abs(ord(ans[-1][-1]) - ord(ans2[0][0])) == 1):
		print(*ans2, *ans, sep='')
	else:
		print(*ans, *ans2, sep='')


def construct(uniq):
	cst = []
	for i in range(1, len(uniq), 2):
		cst.append(uniq[i])
	for i in range(0, len(uniq), 2):
		cst.append(uniq[i])
	return cst
T = int(input())
for t in range(T):
	s = input()
	uniq = []
	dc = {}
	for c in s:
		num = ord(c)
		if ord(c) in dc:
			dc[num] += 1
		else:
			dc[num] = 1
			uniq.append(num)
	uniq.sort()
	cst = construct(uniq)
	uniq.reverse()
	cst_rev = construct(uniq)
	ans = 'No answer'
	i = 1
	while i < len(cst):
		if abs(cst[i] - cst[i - 1]) == 1:
			break
		i += 1
	if i == len(cst):
		ans = 'cst'
	i = 1
	while i < len(cst_rev):
		if abs(cst_rev[i] - cst_rev[i - 1]) == 1:
			break
		i += 1
	if i == len(cst_rev):
		ans = 'cst_rev'
	if ans != 'No answer':
		if ans == 'cst':
			temp = cst
		else:
			temp = cst_rev
		ans = ''
		for i in temp:
			for j in range(dc[i]):
				ans += chr(i)
	print(ans)


from collections import Counter

def diffone(a, b):
	return abs(ord(a) - ord(b)) == 1
T = int(input())
for i in range(T):
	s = Counter(input())
	t = sorted(s)
	out = [t.pop()]
	last = 0
	while len(t):
		c = t.pop()
		if not diffone(c, out[0]):
			out.insert(0, c)
		elif not diffone(c, out[-1]):
			out.append(c)
		elif diffone(c, out[len(out) // 2 - 1]) or diffone(c, out[len(out) // 2]):
			if last == c:
				t.insert(0, c)
				break
			last = c
			t.insert(0, c)
		else:
			out.insert(len(out) // 2, c)
	if len(t):
		print('No answer')
	else:
		print(''.join([c * s[c] for c in out]))


class MyError(RuntimeError):
	pass
n = int(input())
for i in range(n):
	s = input()
	odd = []
	even = []
	for ch in s:
		if ord(ch) % 2 == 0:
			even.append(ch)
		else:
			odd.append(ch)
	if len(odd) == 0 or len(even) == 0:
		print(s)
	else:
		u = -1
		v = -1
		try:
			for i in range(len(odd)):
				for j in range(len(even)):
					if abs(ord(odd[i]) - ord(even[j])) != 1:
						(u, v) = (i, j)
						raise MyError()
			print('No answer')
		except MyError:
			odd = odd[:u] + odd[u + 1:] + odd[u:u + 1]
			even = even[v:v + 1] + even[:v] + even[v + 1:]
			print(''.join(odd + even))


for t in range(int(input())):
	s = str(input())
	l = set(s)
	p = ''
	l = list(l)
	l.sort()
	i = 0
	while i < len(l):
		p += l[i]
		i += 2
	i = 1
	p1 = ''
	while i < len(l):
		p1 += l[i]
		i += 2
	ans = ''
	if len(p) >= 1 and len(p1) >= 1:
		if abs(ord(p[len(p) - 1]) - ord(p1[0])) == 1:
			p = p[-1] + p[:len(p) - 1]
			p1 = p1[1:len(p1)] + p1[0]
	temp = p + p1
	for i in temp:
		ans += i * s.count(i)
	check = 0
	for i in range(len(ans) - 1):
		if abs(ord(ans[i]) - ord(ans[i + 1])) == 1:
			check = -1
	if check == -1:
		print('No answer')
	else:
		print(ans)


N = int(input())
for i in range(N):
	maps = [0] * 26
	A = input()
	for a in A:
		maps[ord(a) - ord('a')] += 1
	L = []
	for (i, m) in enumerate(maps):
		if m != 0:
			L += [[i + ord('a'), m]]
	ans = []
	if len(L) > 4 or (len(L) == 3 and abs(L[-1][0] - L[-2][0]) != 1):
		for i in range(0, len(L), 2):
			ans += [chr(L[i][0]) * L[i][1]]
		for i in range(1, len(L), 2):
			ans += [chr(L[i][0]) * L[i][1]]
	elif len(L) == 4 or (len(L) == 3 and abs(L[0][0] - L[1][0]) != 1) or (len(L) == 2 and abs(L[0][0] - L[1][0]) != 1):
		for i in range(1, len(L), 2):
			ans += [chr(L[i][0]) * L[i][1]]
		for i in range(0, len(L), 2):
			ans += [chr(L[i][0]) * L[i][1]]
	elif len(L) == 1:
		ans += chr(L[0][0]) * L[0][1]
	if ans != []:
		print(''.join(ans))
	else:
		print('No answer')


import sys
from sys import stdin, stdout
import bisect
import math
import heapq

def modinv(n, p):
	return pow(n, p - 2, p)

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())
import math

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def main():
	t = inin()
	for _ in range(t):
		s = sin()
		d = {}
		n = len(s)
		for i in s:
			if i not in d:
				d[i] = 1
			else:
				d[i] += 1
		j = ord('a')
		ans = []
		for i in range(0, 26, 2):
			x = chr(i + j)
			if x in d:
				for k in range(d[x]):
					ans.append(x)
		an = []
		for i in range(1, 26, 2):
			x = chr(i + j)
			if x in d:
				for k in range(d[x]):
					an.append(x)
		anss = ans[::-1]
		an = an[:]
		bs = an[:]
		bss = an[::-1]
		bss.extend(anss)
		bs.extend(ans)
		ans.extend(an)
		anss.extend(an[::-1])
		f = 1
		for i in range(n - 1):
			if abs(ord(ans[i]) - ord(ans[i + 1])) == 1 and f == 1:
				f = 0
				break
		if f == 1:
			print(*ans, sep='')
			f = 2
		elif f == 0:
			f = 1
		for i in range(n - 1):
			if abs(ord(anss[i]) - ord(anss[i + 1])) == 1 and f == 1:
				f = 0
				break
		if f == 1:
			print(*anss, sep='')
			f = 2
		elif f == 0:
			f = 1
		for i in range(n - 1):
			if abs(ord(bs[i]) - ord(bs[i + 1])) == 1 and f == 1:
				f = 0
				break
		if f == 1:
			print(*bs, sep='')
			f = 2
		elif f == 0:
			f = 1
		for i in range(n - 1):
			if abs(ord(bss[i]) - ord(bss[i + 1])) == 1 and f == 1:
				f = 0
				break
		if f == 1:
			print(*bss, sep='')
			f = 2
		elif f == 0:
			f = 1
		if f == 1:
			print('No answer')
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'

def readnumbers(zero=0):
	conv = ord if py2 else lambda x: x
	A = []
	numb = zero
	sign = 1
	i = 0
	s = sys.stdin.buffer.read()
	try:
		while True:
			if s[i] >= b'0'[0]:
				numb = 10 * numb + conv(s[i]) - 48
			elif s[i] == b'-'[0]:
				sign = -1
			elif s[i] != b'\r'[0]:
				A.append(sign * numb)
				numb = zero
				sign = 1
			i += 1
	except:
		pass
	if s and s[-1] >= b'0'[0]:
		A.append(sign * numb)
	return A
main()


q = int(input())

def check(s):
	for i in range(len(s) - 1):
		if abs(ord(s[i]) - ord(s[i + 1])) == 1:
			return False
	return True
for _ in range(q):
	s = input().strip()
	evens = []
	odds = []
	for ch in s:
		if ord(ch) % 2 == 0:
			evens.append(ch)
		else:
			odds.append(ch)
	evens.sort()
	odds.sort()
	evens = ''.join(evens)
	odds = ''.join(odds)
	if check(evens + odds):
		print(evens + odds)
	elif check(odds + evens):
		print(odds + evens)
	else:
		print('No answer')


def check(u):
	for i in range(len(u) - 1):
		if abs(ord(u[i]) - ord(u[i + 1])) == 1:
			return False
	return True
t = int(input())
for _ in range(t):
	s = input()
	cnt = {chr(i): 0 for i in range(ord('a'), ord('z') + 1)}
	for x in s:
		cnt[x] += 1
	s = sorted(list(set(list(s))))
	if len(s) == 2 and ord(s[1]) == ord(s[0]) + 1 or (len(s) == 3 and ord(s[1]) - ord(s[0]) == ord(s[2]) - ord(s[1]) == 1):
		print('No answer')
		continue
	if len(s) == 3:
		if ord(s[0]) == ord(s[1]) - 1:
			print(s[0] * cnt[s[0]] + s[2] * cnt[s[2]] + s[1] * cnt[s[1]])
		else:
			print(s[1] * cnt[s[1]] + s[0] * cnt[s[0]] + s[2] * cnt[s[2]])
		continue
	a = [s[i] for i in range(len(s)) if i % 2 == 0][::-1]
	b = [s[i] for i in range(len(s)) if i % 2 == 1][::-1]
	ans = ''
	for x in a:
		ans += x * cnt[x]
	for x in b:
		ans += x * cnt[x]
	print(ans)


from collections import Counter
t = int(input())
for i in range(t):
	s = str(input())
	d = list(s)
	l = Counter(d)
	f = [[x, l[x]] for x in l]
	f.sort(key=lambda x: x[0])
	if len(f) == 2:
		if ord(f[1][0]) == ord(f[0][0]) + 1:
			print('No answer')
		else:
			print(s)
	elif len(f) == 3:
		if ord(f[2][0]) == ord(f[1][0]) + 1 == ord(f[0][0]) + 2:
			print('No answer')
		elif ord(f[2][0]) == ord(f[1][0]) + 1:
			print(f[2][0] * f[2][1] + f[0][0] * f[0][1] + f[1][0] * f[1][1])
		else:
			print(f[0][0] * f[0][1] + f[2][0] * f[2][1] + f[1][0] * f[1][1])
	elif len(f) == 1:
		print(s)
	elif len(f) == 4:
		ans = f[2][0] * f[2][1] + f[0][0] * f[0][1] + f[3][0] * f[3][1] + f[1][0] * f[1][1]
		print(ans)
	else:
		ans = ''
		for i in range(0, len(f), 2):
			ans += f[i][0] * f[i][1]
		for i in range(1, len(f), 2):
			ans += f[i][0] * f[i][1]
		print(ans)


nums = int(input())
strings = [input() for _ in range(nums)]
for i in strings:
	odds = []
	evens = []
	for j in i:
		if ord(j) - 97 & 1 == 0:
			evens.append(j)
		else:
			odds.append(j)
	num = None
	possible = False
	if len(odds) == 0 or len(evens) == 0:
		possible = True
		print(i)
	else:
		high_odd = odds.index(max(odds))
		low_odd = odds.index(min(odds))
		high_even = evens.index(max(evens))
		low_even = evens.index(min(evens))
		if abs(ord(odds[low_odd]) - ord(evens[high_even])) != 1:
			odd_letter = odds.pop(low_odd)
			even_letter = evens.pop(high_even)
			possible = True
			print(''.join(odds) + odd_letter + even_letter + ''.join(evens))
		elif abs(ord(odds[high_odd]) - ord(evens[low_even])) != 1:
			odd_letter = odds.pop(high_odd)
			even_letter = evens.pop(low_even)
			possible = True
			print(''.join(odds) + odd_letter + even_letter + ''.join(evens))
	if not possible:
		print('No answer')


import sys
import math

def input():
	return sys.stdin.readline().strip('\n')

def I():
	return input()

def II():
	return int(input())

def MI():
	return map(int, input().split())

def LI():
	return list(map(int, input().split()))

def check(s):
	for i in range(len(s) - 1):
		if abs(ord(s[i]) - ord(s[i + 1])) == 1:
			return 0
	return 1
for _ in range(II()):
	s = I()
	o = ''
	e = ''
	for i in range(len(s)):
		if ord(s[i]) % 2 == 0:
			e += s[i]
		else:
			o += s[i]
	o = sorted(o)
	e = sorted(e)
	if check(o + e):
		print(''.join(o + e))
	elif check(e + o):
		print(''.join(e + o))
	else:
		print('No answer')


import atexit
import io
import sys
import copy
_I_B = sys.stdin.read().splitlines()
input = iter(_I_B).__next__
_O_B = io.StringIO()
sys.stdout = _O_B

@atexit.register
def write():
	sys.__stdout__.write(_O_B.getvalue())

def bf(s, l):
	global vis, idx, ts
	if l == len(s):
		return s
	for i in ts:
		if vis[idx[i]]:
			if len(s) == 0 or abs(idx[s[-1]] - idx[i]) != 1:
				s.append(i)
				vis[idx[i]] = 0
				res = bf(s, l)
				vis[idx[i]] = 1
				if res != -1:
					return res
				s.pop()
	return -1
az = 'abcdefghijklmnopqrstuvwxyz'
idx = dict()
count = dict()
ii = 0
for i in az:
	idx[i] = ii
	ii += 1
for _ in range(int(input())):
	s = input()
	ts = list(set(s))
	vis = [1] * 26
	for i in az:
		count[i] = 0
	for i in s:
		count[i] += 1
	res = bf([], len(ts))
	if res != -1:
		for i in res:
			print(i * count[i], end='')
		print()
	else:
		print('No answer')


import sys
import random
from collections import Counter
sys.setrecursionlimit(10 ** 5 + 1)
inf = int(10 ** 20)
max_val = inf
min_val = -inf
RW = lambda : sys.stdin.readline().strip()
RI = lambda : int(RW())
RMI = lambda : [int(x) for x in sys.stdin.readline().strip().split()]
RWI = lambda : [x for x in sys.stdin.readline().strip().split()]

def is_it_ugly(s, n):
	for i in range(1, n):
		if abs(ord(s[i]) - ord(s[i - 1])) == 1:
			return True
	return False
nb_test = RI()
for _ in range(nb_test):
	count = Counter(input())
	candidate = list(count.keys())
	valid = 'No answer'
	for _ in range(1000):
		random.shuffle(candidate)
		if not is_it_ugly(candidate, len(candidate)):
			valid = ''.join([count[x] * x for x in candidate])
			break
	print(valid)


import collections
import copy

def solve():
	N = int(input())
	S = [list(input()) for i in range(N)]
	ans = []
	for i in range(N):
		cnt = collections.Counter(S[i])
		lenS = len(S[i])
		ck = list(cnt.keys())
		ck.sort()
		if len(ck) == 1:
			ans.append(ck[0] * cnt[ck[0]])
		elif len(ck) == 2:
			if ord(ck[1]) - ord(ck[0]) == 1:
				ans.append('No answer')
			else:
				ans.append(ck[0] * cnt[ck[0]] + ck[1] * cnt[ck[1]])
		elif len(ck) == 3:
			if ord(ck[2]) - ord(ck[1]) == 1 and ord(ck[1]) - ord(ck[0]) == 1:
				ans.append('No answer')
			elif ord(ck[2]) - ord(ck[1]) == 1:
				ans.append(ck[2] * cnt[ck[2]] + ck[0] * cnt[ck[0]] + ck[1] * cnt[ck[1]])
			else:
				ans.append(ck[0] * cnt[ck[0]] + ck[2] * cnt[ck[2]] + ck[1] * cnt[ck[1]])
		else:
			a = ''
			for j in range(1, len(ck), 2):
				a += ck[j] * cnt[ck[j]]
			for j in range(0, len(ck), 2):
				a += ck[j] * cnt[ck[j]]
			ans.append(a)
	for a in ans:
		print(a)
solve()


t = int(input())
for _ in range(t):
	s = input()
	d = {}
	for c in s:
		try:
			d[c] += 1
		except:
			d[c] = 1
	i = 'a'
	an = ''
	while i <= 'z':
		try:
			if d[i] > 0:
				for j in range(d[i]):
					an += i
		except:
			pass
		i = chr(ord(i) + 2)
	i = 'b'
	ans2 = ''
	while i <= 'z':
		try:
			if d[i] > 0:
				for j in range(d[i]):
					ans2 += i
		except:
			pass
		i = chr(ord(i) + 2)
	f = 2
	ans = an + ans2
	for i in range(1, len(ans)):
		if abs(ord(ans[i]) - ord(ans[i - 1])) == 1:
			f -= 1
			break
	if f == 2:
		print(ans)
		continue
	ans = ans2 + an
	for i in range(1, len(ans)):
		if abs(ord(ans[i]) - ord(ans[i - 1])) == 1:
			f -= 1
			break
	if f == 1:
		print(ans)
		continue
	print('No answer')


import string
alpha = {x: i for (i, x) in enumerate(list(string.ascii_lowercase))}

def solve():
	s = input()
	odds = [c for c in s if alpha[c] % 2 == 1]
	evens = [c for c in s if alpha[c] % 2 == 0]
	odds.sort()
	evens.sort()
	if evens and odds and (max(abs(alpha[evens[-1]] - alpha[odds[0]]), abs(alpha[evens[0]] - alpha[odds[-1]])) <= 1):
		return 'No answer'
	elif evens and odds and (abs(alpha[evens[-1]] - alpha[odds[0]]) > 1):
		y = evens + odds
	else:
		y = odds + evens
	return ''.join(y)
t = int(input())
for case in range(t):
	print(solve())


def position(a):
	if a == 'a':
		return 1
	if a == 'b':
		return 2
	if a == 'c':
		return 3
	if a == 'd':
		return 4
	if a == 'e':
		return 5
	if a == 'f':
		return 6
	if a == 'g':
		return 7
	if a == 'h':
		return 8
	if a == 'i':
		return 9
	if a == 'j':
		return 10
	if a == 'k':
		return 11
	if a == 'l':
		return 12
	if a == 'm':
		return 13
	if a == 'n':
		return 14
	if a == 'o':
		return 15
	if a == 'p':
		return 16
	if a == 'q':
		return 17
	if a == 'r':
		return 18
	if a == 's':
		return 19
	if a == 't':
		return 20
	if a == 'u':
		return 21
	if a == 'v':
		return 22
	if a == 'w':
		return 23
	if a == 'x':
		return 24
	if a == 'y':
		return 25
	if a == 'z':
		return 26
trials = int(input())
for i in range(trials):
	sequence = list(input())
	odds = []
	evens = []
	impossible = ''
	for j in sequence:
		if j in ['a', 'c', 'e', 'g', 'i', 'k', 'm', 'o', 'q', 's', 'u', 'w', 'y']:
			odds.append(j)
		if j in ['b', 'd', 'f', 'h', 'j', 'l', 'n', 'p', 'r', 't', 'v', 'x', 'z']:
			evens.append(j)
	odds_up = sorted(odds)
	evens_up = sorted(evens)
	final_1 = odds_up + evens_up
	final_2 = evens_up + odds_up
	for j in range(len(final_1) - 1):
		if abs(position(final_1[j]) - position(final_1[j + 1])) == 1:
			impossible = 'True'
	if impossible == '':
		print(''.join(final_1))
	else:
		impossible = ''
		for j in range(len(final_2) - 1):
			if abs(position(final_2[j]) - position(final_2[j + 1])) == 1:
				impossible = 'True'
		if impossible == '':
			print(''.join(final_2))
		else:
			print('No answer')


t = int(input())
for w in range(t):
	arr = [0 for i in range(26)]
	s = input()
	l = len(s)
	for i in range(l):
		arr[ord(s[i]) - ord('a')] += 1
	even = ''
	for i in range(26):
		if i % 2 == 0:
			even += chr(ord('a') + i) * arr[i]
	for i in range(26):
		if i % 2 == 1:
			even += chr(ord('a') + i) * arr[i]
	odd = ''
	for i in range(26):
		if i % 2 == 1:
			odd += chr(ord('a') + i) * arr[i]
	for i in range(26):
		if i % 2 == 0:
			odd += chr(ord('a') + i) * arr[i]
	flag1 = 0
	for i in range(1, l):
		if abs(ord(even[i - 1]) - ord(even[i])) == 1:
			flag1 = 1
	flag2 = 0
	for i in range(1, l):
		if abs(ord(odd[i - 1]) - ord(odd[i])) == 1:
			flag2 = 1
	if flag1 == 0:
		print(even)
	elif flag2 == 0:
		print(odd)
	else:
		print('No answer')


import collections
import string
alpha = string.ascii_lowercase
for t in range(int(input())):
	s = input()
	a = [ord(ch) - ord('a') for ch in s]
	a.sort()
	(odd, even) = ([], [])
	for ch in a:
		if ch % 2:
			odd.append(ch)
		else:
			even.append(ch)
	if odd and even:
		b = odd + even if abs(odd[-1] - even[0]) > 1 else even + odd
	else:
		b = (odd, even)[not len(odd)]
	ans = ''
	for i in range(1, len(b)):
		if abs(b[i] - b[i - 1]) == 1:
			ans = 'No answer'
			break
	if ans == '':
		for i in range(len(b)):
			ans += alpha[b[i]]
	print(ans)


from bisect import bisect_right as br
from bisect import bisect_left as bl
from collections import *
from itertools import *
import functools
import sys
from math import *
from decimal import *
from copy import *
getcontext().prec = 30
MAX = sys.maxsize
MAXN = 10 ** 5 + 10
MOD = 10 ** 9 + 7

def isprime(n):
	n = abs(int(n))
	if n < 2:
		return False
	if n == 2:
		return True
	if not n & 1:
		return False
	for x in range(3, int(n ** 0.5) + 1, 2):
		if n % x == 0:
			return False
	return True

def mhd(a, b, x, y):
	return abs(a - x) + abs(b - y)

def numIN(x=' '):
	return map(int, sys.stdin.readline().strip().split(x))

def charIN(x=' '):
	return sys.stdin.readline().strip().split(x)

def arrIN():
	return list(numIN())

def dis(x, y):
	a = y[0] - x[0]
	b = x[1] - y[1]
	return (a * a + b * b) ** 0.5

def lgcd(a):
	g = a[0]
	for i in range(1, len(a)):
		g = math.gcd(g, a[i])
	return g

def ms(a):
	msf = -MAX
	meh = 0
	st = en = be = 0
	for i in range(len(a)):
		meh += a[i]
		if msf < meh:
			msf = meh
			st = be
			en = i
		if meh < 0:
			meh = 0
			be = i + 1
	return (msf, st, en)

def res(ans, t):
	print('Case #{}: {} {}'.format(t, ans[0], ans[1]))

def chk(s):
	for i in range(1, len(s)):
		if abs(ord(s[i]) - ord(s[i - 1])) == 1:
			return 0
	return 1

def gen(s, d):
	p = permutations(s)
	ans = ''
	for i in list(p):
		if chk(list(i)):
			f = 1
			for j in list(i):
				ans += j * d[j]
			break
	if len(ans) > 0:
		return ans.strip()
	else:
		return 'No answer'.strip()
for _ in range(int(input())):
	s = input()
	if chk(s):
		print(s)
		continue
	d = Counter(s)
	a = [i for i in d.keys()]
	a.sort()
	ans = ''
	if len(a) == 3:
		print(gen(a, d))
		continue
	elif len(a) % 2:
		for i in a[::2]:
			ans += i * d[i]
		for i in a[1::2]:
			ans += i * d[i]
	else:
		for i in a[1::2]:
			ans += i * d[i]
		for i in a[::2]:
			ans += i * d[i]
	if chk(ans):
		print(ans)
	else:
		print('No answer')