You are given an integer N and a (0-indexed) binary string A having length N+1. 

Find any permutation P of {0,1,2,...,N-1} (or determine that it does not exist) that satisfies the following conditions for all i (0 ≤ i ≤ N): 
if A_{i} = 0: No contiguous segment of P has \texttt{mex} equal to i 
if A_{i} = 1: There exists at least one contiguous segment of P that has \texttt{mex} equal to i

If multiple permutations exist that satisfy the given conditions, print any.

Note: \texttt{mex} of a segment is the smallest non-negative number that does not occur in that segment.

------ Input Format ------ 

- The first line contains the number of test cases T. Description of the test cases follows.
- The first line of each test case contains a single integer N.
- The second line of each test case contains the binary string A of length N + 1.

------ Output Format ------ 

For each test case print :
- \texttt{Yes} if there exists a permutation P that satisfies the conditions described in the statement, followed by the permutation P in the next line (If multiple permutations exist that satisfy the given conditions, print any).
- \texttt{No} otherwise.

You may print each character of \texttt{Yes} and \texttt{No} in uppercase or lowercase (for example, \texttt{yes}, \texttt{yEs}, \texttt{YES} will be considered identical).

------ Constraints ------ 

$1 ≤ T ≤  10^{4}$
$2 ≤ N ≤ 3 \cdot 10^{5}$
$|A| = N + 1$
- It is guaranteed that the sum of $N$ over all test cases does not exceed $3 \cdot 10^{5}$.

----- Sample Input 1 ------ 
4
2
111
5
110100
5
110101
7
11100111

----- Sample Output 1 ------ 
Yes
0 1
No
Yes
0 2 1 4 3
Yes
0 1 3 4 2 5 6

----- explanation 1 ------ 
Test case-1: One of the possible permutations satisfying the given conditions is [$0, 1$] because:
- $\texttt{mex}([1]) = 0$. Therefore the condition is satisfied for $i = 0$.
- $\texttt{mex}([0]) = 1$. Therefore the condition is satisfied for $i = 1$.
- $\texttt{mex}([0, 1]) = 2$. Therefore the condition is satisfied for $i = 2$.

Test case-2: It can be proven that no permutation exists that satisfies the given conditions.

Test case-3: One of the possible permutations satisfying the given conditions is [$0, 2, 1, 4, 3$] because:
- $\texttt{mex}([2]) = 0$. Therefore the condition is satisfied for $i = 0$.
- $\texttt{mex}([0, 2]) = 1$. Therefore the condition is satisfied for $i = 1$.
- There does not exist any segment with $\texttt{mex} = 2$. Therefore the condition is satisfied for $i = 2$.
- $\texttt{mex}([0, 2, 1]) = 3$. Therefore the condition is satisfied for $i = 3$.
- There does not exist any segment with $\texttt{mex} = 4$. Therefore the condition is satisfied for $i = 4$.
- $\texttt{mex}([0, 2, 1, 4, 3]) = 5$. Therefore the condition is satisfied for $i = 5$.

Difficulty: MEDIUM_HARD

Solutions:
t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	l = [i for i in range(n)]
	for i in range(n):
		if s[i] == '0':
			(l[i], l[i - 1]) = (l[i - 1], l[i])
	if s[n] == '1' and s[0] == '1' and (s[1] == '1'):
		print('Yes')
		print(*l)
	else:
		print('No')


try:
	for _ in range(int(input())):
		n = int(input())
		array = input()
		ans = []
		if array == '01':
			ans = '0'
		elif array[-1] == '0' or array[0] == '0' or array[1] == '0' or (n == 1):
			ans = -1
		else:
			for i in range(n):
				if array[i] == '1':
					ans.append(i)
				else:
					a = ans.pop(-1)
					ans.append(i)
					ans.append(a)
		if ans == -1:
			print('No')
		else:
			print('Yes')
			print(*ans)
except:
	pass


for _ in range(int(input())):
	n = int(input()) + 1
	s = list(input())
	out = []
	if int(s[0]) == 0 or int(s[1]) == 0 or int(s[-1]) == 0:
		print('No')
		continue
	print('Yes')
	out = []
	out.append(0)
	i = 2
	while int(s[i] == 1) and i < n:
		out.append(i - 1)
		i += 1
	(x, y) = (i, i - 1)
	while x < n:
		if int(s[x]) == 0:
			out.append(x)
		else:
			out.append(y)
			y += 1
			while int(s[y]) == 0:
				y += 1
		x += 1
	print(*out)


import math
import os
import random
import re
import sys
T = int(input())
for _ in range(T):
	N = int(input())
	A = input()
	B = []
	if A[0] == '0' or A[1] == '0' or A[N] == '0':
		print('No')
	else:
		B.append(0)
		c = 1
		for i in range(2, len(A) - 1):
			if A[i] == '0':
				B.append(i)
			else:
				B.append(c)
				c = i
		B.append(c)
		print('Yes')
		print(*B)


from math import *
from collections import *
import os
from io import BytesIO, IOBase
import sys
from bisect import *
from heapq import *
MOD = 1000000007

def binpow(a, b, m):
	a %= m
	x = 1
	while b > 0:
		if b & 1:
			x = x * a % m
		a = a * a % m
		b >>= 1
	return x

def binser(arr, l, r, x):
	while l < r:
		mid = l + (r - l) // 2
		if arr[mid] == x:
			return mid
		elif arr[mid] < x:
			l = mid + 1
		else:
			r = mid - 1
	return mid

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

def sod(n):
	l = list(str(n))
	s = 0
	for i in l:
		s += int(i)
	return s

def prime_factors(num):
	l = []
	if num % 2:
		l.append(2)
	while num % 2 == 0:
		num = num / 2
	for i in range(3, int(sqrt(num)) + 1, 2):
		if not num % i:
			l.append(i)
		while num % i == 0:
			num = num / i
	if num > 2:
		l.append(num)
	return l

def factmod(n, p):
	f = defaultdict(int)
	f[0] = 1
	for i in range(1, n + 1):
		f[i] = f[i - 1] * i % MOD
	return f

def largestPower(n, p):
	x = 0
	while n:
		n //= p
		x += n
	return x

def modFact(n, p):
	if n >= p:
		return 0
	res = 1
	isPrime = [1] * (n + 1)
	i = 2
	while i * i <= n:
		if isPrime[i]:
			for j in range(2 * i, n, i):
				isPrime[j] = 0
		i += 1
	for i in range(2, n):
		if isPrime[i]:
			k = largestPower(n, i)
			res = res * binpow(i, k, p) % p
	return res

def drec(x, y):
	if y == x + 1:
		return 'R'
	if y == x - 1:
		return 'L'
	if x < y:
		return 'D'
	return 'U'

def cellhash(x, y):
	return (x - 1) * m + y

def bins(l, x, n):
	i = bisect_left(l, x)
	if i < n:
		return i
	if i:
		return i - 1
	else:
		return n

def cond(l):
	for i in range(len(l) - 1):
		if l[i] == str(int(l[i + 1]) - 1):
			return False
	return True

def isvowel(s):
	if s in list('aeiou'):
		return 1
	return 0

def countOdd(L, R):
	N = (R - L) // 2
	if R % 2 != 0 or L % 2 != 0:
		N += 1
	return N

def tst(A, B, C):
	return (A | B) & (B | C) & (C | A)

def palcheck(n, s):
	(i, j) = (0, n - 1)
	while i <= j:
		if s[i] == s[j]:
			return False
		i += 1
		j -= 1
	return True

def sakurajima(n):
	if n < 9:
		n = 10
	l = [1] * (n + 1)
	l[1] = 0
	for i in range(2, int(n ** 0.5) + 1):
		if l[i]:
			for j in range(i * i, n + 1, i):
				if not j % i:
					l[j] = 0
	return l

def prchck(n):
	l = [1] * (n + 1)
	l[1] = 0
	for i in range(2, n + 1):
		for j in range(2, int(sqrt(n)) + 1):
			if j % i == 0:
				l[j] = 1
	return l

def ispal(s, n):
	for i in range(n // 2):
		if s[i] != s[n - i - 1]:
			return False
	return True

def bfs(src, dest, ajl, vis):
	q = deque([src])
	vis[src] = True
	while q:
		i = q.popleft()
		if i == dest:
			return True
		for j in ajl[i]:
			if not vis[j]:
				vis[j] = True
				q.append(j)
	return False

def dfs(i, ajl, vis):
	vis[i] = True
	for j in ajl[i]:
		if not vis[j]:
			dfs(j, ajl, vis)

class DisjSet:

	def __init__(self, n):
		self.rank = [1] * n
		self.parent = [i for i in range(n)]

	def find(self, x):
		if self.parent[x] != x:
			self.parent[x] = self.find(self.parent[x])
		return self.parent[x]

	def Union(self, x, y):
		xset = self.find(x)
		yset = self.find(y)
		if xset == yset:
			return
		if self.rank[xset] < self.rank[yset]:
			self.parent[xset] = yset
		elif self.rank[xset] > self.rank[yset]:
			self.parent[yset] = xset
		else:
			self.parent[yset] = xset
			self.rank[xset] = self.rank[xset] + 1

def snek(i, ajl, vis, x, ds):
	vis[i] = True
	for j in ajl[i]:
		if not vis[j]:
			ds[j] = x
			snek(j, ajl, vis, x, ds)

def panda(n, s):
	if s[0] == '0' or s[1] == '0' or s[n] == '0':
		print('No')
		return
	ans = [0]
	x = 1
	for i in range(2, n):
		if s[i] == '0':
			ans.append(i)
		else:
			ans.append(x)
			x = i
	ans.append(x)
	print('Yes')
	print(*ans)
t = 1
t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	panda(n, s)


from itertools import permutations
import os.path
from math import gcd, floor, ceil
from collections import *
from random import randint
import sys
mod = 1000000007
INF = float('inf')

def st():
	return list(sys.stdin.readline().strip())

def li():
	return list(map(int, sys.stdin.readline().split()))

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

def inp():
	return int(sys.stdin.readline())

def pr(n):
	return sys.stdout.write(str(n) + '\n')

def prl(n):
	return sys.stdout.write(str(n) + ' ')
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def solve():
	n = inp()
	s = st()
	if s[0] == '0' or s[1] == '0' or s[-1] == '0':
		pr('No')
		return
	ind = -1
	l = list(range(n))
	for i in range(n - 1, -1, -1):
		if s[i] == '0':
			ind = i
			break
	if ind == -1:
		pr('Yes')
		print(*l)
	else:
		index = {i: i for i in range(n)}
		for i in range(1, ind + 1):
			if s[i] == '0':
				(l[i], l[i - 1]) = (l[i - 1], l[i])
		pr('Yes')
		print(*l)
for _ in range(inp()):
	solve()


def ri():
	return int(input())

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

def rm():
	return map(int, input().split())
for _ in range(ri()):
	n = ri()
	a = input()
	if a[0] == '0' or a[1] == '0' or a[-1] == '0':
		print('No')
		continue
	print('Yes')
	j = 1
	l = []
	i = 0
	f = 0
	for k in range(n + 1):
		if i == n:
			break
		if a[i] == '1':
			if a[j] == '1':
				l.append(i)
				i = j
				j += 1
			else:
				l.append(j)
				j += 1
	print(*l)


for i in range(int(input())):
	n = int(input())
	s = input()
	if s[n] == '0' or s[0] == '0' or s[1] == '0':
		print('No')
		continue
	nlist = []
	for j in range(n + 1):
		nlist.append(j)
	for j in range(n):
		if s[j + 1] == '0':
			(nlist[j], nlist[j + 1]) = (nlist[j + 1], nlist[j])
	if nlist[n - 1] == 0:
		print('No')
	else:
		print('Yes')
		print(*nlist[:n])


t = int(input())
for _ in range(t):
	n = int(input())
	s = input().rstrip()
	a = []
	if s[0] == '0' or s[-1] == '0' or s[1] == '0':
		print('No')
	else:
		i = 0
		while i < n:
			if s[i] == '1':
				if s[i + 1] == '1':
					a.append(i)
					i += 1
				else:
					idx = -1
					for j in range(i + 1, n + 1):
						if s[j] == '1':
							idx = j
							break
						else:
							a.append(j)
					a.append(i)
					i = idx
		print('Yes')
		print(*a)


for _ in range(int(input())):
	N = int(input())
	A = list(input().strip())
	data = ['0']
	last = 1
	if A[1] == '0' or A[0] == '0' or A[-1] == '0':
		print('No')
	else:
		for i in range(1, N):
			if A[i + 1] == '1':
				data.append(str(last))
				last = i + 1
			else:
				data.append(str(i + 1))
		sol = ' '.join(data)
		print('Yes')
		print(sol)


t = int(input())
for _ in range(t):
	h = 1
	n = int(input())
	s = input()
	if s[0] == '0' or s[1] == '0' or s[n] == '0':
		print('No')
		continue
	v = []
	v.append(0)
	for i in range(2, len(s) - 1):
		if s[i] == '0':
			v.append(i)
		else:
			v.append(h)
			h = i
	v.append(h)
	print('Yes')
	print(*v, sep=' ')


import sys
from math import sqrt, ceil, floor, gcd
from collections import Counter, defaultdict

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

def str_arr():
	return list(map(str, input().split()))

def get_str():
	return map(str, input().split())

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

def get_flo():
	return map(float, input().split())

def lcm(a, b):
	return a * b // gcd(a, b)
mod = 1000000007

def solve():
	n = int(input())
	s = list(str(input()))
	if s[0] == '0' or s[-1] == '0' or s[1] == '0':
		print('No')
	else:
		ans = [i for i in range(0, n)]
		for i in range(1, n):
			if s[i] == '0':
				(ans[i], ans[i - 1]) = (ans[i - 1], ans[i])
		print('Yes')
		print(*ans)
T = 1
T = int(input())
while T:
	solve()
	T -= 1


t = int(input())
while t:
	n = int(input())
	s = input()
	if s[0] == '0' or s[1] == '0':
		print('No')
	elif s[-1] == '0':
		print('No')
	else:
		lst = []
		for i in range(0, n):
			if s[i] == '1':
				lst.append(i)
			else:
				x = lst[-1]
				lst.pop()
				lst.append(i)
				lst.append(x)
		print('Yes')
		print(*lst)
	t = t - 1


for t in range(int(input())):
	n = int(input())
	s = input()
	if n == 1:
		if s[0] == '0':
			print('No')
		else:
			print('Yes')
			print(0)
		continue
	if n == 2:
		if s[0] == '0' or s[1] == '0':
			print('No')
		else:
			print('Yes')
			print('0 1')
		continue
	if s[0] == '0' or s[1] == '0' or s[-1] == '0':
		print('No')
		continue
	arr = []
	arr.append(0)
	cnt = 1
	for i in range(2, len(s) - 1):
		if s[i] == '0':
			arr.append(i)
		else:
			arr.append(cnt)
			cnt = i
	print('Yes')
	for i in arr:
		print(i, end=' ')
	print(cnt)