Chef received a new sequence $A_1, A_2, \ldots, A_N$. He does not like arbitrarily ordered sequences, so he wants to permute the elements of $A$ in such a way that it would satisfy the following condition: there is an integer $p$ ($1 \le p \le N$) such that the first $p$ elements of the new (permuted) sequence are strictly increasing and the last $N-p+1$ elements are strictly decreasing.
Help Chef and find a permutation of the given sequence which satisfies this condition or determine that no such permutation exists. If there are multiple solutions, you may find any one.

-----Input-----
- The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.
- The first line of each test case contains a single integer $N$.
- The second line contains $N$ space-separated integers $A_1, A_2, \ldots, A_N$.

-----Output-----
For each test case:
- If there is no permutation of $A$ that satisfies the given condition, print a single line containing the string "NO" (without quotes).
- Otherwise, print two lines.
- The first of these lines should contain the string "YES" (without quotes).
- The second line should contain $N$ space-separated integers ― the elements of your permuted sequence.

-----Constraints-----
- $1 \le T \le 100$
- $1 \le N \le 10^5$
- $1 \le A_i \le 2 \cdot 10^5$ for each valid $i$
- the sum of $N$ over all test cases does not exceed $10^6$

-----Subtasks-----
Subtask #1 (50 points):
- $N \le 10^3$
- $A_i \le 2 \cdot 10^3$ for each valid $i$
- the sum of $N$ over all test cases does not exceed $10^4$
Subtask #2 (50 points): original constraints

-----Example Input-----
5
4
1 3 2 4
4
1 3 2 4
6
1 10 10 10 20 15
5
1 1 2 2 3
4
1 2 3 3

-----Example Output-----
YES
1 2 3 4
YES
4 3 2 1
NO
YES
1 2 3 2 1
NO

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = '# cook your dish here\ndef PrintBothArrays(a, n) : \n \n # Store both arrays  \n v1, v2 = [], [] \n \n # Used for hashing  \n mpp = dict.fromkeys(a, 0) \n \n # Iterate for every element  \n for i in range(n) : \n \n  # Increase the count  \n  mpp[a[i]] += 1 \n \n  # If first occurrence  \n  if (mpp[a[i]] == 1) : \n   v1.append(a[i]) \n \n  # If second occurrence  \n  elif (mpp[a[i]] == 2) :  \n   v2.append(a[i]) \n \n  # If occurs more than 2 times  \n  else :  \n   print("NO") \n   return;  \n \n # Sort in increasing order\n maximum=max(v1)\n if maximum in v2:\n  print("NO")\n  return;\n \n v1.sort();  \n \n # Print the increasing array  \n print("YES");  \n for it in v1: \n  print(it, end = " ");  \n \n # Sort in reverse order  \n v2.sort(reverse = True);  \n \n # Print the decreasing array \n for it in v2 :  \n  print(it, end = " ") \n print()\n \n# Driver code  \ndef __starting_point(): \n try:\n  t=int(input())\n  for _ in range(t):\n   n=int(input())\n   a=list(map(int,input().split())) \n   PrintBothArrays(a, n); \n except EOFError as t : pass\n__starting_point()'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13619