When Serezha was three years old, he was given a set of cards with letters for his birthday. They were arranged into words in the way which formed the boy's mother favorite number in binary notation. Serezha started playing with them immediately and shuffled them because he wasn't yet able to read. His father decided to rearrange them. Help him restore the original number, on condition that it was the maximum possible one. 


-----Input-----

The first line contains a single integer $n$ ($1 \leqslant n \leqslant 10^5$) — the length of the string. The second line contains a string consisting of English lowercase letters: 'z', 'e', 'r', 'o' and 'n'.

It is guaranteed that it is possible to rearrange the letters in such a way that they form a sequence of words, each being either "zero" which corresponds to the digit $0$ or "one" which corresponds to the digit $1$.


-----Output-----

Print the maximum possible number in binary notation. Print binary digits separated by a space. The leading zeroes are allowed.


-----Examples-----
Input
4
ezor

Output
0 

Input
10
nznooeeoer

Output
1 1 0 



-----Note-----

In the first example, the correct initial ordering is "zero".

In the second example, the correct initial ordering is "oneonezero".

Source: codeforces | Difficulty: EASY
Tags: String algorithms

Sorting

Implementation


Solutions:
import bisect
import functools
import math
import sys
from collections import defaultdict
rt = lambda : map(int, input().split())
ri = lambda : int(input())
rl = lambda : list(map(int, input().split()))

def main():
	_ = ri()
	s = input()
	print(' '.join(['1'] * s.count('n') + ['0'] * s.count('z')))
main()


n = int(input())
d = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
s = input()
for i in range(n):
	d[s[i]] += 1
seq = []
for i in range(n):
	if d['o'] >= 1 and d['n'] >= 1 and (d['e'] >= 1):
		seq.append(1)
		d['o'] -= 1
		d['n'] -= 1
		d['e'] -= 1
	if d['o'] == 0 and d['n'] == 0 and (d['e'] == 0):
		print(' '.join((str(x) for x in sorted(seq, reverse=True))))
		break
if d['o'] >= 1:
	for i in range(n):
		if d['z'] >= 1 and d['e'] >= 1 and (d['r'] >= 1) and (d['o'] >= 1):
			seq.append(0)
			d['z'] -= 1
			d['e'] -= 1
			d['r'] -= 1
			d['o'] -= 1
	print(' '.join((str(x) for x in sorted(seq, reverse=True))))


import sys
input = sys.stdin.readline
n = int(input())
S = input().strip()
one = S.count('n')
zero = S.count('z')
ANS = [1] * one + [0] * zero
print(*ANS)


n = int(input())
s = input()
zero = s.count('o')
nnnn = s.count('n')
zzzz = s.count('z')
x1 = min(zero - zzzz, nnnn)
x2 = zzzz
a = [1] * x1 + [0] * x2
print(' '.join(map(str, a)))


n = int(input())
st = input()
z = 0
n = 0
for i in st:
	if i == 'z':
		z += 1
	if i == 'n':
		n += 1
print('1 ' * n + '0 ' * z)


n = int(input())
s = input()
print(' '.join(list('1' * s.count('n') + '0' * s.count('z'))))


a = int(input())
b = input()
c = int(b.count('z'))
d = int(b.count('n'))
e = ''
f = ''
while c > 0:
	e = str(c % 2) + e
	c = c - 1
while d > 0:
	f = str(d % 2) + f
	d = d - 1
e = e.replace('1', '0')
f = f.replace('0', '1')
e = e.replace('', ' ')
f = f.replace('', ' ')
print(f, e)


inp = int(input())
word = input()
i = 0
while i < len(word):
	if word[i] == 'n':
		print('1 ')
	i = i + 1
i = 0
while i < len(word):
	if word[i] == 'z':
		print('0 ')
	i = i + 1


n = int(input())
ad = []
ad = list(input())
z = 0
e = 0
r = 0
o = 0
n = 0
sum_one = 0
sum_zero = 0
for i in range(len(ad)):
	if ad[i] == 'z':
		z += 1
	if ad[i] == 'e':
		e += 1
	if ad[i] == 'r':
		r += 1
	if ad[i] == 'o':
		o += 1
	if ad[i] == 'n':
		n += 1
sum_one = min(o, n, e)
k = min(o, n, e)
o -= k
n -= k
e -= k
sum_zero = min(z, e, r, o)
a = '1 '
b = '0 '
c = '0'
if sum_zero == 1:
	print(str(a * sum_one + c))
else:
	print(str(a * sum_one + b * sum_zero))


a = int(input())
s = input()[:a]
d = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for x in s:
	if x in d:
		d[x] += 1
	else:
		d[x] = 1
k = min(d['o'], d['n'], d['e'])
d['o'] = d['o'] - k
d['e'] = d['e'] - k
if k == 0:
	print('0 ' * min(d['z'], d['e'], d['r'], d['o']))
else:
	print('1 ' * k + '0 ' * min(d['z'], d['e'], d['r'], d['o']))


n = int(input())
s = input()
nz = 0
no = 0
ne = 0
nr = 0
nn = 0
for i in s:
	if i == 'o':
		no += 1
	elif i == 'n':
		nn += 1
	elif i == 'e':
		ne += 1
	elif i == 'z':
		nz += 1
	elif i == 'r':
		nr += 1
min1 = min([no, nn, ne])
print('1 ' * min1, end='')
no = no - min1
ne = ne - min1
min1 = min([nz, ne, nr, no])
print('0 ' * min1)


n = int(input())
a = list(input())
q = [1] * a.count('n') + [0] * a.count('z')
print(*q)


from collections import defaultdict
n = int(input())
s = input()
l = list(s)
count = defaultdict(int)
for i in l:
	count[i] += 1
comp = 0
while 1:
	comp = count['o'] + count['n'] + count['e']
	if comp >= 3 and count['o'] > 0 and (count['n'] > 0) and (count['e'] > 0):
		count['o'] -= 1
		count['n'] -= 1
		count['e'] -= 1
		print(1, end=' ')
	else:
		break
comp = 0
while 1:
	comp = count['z'] + count['e'] + count['r'] + count['o']
	if comp >= 4 and count['z'] > 0 and (count['e'] > 0) and (count['r'] > 0) and (count['o'] > 0):
		count['o'] -= 1
		count['z'] -= 1
		count['e'] -= 1
		count['r'] -= 1
		print(0, end=' ')
	else:
		break


s = int(input())
v = input()
a = v.count('z')
b = v.count('e')
c = v.count('r')
d = v.count('o')
e = v.count('n')
f = min(b, d, e)
i = f * '1' + a * '0'
print(' '.join(i))


line1 = int(input())
line2 = input()
one_count = 0
zero_count = 0
letter_count = line1
for l in line2:
	if l == 'z':
		zero_count = zero_count + 1
one_count = (letter_count - 4 * zero_count) / 3
i = one_count
s = ''
while i > 0:
	s = s + '1 '
	i = i - 1
i = zero_count
while i > 0:
	s = s + '0 '
	i = i - 1
print(s)


c = 0
n = int(input())
for x in input():
	if x == 'n':
		print(1, end=' ')
	elif x == 'z':
		c += 1
if c > 1:
	print('0 ' * (c - 1))
	c = 1
print('0' * c)


def Cards(s):
	print(''.join([str(1) + ' ' for x in range(0, s.count('n'))]) + ''.join([str(0) + ' ' for x in range(0, s.count('z'))]))
n = int(input())
Cards(input())


n = int(input())
s = input()
one = s.count('n')
zero = s.count('z')
for i in range(one):
	print(1, end=' ')
for i in range(zero):
	print(0, end=' ')


n_letters = int(input())
word = input()
n_ones = []
n_zeros = []
for letter in word:
	if letter == 'n':
		n_ones.append('1')
	elif letter == 'z':
		n_zeros.append('0')
if len(n_zeros) == 1 and len(n_ones) == 0:
	print('0')
else:
	final_number = ' '.join(n_ones) + ' ' + ' '.join(n_zeros)
	print(final_number)


n = int(input())
str = input()
str1 = 'one'
str2 = 'zero'
o = str.count('o')
n = str.count('n')
e = str.count('e')
a = min(o, n, e)
for i in range(a):
	print('1', end=' ')
o = o - a
e = e - a
z = str.count('z')
b = min(o, e, z)
if b > 0:
	for i in range(b):
		print('0', end=' ')


from collections import Counter
n = int(input())
try:
	while True:
		s = input()
		if s != '':
			continue
		else:
			break
except EOFError:
	pass
d = Counter(s)
count1 = 0
count2 = 0
for i in d:
	if i == 'z':
		count1 = d[i]
	elif i == 'n':
		count2 = d[i]
while count2:
	print(1, end=' ')
	count2 -= 1
while count1:
	print(0, end=' ')
	count1 -= 1


n = int(input())
x = list(input())
count_z = x.count('z')
count_n = x.count('n')
result = '1' * count_n + '0' * count_z
print(' '.join(list(result)))


n = int(input())
s = input()
z = s.count('z')
o = s.count('o')
ans = [1] * (o - z) + [0] * z
print(*ans)


n = int(input())
z = input().count('z')
print('1 ' * ((n - z * 4) // 3) + '0 ' * z)


n = int(input())
s = input()
z = 0
o = 0
for i in s:
	if i == 'z':
		z += 1
o = (len(s) - z * 4) // 3
for i in range(o):
	print(1, end=' ')
for i in range(z):
	print(0, end=' ')


n = int(input())
st = input()
nc = 0
zc = 0
for i in st:
	if i == 'n':
		nc += 1
	if i == 'z':
		zc += 1
print('1 ' * nc, end='')
print('0 ' * zc, end='')


n = int(input())
s = input()
z = 0
o = 0
s2 = []
for i in range(n):
	if 'z' == s[i]:
		z = z + 1
for i in range(n):
	if 'o' == s[i]:
		o = o + 1
print('1 ' * (o - z) + '0 ' * z)


n = int(input())
s = input()
s = sorted(s)
for i in s:
	if i == 'n':
		print(1, end=' ')
	elif i == 'z':
		print(0, end=' ')


n = int(input())
s = input()
a = s.count('n')
b = s.count('z')
for i in range(a):
	print('1 ', end='')
for j in range(b):
	print('0 ', end='')


n = int(input())
string = input()
zero_count = 0
one_count = 0
for letter in string:
	if letter == 'z':
		zero_count += 1
	elif letter == 'n':
		one_count += 1
result = '1 ' * one_count + '0 ' * zero_count
print(result)


a = int(input())
b = input()
one = 0
zero = 0
lst = list()
for i in b:
	if i == 'z':
		zero += 1
	if i == 'n':
		one += 1
for i in range(one):
	print(1, end=' ')
for i in range(zero):
	print(0, end=' ')


from collections import Counter
n = int(input())
s = [l for l in input()]
l = Counter(s)
for _ in range(l['n']):
	print(1, end=' ')
for _ in range(l['z']):
	print(0, end=' ')


n = int(input())
s = input()
z = s.count('z')
n = s.count('n')
print('1 ' * n, end=' ')
print('0 ' * z)


n = int(input())
jumble = input()
result = list()
for i in range(0, n):
	if jumble[i] == 'z':
		result.append('0')
	elif jumble[i] == 'n':
		result.insert(0, '1')
print(' '.join(result))


n = int(input())
q = input()
s = list(q)
x = s.count('z')
y = s.count('n')
for i in range(0, y):
	print('1', end=' ')
for j in range(0, x):
	print('0', end=' ')


q = int(input())
s = input()
n = s.count('n')
r = s.count('r')
ans = '1 ' * n + '0 ' * r
print(ans)


from collections import Counter
input()
d = Counter(input())
digit = min(min(d['z'], d['r']) + d['n'], min(d['o'], d['e']))
one = min(d['o'], d['n'], d['e'])
ans = '1 ' * one + '0 ' * (digit - one)
print(ans)


n = int(input())
string = input()
(oc, nc, ec, zc, rc) = (0, 0, 0, 0, 0)
for i in range(n):
	char = string[i]
	if char == 'z':
		zc += 1
	elif char == 'e':
		ec += 1
	elif char == 'r':
		rc += 1
	elif char == 'o':
		oc += 1
	elif char == 'n':
		nc += 1
ans = ''
pOne = min(oc, min(nc, ec))
if pOne > 0:
	ans += '1 ' * pOne
	oc -= pOne
	nc -= pOne
	ec -= pOne
pZero = min(min(zc, ec), min(rc, oc))
if pZero > 0:
	ans += '0 ' * pZero
	zc -= pZero
	oc -= pZero
	rc -= pZero
	ec -= pZero
print(ans.strip())


n = int(input())
s = input()
m = {}
m['z'] = 0
m['e'] = 0
m['r'] = 0
m['o'] = 0
m['n'] = 0
for i in s:
	m[i] += 1
tmp = m.copy()
cnt_one = min(m['o'], m['n'], m['e'])
m['o'] -= cnt_one
m['e'] -= cnt_one
cnt_zero = min(m['z'], m['e'], m['r'], m['o'])
m = tmp.copy()
scnt_zero = min(m['z'], m['e'], m['r'], m['o'])
m['o'] -= scnt_zero
m['e'] -= scnt_zero
scnt_one = min(m['o'], m['n'], m['e'])
if int(cnt_one * '1' + cnt_zero * '0', 2) > int(scnt_one * '1' + scnt_zero * '0', 2):
	cnt_one = scnt_one
	cnt_zero = scnt_zero
for i in range(cnt_one):
	print(1, end=' ')
for i in range(cnt_zero):
	print(0, end=' ')


x = int(input())
s = input()
(z, n) = (s.count('z'), s.count('n'))
print('1 ' * n + '0 ' * z)


n = str(input())
a = str(input())
ans = ''
for char in a:
	if char == 'n':
		ans = '1 ' + ans
	elif char == 'z':
		ans = ans + '0 '
	else:
		pass
print(ans.strip())


import sys
input = sys.stdin.readline

def main():
	N = int(input())
	S = input()
	z = S.count('z')
	t = N - z * 4
	A = [1 for k in range(t // 3)] + [0 for l in range(z)]
	print(*A, sep=' ')
main()


n = int(input())
s = input()
z = 0
e = 0
r = 0
o = 0
n = 0
for el in s:
	if el == 'z':
		z += 1
	elif el == 'e':
		e += 1
	elif el == 'r':
		r += 1
	elif el == 'o':
		o += 1
	elif el == 'n':
		n += 1
s = ['1' for i in range(n)] + ['0' for i in range(z)]
print(' '.join(s))


_ = int(input())
s = list(input())
z = len([z for z in s if z == 'z'])
n = len([n for n in s if n == 'n'])
print(' '.join(list('1' * n + '0' * z)))


mylen = int(input())
mystr = input()
mylist = []
if 'n' in mystr:
	ncount = mystr.count('n')
	for i in range(ncount):
		mylist.append(1)
if 'z' in mystr:
	zcount = mystr.count('z')
	for i in range(zcount):
		mylist.append(0)
print(' '.join(map(str, mylist)))


n = int(input())
st = input('')
st = list(st)
f_z = 0
f_n = 0
for i in st:
	if i == 'z':
		f_z += 1
	elif i == 'n':
		f_n += 1
out = ''
for j in range(f_n):
	out = out + '1 '
for k in range(f_z):
	out = out + '0 '
print(out)


x = int(input())
one = zer = 0
n = input()
for i in range(x):
	if n[i] == 'n':
		one += 1
	elif n[i] == 'z':
		zer += 1
print('1 ' * one + '0 ' * zer)


n = int(input())
string = input()
num_0 = len([i for i in string if i == 'z'])
num_1 = int((n - num_0 * 4) / 3)
ans = '1 ' * num_1 + '0 ' * num_0
print(ans)


n = int(input())
s = input()
ones = s.count('n')
for i in range(ones):
	print(1, end=' ')
zeros = (len(s) - ones * 3) // 4
for i in range(zeros):
	print(0, end=' ')


n = int(input())
letters = list(input())
zeroes = letters.count('z')
ones = letters.count('o') - zeroes
max_num = '1' * ones + '0' * zeroes
print(*list(max_num), sep=' ')


n = int(input())
s = input()
(z, o) = (0, 0)
for i in range(n):
	if s[i] == 'z':
		z += 1
	elif s[i] == 'n':
		o += 1
while o:
	print(1, end=' ')
	o -= 1
while z:
	print(0, end=' ')
	z -= 1


s = int(input())
a = input()
z = a.count('z')
e = a.count('e')
r = a.count('r')
o = a.count('o')
n = a.count('n')
one = min(o, n, e)
ze = a.replace('e', '', one)
zo = ze.replace('o', '', one)
i = ze.count('e')
g = ze.count('o')
h = ze.count('z')
re = ze.count('r')
zero = min(h, i, re, g)
p = '1' * one
l = '0' * zero
print(' '.join(p), ' '.join(l))


n = int(input())
s = input()
n = 0
z = 0
for i in s:
	if i == 'z':
		z += 1
	if i == 'n':
		n += 1
for _ in range(n):
	print('1', end=' ')
for _ in range(z):
	print('0', end=' ')


from collections import Counter
n = int(input())
a = Counter(input())
print('1 ' * a.get('n', 0) + '0 ' * a.get('z', 0))


n = int(input())
a = input()
o_count = a.count('o')
n_count = a.count('n')
e_count = a.count('e')
one_minn = min(o_count, n_count, e_count)
z_count = a.count('z')
r_count = a.count('r')
e_count -= one_minn
o_count -= one_minn
zeromin = min(z_count, e_count, r_count, o_count)
for i in range(one_minn):
	print('1', end=' ')
for i in range(zeromin):
	print('0', end=' ')


n = int(input())
s = input()
k = s.count('n')
l = s.count('z')
r = ''
for i in range(k):
	r += '1'
	r += ' '
for i in range(l):
	r += '0'
	r += ' '
print(r)


n = int(input())
s = input()
zero = 0
one = 0
for i in range(n):
	if s[i] == 'z':
		zero += 1
	elif s[i] == 'n':
		one += 1
ans = '1 ' * one + '0 ' * zero
print(ans[:-1])


a = int(input())
b = list(input())
o = b.count('n')
z = b.count('z')
for x in range(o):
	print(1, end=' ')
for x in range(z):
	print(0, end=' ')


n = int(input())
ar = list(input())
A = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for elem in ar:
	A[elem] += 1
(x, y) = (min(A['z'], A['e'], A['r'], A['o']), A['n'])
ans = []
for _ in range(y):
	ans.append(1)
for _ in range(x):
	ans.append(0)
print(*ans)


n = int(input())
l = input()
l = list(l)
z = l.count('z')
one = (n - z * 4) // 3
for i in range(one):
	print(1, end=' ')
for i in range(z):
	print(0, end=' ')


n = int(input())
nStr = input()
a1 = nStr.count('o')
a2 = nStr.count('n')
a3 = nStr.count('e')
r1 = nStr.count('z')
r2 = nStr.count('r')
str1 = min(a1, a2, a3)
S1 = ''
for _ in range(str1):
	S2 = ' '
	S1 = S1 + '1' + S2
one = S1
one = one[0:-1]
a1 = a1 - str1
a2 = a2 - str1
a3 = a3 - str1
str2 = min(a1, a3, r1, r2)
S1 = ''
for _ in range(str2):
	S2 = ' '
	S1 = S1 + '0' + S2
print(one, S1)


n = int(input())
st = list(input())
kol_0 = st.count('z')
kol_1 = (n - 4 * kol_0) // 3
itog = ['1' for i in range(kol_1)]
itog += ['0' for i in range(kol_0)]
print(*itog)


n = int(input())
t = str(input())
p = list(t)
c = p.count('n')
e = p.count('r')
for i in range(c):
	print('1', end=' ')
for j in range(e):
	print('0', end=' ')


n = int(input())
s = input()
c1 = 0
c2 = 0
c1 = s.count('n')
c2 = s.count('z')
for i in range(c1):
	print('1', end=' ')
for j in range(c2):
	print('0')


n = int(input())
st = input()
a = 0
c = 0
for i in range(0, n):
	if st[i] == 'z':
		a += 1
	elif st[i] == 'n':
		c += 1
for i in range(0, c):
	print(1, end=' ')
for i in range(0, a):
	print(0, end=' ')


n = int(input())
string = input()
letters = [0] * 5
for i in string:
	if i == 'z':
		letters[0] += 1
	elif i == 'e':
		letters[1] += 1
	elif i == 'r':
		letters[2] += 1
	elif i == 'o':
		letters[3] += 1
	elif i == 'n':
		letters[4] += 1
ones = min(letters[4], letters[3], letters[1])
zeros = letters[0]
for i in range(ones):
	if i == ones - 1 and zeros != 0:
		print('1', end=' ')
	elif i == ones - 1 and zeros == 0:
		print('1')
	else:
		print('1', end=' ')
for i in range(zeros):
	if i == zeros - 1:
		print('0')
	else:
		print('0', end=' ')


n = int(input())
s = input()
n = 0
r = 0
n += s.count('n')
r += s.count('r')
for i in range(n):
	print('1', end=' ')
for i in range(r):
	print('0', end=' ')


l = ''
input()
i = input()
a = i.count('z')
b = i.count('n')
l += '1 ' * b
l += '0 ' * a
print(l)


asd = int(input())
k = str(input())
k = list(k)
[print(1, end=' ') for i in range(k.count('n'))]
[print(0, end=' ') for i in range(int((len(k) - k.count('n') * 3) / 4))]


q = input()
q = input()
z = q.count('z')
e = q.count('e')
r = q.count('r')
o = q.count('o')
n = q.count('n')
while o * n * e != 0:
	print('1', end=' ')
	o -= 1
	n -= 1
	e -= 1
if z > e:
	z = e
if z > r:
	z = r
if z > o:
	z = o
if z > 0:
	print('0', end='')
	z -= 1
while z > 0:
	print(' 0', end='')
	z -= 1


def main():
	string_length = input()
	input_string = input()
	letters = []
	for letter in input_string:
		letters.append(letter)
	times_zero = letters.count('z')
	times_one = letters.count('n')
	binary_code = ''
	for i in range(times_one):
		binary_code += '1 '
	for i in range(times_zero):
		binary_code += '0 '
	print(binary_code)
main()


n = input()
string = input()
f = int(string.count('n'))
z = int(string.count('z'))
st = ''
while f > 0:
	st += '1 '
	f -= 1
while z > 0:
	st += '0 '
	z -= 1
st = st[:-1]
print(st)


n = int(input())
s = input()
l = {'n': 0, 'z': 0}
for i in range(n):
	if s[i] == 'n' or s[i] == 'z':
		l[s[i]] += 1
l1 = [1] * l['n']
l1.extend([0] * l['z'])
print(*l1)


n = input()
word = list(input())
countz = word.count('z')
countn = word.count('n')
st = ''
tz = ''
for i in range(countn):
	st = st + ' ' + '1'
for j in range(countz):
	tz = tz + ' ' + '0'
print((st + tz)[1:])


n = int(input())
s = input()
z = s.count('z')
n = s.count('n')
print(('1 ' * n + '0 ' * z).strip())


import os
import sys

def get_int():
	return int(input())

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

def get_strs():
	return input().split()

def get_float():
	return float(input())

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

def list_strs():
	return list(input().split())

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

def list_floats():
	return list(map(float, input.split()))

def post(x):
	print(x, end=' ')
T = int(input())
cards = input()
res = []
for t in range(T):
	if cards[t] == 'n':
		res.append(1)
	elif cards[t] == 'z':
		res.append(0)
res.sort(reverse=True)
print(' '.join(map(str, res)))


n = int(input())
string = input()
number_of_ones = string.count('n')
number_of_zeros = string.count('z')
print(' '.join((' 1 ' * number_of_ones + ' 0 ' * number_of_zeros).split()))


m = int(input())
x = input()
z = x.count('z')
n = x.count('n')
for i in range(0, n):
	print(1, end=' ')
for i in range(0, z):
	print(0, end=' ')


from collections import Counter
m = int(input())
n = input()
c = Counter(n)
zero = 0
words = 0
one = 0
zero = c.get('z', 0)
words = c.get('e', 0)
one = words - zero
if one == 0:
	print(*[0 for _ in range(zero)])
elif zero == 0:
	print(*[1 for _ in range(one)])
else:
	print(*[1 for _ in range(one)], end=' ')
	print(*[0 for _ in range(zero)])


countSymbols = int(input())
symbols = input()
countN = 0
countZ = 0
rezStrSymbols = ''
for symbol in symbols:
	if symbol == 'n':
		countN += 1
	elif symbol == 'z':
		countZ += 1
if countN != 0:
	for _ in range(countN):
		rezStrSymbols += '1 '
if countZ != 0:
	for _ in range(countZ):
		rezStrSymbols += '0 '
rezStrSymbols.strip()
print(rezStrSymbols)


n = int(input())
s = input()
nz = 0
nn = 0
for i in range(n):
	if s[i] == 'z':
		nz += 1
	if s[i] == 'n':
		nn += 1
for i in range(nn):
	print(1, end=' ')
for i in range(nz):
	print(0, end=' ')
print()


n = int(input())
s1 = input()
one = s1.count('n')
zero = s1.count('z')
s2 = '1' * one + '0' * zero
for i in range(len(s2)):
	print(int(s2[i]), end=' ')
print('\n')


from collections import Counter
from itertools import repeat, chain
n = int(input())
letters = Counter(input())
nz = letters['z']
no = letters['n']
print(' '.join(chain(repeat('1', no), repeat('0', nz))))


n = int(input())
lst = [x for x in input()]
one = 0
zero = 0
for char in lst:
	if char == 'n':
		one += 1
	if char == 'z':
		zero += 1
print('1 ' * one + '0 ' * zero)


from collections import Counter
n = int(input())
l = []
inp = input().strip()
for s in inp:
	if s == 'z':
		l.append(0)
	elif s == 'n':
		l.append(1)
print(*sorted(l, reverse=True))


import sys
import math
from collections import defaultdict
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
n = int(input())
s = input()
freq = {0: 0, 1: 0}
for c in s:
	if c == 'z':
		freq[0] += 1
	elif c == 'n':
		freq[1] += 1
ans = []
while freq[1] != 0:
	ans.append(1)
	freq[1] -= 1
while freq[0] != 0:
	ans.append(0)
	freq[0] -= 1
print(*ans)


n = input()
l = list(input())
lenght = len(l)
z = l.count('z')
o = (lenght - z * 4) // 3
print('1 ' * o + '0 ' * z)


_ = int(input())
string = input()
num_o = string.count('o')
alpha_one = (num_o, string.count('n'), string.count('e'))
min_num_one = min(alpha_one)
alpha_zero = (string.count('z'), string.count('e'), string.count('r'), num_o - min_num_one)
print('1 ' * min_num_one + '0 ' * min(alpha_zero))


t = int(input())
s = input()
(z, n) = (s.count('z'), s.count('n'))
print('1 ' * n + '0 ' * z)


n = int(input())
s = input()
d = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for i in s:
	d[i] += 1
z = d['z']
o = d['n']
for i in range(o):
	print(1, end=' ')
for i in range(z):
	print(0, end=' ')


m = int(input())
a = list(map(str, input()))
n = a.count('n')
z = a.count('z')
r = a.count('r')
e = a.count('e')
o = a.count('o')
print('1 ' * n + '0 ' * z)


nb = int(input(''))
st = input('')
n = 0
z = 0
for i in st:
	if i == 'n':
		n = n + 1
	elif i == 'z':
		z = z + 1
Binst = n * '1 ' + z * '0 '
print(Binst)


n = int(input())
s = input()
sl = dict()
sl['z'] = 0
sl['e'] = 0
sl['r'] = 0
sl['o'] = 0
sl['n'] = 0
sl['e'] = 0
for i in s:
	if sl.get(i) != -1:
		sl[i] += 1
while sl['o'] != 0 and sl['n'] != 0 and (sl['e'] != 0):
	print(1, end=' ')
	sl['o'] -= 1
	sl['n'] -= 1
	sl['e'] -= 1
while sl['z'] != 0 and sl['e'] != 0 and (sl['r'] != 0) and (sl['o'] != 0):
	print(0, end=' ')
	sl['z'] -= 1
	sl['e'] -= 1
	sl['r'] -= 1
	sl['o'] -= 1


n = int(input())
st = sorted(list(input()))
nums = st.count('o')
ones = st.count('n')
ls = []
for i in range(0, nums):
	if i < ones:
		ls.append('1')
	else:
		ls.append('0')
print(' '.join(ls))


input()
n = input()
o = n.count('n')
z = n.count('z')
print(('1 ' * o).rstrip(), ('0 ' * z).rstrip())


n = input()
s = input()
a = s.count('z')
b = s.count('n')
t = '1' * b + '0' * a
print(*t)


n = int(input())
a = input()
f = a.count('z')
f1 = a.count('n')
for i in range(f1):
	print(1, end=' ')
for i in range(f):
	print(0, end=' ')
print()


l = int(input())
s = str(input())
z = s.count('z')
n = s.count('n')
for i in range(n):
	print('1', end=' ')
for i in range(z):
	print('0', end=' ')


n = int(input())
a = input()
k = []
for i in a:
	if i == 'n':
		k.append(i)
for i in a:
	if i == 'z':
		k.append(i)
s = ''
for i in k:
	if i == 'n':
		s = s + '1' + ' '
	else:
		s = s + '0' + ' '
print(s[0:len(s) - 1])


n = int(input())
s = input()
z = s.count('z')
e = s.count('e')
r = s.count('r')
o = s.count('o')
n = s.count('n')
for i in range(n):
	print(1, end=' ')
for j in range(z):
	print(0, end=' ')


def get_binary(n, string):
	countz = 0
	countn = 0
	result = ''
	for i in string:
		if str(i) == 'n':
			countn += 1
		elif str(i) == 'z':
			countz += 1
	for i in range(countn):
		result = result + '1' + ' '
	for i in range(countz):
		result = result + '0' + ' '
	return result
n = int(input())
string = input()
print(get_binary(n, string))


n = int(input())
s = input()
zero = s.count('z')
one = s.count('n')
print('1 ' * one + '0 ' * zero)


n = int(input())
c = str(input())
curo = 0
curz = 0
for i in c:
	if i == 'n':
		curo += 1
	if i == 'z':
		curz += 1
print('1 ' * curo + '0 ' * curz)


N = int(input())
s = input()
n = 0
z = 0
for i in range(N):
	if s[i] == 'n':
		n += 1
	elif s[i] == 'z':
		z += 1
print('1 ' * n + '0 ' * z)


def main():
	z = 0
	o = 0
	l = int(input())
	x = input()
	for i in range(l):
		if x[i] == 'z':
			z += 1
		elif x[i] == 'n':
			o += 1
	for i in range(o):
		print(1, end=' ')
	for i in range(z):
		print(0, end=' ')
main()


n = int(input())
L = input()
a = L.count('z')
b = L.count('n')
A = [0] * (a + b)
for i in range(b):
	A[i] = 1
for i in A:
	print(i, end=' ')


n = int(input())
onezero = list(input())
store = []
z = onezero.count('z')
n = onezero.count('n')
for i in range(z):
	store.append('0')
for i in range(n):
	store.append('1')
store.sort(reverse=True)
order = ''
for i in store:
	order = order + i + ' '
print(order)


a = int(input())
b = input()
c = b.count('z')
d = b.count('n')
for i in range(d):
	print(1, end=' ')
for i in range(c):
	print(0, end=' ')


input()
s = input()
n = 0
z = s.count('z')
for i in range(s.count('n')):
	print(1, end=' ')
for i in range(z):
	print(0, end=' ')


n = input()
cad = input()
imp = ''
num = min(cad.count('o'), cad.count('e'))
zer = min(cad.count('z'), cad.count('r'))
on = cad.count('n')
if on + zer <= num:
	for i in range(on):
		imp = imp + '1 '
	for i in range(zer):
		imp = imp + '0 '
print(imp)


def bin(s):
	a = s.count('n')
	b = s.count('z')
	str = '1 ' * a + '0 ' * b
	return str
n = input()
s = input()
print(bin(s))


n = int(input())
l = input()
z = l.count('z')
e = l.count('e')
r = l.count('r')
o = l.count('o')
n = l.count('n')
x = 0
y = 0
x += min(o, n, e)
o -= x
n -= x
e -= x
y += min(z, e, r, o)
for i in range(x):
	print(1, end=' ')
for j in range(y):
	print(0, end=' ')
print()


n = int(input())
w = input()
count_n = sum([1 for c in w if c == 'n'])
temp = '1' * count_n + '0' * ((n - count_n * 3) // 4)
print(*[c for c in temp])


t = int(input())
s = str(input())
di = {}
for i in s:
	if i in di:
		di[i] = di[i] + 1
	else:
		di[i] = 1
res = ''
if 'n' in di:
	while di['n'] > 0:
		res = res + '1 '
		di['n'] = di['n'] - 1
if 'z' in di:
	while di['z'] > 0:
		res = res + '0 '
		di['z'] = di['z'] - 1
if res == 0:
	print('0')
print(res)


n = int(input())
cards = input()
ones = ''.join(('1 ' for _ in range(cards.count('n'))))
zeros = ''.join(('0 ' for _ in range(cards.count('z'))))
print(f'{ones}{zeros}')


string_lenght = int(input())
string = input()
letter_n = string.count('n')
letter_z = string.count('z')
one = '1'
zero = '0'
number_of_one = one * letter_n
number_of_zero = zero * letter_z
total_number = ' '.join(number_of_one + number_of_zero)
print(total_number)


n = int(input())
str_val = str(input())
n_count = str_val.count('n')
z_count = str_val.count('z')
lst = [1] * n_count
lst.extend([0] * z_count)
print(' '.join(map(str, lst)))


n = int(input())
s = input()
zc = nc = 0
for i in range(n):
	if s[i] == 'z':
		zc += 1
	elif s[i] == 'n':
		nc += 1
for i in range(nc):
	print('1', end=' ')
for i in range(zc):
	print('0', end=' ')


n = int(input())
s = input()
z = s.count('z')
e = s.count('e')
r = s.count('r')
o = s.count('o')
n = s.count('n')
one = min([o, n, e])
ans = [1] * one
e -= one
o -= one
ans += [0] * min([z, e, r, o])
print(*ans)


tam = input()
word = input()
zeros = []
unos = []
for i in word:
	if i == 'z':
		zeros.append(0)
	if i == 'n':
		unos.append(1)
print(str(unos + zeros).replace("'", '').replace('[', '').replace(']', '').replace(',', ''))


input()
i = input()
print(' '.join(['1' for _ in range(i.count('n'))] + ['0' for _ in range(i.count('z'))]))


n = int(input())
s = input()
x = s.count('n')
y = s.count('r')
while x:
	print(1, end=' ')
	x -= 1
while y:
	print(0, end=' ')
	y -= 1


import time

def calcBinaryNotation(qzeros, qones):
	return '1 ' * qones + '0 ' * qzeros

def countZerosOnes(binStr):
	zeros = 0
	ones = 0
	for x in binStr:
		if x == 'z':
			zeros += 1
		if x == 'n':
			ones += 1
	return (zeros, ones)

def solve():
	lenStr = int(input())
	binStr = input()
	(zeros, ones) = countZerosOnes(binStr)
	nwBin = calcBinaryNotation(zeros, ones)
	print(nwBin)
solve()


n = int(input())
s = input()
a = s.count('n')
c = ''
for i in range(a):
	c += '1 '
for i in range((n - 3 * a) // 4):
	c += '0 '
print(c)


n = int(input())
s = input()
zc = s.count('z')
oc = s.count('n')
ar = ['1' for _ in range(oc)]
ar.extend(['0' for _ in range(zc)])
print(' '.join(ar))


n = int(input())
f = list(str(input()))
k = f.count('o')
l = f.count('z')
s = '1' * (k - l) + '0' * l
for i in s:
	print(i, end=' ')


n = int(input())
a = str(input())
s = a.count('n')
k = a.count('z')
print(s * '1 ' + k * '0 ')


_ = input()
string = input()
ones = 0
zeroes = 0
for i in string:
	if i == 'z':
		zeroes += 1
	if i == 'n':
		ones += 1
answ = []
answ += ['1'] * ones + ['0'] * zeroes
print(*answ)


n = int(input())
s = str(input())
z_c = s.count('z')
n_c = s.count('n')
print(n_c * '1 ', end='')
print(z_c * '0 ')


word_len = int(input())
word = input()
ans = ''
ansf = []
for i in word:
	if i == 'z':
		ansf.append(0)
	elif i == 'n':
		ansf.append(1)
ansf.sort()
for j in ansf:
	ans = str(j) + ' ' + ans
print(ans)


n = int(input())
string = input()
zero_count = 0
one_count = 0
for ch in string:
	if ch == 'n':
		one_count += 1
	elif ch == 'z':
		zero_count += 1
print('1 ' * one_count + '0 ' * zero_count)


n = int(input())
s = input()
cn = s.count('n')
cz = s.count('z')
ans = '1 ' * cn + '0 ' * cz
print(ans)


n = int(input())
s = input()
print('1 ' * s.count('n'), '0 ' * s.count('r'), sep='')


n = int(input())
s = input()
d = {'e': 0, 'n': 0, 'o': 0, 'r': 0, 'z': 0}
for i in s:
	d[i] += 1
one = min(d['o'], d['n'], d['e'])
d['o'] -= one
d['n'] -= one
d['e'] -= one
zero = min(d['o'], d['z'], d['e'], d['r'])
print(' '.join('1' * one + '0' * zero))


import sys
input = sys.stdin.readline
from collections import *
n = int(input())
s = input()[:-1]
nc = s.count('n')
zc = s.count('z')
ans = [1] * nc + [0] * zc
print(*ans)


n = int(input())
s = input()
d = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for i in s:
	d[i] += 1
o = min(d['o'], d['n'], d['e'])
d['o'] -= o
d['n'] -= o
d['e'] -= o
p = min(d['z'], d['r'], d['e'], d['o'])
l = [1] * o + [0] * p
print(*l)


from collections import Counter
from math import ceil, floor

def fun(st):
	dct = Counter(st)
	count1 = 0
	count0 = 0
	if 'z' in dct:
		if 'n' in dct:
			count1 = dct.get('n')
			count0 = dct.get('z')
		else:
			count0 = dct.get('z')
	else:
		count1 = dct.get('n')
	print(*count1 * [1] + [0] * count0)
for _ in range(1):
	var = input()
	st = input()
	fun(st)


n = int(input())
s = input()
d = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for i in s:
	d[i] += 1
print(' '.join(['1'] * d['n']) + ' ' + ' '.join(['0'] * d['z']))


n = int(input())
b = input()
nz = 0
nn = 0
no = 0
for i in b:
	if i == 'z' or i == 'r':
		nz += 1
	if i == 'n':
		nn += 1
	if i == 'o' or i == 'e':
		no += 1
if nn != 0:
	for j in range(nn):
		print('1', end=' ')
		no -= 2
if no == nz:
	for k in range(no // 2):
		print('0', end=' ')


n = int(input())
s = input()
print(*[1] * s.count('n'), *[0] * s.count('z'), sep=' ')


n = int(input())
l = input()
d = {}
d['o'] = l.count('o')
d['n'] = l.count('n')
d['e'] = l.count('e')
d['z'] = l.count('z')
d['r'] = l.count('r')
a = min(d['o'], d['e'])
b = min(a, d['n'])
c = min(d['z'], d['r'], d['o'] - b, d['e'] - b)
for i in range(b):
	print(1, end=' ')
for i in range(c):
	print(0, end=' ')


n = int(input())
A = list(str(input()))
n = A.count('n')
z = A.count('z')
for i in range(n):
	print(1, end=' ')
for i in range(z):
	print(0, end=' ')


n = int(input())
s = input()
nr1 = s.count('n')
print('1 ' * nr1, end='')
nr2 = int((n - 3 * nr1) / 4)
print('0 ' * nr2)


num = int(input())
str = input()
print('1 ' * str.count('n') + '0 ' * str.count('z'))


length = input('')
n = int(length)
i = 0
counts = dict()
string = input('')
while i < n:
	word = string[i]
	counts[word] = counts.get(word, 0) + 1
	i = i + 1
if 'z' in counts and 'n' in counts:
	z = counts['z']
	n = counts['n']
	a = list()
	for i in range(n):
		a.append('1')
	for i in range(z):
		a.append('0')
	for i in range(len(a)):
		print(a[i], end=' ')
elif 'z' in counts:
	z = counts['z']
	a = list()
	for i in range(z):
		a.append('0')
	for i in range(z):
		print(a[i], end=' ')
elif 'n' in counts:
	var = counts['n']
	a = list()
	for i in range(var):
		a.append('1')
		print(a[i], end=' ')


n = int(input())
s = list(str(input()))
t = []
if 'n' in s:
	t = ['1' for i in range(s.count('n'))]
if 'z' in s:
	k = ['0' for i in range(s.count('z'))]
	t = t + k
print(' '.join(t))


t = int(input())
a = input()
z = a.count('z')
o = a.count('o')
k = ''
s = '0' * z
k += s
s1 = '1 ' * abs(z - o)
k += s1
print(' '.join(sorted(list(k), reverse=True)))


n = int(input())
s = list(input())
z = s.count('z')
o = s.count('n')
lis = [1] * o + [0] * z
print(*lis)


n = input()
st = input()
l_st = list(st)
res = ['1'] * l_st.count('n') + ['0'] * l_st.count('z')
print(' '.join(res))


n = int(input())
l = list(input())
d = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for i in l:
	d[i] += 1
l = min(d['o'], d['n'], d['e'])
m = min(d['z'], d['e'] - l, d['r'], d['o'] - l)
print(*[1] * l, sep=' ', end=' ')
print(*[0] * m, sep=' ')


def card():
	n = int(input())
	string = input()
	numberOfZero = 0
	for i in range(len(string)):
		if string[i] == 'z':
			numberOfZero = numberOfZero + 1
	numberOfOne = (n - numberOfZero * 4) // 3
	result = '1 ' * numberOfOne + '0 ' * numberOfZero
	if result[-1] == ' ':
		print(result[0:len(result) - 1])
	else:
		print(result)
card()


from collections import Counter
n = input()
s = input()
c = Counter(s)
if c['o'] == c['n'] + c['z']:
	for i in range(c['n']):
		print(1, end=' ')
	for i in range(c['r']):
		print(0, end=' ')


n = int(input())
s = input()
d = dict()
for i in s:
	if i in d.keys():
		d[i] += 1
	else:
		d[i] = 1
x = 0
y = 0
if 'n' in d.keys():
	x = d['n']
if 'z' in d.keys():
	y = d['z']
for i in range(x):
	print('1', end=' ')
for i in range(y):
	print('0', end=' ')


n = int(input())
s = list(input())
o1 = s.count('o')
n1 = s.count('n')
e1 = s.count('e')
z1 = s.count('z')
r1 = s.count('r')
x = min(o1, n1, e1)
o1 = o1 - x
e1 = e1 - x
y = min(z1, e1, r1, o1)
z = []
for i in range(x):
	z.append('1')
for j in range(y):
	z.append('0')
print(' '.join(z))


n = int(input())
s = input()
one = 0
zero = 0
for i in range(n):
	if s[i] == 'z':
		zero += 1
	elif s[i] == 'n':
		one += 1
while one > 0:
	print('1', end=' ')
	one -= 1
while zero > 0:
	print('0', end=' ')
	zero -= 1


def main(args):
	input()
	n = list(input())
	a = n.count('n')
	b = n.count('z')
	x = []
	for i in range(a):
		x.append(1)
	for i in range(b):
		x.append(0)
	print(*x)
import sys
sys.exit(main(sys.argv))


n = int(input())
s = input()
z = s.count('z')
o = n - z * 4
l = [1] * (o // 3)
l += [0] * z
print(*l)


n = int(input())
s = input()
z = s.count('r')
o = s.count('n')
for _ in range(o):
	print(1, end=' ')
for _ in range(z):
	print(0, end=' ')


import itertools
import math
import sys
import heapq
from collections import Counter
from collections import deque
from fractions import gcd
from functools import reduce
sys.setrecursionlimit(4100000)
INF = 1 << 60
MOD = 10 ** 9 + 7
n = int(input())
s = input()
cnt = [0] * 5
for i in s:
	a = ['z', 'e', 'r', 'o', 'n']
	cnt[a.index(i)] += 1
for i in range(cnt[-1]):
	print(1, end=' ')
for i in range(min(cnt[:-1])):
	print(0, end=' ')


n = int(input())
s = input()
x = s.count('n')
y = s.count('z')
print(' '.join('1' * x), end=' ')
print(' '.join('0' * y))


n = int(input())
s = input()
k = s.count('z')
for i in range(int((n - k * 4) / 3)):
	print('1', end=' ')
for i in range(k):
	print('0', end=' ')


while True:
	f = '1 '
	z = '0 '
	try:
		num = int(input(''))
		ls = input('')
	except:
		break
	one = ls.count('n')
	zero = ls.count('r')
	f *= one
	z *= zero
	print(f + z)


n = int(input())
letters = input()
zero = 0
one = 0
for i in range(len(letters)):
	if letters[i] == 'z':
		zero = zero + 1
	elif letters[i] == 'n':
		one = one + 1
ans = []
for i in range(one):
	ans.append(1)
for i in range(zero):
	ans.append(0)
print(*ans)


length = input()
inp = input()
one = inp.count('n')
zero = inp.count('z')
print('1 ' * one, end='')
print('0 ' * zero)


from collections import Counter
n = int(input())
string = input()
d = dict(Counter(string))
c1 = 0
c2 = 0
if 'z' in d.keys():
	c1 = d.get('z')
if 'n' in d.keys():
	c2 = d.get('n')
s = ''
s += c2 * '1' + c1 * '0'
s1 = ''
for i in s:
	s1 += i + ' '
print(s1.strip())


import atexit
import io
import sys
_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 main():
	n = int(input())
	s = input()
	c0 = s.count('z')
	c1 = s.count('n')
	for i in range(c1):
		print(1, end=' ')
	for i in range(c0):
		print(0, end=' ')
main()


N = int(input())
a = input()
o = 0
z = 0
n = 0
e = 0
r = 0
for i in range(N):
	if a[i] == 'o':
		o = o + 1
	elif a[i] == 'z':
		z = z + 1
	elif a[i] == 'n':
		n = n + 1
	elif a[i] == 'e':
		e = e + 1
	elif a[i] == 'r':
		r = r + 1
for i in range(n):
	print(1, end=' ')
for i in range(z):
	print(0, end=' ')


n = int(input())
s = input()
count_n = s.count('n')
count_z = s.count('z')
while count_n > 0:
	print('1 ', end='')
	count_n -= 1
while count_z > 0:
	print('0 ', end='')
	count_z -= 1


x = []
(e, z, o, r, n) = (0, 0, 0, 0, 0)
s = input()
a = input()
for i in range(len(a)):
	if a[i] == 'e':
		e += 1
	elif a[i] == 'z':
		z += 1
	elif a[i] == 'o':
		o += 1
	elif a[i] == 'r':
		r += 1
	elif a[i] == 'n':
		n += 1
while o >= 1 and n >= 1 and (e >= 1):
	x.append(1)
	o -= 1
	n -= 1
	e -= 1
while z >= 1 and e >= 1 and (r >= 1) and (o >= 1):
	x.append(0)
	z -= 1
	e -= 1
	r -= 1
	o -= 1
print(*x)


from collections import Counter
len = input()
arr = input()
count = Counter(arr)
res = []
num_one = count['n']
num_zero = count['z']
while num_one > 0:
	res.append('1')
	num_one -= 1
while num_zero > 0:
	res.append('0')
	num_zero -= 1
print(*res)


n = int(input())
s = input()
zcnt = s.count('z')
ncnt = s.count('n')
print('1 ' * ncnt + '0 ' * zcnt)


n = int(input())
Word = input()
Chars = [char for char in Word]
ans = ''
OnesCount = Chars.count('n')
ZerosCount = Chars.count('z')
for i in range(OnesCount):
	ans += ''.join('1 ')
for i in range(ZerosCount):
	ans += ''.join('0 ')
print(ans)


N = int(input())
s = input()
n = s.count('n')
z = s.count('z')
print('1 ' * n + '0 ' * z)


n = int(input())
s = input()
a = []
d = {}
for c in s:
	d[c] = d.get(c, 0) + 1
if d.get('n'):
	a = ['1'] * d.get('n')
if d.get('z'):
	a += ['0'] * d.get('z')
print(*a)


n = int(input())
let = list(map(str, list(input())))
ans = []
for i in range(let.count('n')):
	ans.append('1')
for i in range(let.count('z')):
	ans.append('0')
print(' '.join(ans))


import math
import itertools
import collections

def getdict(n):
	d = {}
	if type(n) is list:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def cdiv(n, k):
	return n // k + (n % k != 0)

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

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

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

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

def wr(arr):
	return ' '.join(map(str, arr))

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

def revn(n):
	m = 0
	while n > 0:
		m = m * 10 + n % 10
		n = n // 10
	return m
n = ii()
s = input()
onec = min(s.count('o'), s.count('n'), s.count('e'))
zeroc = min(s.count('z'), s.count('e') - onec, s.count('r'), s.count('o') - onec)
ones = []
if onec > 0:
	ones = [1] * onec
zeros = []
if zeroc > 0:
	zeros = [0] * zeroc
ones.extend(zeros)
print(wr(ones))


n = int(input())
cards = input()
zero = cards.count('z')
one = (n - zero * 4) // 3
for _ in range(one):
	print(1, end=' ')
for _ in range(zero):
	print(0, end=' ')


n = int(input())
s = input()
li = []
z = 0
o = 0
z = s.count('z')
o = s.count('n')
for i in range(o):
	li.append(1)
for j in range(z):
	li.append(0)
for i in range(len(li)):
	if i != len(li) - 1:
		print(li[i], end=' ')
	else:
		print(li[i], end='')
print()


n = input()
lets = list(map(str, input()))
ans = []
nums = {}
for l in lets:
	if l in nums:
		nums[l] += 1
	else:
		nums[l] = 1
ones = 0
zeros = 0
if 'n' in nums:
	ones = nums['n']
if 'z' in nums:
	zeros = nums['z']
for f in range(ones):
	ans.append('1')
for l in range(zeros):
	ans.append('0')
print(' '.join(ans))


import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue

class Scanner:

	@staticmethod
	def int():
		return int(sys.stdin.readline().rstrip())

	@staticmethod
	def string():
		return sys.stdin.readline().rstrip()

	@staticmethod
	def map_int():
		return [int(x) for x in Scanner.string().split()]

	@staticmethod
	def string_list(n):
		return [input() for i in range(n)]

	@staticmethod
	def int_list_list(n):
		return [Scanner.map_int() for i in range(n)]

	@staticmethod
	def int_cols_list(n):
		return [int(input()) for i in range(n)]

class Math:

	@staticmethod
	def gcd(a, b):
		if b == 0:
			return a
		return Math.gcd(b, a % b)

	@staticmethod
	def lcm(a, b):
		return a * b // Math.gcd(a, b)

	@staticmethod
	def divisor(n):
		res = []
		i = 1
		for i in range(1, int(n ** 0.5) + 1):
			if n % i == 0:
				res.append(i)
				if i != n // i:
					res.append(n // i)
		return res

	@staticmethod
	def round_up(a, b):
		return -(-a // b)

	@staticmethod
	def is_prime(n):
		if n < 2:
			return False
		if n == 2:
			return True
		if n % 2 == 0:
			return False
		d = int(n ** 0.5) + 1
		for i in range(3, d + 1, 2):
			if n % i == 0:
				return False
		return True

class PriorityQueue:

	def __init__(self, l=[]):
		self.q = l
		heapq.heapify(self.q)
		return

	def push(self, n):
		heapq.heappush(self.q, n)
		return

	def pop(self):
		return heapq.heappop(self.q)
MOD = int(1000000000.0) + 7
INF = int(1000000000000000.0)

def main():
	N = Scanner.int()
	S = Scanner.string()
	M = {}
	for s in 'zeron':
		M[s] = 0
	for s in S:
		M[s] += 1
	ans = []
	c = min(M['o'], M['n'], M['e'])
	for _ in range(c):
		ans.append(1)
	c = M['o'] - c
	for _ in range(c):
		ans.append(0)
	print(*ans)
main()


n = int(input())
sr = input()
o = 0
z = 0
for x in sr:
	if x == 'n':
		o += 1
	if x == 'z':
		z += 1
while o != 0:
	print('1', end=' ')
	o -= 1
while z != 0:
	print('0', end=' ')
	z -= 1


n = int(input())
line = input()
zero = line.count('z')
one = line.count('n')
if one >= 1:
	for i in range(one):
		print(end=f'{1} ')
if zero >= 1:
	for i in range(zero):
		print(end=f'{0} ')


while True:
	x = int(input(''))
	if 1 <= x <= 10 ** 5:
		break
while True:
	y = input('')
	if len(y) == x:
		break
z1 = y.count('z')
z2 = y.count('e')
z3 = y.count('r')
z4 = y.count('o')
o1 = y.count('n')
t1 = [z1, z2, z3, z4]
t2 = [z2, z4, o1]
t3 = sorted(t1)
t4 = sorted(t2)
k = list()
for i in range(t4[0]):
	k.append('1')
for i in range(t3[0]):
	k.append('0')
b = ' '.join(k)
print(b)


def input_func():
	str_len = int(input())
	while True:
		str_val = input()
		if len(str_val) != str_len:
			continue
		else:
			return str_val

def solve(str_val):
	no_of_z = str_val.count('z')
	no_of_n = str_val.count('n')
	while no_of_n > 0:
		print('1', end=' ')
		no_of_n -= 1
	while no_of_z > 0:
		print('0', end=' ')
		no_of_z -= 1
str_val = input_func()
solve(str_val)


n = int(input())
s = input()
l = []
x = s.count('n')
while x > 0:
	l.append(1)
	x -= 1
z = s.count('z')
while z > 0:
	l.append(0)
	z -= 1
print(*l)


import math, sys
from collections import Counter, defaultdict
from sys import stdin, stdout
lili = lambda : list(map(int, sys.stdin.readlines()))
li = lambda : list(map(int, input().split()))
n = int(input())
s = input()
d = Counter(s)
c = e = 0
c = d['z']
e = d['n']
while e != 0:
	print(1, end=' ')
	e -= 1
while c != 0:
	print(0, end=' ')
	c -= 1


n = int(input())
k = input()
a = 0
b = 0
for i in range(n):
	if k[i] == 'n':
		a += 1
	if k[i] == 'z':
		b += 1
for i in range(a):
	print(1, end=' ')
for i in range(b):
	print(0, end=' ')


def main():
	ones = 0
	zeros = 0
	N = int(input())
	s = str(input())
	for n in range(N):
		if s[n] == 'z':
			zeros += 1
		elif s[n] == 'n':
			ones += 1
	for i in range(ones):
		print('1 ', end='')
	for i in range(zeros):
		if zeros != 0:
			print('0 ', end='')
		else:
			print('0')
main()


n = int(input())
s = input()
a = []
(s1, s2) = (0, 0)
for i in s:
	if i == 'z':
		s1 += 1
	if i == 'n':
		s2 += 1
b = []
for i in range(s2):
	b.append('1')
for i in range(s1):
	b.append('0')
print(' '.join(b))


n = int(input())
txt = input()
dct = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for i in list(txt):
	dct[i] += 1
ones = min([dct['o'], dct['n'], dct['e']])
dct['o'] -= ones
dct['n'] -= ones
dct['e'] -= ones
zeroes = min([dct['o'], dct['z'], dct['e'], dct['r']])
res = ['1 ' for i in range(ones)] + ['0 ' for i in range(zeroes)]
print(''.join(res))


n = int(input())
a = input()
x = a.count('r')
y = a.count('o')
for i in range(y - x):
	print('1', end=' ')
for i in range(x):
	print('0', end=' ')
print(' ')


n = input()
m = {0: 0, 1: 0}
z = 0
o = 0
inp_string = input()
for s in inp_string:
	if s == 'z':
		z += 1
	if s == 'o':
		o += 1
for i in range(abs(z - o)):
	print('1', end=' ')
for i in range(z):
	print('0', end=' ')


input()
stringArr = input()
n = stringArr.count('n')
z = stringArr.count('z')
print('1 ' * n + '0 ' * z)


n = int(input())
a = input()
print(*[1] * a.count('n'), *[0] * a.count('z'))


n = int(input())
s = input()
a = s.count('z')
b = s.count('n')
print(b * '1 ' + a * '0 ')


n = int(input())
str1 = input()
countz = 0
countn = 0
for i in str1:
	if i == 'z':
		countz += 1
	if i == 'n':
		countn += 1
for i in range(0, countn):
	print('1 ', end='')
for i in range(0, countz):
	print('0 ', end='')


n = int(input())
s = input()
list1 = []
list2 = []
S = [i for i in s]
answer = 0
for i in S:
	if i == 'z' or i == 'n':
		list1.append(i)
for j in list1:
	if j == 'z':
		list2.append('0')
	else:
		list2.append('1')
list2.sort()
list2.reverse()
answer = ' '.join(list2)
print(answer)


n = int(input())
s = input()
k = s.count('z')
print('1 ' * ((len(s) - 4 * k) // 3) + '0 ' * k)


number = int(input())
s = input()
z = 0
n = 0
z = s.count('z')
n = s.count('n')
print(*list('1' * n), *list('0' * z))


n = int(input())
s = input()
L = []
c = 0
for i in s:
	if i == 'n':
		c = c + 1
		L.append('1')
for i in range((n - c * 3) // 4):
	L.append('0')
for i in L:
	print(i, end=' ')


n = input()
s = input()
s = list(s)
s.sort()
a = ''
for i in s:
	if i == 'n':
		a += '1 '
	if i == 'z':
		a += '0 '
print(a)


def bin(s):
	numOf0 = 0
	for i in s:
		if i == 'z':
			numOf0 += 1
	numOf1 = int((len(s) - numOf0 * 4) / 3)
	s = ''
	for i in range(0, numOf1):
		s += '1 '
	for i in range(0, numOf0):
		s += '0 '
	print(s.rstrip())
	return
_ = input()
s = input()
bin(s)


j = int(input())
l = ''
s = input()
n = s.count('n')
e = s.count('e')
z = s.count('z')
r = s.count('r')
o = s.count('o')
l = '1' * n + '0' * r
print(*list(''.join(l)))


n = int(input())
s = input()
ones = s.count('n')
zeros = s.count('z')
ans = '1 ' * ones + '0 ' * zeros
print(ans)


n = int(input())
st = str(input())
one = 0
zero = 0
for i in range(n):
	if st[i] == 'n':
		one += 1
	elif st[i] == 'z':
		zero += 1
if one >= 1 and zero == 0:
	print('1 ' * (int(one) - int(1)) + '1')
elif one == 0 and zero == 1:
	print('0 ' * (int(zero) - int(1)) + '0')
elif one >= 1 and zero == 1:
	print('1 ' * one + '0')
else:
	print('1 ' * one + '0 ' * (int(zero) - int(1)) + '0')


def split(word):
	return [char for char in word]
n = int(input())
lst = list(split(input()))
for i in range(0, n):
	if lst[i] == 'n':
		print(1, end=' ')
	else:
		continue
for i in range(0, n):
	if lst[i] == 'z':
		print(0, end=' ')
	else:
		continue


letters = int(input())
string = input()
o = string.count('o')
n = string.count('n')
e = string.count('e')
z = string.count('z')
r = string.count('r')
ones = min(o, n, e)
o -= ones
n -= ones
e -= ones
zeros = min(z, e, r, o)
s = ''
for i in range(ones):
	s = f'{s}1 '
for j in range(zeros):
	s = f'{s}0 '
print(s[:-1])


input()
s = input()
print(' '.join(['1'] * s.count('n') + ['0'] * s.count('z')))


n = int(input())
s = list(input())
zeros = s.count('z')
ones = s.count('n')
result = ''
if ones > 0:
	for i in range(ones - 1):
		result += '1 '
	result += '1'
if zeros > 0:
	if ones > 0:
		result += ' '
	for i in range(zeros - 1):
		result += '0 '
	result += '0'
print(result)


unused = input()
s = input()
one = 0
zer = 0
for i in s:
	if i == 'n':
		one += 1
	if i == 'z':
		zer += 1
print('1 ' * one + '0 ' * zer)


def facstr(string):
	n = len(string)
	A = [string[i] for i in range(n)]
	return A
k = int(input())
w = str(input())
z = w.count('z')
n = w.count('n')
r = w.count('r')
e = w.count('e')
o = w.count('o')
miz = min(z, r, e, o)
o -= miz
e -= miz
miN = min(n, o, e)
l = ''
for i in range(miN):
	l = l + '1 '
for j in range(miz - 1):
	l = l + '0 '
if miz != 0:
	l = l + '0'
print(l)


var = input()
st = input()
one = st.count('n')
zero = st.count('z')
for _ in range(one):
	print('1 ', end=' ')
for _ in range(zero):
	print('0 ', end=' ')
print()


n = int(input())
word = input()
n_count = 0
z_count = 0
for c in word:
	if c == 'n':
		n_count = n_count + 1
	if c == 'z':
		z_count = z_count + 1
for i in range(0, n_count):
	print('1', end=' ')
for i in range(0, z_count):
	print('0', end=' ')
print()


n = int(input())
l = list(input())
f = True
s = {}
for i in l:
	s[i] = s.get(i, 0) + 1
one = min(s.get('o', 0), s.get('e', 0), s.get('n', 0))
print('1 ' * one, min(s.get('z', 0), s.get('e', 0) - one, s.get('r', 0), s.get('o', 0) - one) * '0 ', sep='')


t = int(input())
s = input()
l = []
dict = {'z': 0, 'e': 0, 'o': 0, 'r': 0, 'n': 0}
for i in range(len(s)):
	dict[s[i]] = dict[s[i]] + 1
z = 0
n = 0
maxm = 0
one = 0
zero = 0
for i in range(len(s)):
	if s[i] == 'z':
		z = z + 1
	if s[i] == 'n':
		n = n + 1
if dict['o'] >= n and dict['e'] >= n:
	dict['o'] = dict['o'] - n
	dict['e'] = dict['e'] - n
	one = n
	dict['n'] = 0
elif dict['o'] >= n and dict['e'] <= n:
	dict['o'] = dict['o'] - n
	n = n - dict['e']
	one = dict['e']
	dict['e'] = 0
elif dict['o'] <= n and dict['e'] >= n:
	n = n - dict['o']
	dict['e'] = dict['e'] - n
	one = dict['o']
	dict['o'] = 0
else:
	maxm = min(dict['o'], dict['e'])
	n = n - maxm
	dict['e'] = dict['e'] - maxm
	one = maxm
	dict['o'] = dict['e'] - maxm
maxm = min(dict['e'], dict['o'], dict['r'], dict['z'])
zero = maxm
for i in range(one):
	l.append('1')
for i in range(zero):
	l.append('0')
s = ' '.join(l)
print(s)


n = int(input())
s = input()
a = []
b = []
for i in s:
	if i == 'z':
		a.append(i)
	if i == 'n':
		a.append(i)
for i in range(a.count('n')):
	b.append('1')
for i in range(a.count('z')):
	b.append('0')
for i in b:
	print(i, end=' ')


x = input()
y = input()
one = y.find('n')
if one >= 0:
	print(1, end=' ')
while one >= 0:
	one = y.find('n', one + 1)
	if one >= 0:
		print(1, end=' ')
zero = y.find('z')
if zero >= 0:
	print(0, end=' ')
while zero >= 0:
	zero = y.find('z', zero + 1)
	if zero >= 0:
		print(0, end=' ')


n = int(input())
num = list(input())
zs = num.count('z')
os = num.count('n')
for i in range(os):
	print(1, end=' ')
for i in range(zs):
	print(0, end=' ')
print()


zeroes = 0
ones = 0
n = input()
s = input()
for i in range(len(s)):
	if s[i] == 'n':
		ones += 1
	elif s[i] == 'z':
		zeroes += 1
s1 = ''
for i in range(ones):
	s1 += '1' + ' '
for i in range(zeroes):
	s1 += '0' + ' '
print(s1)


n = int(input())
s = input()
z = s.count('z')
o = (n - z * 4) // 3
print(' '.join(['1' if _ < o else '0' for _ in range(z + o)]))


n = int(input())
s = input()
v = [0, 0]
for i in s:
	if i == 'z':
		v[0] += 1
	elif i == 'n':
		v[1] += 1
for i in range(v[1]):
	print(1, end=' ')
for i in range(v[0]):
	print(0, end=' ')


n = int(input(''))
s = input('')
if len(s) == n:
	l = s
l = list(s)
flag = 0
for i in range(0, len(s)):
	if s[i] == 'o' or 'n' or 'e' or 'z' or 'r':
		flag = 0
	else:
		flag = 1
if flag == 0:
	l.sort()
	d = {}
	a = s.count('o', 0, len(s))
	b = s.count('n', 0, len(s))
	c = s.count('e', 0, len(s))
	h = s.count('z', 0, len(s))
	e = s.count('r', 0, len(s))
	d['o'] = a
	d['n'] = b
	d['e'] = c
	d['z'] = h
	d['r'] = e
	max = 0
	q = [a, b, c]
	q.sort()
	s = ''
	if q[0] >= 1 and q[1] >= 1 and (q[2] >= 1):
		for i in range(0, q[0]):
			s = s + '1'
		q[1] = q[1] - q[0]
		q[2] = q[2] - q[0]
	q.remove(q[0])
	q.append(h)
	q.append(e)
	q.sort()
	if q[0] >= 1 and q[1] >= 1 and (q[2] >= 1) and (q[3] >= 1):
		for i in range(0, q[0]):
			s = s + '0'
	for i in s:
		print(i, end=' ')


n = int(input())
a = input()
ff = {}
ff['z'] = 0
ff['e'] = 0
ff['r'] = 0
ff['o'] = 0
ff['n'] = 0
for i in a:
	ff[i] += 1
if ff['o'] and ff['n'] and ff['e']:
	min_ = min(ff['o'], ff['n'], ff['e'])
	ff['o'] -= min_
	ff['n'] -= min_
	ff['e'] -= min_
	zeros = min(ff['z'], ff['e'], ff['r'], ff['o'])
	print(' '.join(['1'] * min_), ' '.join(['0'] * (0 if zeros < 1 else zeros)), sep=' ')
else:
	zeros = min(ff['z'], ff['e'], ff['r'], ff['o'])
	print(' '.join(['0'] * zeros))


n = int(input())
s1 = input()
s = []
for k in s1:
	s.append(k)
ns = s.count('n')
zs = s.count('z')
ans = []
for i in range(ns):
	ans.append(1)
for j in range(zs):
	ans.append(0)
print(*ans)


n = int(input())
s = input()
d = {'o': 0, 'n': 0, 'e': 0, 'z': 0, 'r': 0}
for x in s:
	d[x] += 1
num = '1 ' * d['n'] + '0 ' * d['z']
print(num)


n = int(input())
s = str(input())
arr = []
arr2 = []
for i in range(len(s)):
	if s[i] == 'z':
		arr.append(0)
	elif s[i] == 'n':
		arr2.append(1)
arr3 = arr2 + arr
print(*arr3, sep=' ')


n = int(input())
s = input()
c = 0
c1 = 0
for i in range(0, n):
	if s[i] == 'n':
		c1 += 1
	elif s[i] == 'z':
		c += 1
for i in range(c1):
	print('1', end=' ')
for i in range(c):
	print('0', end=' ')


n = int(input())
a = input()
for i in a:
	if i == 'n':
		print(1, end=' ')
		n -= 3
for i in range(n // 4):
	print(0, end=' ')


l = int(input())
s = input()
O = s.count('o')
Z = s.count('z')
if Z > 0:
	O = O - Z
res = ''
for i in range(O):
	res = res + '1 '
for i in range(Z):
	res = res + '0 '
print(res)


from collections import Counter
n = int(input())
s = input()
temp = Counter(s)
res = '1 ' * temp['n'] + '0 ' * temp['r']
print(res.rstrip())


from collections import Counter
length = int(input())
word = input()
counts = Counter(word)
ones = counts.get('n') if counts.get('n') is not None else 0
zeros = counts.get('z') if counts.get('z') is not None else 0
for _ in range(0, ones):
	print('1 ', end='')
for _ in range(0, zeros):
	print('0 ', end='')
print()


t = int(input())
my_str = input()
z = 0
n = 0
for char in my_str:
	if char == 'z':
		z += 1
	if char == 'n':
		n += 1
for j in range(n):
	print('1', end=' ')
for i in range(z):
	print('0', end=' ')


_ = input()
second_input = input()
n = second_input.count('n')
if n:
	print(' '.join(('1' for _ in range(n))), end=' ')
	print(' '.join(('0' for _ in range(second_input.count('z')))))
else:
	print(' '.join(('0' for _ in range(second_input.count('z')))))


import sys
from operator import itemgetter
from fractions import gcd
from math import ceil, floor, sqrt
from copy import deepcopy
from collections import Counter, deque
import heapq
from functools import reduce
sys.setrecursionlimit(200000)
input = sys.stdin.readline

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

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

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

def fi():
	return float(input())

def mfi():
	return map(float, input().rstrip().split())

def lmfi():
	return list(map(float, input().rstrip().split()))

def li():
	return list(input().rstrip())

def debug(*args, sep=' ', end='\n'):
	print('debug:', *args, file=sys.stderr, sep=sep, end=end) if not __debug__ else None

def exit(*arg):
	print(*arg)
	sys.exit()

def main():
	N = ii()
	S = li()
	(cnt1, cnt2) = (0, 0)
	for x in S:
		if x == 'z':
			cnt1 += 1
		elif x == 'n':
			cnt2 += 1
	a = [1] * cnt2
	b = [0] * cnt1
	print(*a, *b)
	return
main()


n = int(input())
l = list(map(str, input().strip()))
cnofn = l.count('n')
cnofz = l.count('z')
for _ in range(cnofn):
	print(1, end=' ')
for _ in range(cnofz):
	print(0, end=' ')
print()


n = int(input())
inp2 = list(input())
counter = 0
Antwort = ''
for i in inp2:
	if i == 'n':
		counter += 1
		Antwort += '1 '
for i in range(int((n - 3 * counter) / 4)):
	Antwort += '0 '
print(Antwort[:-1])


s = int(input())
S = input()
a1 = S.count('n')
a2 = S.count('z')
for i in range(a1):
	print(1, end=' ')
for i in range(a2):
	print(0, end=' ')


import math
from decimal import Decimal
import heapq

def na():
	n = int(input())
	b = [int(x) for x in input().split()]
	return (n, b)

def nab():
	n = int(input())
	b = [int(x) for x in input().split()]
	c = [int(x) for x in input().split()]
	return (n, b, c)

def dv():
	(n, m) = map(int, input().split())
	return (n, m)

def dva():
	(n, m) = map(int, input().split())
	a = [int(x) for x in input().split()]
	b = [int(x) for x in input().split()]
	return (n, m, b)

def eratosthenes(n):
	sieve = list(range(n + 1))
	for i in sieve:
		if i > 1:
			for j in range(i + i, len(sieve), i):
				sieve[j] = 0
	return sorted(set(sieve))

def lol(lst, k):
	k = k % len(lst)
	ret = [0] * len(lst)
	for i in range(len(lst)):
		if i + k < len(lst) and i + k >= 0:
			ret[i] = lst[i + k]
		if i + k >= len(lst):
			ret[i] = lst[i + k - len(lst)]
		if i + k < 0:
			ret[i] = lst[i + k + len(lst)]
	return ret

def nm():
	n = int(input())
	b = [int(x) for x in input().split()]
	m = int(input())
	c = [int(x) for x in input().split()]
	return (n, b, m, c)

def dvs():
	n = int(input())
	m = int(input())
	return (n, m)

def Factor(n):
	Ans = []
	d = 2
	while d * d <= n:
		if n % d == 0:
			Ans.append(d)
			n //= d
		else:
			d += 1
	if n > 1:
		Ans.append(n)
	return Ans
n = int(input())
s = input()
k1 = 0
k2 = 0
tc = 'zr'
for i in s:
	if i in tc:
		k1 += 1
	elif i == 'n':
		k2 += 1
k1 //= 2
s = '1' * k2 + '0' * k1
for i in s:
	print(i, end=' ')


from sys import stdin
from collections import defaultdict
n = int(stdin.readline().rstrip())
chars = stdin.readline().rstrip()
c = defaultdict(int)
for char in chars:
	c[char] += 1
ones = min(c['o'], c['n'], c['e'])
c['o'] -= ones
c['n'] -= ones
c['e'] -= ones
zeroes = min(c['z'], c['e'], c['r'], c['o'])
for i in range(ones):
	print('{} '.format(1), end='')
for i in range(zeroes):
	print('{} '.format(0), end='')


import sys
import math
fileoperation = 0
if fileoperation:
	orig_stdout = sys.stdout
	orig_stdin = sys.stdin
	inputfile = open('W:/Competitive Programming/input.txt', 'r')
	outputfile = open('W:/Competitive Programming/output.txt', 'w')
	sys.stdin = inputfile
	sys.stdout = outputfile
mod = 1000000007

def nospace(l):
	ans = ''.join((str(i) for i in l))
	return ans
t = 1
for tt in range(t):
	n = int(input())
	s = str(input())
	a = s.count('n')
	b = s.count('z')
	for i in range(a):
		print(1, end=' ')
	for i in range(b):
		print(0, end=' ')
	print()
if fileoperation:
	sys.stdout = orig_stdout
	sys.stdin = orig_stdin
	inputfile.close()
	outputfile.close()


n = int(input())
x = input()
cnt = 0
count = 0
for i in x:
	if i == 'z':
		count += 1
	if i == 'n':
		cnt += 1
for i in range(cnt):
	print(1, end=' ')
for i in range(count):
	print(0, end=' ')


from sys import exit as sys_return
alpha_1x_bet = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
(amount, letters) = (int(input()), str(input()))
for i in range(amount):
	alpha_1x_bet[letters[i]] += 1
while alpha_1x_bet['n'] > 0:
	print(1, end=' ')
	alpha_1x_bet['e'] -= 1
	alpha_1x_bet['n'] -= 1
	alpha_1x_bet['o'] -= 1
for i in range(alpha_1x_bet['z']):
	print(0, end=' ')


from collections import Counter
y = int(input())
x = input()
z = Counter(x)
if z['n'] > min(z['o'], z['e']):
	for i in range(min(z['o'], z['e'])):
		print('1', end=' ')
else:
	for i in range(z['n']):
		print('1', end=' ')
	for i in range(min(min(z['z'], z['r']), min(z['o'], z['e'] - z['n']))):
		print('0', end=' ')


lettCnt = int(input())
letters = input()
(z, e, r, o, n) = (0, 0, 0, 0, 0)
for item in letters:
	if item == 'z':
		z += 1
	elif item == 'e':
		e += 1
	elif item == 'r':
		r += 1
	elif item == 'o':
		o += 1
	else:
		n += 1
for i in range(n):
	print('1 ', end='')
for i in range(z):
	print('0 ', end='')


n = int(input())
str = input()
a = []
m = 0
for i in str:
	x = str[m]
	if x == 'z':
		a.append(0)
	elif x == 'n':
		a.append(1)
	m += 1
a.sort()
a.reverse()
for i in a:
	print(i, end=' ')


import collections
input()
c = collections.Counter(input())
print(*['1'] * c['n'] + ['0'] * c['r'])


n = int(input())
a = input()
t = a.count('n')
d = a.count('z')
c = '1 '
k = '0 '
print(c * t + k * d)


num = int(input())
word = input()
count = 0
z = 0
n = 0
for x in range(0, num):
	i = word[count]
	if i == 'z':
		z += 1
	elif i == 'n':
		n += 1
	count += 1
one = n * '1 '
zero = z * '0 '
print(one, zero, sep='')


b = int(input())
a = input()
for i in range(a.count('n')):
	print(1, ' ', end='')
for i in range((b - a.count('n') * 3) // 4):
	print(0, ' ', end='')


length = int(input())
string = input()
count_n = string.count('n')
count_z = string.count('z')
if count_n != 0 or count_z != 0:
	print('1 ' * count_n + '0 ' * count_z)


n = int(input())
words = input()
answer = ''
for item in words:
	if item == 'n':
		answer = answer + '1 '
for item in words:
	if item == 'z':
		answer = answer + '0 '
print(answer[:-1])


input()
li = [x for x in input()]
new = ['1'] * li.count('n') + ['0'] * li.count('z')
print(' '.join(new))


n = int(input())
l = list(input())
one = l.count('n')
zero = l.count('z')
no = '1 ' * one + '0 ' * zero
print(no.strip())


n = int(input())
s = input()
w = s.count('n')
c = s.count('z')
if c > 0:
	num = w * '1 ' + (c - 1) * '0 ' + 1 * '0'
else:
	num = (w - 1) * '1 ' + '1'
print(num)


N = int(input())
words = input()
one = words.count('n')
zero = words.count('z')
ans = '1 ' * one + '0 ' * zero
print(ans)


import sys
n = int(input())
m = input()
count_zero = 0
count_one = 0
for c in list(m):
	if c == 'z':
		count_zero += 1
	if c == 'n':
		count_one += 1
print('1 ' * count_one + '0 ' * count_zero)


t = int(input())
a = input()
z = 0
n = 0
for i in a:
	if i == 'z':
		z += 1
	elif i == 'n':
		n += 1
arr = ['1' for j in range(n)]
for j in range(z):
	arr.append('0')
print(*arr)


number = int(input())
string = input()
count_z = 0
count_e = 0
count_r = 0
count_o = 0
count_n = 0
for i in string:
	if i == 'z':
		count_z += 1
	if i == 'e':
		count_e += 1
	if i == 'r':
		count_r += 1
	if i == 'o':
		count_o += 1
	if i == 'n':
		count_n += 1
min_one = min(count_o, count_n, count_e)
min_zero = min(count_z, count_e - min_one, count_r, count_o - min_one)
chislo = int(min_one + min_zero)
print('{} {}'.format('1 ' * min_one, '0 ' * min_zero))


data = input()
data1 = input()
print(data1.count('n') * '1 ' + data1.count('z') * '0 ')


a = int(input())
mas = list(input())
print('1 ' * mas.count('n') + '0 ' * mas.count('z'))


a = input()
b = input()
c0 = 0
c1 = 0
for i in b:
	if i == 'z':
		c0 += 1
	if i == 'n':
		c1 += 1
for i in range(c1):
	print(1, end=' ')
for i in range(c0):
	print(0, end=' ')


n = int(input())
b = input()
r_result = ''
l_result = ''
for c in b:
	if c == 'n':
		r_result = r_result + '1'
	elif c == 'r':
		l_result = l_result + '0'
print(' '.join(r_result + l_result))


t = int(input())
o = 0
n = 0
e = 0
z = 0
r = 0
a = str(input())
for i in range(t):
	if a[i] == 'o':
		o = o + 1
	if a[i] == 'n':
		n = n + 1
	if a[i] == 'e':
		e = e + 1
	if a[i] == 'z':
		z = z + 1
	if a[i] == 'r':
		r = r + 1
one = min(o, n, e)
for i in range(one):
	print(1, end=' ')
o = o - one
e = e - one
zero = min(z, e, r, o)
for i in range(zero):
	print(0, end=' ')


n = int(input())
s = list(input())
d = {}
d['z'] = s.count('z')
d['e'] = s.count('e')
d['r'] = s.count('r')
d['o'] = s.count('o')
d['n'] = s.count('n')
cur = min(d['o'], d['n'], d['e'])
print('1 ' * cur + '0 ' * min(d['z'], d['e'] - cur, d['r'], d['o'] - cur))


n = int(input())
f = input()
n = 0
z = 0
for i in f:
	letter = i.lower()
	if letter == 'z':
		z += 1
	if letter == 'n':
		n += 1
for x in range(n):
	print(1, end=' ')
for x in range(z):
	print(0, end=' ')


from sys import stdin
import math
n = int(stdin.readline().strip())
string = list(stdin.readline().strip())
zero = 0
one = 0
for i in string:
	if i == 'z':
		zero += 1
	elif i == 'n':
		one += 1
for i in range(one):
	print(1, end=' ')
for i in range(zero):
	print(0, end=' ')


n = int(input())
word = list(input())
letters = dict()
for i in word:
	letters[i] = letters.get(i, 0) + 1
answ1 = ''
if 'n' in letters.keys():
	ones = letters['n']
	answ1 += '1 ' * ones
else:
	ones = 0
if 'z' in letters.keys():
	zeros = letters['z']
	answ1 += '0 ' * zeros
else:
	zeros = 0
print(answ1)


n = int(input())
str = input()
nc = 0
zc = 0
list = []
for i in str:
	if i == 'n':
		list.append(1)
	if i == 'z':
		list.append(0)
list.sort()
for i in reversed(list):
	print(i, end=' ')


a = int(input())
b = input()
x = b.count('n')
y = b.count('z')
for i in range(x):
	print(1, end=' ')
for i in range(y):
	print(0, end=' ')


i = int(input())
x = input()
c = 0
k = 0
for l in range(i):
	if x[l] == 'n':
		c += 1
	elif x[l] == 'z':
		k += 1
print('1 ' * c + '0 ' * k)


n = int(input())
cards = input()
n_z = cards.count('z')
n_e = cards.count('e')
n_r = cards.count('r')
n_o = cards.count('o')
n_n = cards.count('n')
num_1 = min(n_o, n_n, n_e)
num_0 = min(n_z, n_e - num_1, n_r, n_o - num_1)
result = [1 for i in range(num_1)]
result.extend([0 for i in range(num_0)])
[print(value, end=' ') for value in result]


a = int(input())
b = str(input())
x = b.count('r')
y = b.count('n')
print('1 ' * y + '0 ' * x)


string = int(input())
a1 = input()
b = a1.count('z')
a = a1.count('n')
for j in range(a):
	print('1', end=' ')
for j in range(b):
	print('0', end=' ')


n = int(input())
s = input()
z = s.count('z')
o = (n - z * 4) // 3
z = z + o
r = ''
for i in range(z):
	if i < o:
		print('1 ', end='')
	else:
		print('0 ', end='')


n = int(input())
lst = input()
b = []
for i in lst:
	if 'z' in i:
		b.append('0')
	if 'n' in i:
		b.append('1')
for i in b:
	if '0' in i:
		b.append('0')
		b.remove(i)
print(' '.join(b))


s = input()
v = input()
a = v.count('z')
b = v.count('e')
c = v.count('r')
d = v.count('o')
e = v.count('n')
f = min(b, d, e)
g = v.replace('e', '', f)
h = g.replace('n', '', f)
i = h.replace('o', '', f)
j = i.count('z')
k = i.count('e')
l = i.count('r')
m = i.count('o')
n = min(j, k, l, m)
o = '1' * f
p = '0' * n
print(' '.join(o), ' '.join(p))


input()
s = input()
nr = s.count('r')
nn = s.count('n')
print(' '.join('1' * nn + '0' * nr))


a = int(input())
b = input()
words = []
z = 0
n = 0
for i in b:
	if i == 'z':
		z += 1
	elif i == 'n':
		n += 1
if n != 0:
	for i in range(n):
		words.append(1)
if z != 0:
	for i in range(z):
		words.append(0)
print(*words)


int = input()
l = list(input())
k = l.count('z')
c = l.count('n')
if k == 0 and c > 0:
	while c != 0:
		print('1', end=' ')
		c -= 1
elif c == 0 and k > 0:
	while k != 0:
		print('0', end=' ')
		k -= 1
elif c > 0 and k > 0:
	while c != 0:
		print('1', end=' ')
		c -= 1
	while k != 0:
		print('0', end=' ')
		k -= 1


from collections import Counter
n = int(input())
s = input()
s = Counter(s)
out = [1] * s['n'] + [0] * s['z']
print(*out)


y = int(input(''))
x = input('')
str1 = 'r'
str2 = 'n'
a = 0
b = 0
for letter in x:
	if letter == str1:
		a += 1
	elif letter == str2:
		b += 1
	else:
		pass
for i in range(0, b):
	print(1, end=' ')
for i in range(0, a):
	print(0, end=' ')


a = int(input())
genome = input()
n = 0
z = 0
for nucl in genome:
	if nucl == 'n':
		n += 1
for nucl in genome:
	if nucl == 'z':
		z += 1
print('1 ' * n + '0 ' * z)


from collections import Counter
n = int(input())
a = list(input())
b = Counter(a)
o = b['n']
z = b['z']
m = ['1'] * o + ['0'] * z
for j in m:
	print(j, end=' ')


n = input()
string = input()
ones = 0
zeros = 0
for i in string:
	if i == 'n':
		ones += 1
	elif i == 'z':
		zeros += 1
for i in range(ones):
	print('1', end=' ')
for i in range(zeros):
	print('0', end=' ')
if zeros:
	print()


n = int(input())
palavra = input()
dic = {'o': 0, 'n': 0, 'e': 0, 'z': 0, 'e': 0, 'r': 0}
for e in palavra:
	dic[e] += 1
resposta = []
while dic['o'] > 0 and dic['n'] > 0 and (dic['e'] > 0):
	resposta.append(1)
	dic['o'] -= 1
	dic['n'] -= 1
	dic['e'] -= 1
while dic['z'] > 0 and dic['e'] > 0 and (dic['r'] > 0) and (dic['o'] > 0):
	resposta.append(0)
	dic['z'] -= 1
	dic['e'] -= 1
	dic['r'] -= 1
	dic['o'] -= 1
print(*resposta)


_ = map(int, input().split())
s = input()

def bin(s):
	l = []
	for letter in s:
		if letter == 'n':
			l.append(1)
		elif letter == 'z':
			l.append(0)
	l.sort(reverse=True)
	print(*l)
bin(s)


n = int(input())
s = input()
ans = s.count('n')
print('1 ' * ans, '0 ' * ((n - ans * 3) // 4), sep='')


n = int(input())
a = input()
z = 0
o = 0
x = []
for i in range(len(a)):
	if a[i] == 'z':
		z += 1
	if a[i] == 'n':
		o += 1
for i in range(o):
	x.append(1)
for i in range(z):
	x.append(0)
print(*x, sep=' ')


x = int(input())
l = list(input())
e = 0
n = 0
o = 0
r = 0
z = 0
for i in range(x):
	if l[i] == 'e':
		e += 1
	if l[i] == 'n':
		n += 1
	if l[i] == 'o':
		o += 1
	if l[i] == 'r':
		r += 1
	if l[i] == 'z':
		z += 1
ones = min(min(n, o), e)
o -= ones
e -= ones
zeros = min(min(min(r, z), e), o)
for i in range(ones):
	print(1, end=' ')
for i in range(zeros):
	print(0, end=' ')


n = int(input())
s = input()
my_str = ''
while s.find('n') != -1:
	my_str += '1 '
	s = s.replace('n', '', 1)
while s.find('z') != -1:
	my_str += '0 '
	s = s.replace('z', '', 1)
print(my_str.strip())


n = int(input())
s = input()
num_n = 0
num_z = 0
for i in range(n):
	if s[i] == 'n':
		num_n += 1
	if s[i] == 'z':
		num_z += 1
while num_n > 0 or num_z > 0:
	if num_n > 0:
		print(1)
		num_n -= 1
	else:
		print(0)
		num_z -= 1


n = int(input())
p = input().rstrip()
x = list(p)
l = []
q = []
w = []
S = []
D = []
for i in range(0, len(x)):
	if x[i] == 'z':
		l.append(x[i])
	elif x[i] == 'e':
		q.append(x[i])
	elif x[i] == 'r':
		w.append(x[i])
	elif x[i] == 'o':
		S.append(x[i])
	else:
		D.append(x[i])
T = min(len(q), len(S), len(D))
print('1 ' * T, end='')
T = min(len(l), len(q), len(w), len(S))
print('0 ' * T)


n = int(input())
s = str(input())
zero = 0
one = 0
for i in range(n):
	if s[i] == 'z':
		zero += 1
	if s[i] == 'n':
		one += 1
res = ''
res += '1' * one
res += '0' * zero
for i in range(len(res)):
	print(res[i], end=' ')


n = int(input())
str1 = input()
zc = str1.count('z')
rn = n - zc * 4
i = 0
while rn > 0:
	if rn == 0:
		break
	else:
		i += 1
		rn = rn - 3
for l in range(0, i):
	print(1, end=' ')
for m in range(0, zc):
	print(0, end=' ')


t = int(input())
s = str(input())
d = {}
k = 0
a = 0
for i in s:
	if i == 'n':
		k += 1
	if i == 'z':
		a += 1
for i in range(0, k):
	print(1, end=' ')
for i in range(0, a):
	print(0, end=' ')


n = int(input())
s = input()
ans = 0
arr = [0, 0, 0, 0]
for x in s:
	if x == 'n':
		ans += 1
	elif x == 'z':
		arr[0] += 1
	elif x == 'e':
		arr[1] += 1
	elif x == 'r':
		arr[2] += 1
	elif x == 'o':
		arr[3] += 1
	else:
		pass
for x in range(ans):
	print(1, end=' ')
for x in range(min(arr)):
	print(0, end=' ')


n = int(input())
l = list(input())
ns = l.count('n')
zs = l.count('z')
s1 = [1] * ns
s2 = zs * [0]
print(*s1, *s2)


a = int(input())
b = input()
c = ''
e = 0
z = 0
n = 0
o = 0
r = 0
for u in b:
	if u == 'e':
		e = e + 1
	elif u == 'z':
		z = z + 1
	elif u == 'n':
		n = n + 1
	elif u == 'o':
		o = o + 1
	elif u == 'r':
		r = r + 1
m = True
while m:
	if n > 0:
		if o > 0:
			if e > 0:
				n = n - 1
				o = o - 1
				e = e - 1
				c = c + '1 '
			else:
				m = False
		else:
			m = False
	else:
		m = False
k = True
while k:
	if z > 0:
		if e > 0:
			if r > 0:
				if o > 0:
					z = z - 1
					e = e - 1
					r = r - 1
					o = o - 1
					c = c + '0 '
				else:
					k = False
			else:
				k = False
		else:
			k = False
	else:
		k = False
print(c)


n = int(input())
s = input()
a = list(s)
p = a.count('n')
z = a.count('z')
print('1 ' * p + '0 ' * z)


n = int(input())
b = input()
t = 0
for i in range(n):
	if b[i] == 'n':
		t += 1
l = (n - t * 3) // 4
for i in range(t):
	print(1, end=' ')
for i in range(l):
	print(0, end=' ')


def binary(s):
	ones = s.count('n')
	zero = s.count('z')
	ans = '1' * ones
	ans += '0' * zero
	new = ' '.join(ans)
	print(new)
n = int(input())
s = input()
binary(s)


n = int(input())
a = input()
b = a.count('n')
c = a.count('z')
print('1 ' * b, end='')
print('0 ' * c)


n = int(input())
n_count = 0
z_count = 0
for c in input():
	if c == 'z':
		z_count += 1
	elif c == 'n':
		n_count += 1
for _ in range(n_count):
	print(1, end=' ')
for _ in range(z_count):
	print(0, end=' ')


n = int(input())
string = input()
a = 'zeron'
d = dict().fromkeys(a, 0)
final = []
for i in string:
	d[i] += 1
z = d['n']
for i in range(z):
	if d['o'] != 0 and d['e'] != 0:
		d['o'] -= 1
		d['e'] -= 1
		final.append(1)
for i in range(d['z']):
	if d['o'] != 0 and d['e'] != 0 and (d['r'] != 0):
		d['o'] -= 1
		d['e'] -= 1
		d['r'] -= 1
		final.append(0)
for i in range(len(final)):
	print(final[i], end=' ')


n = input()
s = [i for i in input().strip('')]
n = s.count('n')
z = s.count('z')
ans = []
for i in range(n):
	ans.append(1)
for i in range(z):
	ans.append(0)
print(*ans)


n = int(input())
cards = input()
binary = ''
while len(cards) != 0:
	if 'o' in cards and 'n' in cards and ('e' in cards):
		cards = cards.replace('o', '', 1)
		cards = cards.replace('n', '', 1)
		cards = cards.replace('e', '', 1)
		binary = binary + '1 '
	else:
		cards = cards.replace('z', '', 1)
		cards = cards.replace('e', '', 1)
		cards = cards.replace('r', '', 1)
		cards = cards.replace('o', '', 1)
		binary = binary + '0 '
print(binary)


input()
fuad = input().count
print(*[1] * fuad('n') + [0] * fuad('z'))


n = int(input())
cards = input()
z = cards.count('z')
n = cards.count('n')
temp = '1 ' * n + '0 ' * z
print(temp)


def Cars(n, num):
	zc = 0
	nc = 0
	if len(num) != n:
		return 0
	for i in range(n):
		if num[i] == 'z':
			zc += 1
		elif num[i] == 'n':
			nc += 1
	result = ''
	for j in range(nc):
		result = result + '1 '
	for k in range(zc):
		result = result + '0 '
	return result
n = int(input())
x = input()
print(Cars(n, x))


q = int(input())
W = str(input())
z = W.count('z')
n = W.count('n')
w = str('')
if n > 0:
	w = w + str('1')
	while n > 1:
		w = w + str(' 1')
		n = n - 1
	if n > 0:
		w = w + str(' 0' * z)
	print(w)
else:
	print(w + '0' + ' 0' * (z - 1))


b = input()
a = input()
c = 0
k = 0
for i in a:
	if i == 'z':
		c += 1
	if i == 'n':
		k += 1
l = ' 0'
g = ' 1'
j = (g * k).strip(' ')
o = (l * c).strip(' ')
if k > 0 and c > 0:
	print(j, o, sep=' ')
if k <= 0:
	print(o)
if c <= 0:
	print(j)


n = int(input())
s = input()
countz = 0
countn = 0
for i in s:
	if i == 'z':
		countz += 1
	elif i == 'n':
		countn += 1
for i in range(countn):
	print('1', end=' ')
for j in range(countz):
	print('0', end=' ')
print()


n = int(input())
a = [0] * 5
for i in list(input()):
	if i == 'z':
		a[0] += 1
	elif i == 'e':
		a[1] += 1
	elif i == 'r':
		a[2] += 1
	elif i == 'o':
		a[3] += 1
	else:
		a[4] += 1
x = min(a[3], a[4], a[1])
print('1 ' * x, end='')
a[3] -= x
a[4] -= x
a[1] -= x
print(min(a[0], a[1], a[2], a[3]) * '0 ')


import sys, os.path
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
n = input()
st = str(input()).strip()
chars = ['o', 'n', 'e', 'z', 'r']
d = dict()
for ch in st:
	ind = chars.index(ch)
	if ind not in d:
		d[ind] = 1
	else:
		d[ind] += 1
zero = 0
while 3 in d and d[3] > 0:
	zero += 1
	d[3] -= 1
	d[2] -= 1
	d[4] -= 1
	d[0] -= 1
one = 0
while 0 in d and d[0] > 0:
	one += 1
	d[0] -= 1
s1 = ' '.join(['1'] * one)
s2 = ' '.join(['0'] * zero)
print(s1 + (' ' if s2 else '') + s2)


input()
x = input()
a = min(x.count('e'), x.count('z'), x.count('r'), x.count('o'))
b = min(x.count('e'), x.count('n'), x.count('o'))
print('1 ' * b + '0 ' * a)


n = int(input())
l = input()
b = l.count('n')
c = l.count('z')
for i in range(b):
	print('1', end=' ')
for i in range(c):
	print('0', end=' ')


n = int(input())
s = input()
x = s.count('z')
y = s.count('n')
for i in range(y):
	print(1, end=' ')
for i in range(x):
	print(0, end=' ')


n = input()
g = input()
r = g.count('n')
f = g.count('z')
while r > 0:
	print('1', end=' ')
	r = r - 1
while f > 0:
	print('0', end=' ')
	f = f - 1


n = int(input())
stri = input()
one = stri.count('n')
result = ['1'] * one + ['0'] * ((n - one * 3) // 4)
print(' '.join(result))


def number(S):
	Number = ''
	for x in S:
		if x == 'n':
			Number += '1 '
	for x in S:
		if x == 'z':
			Number += '0 '
	return Number
t = int(input())
S = input()
print(number(S))


total = int(input())
letters = input()
zes = 0
zeroes = 0
for i in letters:
	if i == 'o':
		zeroes += 1
	if i == 'z':
		zes += 1
zero = zes
one = zeroes - zes
result = ''
for k in range(one):
	result += '1 '
for j in range(zero):
	result += '0 '
print(result)


n = int(input())
l = [*input()]
a = l.count('z')
b = l.count('n')
ch = '1' * b + '0' * a
print(*(_ for _ in ch))


whatever = input()
z = input()
s = []
ones = []
zeros = []
for x in range(len(z)):
	s.append(z[x])
ones.append(s.count('o'))
ones.append(s.count('n'))
ones.append(s.count('e'))
ones.sort()
zeros.append(s.count('z'))
zeros.append(s.count('e'))
zeros.append(s.count('r'))
zeros.append(s.count('o'))
zeros.sort()
print('1 ' * ones[0] + '0 ' * zeros[0])


s = input()
f = input()
s = len(f)
n = f.count('z')
o = f.count('n')
print(('1' * o + '0' * n).replace('', ' ').lstrip().rstrip())


x = int(input())
n = input()
a = n.count('z')
b = n.count('n')
s = ''
for i in range(b):
	s += '1'
for i in range(a):
	s += '0'
s = list(s)
print(' '.join(s))


n = int(input())
string = list(input())
zero = string.count('r')
one = string.count('n')
array = [1] * one
array += [0] * zero
print(*array)


from math import *
t = int(input())
s = input()
n = s.count('n')
o = s.count('o')
e = s.count('e')
r = s.count('r')
z = s.count('z')
while o > 0 and n > 0 and (e > 0):
	print(1, end=' ')
	n -= 1
	o -= 1
	e -= 1
while z > 0:
	print(0, end=' ')
	z -= 1


f = int(input())
s = input()
(n, z) = (0, 0)
for i in range(f):
	if s[i] == 'n':
		n += 1
	elif s[i] == 'z':
		z += 1
for j in range(n):
	print('1 ', end='')
for k in range(z):
	print('0 ', end=' ')


from sys import setcheckinterval, stdin, setrecursionlimit
setcheckinterval(1000)
setrecursionlimit(10 ** 7)

def iin():
	return int(stdin.readline())

def lin():
	return list(map(int, stdin.readline().split()))
n = iin()
a = input()
ch = a.count('n')
ans = [1] * ch
n -= ch * 3
ans += [0] * (n // 4)
print(*ans)


n = int(input())
s = input()
cn = s.count('n')
cz = s.count('z')
while cn > 0:
	print('1 ', end='')
	cn -= 1
while cz > 0:
	print('0 ', end='')
	cz -= 1


n = int(input())
a = list(input())
ans = [1] * a.count('n') + [0] * a.count('z')
print(*ans)


n = int(input())
string = input()
o_number = 0
zeros = 0
ones = 0
ans = ''
for char in string:
	if char == 'o':
		o_number += 1
	elif char == 'z':
		zeros += 1
ones = o_number - zeros
while ones > 0 or zeros > 0:
	if ones:
		ans += '1 '
		ones -= 1
	elif zeros:
		ans += '0 '
		zeros -= 1
print(ans)


n = int(input())
c = input().count
print(*[1] * c('n') + [0] * c('r'))


n = input()
d = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for c in input():
	d[c] += 1
t = min(d['o'], d['e'])
o = min(t, d['n'])
t -= o
z = min(t, min(d['z'], d['r']))
print(*[1] * o + [0] * z)


t = int(input())
x = input()
r = x.count('r')
n = x.count('n')
print('1 ' * n + '0 ' * r)


n = int(input())
a = input()
all_frq = {}
x = []
y = []
count1 = 0
count0 = 0
for i in a:
	if i in all_frq:
		all_frq[i] += 1
	else:
		all_frq[i] = 1
for i in all_frq:
	if 'n' not in all_frq:
		count1 = 0
	else:
		count1 = all_frq['n']
	if 'z' not in all_frq:
		count0 = 0
	else:
		count0 = all_frq['z']
for i in range(0, count1):
	x.append('1')
for i in range(0, count0):
	x.append('0')
w = ' '.join(x)
print(w)


import sys
import math
while True:
	try:
		n = int(input())
	except EOFError:
		break
	text = input()
	ones = 0
	zeros = 0
	for char in text:
		if char == 'n':
			ones += 1
		elif char == 'z':
			zeros += 1
	output = ''
	for i in range(ones):
		output += '1 '
	for i in range(zeros):
		output += '0 '
	print(output)
pass


def solution(_input, size):
	if size == 4:
		return 0
	if size == 3:
		return 1
	ones = _input.count('n')
	zeros = _input.count('z')
	out = '1 ' * ones + '0 ' * zeros
	return out.strip(' ')
size = input()
_input = input()
print(solution(_input, int(size)))


l = int(input())
n = input()
one = n.count('n')
zero = n.count('z')
res = ''
for i in range(one):
	res += ' 1'
for i in range(zero):
	res += ' 0'
print(res[1:])


import sys
input = lambda : sys.stdin.readline().strip()
n = int(input())
s = input()
cnt = 0
for i in s:
	if i == 'z':
		cnt += 1
print('1 ' * ((len(s) - 4 * cnt) // 3), end='')
print('0 ' * cnt, end='')
print()


from collections import defaultdict as dd
from collections import Counter as ccd
from itertools import permutations as pp
from itertools import combinations as cc
from random import randint as rd
from bisect import bisect_left as bl
from bisect import bisect_right as br
import heapq as hq
from math import gcd
mod = pow(10, 9) + 7

def inp(flag=0):
	if flag == 0:
		return list(map(int, input().strip().split(' ')))
	else:
		return int(input())
n = inp(1)
s = ccd(input().strip())
zero = s['z']
one = s['o'] - s['z']
ans = [1] * one + [0] * zero
print(*ans)


n = int(input())
s = input()
z = len(list(filter(lambda x: x == 'z', s)))
n = len(list(filter(lambda x: x == 'n', s)))
print(*[1 for i in range(n)], *[0 for i in range(z)])


n = int(input())
s = input()
output = []
z = 0
n = 0
for c in s:
	if c == 'z':
		z += 1
	elif c == 'n':
		n += 1
for i in range(n):
	output.append(1)
for i in range(z):
	output.append(0)
joined_string = ' '.join([str(v) for v in output])
print(joined_string)


n = int(input())
letters = list(str(input()))
zeros = letters.count('z')
ones = int((len(letters) - 4 * zeros) // 3)
out_ones = [1 for i in range(ones)]
out_zeros = [0 for i in range(zeros)]
if len(out_ones) == 0:
	print(*out_zeros)
elif len(out_zeros) == 0:
	print(*out_ones)
else:
	out_ones.extend(out_zeros)
	print(*out_ones)


t = int(input())
n = input()
l = [i for i in n]
z = l.count('z')
n = l.count('n')
sol = []
for i in range(n):
	sol.append(1)
for i in range(z):
	sol.append(0)
for i in sol:
	print(i, end=' ')


n = int(input())
string = input()
tmp_list = []
cN = string.count('n')
cZ = string.count('z')
for i in range(cN):
	tmp_list.append('1')
for i in range(cZ):
	tmp_list.append('0')
for i in range(len(tmp_list)):
	print(tmp_list[i], end=' ')


n = int(input())
string = list(map(str, input()))[:n]
one_count = 0
zero_count = 0
for i in string:
	if i == 'n':
		one_count += 1
	if i == 'z':
		zero_count += 1
if one_count == 0 and zero_count == 1:
	print(0)
else:
	for i in range(one_count):
		print(str(1) + ' ', end=' ')
	for i in range(zero_count):
		print(str(0) + ' ', end=' ')


_ = input()
s = input()
freq = {}
for x in s:
	freq[x] = freq.get(x, 0) + 1
o = 0
z = 0
if 'o' in freq and 'n' in freq and ('e' in freq):
	min = 10 ** 9
	for x in freq:
		if x == 'o' or x == 'n' or x == 'e':
			if freq[x] < min:
				o = freq[x]
				min = o
	freq['o'] = freq['o'] - o
	freq['n'] = freq['n'] - o
	freq['e'] = freq['e'] - o
if 'z' in freq and 'e' in freq and ('r' in freq) and ('o' in freq):
	if freq.get('z') > 0 and freq.get('e') > 0 and (freq.get('r') > 0) and (freq.get('o') > 0):
		min = 10 ** 9
		z = 0
		for x in freq:
			if x == 'z' or x == 'e' or x == 'r' or (x == 'o'):
				if freq[x] < min:
					z = freq[x]
					min = z
for x in range(o):
	print(1, end=' ')
for x in range(z):
	print(0, end=' ')


thisfra = input()
slovo = input()
a = slovo.count('z')
b = slovo.count('e')
c = slovo.count('r')
d = slovo.count('o')
e = slovo.count('n')
one = min(d, e, b)
d = d - one
e = e - one
b = b - one
zero = min(a, b, c, d)
print('1 ' * one, '0 ' * zero)


count = input()
line = input()
z = line.count('z')
e = line.count('e')
r = line.count('r')
o = line.count('o')
n = line.count('n')
zero = z
one = o - z
s = ''
for i in range(0, one):
	s += '1 '
for i in range(0, zero):
	s += '0 '
print(s[:-1])


n = int(input())
str1 = input()
for i in range(str1.count('n')):
	print(1, end=' ')
for c in range(str1.count('z')):
	print(0, end=' ')


from collections import defaultdict, deque
from heapq import heappush, heappop
import sys
import math
import bisect

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

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

def LS():
	return [list(x) for x in sys.stdin.readline().split()]

def S():
	res = list(sys.stdin.readline())
	if res[-1] == '\n':
		return res[:-1]
	return res

def IR(n):
	return [I() for i in range(n)]

def LIR(n):
	return [LI() for i in range(n)]

def SR(n):
	return [S() for i in range(n)]

def LSR(n):
	return [LS() for i in range(n)]
sys.setrecursionlimit(1000000)
mod = 1000000007

def A():
	n = I()
	s = S()
	d = defaultdict(lambda : 0)
	for i in s:
		d[i] += 1
	ans = [1] * d['n']
	d['o'] -= d['n']
	ans += [0] * d['o']
	print(*ans)
	return

def B():
	return

def C():
	return

def D():
	return

def E():
	return

def F():
	return

def G():
	return

def __starting_point():
	A()
__starting_point()


n = int(input())
s = input()
countofz = s.count('z')
countofn = s.count('n')
for i in range(countofn):
	print('1', end=' ')
for i in range(countofz):
	print('0', end=' ')
print()


t = int(input())
s = input()
z = 0
n = 0
for i in range(t):
	if s[i] == 'z':
		z += 1
	elif s[i] == 'n':
		n += 1
print('1 ' * n, '0 ' * z, sep='')


n = int(input())
s = input()
ans = s.count('n') * ['1'] + s.count('z') * ['0']
print(' '.join(ans))


n = int(input())
str = input()
z = 0
n = 0
for i in str:
	if i == 'z':
		z += 1
	elif i == 'n':
		n += 1
print(*[1] * n, *[0] * z)


n = int(input())
word = input()
chars = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for i in range(n):
	if word[i] == 'z':
		chars['z'] += 1
	if word[i] == 'n':
		chars['n'] += 1
for i in range(chars['n']):
	print(1, end=' ')
for i in range(chars['z']):
	print(0, end=' ')


n = int(input())
a = input()
n = 0
z = 0
for i in a:
	if i == 'n':
		n += 1
	elif i == 'z':
		z += 1
print(''.join(['1 ' * n, '0 ' * z]))


input()
letters = input()
ones = letters.count('n')
zeroes = letters.count('z')
print(*[1] * ones + [0] * zeroes)


m = int(input())
p = str(input())
z = p.count('z')
n = p.count('n')
for i in range(n):
	print('1 ', end='')
for i in range(z):
	print('0 ', end='')


n = int(input())
s = input()
(ones, zeroes) = (0, 0)
h = {}
for c in s:
	if h.get(c, 0) == 0:
		h[c] = 1
	else:
		h[c] += 1
while h.get('o', 0) != 0 and h.get('n', 0) != 0 and (h.get('e', 0) != 0):
	h['o'] -= 1
	h['n'] -= 1
	h['e'] -= 1
	ones += 1
while h.get('z', 0) != 0 and h.get('e', 0) != 0 and (h.get('r', 0) != 0) and (h.get('o', 0) != 0):
	h['z'] -= 1
	h['e'] -= 1
	h['r'] -= 1
	h['o'] -= 1
	zeroes += 1
ans = ''
while ones > 0:
	ans += '1 '
	ones -= 1
while zeroes > 0:
	ans += '0 '
	zeroes -= 1
print(ans)


n = int(input())
s = input()
(cnt1, cnt0) = (0, 0)
for l in s:
	if l == 'n':
		cnt1 += 1
	if l == 'r':
		cnt0 += 1
for i in range(cnt1):
	print(1, end=' ')
for i in range(cnt0):
	print(0, end=' ')


t = int(input())
st = input()
s = []
for _ in range(st.count('n')):
	s.append('1')
for _ in range(st.count('z')):
	s.append('0')
f = ' '.join(s)
print(f)


n = int(input())
s = input()
z = 0
ns = 0
ans = ''
for ch in s:
	if ch == 'z':
		z += 1
	if ch == 'n':
		ns += 1
for x in range(ns):
	ans += '1 '
for y in range(z - 1):
	ans += '0 '
if z >= 1:
	ans += '0'
print(ans)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

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

def function(n, word):
	e = ''
	word = list(word)
	word = sorted(word)
	for char in word:
		if char == 'z':
			e += '0 '
		elif char == 'n':
			e += '1 '
	print(e)
n = inp()
word = input()
function(n, word)


lens = int(input())
inss = input()
ans = []
ans.extend(['1'] * inss.count('n'))
ans.extend(['0'] * inss.count('z'))
print(*ans)


n = int(input())
s = input()
t = s.count('n')
y = s.count('r')
l = []
for i in range(t):
	l.append(1)
for i in range(y):
	l.append(0)
print(*l)


from collections import Counter
n = int(input())
s = list(input())
d = dict(Counter(s))
cn1 = 0
cn0 = 0
l = []
for i in d.keys():
	if i == 'n':
		if d['o'] >= d['n'] and d['e'] >= d['n']:
			cn1 = d['n']
			d['o'] = d['o'] - d['n']
			d['e'] = d['e'] - d['n']
for i in d.keys():
	if i == 'r':
		if d['o'] >= d['r'] and d['e'] >= d['r'] and (d['z'] >= d['r']):
			cn0 = d['r']
for i in range(cn1):
	l.append('1')
for i in range(cn0):
	l.append('0')
print(*l)


n = int(input())
s = input()
o = s.count('o')
n = s.count('n')
e = s.count('e')
r = s.count('r')
z = s.count('z')
ones = 0
zeros = 0
while o != 0 and n != 0 and (e != 0):
	o -= 1
	n -= 1
	e -= 1
	ones += 1
while z != 0 and e != 0 and (r != 0) and (o != 0):
	z -= 1
	e -= 1
	r -= 1
	o -= 1
	zeros += 1
out = '1 ' * ones
out += '0 ' * zeros
print(out[:-1])


n = int(input())
s = input()
(num0, num1) = (0, 0)
for i in range(n):
	if s[i] == 'z':
		num0 += 1
	if s[i] == 'n':
		num1 += 1
print(' '.join(('1' for i in range(num1))), ' '.join(('0' for i in range(num0))))


def main():
	input()
	l = [0] * 128
	for c in input():
		l[ord(c)] += 1
	print(*['1'] * l[ord('n')], *['0'] * l[ord('z')])
main()


(n, s) = (int(input()), input())
x = s.count('z')
y = (n - 4 * x) // 3
print('1 ' * y + '0 ' * x)


n = int(input())
s = input()
c1 = s.count('n')
c2 = s.count('z')
while c1 != 0:
	print('1', end=' ')
	c1 -= 1
while c2 != 0:
	print('0', end=' ')
	c2 -= 1


inp = input
li = list
iinp = lambda : int(inp())
ent = lambda : map(int, inp().split())
lient = lambda : li(ent())
n = iinp()
cadena = inp()
o = n = e = z = r = 0
for i in cadena:
	if i == 'o':
		o += 1
	elif i == 'n':
		n += 1
	elif i == 'e':
		e += 1
	elif i == 'z':
		z += 1
	elif i == 'r':
		r += 1
res = ''
while o > 0 and n > 0 and (e > 0):
	res += '1 '
	o -= 1
	n -= 1
	e -= 1
while z > 0 and e > 0 and (r > 0) and (o > 0):
	res += '0 '
	z -= 1
	e -= 1
	r -= 1
	o -= 1
print(res[:-1])


n = int(input())
s = str(input())
countZ = 0
countN = 0
for i in range(n):
	if s[i] == 'z':
		countZ += 1
	elif s[i] == 'n':
		countN += 1
for i in range(countN):
	print(1, end=' ')
for i in range(countZ):
	print(0, end=' ')


tab = []
n = int(input())
string = input()
for i in range(string.count('n')):
	tab.append('1 ')
for i in range(string.count('z')):
	tab.append('0 ')
print(''.join(tab))


n = int(input())
word = str(input())
n0 = 0
n1 = 0
for i in range(n):
	if word[i] == 'n':
		n0 += 1
	elif word[i] == 'z':
		n1 += 1
for i in range(n0):
	print(1, end=' ')
for i in range(n1):
	print(0, end=' ')


n = int(input())
s = str(input())
print('1 ' * s.count('n') + '0 ' * s.count('z'))


n = int(input())
st = input()
st1 = list('1' * st.count('n') + '0' * st.count('z'))
print(*st1, sep=' ')


n = int(input())
s = input()
z_cnt = s.count('z')
n_cnt = s.count('n')
print('1 ' * n_cnt + '0 ' * z_cnt)


n = int(input())
s = input()
one = 0
zero = 0
for c in s:
	if c == 'z':
		zero += 1
	elif c == 'n':
		one += 1
print(' '.join(['1' for _ in range(one)] + ['0' for _ in range(zero)]))


n = int(input())
jumbled = input()
ones = jumbled.count('n')
zeroes = jumbled.count('r')
ans = '1 ' * ones
ans += str('0 ' * zeroes)
print(ans)


n = int(input())
s = input()
(cz, ce, cr, co, cn) = (0, 0, 0, 0, 0)
for i in s:
	if i == 'z':
		cz += 1
	elif i == 'e':
		ce += 1
	elif i == 'r':
		cr += 1
	elif i == 'o':
		co += 1
	elif i == 'n':
		cn += 1
for i in range(cn):
	print('1 ', end='')
for i in range(cz):
	print('0 ', end='')


def maxCardCount(string):
	res = []
	for ch in string:
		if ch == 'z':
			res.append('0')
		if ch == 'n':
			res.insert(0, '1')
	return ' '.join(res)
n = int(input())
string = input().strip()
print(maxCardCount(string))


n = int(input())
s = input()
no = []
nos = []
for i in s:
	if i == 'n':
		no.append(1)
	elif i == 'r':
		no.append(0)
no.sort(reverse=True)
no = map(str, no)
print(' '.join(no))


n = int(input())
binary = input()
l1 = []
ones = binary.count('n')
zeros = binary.count('z')
if ones > 0:
	for x in range(ones):
		l1.append(1)
if zeros > 0:
	for x in range(zeros):
		l1.append(0)
print(*l1)


n = int(input())
s = input()
l = list(s)
kn = s.count('n')
kz = s.count('z')
i = 0
for i in range(kn):
	print(1, end=' ')
for i in range(kz):
	print(0, end=' ')


n = int(input())
s = str(input())
i = s.count('n')
if i > 0:
	print(i * ' 1', end=' ')
j = s.count('z')
if j > 0:
	print(j * ' 0')


n = int(input())
s = input()
i = 0
count = 0
count1 = 0
while i < n:
	if s[i] == 'n':
		count = count + 1
	if s[i] == 'z':
		count1 = count1 + 1
	i = i + 1
j = 0
while j < count:
	print(1, end=' ')
	j = j + 1
l = 0
while l < count1:
	print(0, end=' ')
	l = l + 1


n_letter = int(input())
letters = list(input())
zeros = letters.count('z')
ones = letters.count('n')
saida = []
for i in range(ones):
	saida.append(1)
for j in range(zeros):
	saida.append(0)
print(*saida, sep=' ')


n = int(input())
arr = list(input())
z = 0
n = 0
for i in arr:
	if i == 'z':
		z += 1
	if i == 'n':
		n += 1
ans = ['1'] * n + ['0'] * z
print(' '.join(ans))


n = int(input())
s = str(input())
count = 0
for i in range(len(s)):
	if s[i] == 'z':
		count = count + 1
	else:
		continue
a = int(count)
b = int((len(s) - 4 * count) / 3)
print('1 ' * b, '0 ' * a)


n = int(input())
s = input()
coz = 0
coo = 0
s = list(s)
for i in range(n):
	if s[i] == 'z':
		coz += 1
	elif s[i] == 'n':
		coo += 1
for i in range(coo):
	print(1, end=' ')
for i in range(coz):
	print(0, end=' ')
print()


n = int(input())
s = input()
e = s.count('e')
z = s.count('z')
print('1 ' * (e - z) + '0 ' * z)


n = int(input())
s = input()
ns = s.count('n')
zs = (n - ns * 3) // 4
print(*[1 for _ in range(ns)], *[0 for _ in range(zs)])


l = int(input())
s = input()
ones = s.count('n')
zeros = int((l - ones * 3) / 4)
out = ''
for _ in range(ones):
	out = out + '1 '
for _ in range(zeros):
	out = out + '0 '
print(out[:-1])


n = int(input())
s = input()
s = sorted(s)
zero = 0
one = 0
for i in s:
	if i == 'z':
		zero += 1
	elif i == 'n':
		one += 1
for i in range(one):
	print(1, end=' ')
for j in range(zero):
	if j != zero - 1:
		print(0, end=' ')
	else:
		print(0)


n = int(input())
s = input()
o = s.count('o')
n = s.count('n')
e = s.count('e')
one = min(o, n, e)
zz = s.count('z')
ee = s.count('e') - one
rr = s.count('r')
oo = s.count('o') - one
zero = min(zz, ee, rr, oo)
print('1 ' * one + '0 ' * zero)


n = int(input())
tekst = str(input())
a = tekst.count('z')
b = tekst.count('n')
stri = ''
if b > 0:
	for i in range(b):
		stri += '1 '
	for j in range(a):
		stri += '0 '
else:
	print('0 ' * a)
print(stri)


n = input()
s = input()
n = s.count('n')
o = s.count('o')
e = s.count('e')
z = s.count('z')
r = s.count('r')
m = min(n, o, e)
for i in range(m):
	print(1, end=' ')
e -= m
o -= m
for i in range(min(o, e, z, r)):
	print(0, end=' ')


n = int(input())
s = str(input())
z = s.count('z')
o = s.count('n')
l = []
for i in range(o):
	l.append(1)
for i in range(z):
	l.append(0)
for x in l:
	print(x, end=' ')


main1 = int(input())
main2 = input()
zeros = int(main2.count('z'))
ones = int(main2.count('n'))
res = ''
for x in range(0, ones):
	res = res + '1 '
for x in range(0, zeros):
	res = res + '0 '
print(res.strip())


(n, arr) = (input(), input())
print('1 ' * arr.count('n') + '0 ' * arr.count('z'))


N = int(input())
S = input()
count_n = 0
count_z = 0
for i in range(N):
	if S[i] == 'n':
		count_n += 1
	elif S[i] == 'z':
		count_z += 1
ans = []
for i in range(count_n):
	ans.append('1')
for i in range(count_z):
	ans.append('0')
print(' '.join(ans))


n = int(input(''))
s = input('')
i = 1
output = ''
z = s.count('z')
o = s.count('n')
while i <= o:
	output = output + '1' + ' '
	i += 1
g = 1
while g <= z:
	output = output + '0' + ' '
	g += 1
print(output)


m = int(input())
s = input()
x = s.count('n')
y = s.count('z')
while x:
	print(1, end=' ')
	x -= 1
while y:
	print(0, end=' ')
	y -= 1


n = int(input())
s = list(input())
ans = []
for i in range(n):
	if s[i] == 'z':
		ans.append(0)
	if s[i] == 'n':
		ans.append(1)
ans = sorted(ans, reverse=True)
print(*ans)


n = int(input())
a = input()
l = list(a)
zeros = l.count('z')
s = ''
ones = (len(l) - zeros * 4) // 3
for i in range(ones):
	s = s + '1 '
for j in range(zeros):
	s = s + '0 '
print(s[0:-1])


n = int(input())
l = list(input())
s = ''
for i in range(l.count('n')):
	s += '1 '
for i in range(l.count('z') - 1):
	s += '0 '
if l.count('z') >= 1:
	s += '0'
print(s)


def solve(n, s, d):
	zeros = d.get('z', 0)
	ones = d.get('n', 0)
	res = ''
	for i in range(ones):
		res += '1' + ' '
	for i in range(zeros):
		res += '0' + ' '
	return res
n = int(input())
s = input()
d = {}
for c in s:
	d[c] = d.get(c, 0) + 1
print(solve(n, s, d))


n = input()
s = input()
one = s.count('n')
zero = s.count('z')
ans = ['1' for i in range(one)]
ans += ['0' for i in range(zero)]
print(' '.join(ans))


n = int(input())
s = input()
(countz, countn) = (0, 0)
for i in range(n):
	if s[i] == 'z':
		countz += 1
	elif s[i] == 'n':
		countn += 1
ans = ''
for i in range(countn):
	ans += '1 '
for i in range(countz):
	ans += '0 '
print(ans)


n = int(input())
s = input()
t = 0
a = ['o', 'n', 'e', 'z', 'o']
b = [0, 0, 0, 0, 0]
l = list(s)
b[0] = l.count('o')
b[1] = l.count('n')
b[2] = l.count('e')
b[3] = l.count('z')
b[4] = l.count('r')
if b[3] < b[4]:
	t = t + b[3]
else:
	t = t + b[4]
for i in range(b[1]):
	print(1, end=' ')
for i in range(t):
	print(0, end=' ')


num = int(input())
s = input()
o_count = 0
z_count = 0
for i in s:
	if i == 'n':
		o_count = o_count + 1
	if i == 'z':
		z_count = z_count + 1
for i in range(0, o_count):
	print(1, end=' ')
for j in range(0, z_count):
	print(0, end=' ')


N = int(input())
ns = input().count('n')
print(*['1'] * ns + ['0'] * ((N - 3 * ns) // 4))


n = int(input())
s = input()
z = s.count('z')
e = s.count('e')
r = s.count('r')
o = s.count('o')
n = s.count('n')
ones = min(o, n, e)
o -= ones
n -= ones
e -= ones
zeros = min(z, e, r, o)
res = []
res += [1] * ones
res += [0] * zeros
print(*res)


n = int(input())
array = input()
array = list(array)
zero = array.count('z')
one = array.count('n')
algarisms = zero + one
if one > 0:
	for i in range(one):
		print('1 ', end='')
if zero > 0:
	for i in range(zero):
		print('0 ', end='')


from collections import Counter
n = int(input())
s = list(input())
res = ''
one = s.count('n')
res += '1 ' * one
z = s.count('z')
res += '0 ' * z
print(res)


import re

def cards(n, s):
	pat = re.compile('z')
	zeroes = pat.findall(s)
	pat1 = re.compile('n')
	ones = pat1.findall(s)
	ss = len(ones) * '1' + len(zeroes) * '0'
	return ss
n = int(input())
s = input()
ans = cards(n, s)
for i in ans:
	print(i, end=' ')


from collections import Counter
_ = input()
string = input()
char_dict = Counter(string)
ones = min(char_dict['o'], char_dict['n'], char_dict['e'])
char_dict['o'] -= ones
char_dict['e'] -= ones
zeroes = min(char_dict['z'], char_dict['e'], char_dict['r'], char_dict['o'])
print(' '.join(['1' for _ in range(ones)]) + ' ' + ' '.join(['0' for _ in range(zeroes)]))


n = int(input())
s = input()
t1 = t2 = 0
for i in range(n):
	if s[i] == 'z':
		t1 += 1
	if s[i] == 'n':
		t2 += 1
for i in range(t2):
	print(1, ' ', end='')
for i in range(t1):
	print(0, ' ', end='')


n = int(input(''))
word = input('')
n = 0
z = 0
for i in word:
	if i == 'n':
		n += 1
	if i == 'z':
		z += 1
s = ['1'] * n + ['0'] * z
print(' '.join(s))


size = int(input())
text = input()
print('1 ' * text.count('n') + '0 ' * text.count(min('z', 'r')))


n = (int, input())
str = input().lower()
a = str.count('n')
b = str.count('z')
for i in range(a):
	if a >= 1:
		print('1', end=' ')
for j in range(b):
	if b >= 1:
		print('0', end=' ')


a = [*open(0)][1].count
print(*[1] * a('n') + [0] * a('r'))


from collections import Counter
nm = int(input())
l = list(input())
x = Counter(l)
n = x['n']
o = x['o']
e = x['e']
r = x['r']
z = x['z']
one = min(n, o, e)
if one > 0:
	for t in range(one):
		print(1, end=' ')
n = n - one
o = o - one
e = e - one
zero = min(z, e, r, o)
if zero > 0:
	for ty in range(zero):
		print(0, end=' ')


kolvo = input()
a = input()
_0 = int(a.count('z'))
_1 = int(a.count('n'))
a = '1' * _1 + '0' * _0
a = a.replace('', ' ')
a = a.strip()
print(a)


from collections import Counter
input()
s = Counter(input())
ans = '1 ' * s['n'] + '0 ' * s['z']
print(ans)


n = int(input())
a = input()
for x in range(a.count('n')):
	print('1', end=' ')
for x in range(a.count('z')):
	print('0', end=' ')


a = input()
string = input()
zero = [0 for _ in range(string.count('r'))]
one = [1 for _ in range(string.count('n'))]
res = one + zero
[print(i, end=' ') for i in res]


n = int(input())
s = input()
d = {}
for c in 'zerone':
	d[c] = 0
for c in s:
	d[c] += 1
k1 = min(d['o'], d['n'], d['e'])
d['o'] -= k1
k0 = min(d['o'], d['z'], d['e'], d['r'])
print('1 ' * k1 + '0 ' * k0)


n = int(input())
lis = [a for a in input()]
ones = lis.count('n')
zeroes = lis.count('z')
ans = '1 ' * ones + '0 ' * zeroes
print(ans[:-1])


k = int(input())
i = input()
s = '1' * i.count('n') + '0' * i.count('z')
print(s.replace('', ' ').strip(' '))


n = int(input())
s = input()
n_count = s.count('n')
z_count = s.count('z')
print('1 ' * n_count + '0 ' * z_count)


n = int(input())
s1 = str(input())
s = list(s1)
t = min(s.count('o'), s.count('n'), s.count('e'))
t1 = s.count('o') - t
t2 = s.count('n') - t
t3 = s.count('e') - t
t4 = min(s.count('z'), s.count('r'), t1, t3)
a = [1] * t
b = [0] * t4
print(*a, end=' ')
print(*b)


o = z = 0
n = int(input())
s = str(input())
for i in s:
	if i == 'n':
		o += 1
	elif i == 'z':
		z += 1
print(f"{o * '1 '}{z * '0 '}")


t = input()
m = input()
one = m.count('n')
zero = m.count('z')
out = ''
for i in range(one):
	out += '1 '
for i in range(zero):
	out += '0 '
print(out)


num = int(input())
word = input()
if len(word) == num:
	n = 0
	z = 0
	for i in word:
		if i == 'z':
			z += 1
		elif i == 'n':
			n += 1
	print('1 ' * n + '0 ' * z)


n = int(input())
x = input()
x = sorted(x)
otv = []
for i in range(n):
	if x[i] == 'n':
		otv.append('1')
	elif x[i] == 'z':
		otv.append('0')
print(' '.join(otv))


len = int(input())
s = input()
n0 = s.count('z')
n1 = s.count('n')
print('1 ' * n1 + '0 ' * n0)


n = int(input())
s = input()
zs = 0
ns = 0
for ch in s:
	if ch == 'n':
		ns += 1
	elif ch == 'z':
		zs += 1
ans = ''
for i in range(ns):
	ans = ans + '1 '
for i in range(zs):
	ans = ans + '0 '
print(ans)


from collections import Counter
n = int(input())
l = list(input())
d = dict(Counter(l))
try:
	z = d['z']
except:
	z = 0
try:
	o = d['n']
except:
	o = 0
for i in range(o):
	print('1', end=' ')
for i in range(z):
	print('0', end=' ')


n = int(input())
s = input()
l = []
o = s.count('n')
z = s.count('z')
for _ in range(o):
	l.append(1)
for _ in range(z):
	l.append(0)
print(*l)


a = input()
b = input()
c = b.count('z')
d = b.replace('e', '', c)
e = d.count('e')
f = ''
for _ in range(e):
	f += ' 1'
for _ in range(c):
	f += ' 0'
print(f)


l = int(input())
n = input()
count_z = 0
count_o = 0
for i in n:
	if i == 'z':
		count_z = count_z + 1
	if i == 'o':
		count_o = count_o + 1
count_o = count_o - count_z
res = ''
for j in range(count_o):
	res = res + '1 '
for j in range(count_z):
	res = res + '0 '
print(res)


import heapq

def func(x):
	count_z = 0
	for i in range(len(x)):
		if x[i] is 'z':
			count_z += 1
	z_length = 4
	one_length = 3
	ans = []
	total = len(x)
	ones = (total - z_length * count_z) // one_length
	ans.extend([0] * count_z)
	ans.extend([1] * ones)
	ans.sort()
	return ans
x = int(input())
s = str(input())
arr = func(s)
if len(arr) is 0:
	print()
elif len(arr) is 1:
	print(arr[0])
else:
	for i in range(len(arr) - 1, 0, -1):
		print(arr[i], end=' ')
	print(arr[0])


n = int(input())
s = input()
num_1 = s.count('n')
num_0 = s.count('z')
for i in range(num_1):
	print(1, end=' ')
for i in range(num_0):
	print(0, end=' ')


n = int(input())
s = str(input())
o = 0
z = 0
ans = ''
for i in s:
	if i == 'o':
		o += 1
	elif i == 'z':
		z += 1
for j in range(o - z):
	ans += '1'
for k in range(z):
	ans += '0'
print(' '.join([str(i) for i in ans]))


n = int(input())
m = input()
str = ''
all_freq = {'n': 0, 'z': 0}
for i in m:
	if i in all_freq:
		all_freq[i] += 1
	else:
		all_freq[i] = 1
x = all_freq['n']
while x != 0:
	str += '1 '
	x = x - 1
x = all_freq['z']
while x != 0:
	str += '0 '
	x = x - 1
print(str)


n = int(input())
s = input()
n = s.count('n')
e = s.count('e')
z = s.count('z')
r = s.count('r')
o = s.count('o')
ones = min(n, e, o)
for i in range(ones):
	print(1, end=' ')
o -= ones
e -= ones
zeros = min(z, r, o, e)
for i in range(zeros):
	print(0, end=' ')


x = int(input())
s = input()
u = s.count('z')
w = s.count('n')
a = [0] * u
b = [1] * w
c = b + a
print(*c)


from collections import Counter
_ = input()
d = dict()
c = Counter(input())
zeros = c['z']
ones = c['o'] - zeros
print(' '.join(['1'] * ones + ['0'] * zeros))


n = int(input())
s = input()
k0 = 0
k1 = 0
for c in s:
	if c == 'z':
		k0 += 1
	if c == 'n':
		k1 += 1
while k1 != 0:
	print(1, end=' ')
	k1 -= 1
while k0 != 0:
	print(0, end=' ')
	k0 -= 1


n = int(input())
arr = list(input())
ones = 3
zeroes = 4
z1 = arr.count('z')
n1 = arr.count('n')
new = []
for i in range(n1):
	new.append('1')
for i in range(z1):
	new.append('0')
print(*new, sep=' ')


n = int(input())
s = input()
z1 = s.count('n')
z2 = s.count('z')
flag = 0
for i in range(z1):
	print(1, end=' ')
	flag = 1
for i in range(z2):
	print(0, end=' ')


length = int(input())
l = input()
l = l.strip()
l = l.lower()
zeros = int(l.count('z'))
ones = int((length - zeros * 4) / 3)
lst = [1] * ones + [0] * zeros
c = 0
output = ''
while c < len(lst):
	lst[c] = str(lst[c])
	output += lst[c] + ' '
	c += 1
print(output)


n = int(input())
s = input()
a = list(s)
z = a.count('z')
e = a.count('e')
r = a.count('e')
n = a.count('n')
o = a.count('o')
if n > 0 and z > 0:
	for i in range(n + z):
		if i < n:
			print('1', end=' ')
		elif i >= n:
			print('0', end=' ')
elif z > 0:
	for i in range(z):
		print('0', end=' ')
elif n > 0:
	for i in range(n):
		print('1', end=' ')


n = int(input())
letters = input()
zeros = letters.count('z')
ones = letters.count('n')
print('1 ' * ones, '0 ' * zeros, sep='')


def main():
	dd = input()
	c = input()
	zc = len([d for d in c if d == 'z'])
	oc = (len(c) - zc * 4) // 3
	print(' '.join(['1'] * oc + ['0'] * zc))
main()


n = int(input())
c = input()
pos = ''
o = c.count('o')
n = c.count('n')
e = c.count('e')
z = c.count('z')
r = c.count('r')
if o > r:
	o = o - r
	pos += '1 ' * o
pos += '0 ' * r
print(pos)


n = int(input())
s = input()
counts = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for c in s:
	counts[c] += 1
ones = min(counts['o'], counts['n'], counts['e'])
counts['o'] -= ones
counts['n'] -= ones
counts['e'] -= ones
zeros = min(counts['z'], counts['e'], counts['r'], counts['o'])
z = ['0'] * zeros
o = ['1'] * ones
print(' '.join(o + z))


n = int(input())
s = input()
a = {}
b = []
z = 0
n = 0
a['n'] = n
a['z'] = z
for i in range(len(s)):
	if s[i] == 'n':
		n += 1
		a['n'] = n
	if s[i] == 'z':
		z += 1
		a['z'] = z
one = a.get('n')
zero = a.get('z')
if one > 0:
	for j in range(0, one):
		b.append(1)
if zero > 0:
	for k in range(0, zero):
		b.append(0)
for p in range(len(b)):
	print(b[p], end=' ')


t = int(input())
s = input()
p = s.count('z')
q = s.count('n')
k = '1 ' * q + '0 ' * p
print(k)


def count_letter(lst, ltr):
	cnt = 0
	for c in lst:
		if c == ltr:
			cnt += 1
	return cnt

def get_biggest_bin(lst):
	s = ''
	for _ in range(count_letter(lst, 'n')):
		s += ' 1'
	for _ in range(count_letter(lst, 'z')):
		s += ' 0'
	return s[1:]
input()
print(get_biggest_bin(input()))


input()
A = input()
print(*[1 for i in range(A.count('n'))], *[0 for i in range(A.count('z'))])


n = int(input())
s = input()
a = s.count('n')
b = s.count('z')
c = '1 ' * a + '0 ' * b
print(c.rstrip().lstrip())


n = input()
st = input()
ones = st.count('n')
zeros = (len(st) - 3 * ones) // 4
while ones:
	ones -= 1
	print(1, end=' ')
while zeros:
	zeros -= 1
	print(0, end=' ')


n = int(input())
kards = list(input())
vok = {}
vok['z'] = 0
vok['e'] = 0
vok['r'] = 0
vok['o'] = 0
vok['n'] = 0
for i in range(n):
	if kards[i] in vok:
		vok[kards[i]] += 1
k = min(vok['o'], vok['n'], vok['e'])
z = min(vok['z'], vok['e'] - k, vok['r'], vok['o'] - k)
answ = ['1'] * k + ['0'] * z
print(*answ, sep=' ')


n = int(input())
s = input()
(a, b) = (0, 0)
for x in s:
	if x == 'z':
		a += 1
	elif x == 'n':
		b += 1
for x in range(b):
	print(1, end=' ')
for x in range(a):
	print(0, end=' ')


n = int(input())
st = input()
cnt = dict()
for i in st:
	cnt[i] = cnt.get(i, 0) + 1
if 'n' in cnt:
	while cnt['n'] > 0:
		print(1, end=' ')
		cnt['n'] -= 1
if 'z' in cnt and 'r' in cnt:
	while cnt['z'] > 0 and cnt['r'] > 0:
		print(0, end=' ')
		cnt['z'] -= 1
		cnt['r'] -= 1


x = int(input())
y = list(input())
(z, e, r, o, n) = (0, 0, 0, 0, 0)
for i in y:
	if i == 'z':
		z += 1
	if i == 'e':
		e += 1
	if i == 'r':
		r += 1
	if i == 'o':
		o += 1
	if i == 'n':
		n += 1
if n <= o and n <= e:
	o = o - n
	e = e - n
	print(n * '1 ', end='')
if z == o and e == z and (r == z):
	print(z * '0 ')


def cards(n, string):
	binarylist = []
	for i in range(string.count('n')):
		binarylist.append(1)
	for i in range(string.count('r')):
		binarylist.append(0)
	return binarylist
n = int(input())
string = str(input())
iterable = ' '
cardslist = cards(n, string)
print(iterable.join(list(map(str, cardslist))))


n = int(input())
letters = input()
count_ones = letters.count('n')
l = len(letters)
l -= count_ones * 3
count_zeros = l // 4
answer = ['1'] * count_ones + ['0'] * count_zeros
print(' '.join(answer))


n = int(input())
string = input()
one = string.count('n')
zero = string.count('z')
for i in range(one):
	print(1, end=' ')
for j in range(zero):
	print(0, end=' ')


n = input()
l = input()
z = l.count('z')
c = l.count('o')
o = c - z
print(' '.join(['1'] * o + ['0'] * z))


n = int(input())
a = input()
zero = 0
one = 0
output = ''
for i in a:
	if i == 'z':
		zero += 1
	elif i == 'n':
		one += 1
for i in range(one):
	output += '1 '
for i in range(zero):
	output += '0 '
print(output)


def rahul(word):
	return [char for char in word]
a = int(input())
z = input()
b = rahul(z)
r = 0
c = 0
while r < a:
	if b[r] == 'z':
		c = c + 1
	r = r + 1
d = a - 4 * c
e = d / 3
r = 1
f = list()
while r <= e:
	f.append(1)
	r = r + 1
r = 1
while r <= c:
	f.append(0)
	r = r + 1
print(' '.join([str(char) for char in f]))


n = int(input())
a = input()
b = list(a)
c = 0
for i in b:
	if i == 'z':
		c += 1
q = n - c * 4
w = q // 3
y = []
for r in range(w):
	y.append(1)
for t in range(c):
	y.append(0)
for p in y:
	print(p, end=' ')


n = eval(input())
s = input()
dic = {}
for x in s:
	if x in dic.keys():
		dic[x] += 1
	else:
		dic[x] = 1
s2 = ''
f = 0
if 'n' in dic.keys():
	ls = ['1' for x in range(dic['n'])]
	s2 += ' '.join(ls)
	f = 1
if 'z' in dic.keys():
	ls2 = ['0' for x in range(dic['z'])]
	if f == 1:
		s2 += ' '
	s2 += ' '.join(ls2)
print(s2)


q = int(input())
l = input()
c = 0
d = 0
for a in l:
	if a == 'n':
		c = c + 1
	if a == 'z':
		d = d + 1
print(c * '1 ' + d * '0 ')


n = int(input())
word = list(input())
my_dict = dict()
answer = list()
for i in word:
	my_dict[i] = my_dict.get(i, 0) + 1
if 'n' in my_dict:
	for i in range(my_dict['n']):
		answer.append(1)
if 'z' in my_dict:
	for i in range(my_dict['z']):
		answer.append(0)
print(*answer, sep=' ')


total = int(input())
s = input()
n = s.count('n')
z = s.count('z')
print('1 ' * n + '0 ' * z)


n = int(input())
arr = input()
a = []
for i in arr:
	if i == 'z':
		a.append(0)
	elif i == 'n':
		a.insert(0, 1)
print(*a, sep=' ')


n = int(input())
s = ' '.join(input()).split()
for i in range(s.count('n')):
	print(1, end=' ')
for i in range(s.count('z')):
	print(0, end=' ')


n = int(input())
s = input()
one = s.count('n')
zero = s.count('z')
bi = ['1'] * one
bi2 = ['0'] * zero
ans = bi + bi2
for i in range(len(ans)):
	print(ans[i], end=' ')


a_list = []
n = int(input())
st = input()
for i in range(n):
	a_list.append(st[i])
frequencies = {}
for item in a_list:
	if item in frequencies:
		frequencies[item] += 1
	else:
		frequencies[item] = 1
o_count = 0
n_count = 0
e_count = 0
o_count = frequencies.get('o')
n_count = frequencies.get('n')
e_count = frequencies.get('e')
try:
	r = min(o_count, n_count, e_count)
	u_o = frequencies.get('o') - r
	u_n = frequencies.get('n') - r
	u_e = frequencies.get('e') - r
	frequencies.update({'o': u_o})
	frequencies.update({'n': u_n})
	frequencies.update({'e': u_e})
	for _ in range(r):
		print('1 ', end=' ')
except:
	pass
z_count = frequencies.get('z')
e_count = frequencies.get('e')
r_count = frequencies.get('r')
o_count = frequencies.get('o')
try:
	s = min(z_count, e_count, r_count, o_count)
	for _ in range(s):
		print('0 ', end=' ')
except:
	pass


def main():
	n = int(input())
	letters = input()
	ones_count = 0
	zeros_count = 0
	for l in letters:
		if l == 'z':
			zeros_count += 1
		elif l == 'n':
			ones_count += 1
	ans = []
	for _ in range(ones_count):
		ans.append('1')
	for _ in range(zeros_count):
		ans.append('0')
	print(' '.join(ans))
main()


a = int(input())
b = input()
one = b.count('n')
zero = b.count('z')
s = ''
for i in range(one):
	s += '1 '
for i in range(zero):
	s += '0 '
print(s)


import sys

def read(func=int):
	return func(sys.stdin.readline().strip())

def readList(func=int):
	return list(map(func, sys.stdin.readline().split()))
n = read()
s = read(str)
m = {}
for char in s:
	m[char] = m.get(char, 0) + 1
ones = (len(s) - m.get('z', 0) * 4) // 3
ans = [1] * ones + [0] * m.get('z', 0)
print(*ans)


no = input()
nos = input()
no = int(no)
no1 = 0
no2 = 0
for i in nos:
	if i == 'n':
		no1 += 1
	elif i == 'z':
		no2 += 1
for i in range(no1):
	print('1', end=' ')
for i in range(no2):
	print('0', end=' ')


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')
n = int(input())
vals = [k for k in input()]
zero = 0
one = 0
for j in range(n):
	if vals[j] == 'z':
		zero += 1
	elif vals[j] == 'n':
		one += 1
ans = []
for s in range(one):
	ans.append(1)
for s in range(zero):
	ans.append(0)
print(*ans)


d = int(input())
a = input()
n = a.count('n')
z = a.count('z')
if z != 0:
	print('1 ' * n + '0 ' * (z - 1) + '0')
else:
	print('1 ' * (n - 1) + '1')


N = int(input())
checker = list(input())
print('1 ' * checker.count('n') + '0 ' * checker.count('z'))


n = input()
w = input()
f = str()
pro = [0] * 5
ans = str()
for i in w:
	if i == 'z':
		pro[0] += 1
	elif i == 'e':
		pro[1] += 1
	elif i == 'r':
		pro[2] += 1
	elif i == 'o':
		pro[3] += 1
	elif i == 'n':
		pro[4] += 1
f = pro[0] * 'z' + pro[1] * 'e' + pro[2] * 'r' + pro[3] * 'o' + pro[4] * 'n'
for i in range(f.count('n')):
	ans += '1 '
for i in range(f.count('z')):
	ans += '0 '
print(ans)


a = int(input())
b = str(input())
n = b.count('n')
z = b.count('z')
s = ''
if n == 0 and z == 0:
	print('')
elif z == 0 and n != 0:
	s = s + '1'
	for i in range(n - 1):
		s = s + ' 1'
	print(s)
elif z != 0 and n == 0:
	s = s + '0'
	for j in range(z - 1):
		s = s + ' 0'
	print(s)
else:
	for m in range(n):
		s = s + '1 '
	for n in range(z - 1):
		s = s + '0 '
	s = s + '0'
	print(s)


def answer():
	n = int(input())
	a = list(input())
	ones = 0
	zeroes = 0
	for x in a:
		if x == 'n':
			ones += 1
		if x == 'z':
			zeroes += 1
	s_out = ''
	while ones:
		s_out += '1'
		if ones > 1:
			s_out += ' '
		elif zeroes:
			s_out += ' '
		ones -= 1
	while zeroes:
		s_out += '0'
		if zeroes > 1:
			s_out += ' '
		zeroes -= 1
	print(s_out)
answer()


my_dict = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}

class Solution:

	def reArrangeCards(self, string):
		for ch in string:
			my_dict[ch] += 1
		answer = ''
		numOfOnes = min(my_dict['o'], my_dict['n'], my_dict['e'])
		my_dict['o'] -= numOfOnes
		my_dict['n'] -= numOfOnes
		my_dict['e'] -= numOfOnes
		numOfZeros = min(my_dict['z'], my_dict['e'], my_dict['r'], my_dict['o'])
		for _ in range(numOfOnes):
			answer += '1 '
		for _ in range(numOfZeros):
			answer += '0 '
		return answer
sol = Solution()
t = int(input().strip())
string = input().strip()
print(sol.reArrangeCards(string))


from collections import Counter
n = input()
word = input()
cnt_word = Counter(word)
respuesta = ''
respuesta += '1 ' * cnt_word['n']
respuesta += '0 ' * cnt_word['z']
respuesta.rstrip()
print(respuesta)


from collections import defaultdict
len_str = int(input())
input_str = [char for char in input()]
letters_freq = defaultdict(int)
for letter in input_str:
	letters_freq[letter] += 1
num_ones = letters_freq['n']
num_zeros = letters_freq['z']
for i in range(num_ones):
	print(1, end=' ')
for i in range(num_zeros):
	print(0, end=' ')


n = int(input())
word = list(input())
z = 0
n = 0
for i in word:
	if i == 'z':
		z += 1
	elif i == 'n':
		n += 1
for i in range(n):
	print('1', end=' ')
for i in range(z):
	print('0', end=' ')


n = int(input())
list = list(input())
a = list.count('n')
b = list.count('z')
for i in range(0, a):
	print(1, end=' ')
for i in range(0, b):
	print(0, end=' ')


n = int(input())
x = list(input())
n = x.count('n')
z = x.count('z')
final = ['1'] * n + ['0'] * z
for i in final:
	print(i, end=' ')


n = int(input())
s = str(input().replace('', ' '))
n1 = s.count('n')
z1 = s.count('z')
if n1 >= 1 and z1 >= 1:
	print('1 ' * n1, '0 ' * z1)
elif n1 == 0 and z1 >= 1:
	print('0 ' * z1)
elif n1 >= 1 and z1 == 0:
	print('1 ' * n1)


b = int(input())
a = input()
c = a.count('z')
d = a.count('n')
x = [1] * d + [0] * c
print(*x)


n = int(input())
s = input()
d = {'o': 0, 'n': 0, 'e': 0, 'z': 0, 'r': 0}
for c in s:
	if c is 'o':
		d['o'] += 1
	elif c is 'n':
		d['n'] += 1
	elif c is 'e':
		d['e'] += 1
	elif c is 'z':
		d['z'] += 1
	elif c is 'r':
		d['r'] += 1
ones = min(d['o'], d['n'], d['e'])
d['o'] = d['o'] - ones
d['n'] = d['n'] - ones
d['e'] = d['e'] - ones
zeros = min(d['z'], d['e'], d['r'], d['o'])
total = [1] * ones + [0] * zeros
print(*total)


n = int(input())
string = input()
Rcnt = 0
Ncnt = 0
for i in range(n):
	if string[i] == 'r':
		Rcnt += 1
	elif string[i] == 'n':
		Ncnt += 1
ans = '1 ' * Ncnt + '0 ' * Rcnt
print(ans.strip())


n = input()
s = input()
Counter_o = s.count('o')
Counter_n = s.count('n')
Counter_e = s.count('e')
Counter_z = s.count('z')
Counter_r = s.count('r')
Counter_one = min(Counter_o, Counter_n, Counter_e)
Counter_zero = min(Counter_o - Counter_one, Counter_e - Counter_one, Counter_z, Counter_r)
for i in range(0, Counter_one):
	print(1, end=' ')
for i in range(0, Counter_zero):
	print(0, end=' ')


n = int(input())
line = input()
numN = line.count('n')
numZ = line.count('z')
for i in range(0, numN):
	print('1', end='')
	if i + 1 != numN:
		print(' ', end='')
for i in range(0, numZ):
	if numN != 0:
		print(' ', end='')
		numN = 0
	if i == 0:
		print('0', end='')
	elif i != 0:
		print(' 0', end='')
print()


n = int(input())
a = input()
x = a.count('n')
y = a.count('z')
ans = '1' * x + '0' * y
for i in ans:
	print(i, end=' ')


n = int(input())
string = list(input())
if string.count('n') > 0 and string.count('z') > 0:
	print('1 ' * string.count('n') + '0 ' * (string.count('z') - 1) + '0')
elif string.count('n') > 0 and string.count('z') == 0:
	print('1 ' * (string.count('n') - 1) + '1')
else:
	print('0 ' * (string.count('z') - 1) + '0')


str_len = int(input())
string = input()
n = 0
z = 0
str = ''
for i in range(str_len):
	if string[i] == 'n':
		str = '1 ' + str
	if string[i] == 'z':
		str = str + ' 0'
print(str)


from heapq import heappush, heappop
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations
import sys
import bisect
import string

def I():
	return int(input())

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

def LI():
	return [int(i) for i in input().split()]

def LI_():
	return [int(i) - 1 for i in input().split()]

def StoI():
	return [ord(i) - 97 for i in input()]

def show(*inp, end='\n'):
	if show_flg:
		print(*inp, end=end)
YN = ['Yes', 'No']
mo = 10 ** 9 + 7
input = sys.stdin.readline
show_flg = False
n = I()
s = list(input())
c0 = s.count('z')
c1 = s.count('n')
print(*[1] * c1 + [0] * c0)


n = int(input())
s = input()
c1 = 0
c2 = 0
for i in s:
	if i == 'z':
		c1 += 1
	if i == 'n':
		c2 += 1
s = ''
for j in range(c2):
	s = s + '1' + ' '
for k in range(c1):
	s = s + '0' + ' '
print(s)


n = int(input())
m = input()
zer = 0
one = 0
s = ''
for i in m:
	if i == 'z':
		zer += 1
	elif i == 'n':
		one += 1
while one > 0:
	s = s + '1 '
	one -= 1
while zer > 0:
	s = s + '0 '
	zer -= 1
print(s)


n = int(input())
x = input()
n0 = x.count('z')
n1 = x.count('n')
for _ in range(n1):
	print('1', end=' ')
for _ in range(n0):
	print('0', end=' ')


input()
c = input().count
print('1 ' * c('n') + '0 ' * c('z'))


n = int(input())
s = input()
p = s.count('r')
q = s.count('n')
for _ in range(q):
	print(1, end=' ')
for _ in range(p):
	print(0, end=' ')


n = input()
word = input()
en = 0
z = 0
e = 0
r = 0
o = 0
last = ''
for i in range(0, int(n)):
	if word[i] == 'n':
		en += 1
	elif word[i] == 'z':
		z += 1
	elif word[i] == 'e':
		e += 1
	elif word[i] == 'r':
		r += 1
	elif word[i] == 'o':
		o += 1
for i in range(0, en):
	if last == '':
		last = '1'
	else:
		last = last + ' ' + '1'
if z < e:
	for i in range(0, z):
		last = last + ' ' + '0'
elif e < r:
	for i in range(0, e):
		last = last + ' ' + '0'
elif r < o:
	for i in range(0, e):
		last = last + ' ' + '0'
else:
	for i in range(0, o):
		last = last + ' ' + '0'
print(last)


input()
s = input()
l = [0] * 26
for i in s:
	l[ord(i) - 97] += 1
while l[ord('o') - 97] and l[ord('n') - 97] and l[ord('e') - 97]:
	print(end='1 ')
	l[ord('o') - 97] -= 1
	l[ord('n') - 97] -= 1
	l[ord('e') - 97] -= 1
while l[ord('z') - 97] and l[ord('e') - 97] and l[ord('r') - 97] and l[ord('o') - 97]:
	print(end='0 ')
	l[ord('z') - 97] -= 1
	l[ord('e') - 97] -= 1
	l[ord('r') - 97] -= 1
	l[ord('o') - 97] -= 1


n = int(input())
a = input()
a = list(a)
y = []
b = a.count('z')
c = a.count('o')
for i in range(b):
	y.append('0')
for i in range(abs(b - c)):
	y.append('1')
y = y[::-1]
print(*y)


n = input()
s = input()
ns = 0
zs = 0
for i in s:
	if i == 'n':
		ns += 1
	if i == 'z':
		zs += 1
ans = 0
print('1 ' * ns + '0 ' * zs)


from collections import Counter
n = int(input())
s = input()
c = Counter(s)
z = c['z']
n = c['n']
r = ['1'] * n + ['0'] * z
print(' '.join(r))


a = int(input(''))
b = input('')
c = b.count('z')
d = b.count('n')
s = ''
for j in range(d):
	s = s + ' ' + '1'
for i in range(c):
	s = s + ' ' + '0'
print(s)


n = int(input())
buks = input()
zeros = buks.count('z')
ones = (len(buks) - zeros * 4) // 3
itog = list()
for i in range(ones):
	itog.append('1')
for i in range(zeros):
	itog.append('0')
print(' '.join(itog))


x = int(input(''))
a = input('')
z = 0
n = 0
b = ''
for letter in a:
	if letter == 'z':
		z += 1
	elif letter == 'n':
		n += 1
for i in range(n):
	b += '1 '
for j in range(z):
	b += '0 '
print(b)


n = int(input())
l = list(input())
if l.count('n') > 0:
	print('1' + ' 1' * (l.count('n') - 1) + ' 0' * l.count('z'))
else:
	print('0' + ' 0' * (l.count('z') - 1))


n = int(input())
s = input()
o = ['o', 'n', 'e']
z = ['z', 'e', 'r', 'o']
m = {}
l = []
for _ in s:
	if m.get(_, 0):
		m[_] += 1
	else:
		m[_] = 1
while m.get(o[0], 0) > 0 and m.get(o[1], 0) > 0 and (m.get(o[2], 0) > 0):
	for i in range(3):
		m[o[i]] -= 1
	l.append(1)
while m.get(z[0], 0) > 0 and m.get(z[1], 0) > 0 and (m.get(z[2], 0) > 0) and (m.get(z[3], 0) > 0):
	for i in range(4):
		m[z[i]] -= 1
	l.append(0)
print(*l)


a = int(input())
shuffle = input()
(onelne, zerolen, oi, zi) = (3, 4, 0, 0)
ans = {x: 0 for x in set(shuffle)}
for x in shuffle:
	ans[x] += 1
if 'n' in list(ans.keys()):
	while ans['o'] != 0:
		if ans['n'] > 0 and ans['e'] > 0:
			oi += 1
			ans['o'] -= 1
			ans['n'] -= 1
			ans['e'] -= 1
		else:
			break
if 'z' in list(ans.keys()) and 'r' in list(ans.keys()):
	while ans['z'] > 0:
		if ans['e'] > 0 and ans['r'] > 0 and (ans['o'] > 0):
			zi += 1
			ans['z'] -= 1
			ans['e'] -= 1
			ans['r'] -= 1
			ans['o'] -= 1
		else:
			break
ans = [1] * oi + [0] * zi
print(*ans)


a = int(input())
b = input()
zero = b.count('z')
one = b.count('n')
zero = ' '.join(zero * '0')
one = ' '.join(one * '1')
print(one, zero)


n = int(input())
line = input()
ones = line.count('n')
zeros = line.count('z')
for i in range(ones):
	print(1, end=' ')
for i in range(zeros):
	print(0, end=' ')
print()


a = int(input())
b = input()
c = b.count('z')
c2 = b.count('n')
h = ['1'] * c2 + ['0'] * c
h = list(filter(None, h))
for i in h:
	print(i, end=' ')


n = int(input())
s = input()
(d, k) = (dict(), 0)
for i in s:
	if i in d:
		d[i] += 1
	else:
		d[i] = 1
if 'o' in d and 'n' in d and ('e' in d):
	k = min(d['o'], d['n'], d['e'])
	d['o'] -= k
	d['n'] -= k
	d['e'] -= k
for i in range(k):
	print(1, end=' ')
k = 0
if 'z' in d and 'e' in d and ('r' in d) and ('o' in d):
	k = min(d['z'], d['e'], d['r'], d['o'])
for i in range(k):
	print(0, end=' ')
print()


from string import *
(a, s, x) = (int(input()), input(), [])
for i in range(int(a / 3)):
	if 'o' in s and 'n' in s and ('e' in s):
		x.append(1)
		for j in 'one':
			s = s.replace(j, '', 1)
for i in range(int(a / 4)):
	if 'z' in s and 'r' in s and ('e' in s) and ('o' in s):
		x.append(0)
		for j in 'zero':
			s = s.replace(j, '', 1)
[print(i) for i in x]


n = int(input())
s = [i for i in input()]
o_count = []
z_count = []
for j in s:
	if j == 'z':
		z_count.append(0)
	elif j == 'n':
		o_count.append(1)
	else:
		continue
res = o_count + z_count
print(*res)


n = int(input())
s = input()
o = 0
n = 0
e = 0
z = 0
r = 0
l = []
for i in range(len(s)):
	if s[i] == 'o':
		o += 1
	elif s[i] == 'n':
		n += 1
	elif s[i] == 'e':
		e += 1
	elif s[i] == 'z':
		z += 1
	elif s[i] == 'r':
		r += 1
	if o > 0 and n > 0 and (e > 0):
		l.append(1)
		o -= 1
		n -= 1
		e -= 1
	elif z > 0 and e > 0 and (r > 0) and (o > 0):
		l.append(0)
		z -= 1
		e -= 1
		r -= 1
		o -= 1
l.sort(reverse=True)
for k in l:
	print(k, end=' ')


n = int(input())
s = input()
o = s.count('o')
n = s.count('n')
e = s.count('e')
z = s.count('z')
r = s.count('r')
min1 = min(o, n, e)
a = []
b = []
if min1 > 0:
	a = [1] * min1
	o = o - min1
	n = n - min1
	e = e - min1
min2 = min(z, e, r, o)
b = [0] * min2
c = a + b
print(*c)


n = int(input())
value = input()
counterOnes = 0
counterZeros = 0
for i in value:
	if i == 'n':
		counterOnes += 1
	elif i == 'z':
		counterZeros += 1
temp = []
while counterOnes > 0:
	temp.append('1 ')
	counterOnes -= 1
while counterZeros > 0:
	temp.append('0 ')
	counterZeros -= 1
new = ''
for x in temp:
	new += x
result = [int(n) for n in new.split()]
print(*result)


n = int(input())
s = input()
n1 = s.count('n')
z = s.count('z')
a = ''
while n1 > 0:
	a = a + '1' + ' '
	n1 = n1 - 1
while z > 0:
	a = a + '0' + ' '
	z = z - 1
print(a[:-1])


n = int(input())
s = input()
d = dict()
d['z'] = 0
d['e'] = 0
d['r'] = 0
d['o'] = 0
d['n'] = 0
for i in s:
	d[i] = d[i] + 1
while d['o'] > 0 and d['n'] > 0 and (d['e'] > 0):
	print(1, end=' ')
	d['o'] = d['o'] - 1
	d['n'] = d['n'] - 1
	d['e'] = d['e'] - 1
while d['z'] > 0 and d['e'] > 0 and (d['r'] > 0) and (d['o'] > 0):
	print(0, end=' ')
	d['z'] = d['z'] - 1
	d['e'] = d['e'] - 1
	d['r'] = d['r'] - 1
	d['o'] = d['o'] - 1


n = int(input())
a = input()
dct = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for i in a:
	dct[i] += 1
ans = []
while dct['z'] > 0 and dct['e'] > 0 and (dct['r'] > 0) and (dct['o'] > 0) or (dct['o'] > 0 and dct['n'] > 0 and (dct['e'] > 0)):
	if dct['o'] > 0 and dct['n'] > 0 and (dct['e'] > 0):
		ans.append('1')
		dct['o'] -= 1
		dct['n'] -= 1
		dct['e'] -= 1
	else:
		ans.append('0')
		dct['z'] -= 1
		dct['e'] -= 1
		dct['r'] -= 1
		dct['o'] -= 1
if ans:
	print(' '.join(ans))
else:
	print(0)


nos = int(input())
wrd = str(input())
(n_ctr, o_ctr, e_ctr, z_ctr, r_ctr) = (0, 0, 0, 0, 0)
n_1 = 0
ans = ''

def split(word):
	return [char for char in word]
ls = split(wrd)
for a in ls:
	if a == 'n':
		n_ctr += 1
	if a == 'e':
		e_ctr += 1
n_1 = n_ctr
n_0 = e_ctr - n_ctr
for i in range(n_ctr):
	print('1', end=' ')
for i in range(n_0):
	print('0', end=' ')
print(ans)


n = input()
a = input()
counto = 0
countn = 0
counte = 0
countz = 0
countr = 0
for i in a:
	if i == 'o':
		counto += 1
	elif i == 'n':
		countn += 1
	elif i == 'e':
		counte += 1
	elif i == 'z':
		countz += 1
	else:
		countr += 1
while counto > 0 and countn > 0 and (counte > 0):
	print(1)
	counto -= 1
	countn -= 1
	counte -= 1
while counto > 0 and countz > 0 and (counte > 0) and (countr > 0):
	print(0)
	counto -= 1
	countz -= 1
	counte -= 1
	countr -= 1


n = int(input())
s = input()
n0 = s.count('z')
n1 = s.count('n')
for i in range(n1):
	print(1, end=' ')
for i in range(n0):
	print(0, end=' ')


from bisect import *
from collections import *
from itertools import *
import functools
import sys
import math
from decimal import *
from copy import *
from heapq import *
getcontext().prec = 30
MAX = sys.maxsize
MAXN = 10 ** 6 + 1
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):
	return abs(a[0] - b[0]) + abs(b[1] - a[1])

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

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

def eld(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 ncr(n, r):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % MOD
		den = den * (i + 1) % MOD
	return num * pow(den, MOD - 2, MOD) % MOD

def flush():
	return sys.stdout.flush()

def fac(n):
	ans = 1
	for i in range(1, n + 1):
		ans *= i
		ans %= MOD
	return ans
x = int(input())
s = input()
n = s.count('n')
e = s.count('e') - n
print('1 ' * n + '0 ' * e)


n = int(input())
u = list(input())
r0 = 0
n1 = 0
for i in range(n):
	if u[i] == 'r':
		r0 += 1
	elif u[i] == 'n':
		n1 += 1
for i in range(n1):
	print(1, end=' ')
for i in range(r0):
	print(0, end=' ')


n = int(input())
b = input()
z = 0
o = 0
for i in range(len(b)):
	if b[i] == 'n':
		o = o + 1
	if b[i] == 'z':
		z = z + 1
for i in range(o):
	print('1', end=' ')
for i in range(z):
	print('0', end=' ')


from collections import Counter
input()
count = Counter(input())
ones = ['1'] * count['n']
zeros = ['0'] * count['z']
print(' '.join(ones + zeros))


e = 0
nums = []
N = int(input())
str1 = input()
for i in range(N):
	if str1[i] == 'n':
		nums.append(1)
	elif str1[i] == 'z':
		nums.append(0)
nums.sort(reverse=True)
for each in nums:
	print(each, end=' ')


a = int(input())
b = input()
z = 0
n = 0
r = ''
for i in range(a):
	if b[i] == 'z':
		z += 1
	elif b[i] == 'n':
		n += 1
for j in range(n):
	r = r + '1 '
for k in range(z):
	r = r + '0 '
print(r.strip())


num = int(input())
L = list(input())

def cards(num, list):
	one = 0
	zero = 0
	count = 0
	for n in range(num):
		if L[count] == 'n':
			one += 1
			count += 1
		elif L[count] == 'z':
			zero += 1
			count += 1
		else:
			count += 1
	print('1 ' * one, end='')
	print('0 ' * zero)
cards(num, list)


from collections import Counter
n = int(input())
letters = Counter(input())
one_count = min(letters['o'], letters['n'], letters['e'])
zero_count = min(letters['z'], letters['e'] - one_count, letters['r'], letters['o'] - one_count)
print(' '.join(['1'] * one_count + ['0'] * zero_count))


n = int(input())
s = input()
d = {'z': 0, 'n': 0}
for i in s:
	if i in d:
		d[i] += 1
	else:
		d[i] = 0
(zero, one) = (d['z'], d['n'])
print(' '.join(['1'] * one + ['0'] * zero))


sz = input()
s = input()
n = s.count('n')
z = s.count('z')
print('1 ' * n + '0 ' * z)


letters = int(input())
a = input()
z = a.count('z')
e = a.count('e')
r = a.count('r')
o = a.count('o')
n = a.count('n')
m = min(e, o)
ones = 0
if n >= m:
	ones = m
	o -= m
	e -= m
else:
	ones = min(m, n)
	o -= ones
	e -= ones
zeroes = min(z, min(e, min(r, o)))
for i in range(ones):
	print(1, end=' ')
for i in range(zeroes):
	print(0, end=' ')
print()


n = input()
s = input()
print(*list('1' * s.count('n') + '0' * s.count('z')))


n = int(input())
s = input()
n = s.count('n')
z = s.count('r')
print('1 ' * n + '0 ' * z)


a = int(input())
s = input()
z = s.count('z')
e = s.count('e')
r = s.count('r')
o = s.count('o')
n = s.count('n')
one = min(o, n, e)
o = o - one
e = e - one
zero = min(z, e, r, o)
print('1 ' * one + '0 ' * zero)


import sys
first = True
for line in sys.stdin:
	if first:
		first = False
		continue
	zs = len(list(filter(lambda c: c == 'z', line)))
	ns = len(list(filter(lambda c: c == 'n', line)))
	printed = 0
	for _ in range(ns):
		printed += 1
		if printed == zs + ns:
			print('1', end='\n')
		else:
			print('1', end=' ')
	for _ in range(zs):
		printed += 1
		if printed == zs + ns:
			print('0', end='\n')
		else:
			print('0', end=' ')
	quit()


x = [0, 0, 0, 0, 0]
n = int(input())
y = list(input())
for i in y:
	if i == 'z':
		x[0] += 1
	elif i == 'e':
		x[1] += 1
	elif i == 'r':
		x[2] += 1
	elif i == 'o':
		x[3] += 1
	else:
		x[4] += 1
zero = 0
one = 0
one = min(x[1], x[3], x[4])
x[1] = x[1] - one
x[3] = x[3] - one
x[4] = x[4] - one
zero = min(x[0], x[1], x[2], x[3])
for i in range(one):
	print(1, end=' ')
for i in range(zero):
	print(0, end=' ')


x = input()
text = input()
one = text.count('n')
zero = text.count('z')
print('1 ' * one + '0 ' * zero)


length = int(input())
st = input()
zeros = st.count('z')
ones = st.count('n')
if ones:
	print(*['1'] * ones, end=' ')
print(*['0'] * zeros)


n = int(input())
str = input()
n = 0
z = 0
for x in str:
	if x == 'n':
		n = n + 1
	elif x == 'z':
		z = z + 1
for i in range(n):
	print(1, end=' ')
for i in range(z):
	print(0, end=' ')


n = int(input())
s = list(input().strip())
nn = s.count('n')
nr = s.count('r')
print(nn * '1 ' + nr * '0 ')


n = int(input())
string = input()
count_n = 0
count_z = 0
for c in string:
	if c == 'n':
		count_n += 1
	elif c == 'z':
		count_z += 1
for i in range(count_n):
	print('1 ', end='')
for i in range(count_z):
	print('0 ', end='')


n = int(input())
s = input()
t = s.count('z')
t1 = s.count('n')
for i in range(t1):
	print(1, end=' ')
for i in range(t):
	print(0, end=' ')


n = int(input())
s = input()
z = s.count('z')
o = s.count('n')
for i in range(o):
	print(1)
	print(' ')
for i in range(z):
	print(0)
	print(' ')


t = int(input())
s = input()
cn = s.count('n')
co = s.count('o')
ce = s.count('e')
loe = min(co, ce)
c1 = min(cn, loe)
co = co - c1
ce = ce - c1
cz = s.count('z')
cr = s.count('r')
czr = min(cz, cr)
loe1 = min(co, ce)
c0 = min(czr, loe1)
if c1 != 0:
	while c1 != 0:
		print(1, end=' ')
		c1 -= 1
if c0 != 0:
	while c0 != 0:
		print(0, end=' ')
		c0 -= 1


n = int(input())
l = input()
a = l.count('n')
c = l.count('z')
for i in range(a):
	print(1, end=' ')
for j in range(c):
	print('0', end=' ')


inp = int(input())
st = input()
z = n = 0
for i in st:
	if i == 'z':
		z += 1
	elif i == 'n':
		n += 1
res = ''
for i in range(n):
	res += '1 '
for i in range(z):
	res += '0 '
print(res[:-1])


n = int(input())
s = input()
while 'n' in s:
	print(1, end=' ')
	for i in 'one':
		s = s.replace(i, '', 1)
while 'z' in s:
	print(0, end=' ')
	for i in 'zero':
		s = s.replace(i, '', 1)


n = int(input())
a = input()
o = 0
z = 0
for i in a:
	if i == 'n':
		o = o + 1
	if i == 'z':
		z = z + 1
c = []
for i in range(o):
	c.append(1)
for i in range(z):
	c.append(0)
for i in c:
	print(i, end=' ')


n = int(input())
s = input()
z = 0
e = 0
r = 0
o = 0
n = 0
for i in s:
	if i == 'z':
		z += 1
	elif i == 'e':
		e += 1
	elif i == 'r':
		r += 1
	elif i == 'o':
		o += 1
	else:
		n += 1
min1 = min(o, n, e)
o -= min1
n -= min1
e -= min1
min2 = min(z, e, r, o)
while min1:
	print('1 ', end='')
	min1 -= 1
while min2:
	print('0 ', end='')
	min2 -= 1
print()


from collections import defaultdict
n = int(input())
s = input()
m = defaultdict(int)
for i in s:
	m[i] += 1
ones = min(m['o'], m['n'], m['e'])
if ones != 0:
	(m['o'], m['n'], m['e']) = (m['o'] - ones, m['n'] - ones, m['e'] - ones)
zeros = min(m['z'], m['e'], m['r'], m['o'])
print(ones * '1 ' + zeros * '0 ')


n = int(input())
a1 = []
a0 = []
t = input()
f = 0
for i in t:
	if i == 'z':
		a0.append(0)
	if i == 'n':
		a1.append(1)
		f = 1
if f == 1:
	print(*a1, end=' ')
	print(*a0)
else:
	print(*a0)


n = int(input())
s = input()
zc = s.count('z')
oc = s.count('n')
print('1 ' * oc + '0 ' * zc)


n = int(input())
s = list(input())
(kz, ke, kr, ko, kn) = (s.count('z'), s.count('e'), s.count('r'), s.count('o'), s.count('n'))
m = min(ko, kn, ke)
ko -= m
kn -= m
ke -= m
n = min(kz, ke, kr, ko)
for i in range(m):
	print(1, end=' ')
for i in range(n):
	print(0, end=' ')


def fun(st):
	one = st.count('n')
	zero = st.count('z')
	print('1 ' * one + '0 ' * zero)
for _ in range(1):
	var = input()
	st = input()
	fun(st)


x = int(input())
y = input()
c1 = y.count('z')
c = y.count('n')
if c >= 1:
	for _ in range(c):
		print('1')
if c1 >= 1:
	for _ in range(c1):
		print('0')


n = int(input())
s = input()
l = []
for i in s:
	if i == 'z':
		l.append(0)
	elif i == 'n':
		l.append(1)
for i in sorted(l, reverse=True):
	print(i, end=' ')


from collections import defaultdict
n = int(input())
s = input()
dic = defaultdict(int)
for ele in s:
	dic[ele] += 1
zero = dic['z']
one = dic['n']
s = '1 ' * one + '0 ' * zero
print(s[:-1])


n = input()
s = input()
z = s.count('z')
nn = s.count('n')
print('1 ' * nn + '0 ' * z)


a = input()
b = input()
n = 0
z = 0
for i in b:
	if i == 'n':
		n += 1
	if i == 'z':
		z += 1
res = ''
while n:
	res += '1 '
	n -= 1
while z:
	res += '0 '
	z -= 1
print(res)


a = int(input())
b = input()
c = b.count('z')
d = b.count('e')
e = b.count('r')
f = b.count('o')
g = b.count('n')
h = min(c, d, e, f)
f = f - h
d = d - h
j = min(g, f, d)
for i in range(j):
	print('1', end=' ')
for i in range(h):
	print('0', end=' ')


(_, s) = (input(), input())
(n, z) = (s.count('n'), s.count('z'))
print(*[1] * n + [0] * z, sep=' ')


w = input()
w = input()
z = w.count('z')
n = w.count('n')
p = ['1'] * n + ['0'] * z
print(' '.join(p))


n = int(input())
l = input()
k1 = l.count('o')
k2 = l.count('n')
k3 = l.count('e')
k = min(k1, k2, k3)
k1 -= k
k3 -= k
k4 = l.count('z')
k5 = l.count('r')
m = min(k1, k3, k4, k5)
while k > 0:
	print('1', end=' ')
	k -= 1
while m > 0:
	print('0', end=' ')
	m -= 1


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

def si():
	return input()

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

def li():
	return list(mi())
import math
n = ii()
s = si()
a = s.count('n')
b = s.count('z')
for i in range(a):
	print(1, end=' ')
for i in range(b):
	print(0, end=' ')


n = int(input())
st = input()
zeros = 0
message = ''
for i in range(len(st)):
	if st[i] == 'z':
		zeros += 1
ones = (len(st) - 4 * zeros) // 3
for i in range(ones):
	message += '1 ' if i != ones - 1 or zeros != 0 else '1'
for i in range(zeros):
	message += '0 ' if i != zeros - 1 else '0'
print(message)


def func(st):
	n = st.count('n')
	z = st.count('z')
	for _ in range(n):
		print(1, end=' ')
	for _ in range(z):
		print(0, end=' ')
n = int(input())
st = input()
func(st)


input()
z = n = 0
for i in input():
	if i == 'z':
		z += 1
	elif i == 'n':
		n += 1
print(('1' * n + '0' * z).replace('', ' ').strip())


from collections import Counter
n = int(input())
s = list(input())
c = Counter(s)
if c['n'] <= c['o'] and c['n'] <= c['e']:
	for i in range(c['n']):
		print('1', end=' ')
for i in range(c['z']):
	print('0', end=' ')


def letter_to_binary(letter):
	if letter == 'n':
		return '1 '
	elif letter == 'z':
		return '0 '
	return ''
n = input()
print(''.join(sorted(list(map(letter_to_binary, list(input()))), reverse=True)))


n = int(input())
s = input()
d = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for c in s:
	d[c] += 1
print('1 ' * d['n'], '0 ' * d['z'], sep='')


n = int(input())
a = input()
f = []
b = a.count('o') - a.count('z')
for i in range(b):
	print(1, end=' ')
for j in range(a.count('z')):
	print(0, end=' ')


n = int(input())
s = input()
one = s.count('n')
zero = s.count('z')
n = one + zero
for _ in range(n):
	if one:
		print('1', end=' ')
		one -= 1
	else:
		print('0', end=' ')
		zero -= 1
print('')


n = int(input())
s = input()
k1 = 0
k0 = 0
for i in range(len(s)):
	if s[i] == 'z':
		k0 += 1
	elif s[i] == 'n':
		k1 += 1
for i in range(k1):
	print(1, end=' ')
for i in range(k0):
	print(0, end=' ')


a = int(input())
b = input()
d = {i: 0 for i in ['o', 'n', 'e', 'z', 'r']}
for i in b:
	d[i] += 1
ones = min(d['n'], d['o'], d['e'])
d['e'] -= ones
d['o'] -= ones
zeros = min(d['z'], d['e'], d['r'], d['o'])
for i in range(ones):
	print(1, end=' ')
for i in range(zeros):
	print(0, end=' ')
print()


n = int(input())
tmp = input().count('n')
tmp2 = (n - tmp * 3) // 4
print(('1 ' * tmp + '0 ' * tmp2)[:-1])


class CodeforcesTask1220ASolution:

	def __init__(self):
		self.result = ''
		self.n = 0
		self.cards = []

	def read_input(self):
		self.n = int(input())
		self.cards = input()

	def process_task(self):
		ones = self.cards.count('n')
		zeros = self.cards.count('z')
		self.result = ' '.join([str(x) for x in [1] * ones + [0] * zeros])

	def get_result(self):
		return self.result
Solution = CodeforcesTask1220ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


n = int(input())
s = input()
cnt_n = s.count('n')
cnt_o = s.count('o')
for index in range(cnt_n):
	if index:
		print(' ', end='')
	print(1, end='')
for index in range(cnt_o - cnt_n):
	if cnt_n or index:
		print(' ', end='')
	print(0, end='')
print('')


def main():
	n = input()
	line = input()
	S = [0 for i in range(5)]
	for s in line:
		if s == 'o':
			ind = 0
		elif s == 'n':
			ind = 1
		elif s == 'e':
			ind = 2
		elif s == 'z':
			ind = 3
		elif s == 'r':
			ind = 4
		S[ind] += 1
	ones = S[1]
	S[0] -= ones
	S[2] -= ones
	zeroes = S[0]
	for i in range(ones):
		print(1, end=' ')
	for i in range(zeroes):
		print(0, end=' ')
main()


n = int(input())
m = input().count('n')
print(m * '1 ' + (n - 3 * m) // 4 * '0 ')


from collections import Counter
t = int(input())
s = input()
n = 0
z = 0
d = dict(Counter(s))
if 'n' in d.keys():
	n = d.get('n')
if 'z' in d.keys():
	z = d.get('z')
s = ''
s = s + n * '1 ' + z * '0 '
print(s.strip())


n = int(input())
s = input()
cnt = [0] * 500
for i in s:
	cnt[ord(i)] += 1
while cnt[ord('o')] and cnt[ord('n')] and cnt[ord('e')]:
	print(1, end=' ')
	cnt[ord('o')] -= 1
	cnt[ord('n')] -= 1
	cnt[ord('e')] -= 1
while cnt[ord('z')] and cnt[ord('e')] and cnt[ord('r')] and cnt[ord('o')]:
	print(0, end=' ')
	cnt[ord('o')] -= 1
	cnt[ord('z')] -= 1
	cnt[ord('e')] -= 1
	cnt[ord('r')] -= 1


int(input())
s = input()
for j in range(s.count('n')):
	print(1, end=' ')
for j in range(s.count('z')):
	print(0, end=' ')


n = int(input())
s = input()
lst = list()
a = ''
for i in s:
	if i == 'n':
		a = a + ' 1'
for i in s:
	if i == 'z':
		a = a + ' 0'
print(a.lstrip())


n = int(input())
s = input()
count_z = s.count('z')
count_n = s.count('n')
print(*[1] * count_n + [0] * count_z)


n = int(input())
s = input()
while 'o' in s and 'n' in s and ('e' in s):
	print(1, end=' ')
	for i in 'one':
		s = s.replace(i, '', 1)
while 'z' in s and 'e' in s and ('r' in s) and ('o' in s):
	print(0, end=' ')
	for i in 'zero':
		s = s.replace(i, '', 1)


from collections import deque, Counter
import array
from itertools import combinations, permutations
from math import sqrt
import unittest

def read_int():
	return int(input().strip())

def read_int_array():
	return [int(i) for i in input().strip().split(' ')]
n = read_int()
s = input().strip()
c = Counter(s)
while c['n'] > 0:
	print('1', end=' ')
	c['n'] -= 1
while c['z'] > 0:
	print('0', end=' ')
	c['z'] -= 1


def gns():
	return list(map(int, input().split()))
d = {}
d['z'] = 0
d['e'] = 1
d['r'] = 2
d['o'] = 3
d['n'] = 4
nm = [0] * 5
n = int(input())
s = input()
for c in s:
	nm[d[c]] += 1
z = nm[2]
o = nm[-1]
ans = [1] * o + [0] * z
print(' '.join(map(str, ans)))


n = int(input())
s = input()
count1 = s.count('n')
count0 = s.count('z')
for i in range(count1):
	print(1, end=' ')
for i in range(count0):
	print(0, end=' ')


(n, c0) = (int(input()), input().count('z'))
c1 = (n - 4 * c0) // 3
print(' '.join(c1 * '1' + c0 * '0'))


n = int(input())
s = input()
nums = ['zero', 'one']
m = {}
for c in s:
	if c in m:
		m[c] += 1
	else:
		m[c] = 1
out = ''
i = 0
while 'z' in m and i < m['z']:
	if len(out) == 0:
		out = out + '0'
	else:
		out = out + ' 0'
	i += 1
i = 0
while 'n' in m and i < m['n']:
	if len(out) == 0:
		out = '1' + out
	else:
		out = '1 ' + out
	i += 1
print(out)


a = int(input())
b = str(input())
cnt_zeros = int(0)
for i in b:
	if i == 'z':
		cnt_zeros += 1
cnt_ones = int((a - 4 * cnt_zeros) / 3)
ans = str()
for i in range(cnt_ones):
	if i != cnt_ones:
		ans += '1 '
for i in range(cnt_zeros):
	if i != cnt_zeros:
		ans += '0 '
print(ans)


n = int(input())
letters = input()
dic = {}
for letter in letters:
	if letter in dic:
		dic[letter] += 1
	else:
		dic[letter] = 1
if 'n' in dic:
	for i in range(dic['n']):
		print('1', end=' ')
if 'z' in dic:
	for i in range(dic['z']):
		print('0', end=' ')


a = int(input())
b = input()
c = list(b)
s1 = c.count('z')
o2 = c.count('n')
z1 = str('0 ') * s1
n1 = str('1 ') * o2
print(n1, z1, sep='')


n = int(input())
palavra = input()
zeros = palavra.count('z')
one = palavra.count('n')
for i in range(one):
	print('1 ', end='')
for i in range(zeros):
	print('0 ', end='')


a = int(input())
b = input()
r = ''
r += b.count('n') * '1 '
r += b.count('z') * '0 '
print(r)


p = int(input())
x = input('')
a = []
k = []
x = ''.join(sorted(x))
for i in range(p):
	if x[i] == 'n':
		k.append('1')
	elif x[i] == 'z':
		k.append('0')
print(' '.join(k))


n = int(input())
s = input()
l = [1] * s.count('n')
l += [0] * s.count('z')
print(*l)


def main():
	n = int(input())
	l = input()
	ones = 0
	zeros = 0
	for i in l:
		if i == 'z':
			zeros += 1
		elif i == 'n':
			ones += 1
	for i in range(ones):
		print(1, end=' ')
	for i in range(zeros):
		print(0, end=' ')
main()


n = int(input())
s = input()
zc = ''
oc = ''
for i in s:
	if i == 'n':
		oc += '1' + ' '
	if i == 'z':
		zc += '0' + ' '
print(oc + zc)


num = int(input())
str = input()
(o, n) = (0, 0)
for x in str:
	if x == 'n':
		n += 1
	elif x == 'o':
		o += 1
o -= n
total = ''
for x in range(n):
	total += '1 '
for x in range(o):
	total += '0 '
print(total)


a = int(input())
stri = input()
n_count = stri.count('n')
z_count = stri.count('z')
if n_count != 0:
	print('1 ' * n_count + '0 ' * z_count)
else:
	print('0 ' * z_count)


n = int(input())
m = input()
l = list(m)
a = 0
b = 0
for i in l:
	if i == 'o':
		a += 1
	elif i == 'z':
		b += 1
	else:
		continue
c = a - b
for i in range(c):
	print('1 ', end='')
for i in range(b):
	print('0')


n = int(input())
zero = ''
one = 0
count_let = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for let in input():
	count_let[let] += 1
zeros = count_let['z']
ones = count_let['e'] - zeros
if ones > 0:
	print(' '.join(('1' for i in range(ones))), end=' ')
if zeros > 0:
	print(' '.join(('0' for i in range(zeros))))


tam = input()
word = input()
zeros = ''
unos = ''
for i in word:
	if i == 'z':
		zeros += '0'
		zeros += ' '
	if i == 'n':
		unos += '1'
		unos += ' '
print(unos + zeros)


n = int(input())
cards = input()
ones = cards.count('n')
zeros = (n - ones * 3) // 4
print('1 ' * ones + '0 ' * zeros)


from collections import Counter

def main():
	(n, s) = (int(input()), input())
	k = Counter(s)
	k = dict(k)
	if 'n' in k:
		print('1 ' * k['n'], end='')
	if 'z' in k:
		print('0 ' * k['z'], end='')
main()


lengthOfString = int(input())
string = input()
n = 0
z = 0
e = 0
r = 0
o = 0
for i in range(lengthOfString):
	if string[i] == 'n':
		n += 1
	if string[i] == 'z':
		z += 1
	if string[i] == 'e':
		e += 1
	if string[i] == 'r':
		r += 1
	if string[i] == 'o':
		o += 1
if n > 0 and z == 0 and (r == 0):
	if o == n == e:
		for i in range(n):
			print(1, end=' ')
elif n == 0 and z > 0 and (r > 0):
	if z == e == o:
		for i in range(z):
			print(0, end=' ')
else:
	s = ''
	total = n + z
	if o == total == e:
		for i in range(n):
			s += '1 '
		for i in range(z):
			s += '0 '
	print(s)


n = int(input())
string = input().strip()
zcount = string.count('z')
ocount = string.count('o')
zeros = zcount
ones = ocount - zcount
answer = ['1'] * ones
for i in range(zeros):
	answer.append('0')
print(' '.join(answer))


import sys
input = sys.stdin.readline

def inp():
	return int(input())

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
n = inp()
li = insr()
o = li.count('n')
z = li.count('z')
r = li.count('r')
c = 0
if z == r:
	c = c + r
elif z > r:
	c = c + r
elif z < r:
	c = c + z
for i in range(o):
	print(1, end=' ')
for i in range(c):
	print(0, end=' ')


import sys
i = 0
nz = 0
ans = ''
for line in sys.stdin:
	if i == 0:
		i = 1
		n = list(map(int, line.split()))
	else:
		for x in range(0, n[0]):
			if line[x] == 'z':
				nz = nz + 1
		no = int((n[0] - 4 * nz) / 3)
		nt = int((n[0] - nz) / 3)
		for y in range(0, nt):
			if y < no:
				ans = ans + '1'
			else:
				ans = ans + '0'
			if y < nt - 1:
				ans = ans + ' '
		print(ans)
		i = 0
		nz = 0
		ans = ''


L = input()
S = input()
ans = ''
for i in S:
	if i == 'n':
		ans = ' 1' + ans
	elif i == 'z':
		ans = ans + ' 0'
print(ans[1:])


n = int(input())
s = input()
cz = s.count('z')
zero = cz * 4
one = (n - zero) // 3
zero = zero // 4
s2 = ''
s2 += one * '1'
s2 += zero * '0'
s2 = list(s2)
print(*s2)


x = int(input())
s = input()
z = 0
n = 0
for i in s:
	if i == 'z':
		z += 1
	elif i == 'n':
		n += 1
arr = []
for i in range(z):
	arr.append(0)
for i in range(n):
	arr.append(1)
arr.sort(reverse=True)
for i in range(len(arr)):
	if i == len(arr) - 1:
		print(arr[i])
	else:
		print(arr[i], end=' ')


input()
s = input()
zeros = s.count('z')
ones = s.count('n')
for i in range(ones):
	print('1', end=' ')
for j in range(zeros):
	print('0', end=' ')


length = input()
string = input()
ones = string.count('n')
zeros = string.count('z')
s = ''
for i in range(ones):
	s += '1'
	s += ' '
for j in range(zeros):
	s += '0'
	s += ' '
print(s)


j = int(input())
a = str(input())
k = 0
z = 0
for i in a:
	if i == 'n':
		k += 1
	elif i == 'z':
		z += 1
q = ''
q += k * '1 '
q += z * '0 '
q = q[:-1]
print(q)


p = input('')
x = input('')
i = 0
c1 = 0
c2 = 0
while i < len(x):
	if x[i] == 'z':
		c1 = c1 + 1
	elif x[i] == 'n':
		c2 = c2 + 1
	i = i + 1
i = 0
while i < c2:
	if i == c2 - 1 and c1 == 0:
		print('1', end=' ')
	else:
		print('1 ', end=' ')
	i = i + 1
i = 0
while i < c1:
	if i == c1 - 1:
		print('0', end=' ')
	else:
		print('0 ', end=' ')
	i = i + 1
print('')


def printing(t):
	for i in t:
		print(i, end=' ')
n = int(input())
l = list(input())
p = l.count('z')
q = l.count('n')
if p > 0 and q > 0:
	printing('1' * q)
	printing('0' * p)
elif p > 0:
	printing('0' * p)
else:
	printing('1' * q)


import sys
from collections import defaultdict as dd
from itertools import permutations as pp
from itertools import combinations as cc
from collections import Counter as ccd
from random import randint as rd
from bisect import bisect_left as bl
from heapq import heappush as hpush
from heapq import heappop as hpop
mod = 10 ** 9 + 7

def ri(flag=0):
	if flag == 0:
		return [int(i) for i in sys.stdin.readline().split()]
	else:
		return int(sys.stdin.readline())
n = ri(1)
c = dd(int)
a = input()
for i in a:
	c[i] += 1
ans = []
for i in range(n):
	if c['o'] > 0 and c['n'] > 0 and (c['o'] > 0):
		ans.append(1)
		c['o'] -= 1
		c['n'] -= 1
		c['e'] -= 1
	elif c['z'] > 0 and c['e'] > 0 and (c['r'] > 0) and (c['o'] > 0):
		ans.append(0)
		c['z'] -= 1
		c['e'] -= 1
		c['r'] -= 1
		c['o'] -= 1
print(*ans)


n = int(input())
s = str(input())
l = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for i in s:
	l[i] += 1
ones = 0
zeros = 0
if l['n'] > 0:
	ones = l['n']
	l['o'] -= ones
	l['e'] -= ones
	l['n'] = 0
if l['e'] > 0:
	zeros = l['e']
ans = [1 for i in range(ones)]
for i in range(zeros):
	ans.append(0)
print(*ans)


import os

def f(s):
	n_count = s.count('n')
	z_count = s.count('z')
	result = ''
	for _ in range(n_count):
		result += '1 '
	for _ in range(z_count):
		result += '0 '
	return result
if os.environ.get('DEBUG', False):
	print(f"{f('ezor')} = 0")
	print(f"{f('nznooeeoer')} = 1 1 0")
else:
	input()
	print(f(input()))


n = int(input())
str1 = input().strip()
z = 0
n1 = 0
str2 = ''
for i in range(int(n)):
	if 'z' == str1[i]:
		z += 1
	elif 'n' == str1[i]:
		n1 += 1
if n1 > 0:
	for i in range(n1):
		str2 += '1 '
if z > 0:
	for i in range(z):
		str2 += '0 '
print(str2)


a = int(input())
b = input()
print('1 ' * b.count('n'), '0 ' * b.count('r'), sep='')


def rint():
	return int(input())

def rints():
	return list(map(int, input().split()))
n = rint()
s = input()
from collections import defaultdict
m = defaultdict(int)
for c in s:
	m[c] += 1
for i in range(m['n']):
	print(1, end=' ')
for i in range(m['z']):
	print(0, end=' ')
print()


n = int(input())
inp = input()
zc = 0
for i in inp:
	if i == 'z':
		zc += 1
oc = (n - zc * 4) // 3
res = [1] * oc
res += [0] * zc
print(*res)


letters = int(input())
answer = []
text = input()
for i in range(text.count('n')):
	answer.append(1)
for i in range(text.count('z')):
	answer.append(0)
print(*answer)


n = int(input())
y = input()
i = 0
j = 0
z = y.count('z')
n = y.count('n')
for i in range(n):
	print(1, end=' ')
for j in range(z):
	print(0, end=' ')


import sys

def main():
	n = int(sys.stdin.readline())
	s = sys.stdin.readline()
	x = s.count('z')
	y = (n - 4 * x) // 3
	for i in range(y):
		print(1, end=' ')
	for i in range(x):
		print(0, end=' ')

def __starting_point():
	main()
__starting_point()


n = int(input())
b = input()
zero = int(b.count('z'))
one = int(b.count('n'))
x = ''
x = x.rjust(one, '1')
x = x.ljust(one + zero, '0')
print(' '.join(x))


n = int(input())
s = input()
Ans = []
for ss in s:
	if ss == 'z':
		Ans.append(0)
	elif ss == 'n':
		Ans.append(1)
Ans.sort(reverse=True)
print(*Ans)


from collections import defaultdict as dd
n = int(input())
s = [i for i in input()]
d = dd(int)
for i in s:
	d[i] += 1
ans = []
m = min(d['o'], d['n'], d['e'])
for i in range(m):
	ans.append(1)
for i in range(d['o'] - m):
	ans.append(0)
print(*ans)


from collections import Counter
n = int(input())
z = str(input())
c = Counter(z)
zero = c['z']
one = c['n']
ans = [1] * one
ans += [0] * zero
print(*ans)


n = int(input())
a = list(input())
z = a.count('z')
e = a.count('e')
r = a.count('r')
o = a.count('o')
n = a.count('n')
n1 = min(n, e, o)
n0 = min(o - n1, r, z, e - n1)
if n0 < 0:
	n0 = 0
for i in range(n1):
	print(1, end=' ')
for i in range(n0):
	print(0, end=' ')
print('\n')


def ras(a):
	c = []
	if 'o' in a and 'n' in a and ('e' in a):
		y = min([a.count('o'), a.count('n'), a.count('e')])
		x = y
		while x > 0:
			c.append(1)
			x = x - 1
	if 'z' in a and 'r' in a and ('e' in a) and ('o' in a):
		if 'n' in a:
			if a.count('o') - a.count('n') > 0 and a.count('e') - a.count('n') > 0:
				y = min([a.count('o'), a.count('e')])
				x = y - a.count('n')
				while x > 0:
					c.append(0)
					x = x - 1
		else:
			y = min([a.count('o'), a.count('z'), a.count('e'), a.count('r')])
			x = y
			while x > 0:
				c.append(0)
				x = x - 1
	return c
n = int(input())
a = input()
r = ras(a)
print(*r)


try:
	n = int(input())
	s = input()
	(countn, countz) = (0, 0)
	for i in s:
		if i == 'n':
			countn += 1
		elif i == 'z':
			countz += 1
	for i in range(countn):
		print(1, end=' ')
	for i in range(countz):
		print(0, end=' ')
except Exception:
	pass


def count(s, c):
	res = 0
	for i in range(len(s)):
		if s[i] == c:
			res = res + 1
	return res
n = int(input())
a = str(input())
n = count(a, 'n')
z = count(a, 'z')
b = [1 for i in range(n)]
c = [0 for i in range(z)]
d = b + c
for i in d:
	print(i, end=' ')


n = int(input())
s = input()
one = s.count('n')
zero = (n - one * 3) // 4
solution = ['1'] * one + ['0'] * zero
print(' '.join(solution))


total = int(input())
l = input()
p = []
for i in l:
	p.append(i)
count = 0
q = []
for i in p:
	if i == 'n':
		count += 1
total = total - count * 3
zero = total // 4
for i in range(count):
	q.append(1)
for i in range(zero):
	q.append(0)
for i in q:
	print(i, end=' ')


n = int(input())
a = input()
o = a.count('n')
z = a.count('z')
for i in range(o):
	print(1, end=' ')
i = 0
for i in range(z):
	print(0, end=' ')


n = int(input())
c = input()
a = 0
b = 0
if 'z' in c:
	a = c.count('z')
if 'n' in c:
	b = c.count('n')
print('1 ' * b + '0 ' * a)


n = int(input())
s = input()
zcount = 0
ncount = 0
for i in range(len(s)):
	if s[i] == 'z':
		zcount += 1
	elif s[i] == 'n':
		ncount += 1
total = zcount + ncount
for i in range(ncount):
	print('1 ', end='')
for i in range(zcount):
	print('0 ', end='')


k = int(input())
s = input()
o = s.count('o')
z = s.count('z')
e = s.count('e')
r = s.count('r')
n = s.count('n')
while o > 0 and n > 0 and (e > 0):
	print(1, end=' ')
	o -= 1
	n -= 1
	e -= 1
while z > 0 and e > 0 and (r > 0) and (o > 0):
	print(0, end=' ')
	z -= 1
	e -= 1
	r -= 1
	o -= 1


n = int(input())
l = input()
d = {}
for i in range(n):
	if l[i] in d:
		d[l[i]] += 1
	else:
		d[l[i]] = 1
if 'z' in d:
	x = d['z']
else:
	x = 0
if 'n' in d:
	y = d['n']
else:
	y = 0
for i in range(y):
	print('1', end=' ')
for i in range(x):
	print('0', end=' ')


size = int(input())
st = input()
ones = st.count('n')
zeros = st.count('r')
print('1 ' * ones + '0 ' * zeros)


n = int(input())
s = list(input())
ans = ''
n = s.count('z')
m = s.count('n')
while m != 0:
	if len(ans) != 0:
		ans += ' '
	ans += '1'
	m -= 1
while n != 0:
	if len(ans) != 0:
		ans += ' '
	ans += '0'
	n -= 1
print(ans)


from sys import stdin, stdout
count1 = 0
count2 = 0
n = int(stdin.readline())
str1 = stdin.readline()
for i in range(n):
	if str1[i] == 'z':
		count1 += 1
	if str1[i] == 'n':
		count2 += 1
ans = count2 * '1' + count1 * '0'
ans1 = list(ans)
print(*ans1)


integer = input()
string = input()
c = 0
a = 0
for i in range(len(string)):
	if string[i] == 'z':
		c = c + 1
	elif string[i] == 'n':
		a = a + 1
for i in range(a):
	print('1', end=' ')
for i in range(c):
	print('0', end=' ')


n = int(input())
text = str(input())
i = text.count('n')
j = text.count('r')
ans = ''
for a in range(i):
	ans += '{} '.format(int(1))
for a in range(j):
	ans += '{} '.format(int(0))
print(ans)


zcount = int(0)
ncount = int(0)
output = str('')
length = int(input())
string = str(input())
for i in range(0, length):
	if string[i] == 'z':
		zcount = zcount + 1
	if string[i] == 'n':
		ncount = ncount + 1
for i in range(0, ncount):
	output = output + ' 1'
for i in range(0, zcount):
	output = output + ' 0'
print(output)


n = int(input())
s = input()
count_1 = s.count('n')
count_0 = s.count('z')
print('1 ' * count_1 + '0 ' * count_0)


def dkwpwn(string):
	output = ''
	for i in string:
		if i == 'n':
			output += '1 '
	for i in string:
		if i == 'z':
			output += '0 '
	return output
useless = int(input())
string = input()
print(dkwpwn(string))


x = int(input())
unarrange = str(input())
zCount = 0
nCount = 0
for i in range(len(unarrange)):
	if unarrange[i] == 'z':
		zCount += 1
	elif unarrange[i] == 'n':
		nCount += 1
for i in range(nCount):
	print(1, end=' ')
for i in range(zCount):
	print(0, end=' ')


n = int(input())
c = input()
zero = 0
one = 0
for i in c:
	if i == 'z':
		zero = zero + 1
	if i == 'n':
		one = one + 1
print('1 ' * one + '' + '0 ' * zero)


import sys
n = int(input())
x = input()
z = x.count('z')
n = n - 4 * z
y = n / 3
answer = []
while y >= 1:
	answer.append('1')
	y = y - 1
while z >= 1:
	answer.append('0')
	z = z - 1
answer = ' '.join(answer)
print(answer)


n = int(input())
strok = input()
Z = strok.count('z')
N = strok.count('n')
mass = []
for _ in range(N):
	mass.append('1')
for _ in range(Z):
	mass.append('0')
print(' '.join(mass))


N = int(input())
S = input()
num_zeros = 0
num_ones = 0
for w in S:
	if w == 'z':
		num_zeros += 1
	if w == 'n':
		num_ones += 1
foo = ['1' for _ in range(num_ones)] + ['0' for _ in range(num_zeros)]
print(' '.join(foo))


n = int(input())
s = input()
l = list(s)
z = l.count('z')
o = l.count('o')
for i in range(o - z):
	print(1, end=' ')
for i in range(z):
	print(0, end=' ')
print()


N = int(input())
lamp = input()
d = dict()
d['z'] = 0
d['e'] = 0
d['r'] = 0
d['o'] = 0
d['n'] = 0
for i in lamp:
	if i in d:
		d[i] += 1
	else:
		d[i] = 1
z = d['z']
e = d['e']
r = d['r']
o = d['o']
n = d['n']
res = min(o, n, e)
d['o'] -= res
d['n'] -= res
d['e'] -= res
res2 = min(z, e, r, o)
for i in range(res):
	if not i:
		print(1, end='')
	else:
		print('', 1, end='')
for i in range(res2):
	if not i and res != 0:
		print('', 0, end='')
	elif not i:
		print(0, end='')
	else:
		print('', 0, end='')
print()


n = int(input())
s = str(input())
d = s.count('n')
e = s.count('z')
l = [1] * d
m = [0] * e
e = l + m
print(*e)


def convert(lst):
	return ' '.join(lst)
n = int(input())
s = input()
cz = 0
co = 0
st = []
for i in s:
	if i == 'z':
		cz = cz + 1
	if i == 'n':
		co = co + 1
for i in range(0, co):
	st.append('1')
for i in range(0, cz):
	st.append('0')
print(convert(st))


n = int(input())
one = ''
zero = ''
for ch in input():
	if ch == 'n':
		one += '1 '
	if ch == 'z':
		zero += '0 '
print(one[:-1] + ' ' + zero[:-1])


inputnum = int(input())
inputletters = input()
outputstr = ''
for char in inputletters:
	if char == 'n':
		outputstr = outputstr + '1 '
for char in inputletters:
	if char == 'z':
		outputstr = outputstr + '0 '
print(outputstr)


n = int(input())
zero_or_one = input()
new_string = ''
while zero_or_one != '':
	if 'n' in zero_or_one:
		zero_or_one = zero_or_one.replace('o', '', 1)
		zero_or_one = zero_or_one.replace('n', '', 1)
		zero_or_one = zero_or_one.replace('e', '', 1)
		new_string += 'one'
	elif 'z' in zero_or_one:
		zero_or_one = zero_or_one.replace('z', '', 1)
		zero_or_one = zero_or_one.replace('e', '', 1)
		zero_or_one = zero_or_one.replace('r', '', 1)
		zero_or_one = zero_or_one.replace('o', '', 1)
		new_string += 'zero'
while new_string != '':
	if new_string.startswith('zero'):
		new_string = new_string.replace('zero', '', 1)
		print('0', end=' ')
	else:
		new_string = new_string.replace('one', '', 1)
		print('1', end=' ')


n = int(input())
z = 0
s = input()
for i in s:
	if i == 'z':
		z += 1
ones = (n - z * 4) // 3
ans = ''
for i in range(ones):
	ans += '1 '
for i in range(z):
	ans += '0 '
if ans == '':
	ans = '0'
print(ans)


n = int(input())
s = input()
c1 = s.count('n')
c2 = s.count('e')
c3 = s.count('o')
ans = []
for i in range(min(c1, c2, c3)):
	ans.append(1)
c1 = c1 - min(c1, c2, c3)
c2 = c2 - min(c1, c2, c3)
c3 = c3 - min(c1, c2, c3)
c4 = min(s.count('z'), s.count('r'))
for i in range(min(c3, c2, c4)):
	ans.append(0)
print(*ans)


N = int(input())
a = list(input())
ones = zeros = 0
for c in a:
	if c == 'z':
		zeros += 1
	elif c == 'n':
		ones += 1
print('1 ' * ones + '0 ' * zeros, sep=' ')


import math
n = int(input())
arr = ''.join(list(map(str, input().strip().split(' '))))
zc = arr.count('z')
nc = arr.count('n')
for i in range(nc):
	print(1, end=' ')
for j in range(zc):
	print(0, end=' ')


import sys
n = int(sys.stdin.readline())
word = sys.stdin.readline()

def cards(n, word):
	zeroes = word.count('z')
	ones = word.count('n')
	outString = ''
	for i in range(ones):
		outString += '1 '
	for j in range(zeroes):
		outString += '0 '
	print(outString[:-1])
cards(n, word)


t = int(input())
s = str(input())
z = 0
n = 0
for i in s:
	if i == 'z':
		z = z + 1
	elif i == 'n':
		n = n + 1
li = []
for k in range(n):
	li.append(1)
for h in range(z):
	li.append(0)
for x in li:
	print(x, end=' ')


n = int(input())
k = input()
x = 0
y = 0
z = 0
c = 0
d = 0
for i in range(n):
	if k[i] == 'o':
		x += 1
	elif k[i] == 'n':
		y += 1
	elif k[i] == 'e':
		z += 1
	elif k[i] == 'z':
		c += 1
	elif k[i] == 'r':
		d += 1
p = min(x, y, z)
q = min(c, z - p, d, x - p)
print('1 ' * p, end=' ')
print('0 ' * q, end=' ')


nb = input('')
st = input('')
n = 0
o = 0
z = 0
e = 0
r = 0
for i in st:
	if i == 'n':
		n = n + 1
	elif i == 'z':
		z = z + 1
	elif i == 'e':
		e = e + 1
	elif i == 'r':
		r = r + 1
	elif i == 'o':
		o = o + 1
if n == 0:
	Binst = z * '0 '
elif z == 0:
	Binst = n * '1 '
elif n == 0 and z == 0:
	Binst = ''
else:
	Binst = n * '1 ' + z * '0 '
print(Binst)


k = int(input())
s = input()
z = n = 0
for i in range(0, k):
	if s[i] == 'z':
		z += 1
	if s[i] == 'n':
		n += 1
sn = '1 ' * n
sz = '0 ' * z
print(sn + sz)


n = int(input())
s = input().strip()
z = 0
e = 0
r = 0
o = 0
n = 0
for i in s:
	if i == 'z':
		z += 1
	elif i == 'e':
		e += 1
	elif i == 'r':
		r += 1
	elif i == 'o':
		o += 1
	elif i == 'n':
		n += 1
ones = min(o, n, e)
o -= ones
n -= ones
e -= ones
zeros = min(z, e, r, o)
for i in range(ones):
	print(1, end=' ')
for i in range(zeros):
	print(0, end=' ')
print()


k = int(input())
str = input()
l = []
re = []
for i in str:
	l.append(i)
n = l.count('n')
z = l.count('z')
for i in range(n):
	re.append(1)
for i in range(z):
	re.append(0)
print(*re)


qtd = int(input())
frase = list(input())
a = []
for i in range(frase.count('n')):
	a.append(1)
for i in range(frase.count('z')):
	a.append(0)
print(*a)


q = int(input())
a = input()
a = list(a)
w = list(a.count('n') * '1' + a.count('z') * '0')
print(' '.join((p for p in w)))


import sys
import math
counter = -1
count = 0
for lin in sys.stdin:
	line = lin.rstrip()
	counter += 1
	if counter == 0:
		pass
	else:
		s = line
		break
print(('1 ' * s.count('n') + '0 ' * s.count('z'))[:-1])


n = int(input())
ones = {'o': 0, 'n': 0, 'e': 0}
zeroes = {'z': 0, 'e': 0, 'r': 0, 'o': 0}
first = 0
second = 0
mas = sorted([s for s in input()])
for x in mas:
	if x != 'z' and x != 'r':
		ones[x] += 1
	if x != 'n':
		zeroes[x] += 1
	if ones['o'] >= 1 and ones['n'] >= 1 and (ones['e'] >= 1):
		first += 1
		ones['o'] -= 1
		ones['n'] -= 1
		ones['e'] -= 1
		zeroes['o'] -= 1
		zeroes['e'] -= 1
	elif zeroes['z'] >= 1 and zeroes['e'] >= 1 and (zeroes['r'] >= 1) and (zeroes['o'] >= 1):
		second += 1
		zeroes['z'] -= 1
		zeroes['e'] -= 1
		zeroes['r'] -= 1
		zeroes['o'] -= 1
		ones['o'] -= 1
		ones['e'] -= 1
print(' '.join('1' * first + '0' * second))


x = input()
y = input()
print('1 ' * y.count('n'), end='')
print('0 ' * y.count('z'))


z = 0
n = int(input())
k = input()
a = k.count('n')
b = k.count('z')
a = a * '1 '
b = b * '0 '
if a == 0 and b == 0:
	print(0)
else:
	print(a, b)


nt = input()
n = input()
arr = n
dicts = {}
for i in arr:
	if i not in dicts:
		dicts[i] = 1
	else:
		dicts[i] += 1
if 'n' not in dicts:
	v = dicts['z']
	total = '0' * v
	v3 = ''
	for y in total:
		v3 += y
		v3 += ' '
	print(v3[:-1])
else:
	v = dicts['n']
	total = '1' * v
	if 'z' not in dicts:
		v3 = ''
		for y in total:
			v3 += y
			v3 += ' '
		print(v3[:-1])
	else:
		total += '0' * dicts['z']
		v3 = ''
		for y in total:
			v3 += y
			v3 += ' '
		print(v3[:-1])


x = int(input())
st = input()
st = sorted(st)
for i in st:
	if i == 'n':
		print('1', end=' ')
	if i == 'z':
		print('0', end=' ')


n = int(input())
b = input()
result = []
for c in b:
	if c == 'n':
		result.append('1')
	elif c == 'r':
		result.append('0')
sorted_result = sorted(result, reverse=True)
print(' '.join(sorted_result))


n = str(input())
stringInput = list(map(str, input()))
countN = stringInput.count('n')
countZ = stringInput.count('z')
if countN > 0 and countZ > 0:
	print('1 ' * countN + '0 ' * countZ)
if countN is 0 and countZ > 0:
	print('0 ' * countZ)
if countN > 0 and countZ is 0:
	print('1' + ' 1' * (countN - 1))


n = int(input())
s = input()
one = s.count('n')
zero = (n - 3 * one) // 4
for i in range(one + zero):
	if i < one:
		print('1', end=' ')
	else:
		print('0', end=' ')


n = int(input())
s = input()
cntsz = 0
cntso = 0
for i in s:
	if i == 'z':
		cntsz += 1
	elif i == 'n':
		cntso += 1
for i in range(cntso):
	print(1, end=' ')
for i in range(cntsz):
	print(0, end=' ')


n = int(input())
s = input()
(z, e, r, o, n) = (s.count('z'), s.count('e'), s.count('r'), s.count('o'), s.count('n'))
one_count = min(o, n, e)
zero_count = min(z, e, r, o)
vals = [1] * one_count + [0] * zero_count
print(' '.join(map(str, vals)))


N = int(input())
letters = input()
ncount = letters.count('n')
rcount = letters.count('r')
output = '1 ' * ncount + '0 ' * rcount
print(output.strip())


n = int(input())
sequence = input()
zero_count = 0
one_count = 0
total = []
l = [char for char in sequence]
for char in l:
	if char == 'z':
		zero_count += 1
	elif char == 'n':
		one_count += 1
	else:
		pass
for j in range(one_count):
	total.append(1)
for i in range(zero_count):
	total.append(0)
for k in total:
	print(k, end=' ')


n = int(input())
str1 = input()
(z, n) = (0, 0)
for x in str1:
	if x == 'z':
		z += 1
	elif x == 'n':
		n += 1
print(n * '1 ' + z * '0 ')


n = int(input())
a = input()
z = 0
for i in range(n):
	if a[i] == 'z':
		z += 1
p = int((n - 4 * z) / 3)
ans = [0 for j in range(z + p)]
for j in range(p):
	ans[j] = 1
print(*ans)


n = int(input())
s = input()
a = '1' * s.count('n') + '0' * s.count('z')
for i in a:
	print(i, end=' ')


n = int(input())
s = input()
c = 0
t = 0
for i in range(n):
	if s[i] == 'n':
		c = c + 1
	if s[i] == 'z':
		t = t + 1
s1 = ''
s1 += '1' * c + '0' * t
l = list(s1)
print(*l, end='')


def check_value(string, value):
	string = string.casefold()
	count = {}.fromkeys(value, 0)
	for c in string:
		if c in count:
			count[c] += 1
	return count
T = int(input())
digit = input()
one = 'one'
zero = 'zero'
O = check_value(digit, one)
Z = check_value(digit, zero)
count1 = 0
count0 = 0
for i in O:
	if O['o'] >= O['n'] and O['e'] >= O['n']:
		count1 = O['n']
for i in Z:
	Z['e'] = Z['e'] - count1
	Z['o'] = Z['o'] - count1
	break
for j in Z:
	if Z['e'] == Z['o']:
		if Z['z'] == Z['r'] and Z['z'] == Z['e']:
			count0 = Z['z']
for a in range(count1):
	print(1, end=' ')
for b in range(count0):
	print(0, end=' ')


a = input()
b = str(input())
(z, o) = (0, 0)
ms = []
for i in b:
	if i == 'z':
		z += 1
	elif i == 'n':
		o += 1
if o != 0:
	while o > 0:
		ms.append('1')
		o -= 1
if z != 0:
	while z > 0:
		ms.append('0')
		z -= 1
print(' '.join(ms))


n = int(input())
s = str(input())
l = list(s)
zc = l.count('z')
nc = l.count('n')
for i in range(nc):
	print(1, end=' ')
for i in range(zc):
	print(0, end=' ')


n = int(input())
s = input()
c1 = 0
c2 = 0
for i in range(n):
	if s[i] == 'z':
		c1 = c1 + 1
	elif s[i] == 'n':
		c2 = c2 + 1
print('1 ' * c2 + '0 ' * c1)


n = int(input())
str = input()
ones = 0
zeroes = 0
for i in str:
	if i == 'n':
		ones = ones + 1
	elif i == 'z':
		zeroes = zeroes + 1
for i in range(ones):
	print('1', end=' ')
for i in range(zeroes):
	print('0', end=' ')


(n, a) = (int(input()), input())
d = {'n': a.count('n'), 'o': a.count('o'), 'e': a.count('e'), 'z': a.count('z'), 'r': a.count('r')}
ones_count = min([d['n'], d['o'], d['e']])
d['n'] -= ones_count
d['o'] -= ones_count
d['e'] -= ones_count
zeroes_count = min([d['z'], d['o'], d['e'], d['r']])
d['z'] -= zeroes_count
d['o'] -= zeroes_count
d['e'] -= zeroes_count
d['r'] -= zeroes_count
for i in range(ones_count):
	print(1, end=' ')
for i in range(zeroes_count):
	print(0, end=' ')


x = int(input())
a = input()
d = {}
(d['z'], d['e'], d['r'], d['o'], d['n']) = (0, 0, 0, 0, 0)
for i in a:
	d[i] += 1
(z, e, r, o, n) = (d['z'], d['e'], d['r'], d['o'], d['n'])
if r == z and o == n + z and (e == n + z):
	c0 = z
	c1 = n
	print('1 ' * n + '0 ' * z)
else:
	print(-1)


t = int(input())
st = input()
n = 0
z = 0
for l in st:
	if l == 'n':
		n += 1
	elif l == 'z':
		z += 1
for i in range(n):
	print('1', end=' ')
for i in range(z):
	print('0', end=' ')
print()


n = int(input())
st = input()
one = st.count('n')
z = st.count('z')
for i in range(one):
	print(1, end=' ')
for i in range(z):
	print(0, end=' ')


a = int(input())
s = input()
z = s.count('n')
x = s.count('z')
q = 0
for i in range(z + x):
	if i < z:
		print(1, sep=' ', end=' ')
	else:
		print('0', sep=' ', end=' ')


n = int(input())
str = input()
a = str.count('n')
b = str.count('z')
if a and b:
	print(a * '1 ' + b * '0 ')
elif a and (not b):
	print(a * '1 ')
elif not a and b:
	print(b * '0 ')


l = int(input())
n = input()
one = n.count('n')
zero = n.count('r')
while one:
	print('1', end=' ')
	one -= 1
while zero:
	print('0', end=' ')
	zero -= 1


n = int(input())
s = input()
count1 = 0
count2 = 0
for i in range(n):
	if s[i] == 'r':
		count1 = count1 + 1
	if s[i] == 'n':
		count2 = count2 + 1
for i in range(count2):
	print(1, end=' ')
for i in range(count1):
	print(0, end=' ')


n = int(input())
s = input()
d = {}
for ch in s:
	if ch in d:
		d[ch] += 1
	else:
		d[ch] = 1
(zero, one) = (0, 0)
if 'z' in d:
	zero = d['z']
if 'n' in d:
	one = d['n']
l1 = [1] * one
l2 = [0] * zero
l1.extend(l2)
for e in l1:
	print(e, end=' ')


from collections import Counter as c
input()
l = c(input())
print('1 ' * min(l['n'], l['e']) + '0 ' * (l['e'] - min(l['n'], l['e'])))


def func(n, l):
	ans = ''
	count_of_zero = l.count('z')
	count_of_one = l.count('n')
	for i in range(count_of_one):
		ans += '1 '
	for i in range(count_of_zero):
		ans += '0 '
	return ans
number = int(input())
letter = input()
print(func(number, letter))


n = int(input())
word = list(input())
zero_n = word.count('z')
one_n = word.count('n')
print(' '.join([str(1) for x in range(one_n)] + [str(0) for x in range(zero_n)]))


n = int(input())
s = input()
s1 = ''
zc = s.count('z')
nc = s.count('n')
if zc == 0:
	s1 = '1 ' * nc
elif nc == 0:
	s1 = '0 ' * zc
else:
	s1 = '1 ' * nc + '0 ' * zc
print(s1)


import sys
n = int(sys.stdin.readline())
string = list(sys.stdin.readline().rstrip())
count_ones = 0
count_zeroes = 0
for e in string:
	if e == 'n':
		count_ones += 1
	if e == 'z':
		count_zeroes += 1
output = []
output_string = ''
for j in range(count_ones):
	output.append(1)
for j in range(count_zeroes):
	output.append(0)
for j in range(len(output)):
	output_string += str(output[j]) + ' '
print(output_string)


n = int(input())
s = input()
c = s.count('n')
z = s.count('z')
print('1 ' * c + '0 ' * z)


n = int(input())
s = sorted(input())
c = 0
for i in range(len(s) - 1, -1, -1):
	if s[i] == 'z':
		c += 1
x = ['1'] * ((n - c * 4) // 3)
x += ['0'] * c
print(' '.join(x))


t = int(input())
s = input()
a = [1] * s.count('n')
b = [0] * s.count('z')
print(*a, *b, sep=' ')


def solve(s):
	n = r = 0
	for c in s:
		if c == 'n':
			n += 1
			continue
		if c == 'r':
			r += 1
	ans = ' '.join(['1' for i in range(n)] + ['0' for i in range(r)])
	return ans
input()
s = input()
print(solve(s))


t = int(input())
string_val = list(input())
r_cpunt = string_val.count('r')
if r_cpunt == 0:
	no_ones = int(t / 3)
	for i in range(no_ones):
		print(1, end=' ')
else:
	no_zeros = r_cpunt
	no_ones = int((t - 4 * r_cpunt) / 3)
	for i in range(no_ones):
		print(1, end=' ')
	for j in range(no_zeros):
		print(0, end=' ')


n = input()
letters = input()
count0 = 0
count1 = 0
for letter in letters:
	if letter == 'z':
		count0 = count0 + 1
	elif letter == 'n':
		count1 = count1 + 1
if count1 > 0:
	print(1, end='')
	for i in range(1, count1):
		print(' 1', end='')
if count0 > 0:
	print(' 0', end='')
	for i in range(1, count0):
		print(' 0', end='')
print()


n = int(input())
str = input()
(z, e, r, o, n) = (str.count('z'), str.count('e'), str.count('r'), str.count('o'), str.count('n'))
one = min(o, n, e)
(o, n, e) = (o - min(o, n, e), n - min(o, n, e), e - min(o, n, e))
zero = min(z, e, r, o)
for i in range(one):
	print('1', end=' ')
for i in range(zero):
	print('0', end=' ')


n = int(input())
s = list(input())
d = dict.fromkeys(['z', 'e', 'r', 'o', 'n'], 0)
for i in s:
	d[i] += 1
one = min(min(d['o'], d['n']), d['e'])
d['o'] -= one
d['n'] -= one
d['e'] -= one
s = '1 ' * one + '0 ' * d['z']
print(s)


n = int(input())
name = input()
n = []
z = []
for i in name:
	if i == 'n':
		n.append(1)
	elif i == 'z':
		z.append(0)
print(*n, *z)


import collections
input()
s = collections.Counter(input())
print(*(1 for _ in range(int(s['n']))), *(0 for _ in range(int(s['z']))))


def main():
	n = int(input())
	cards = input()
	output = ''
	z = 0
	for i in range(int(n)):
		if cards[i] == 'z':
			z += 1
	for j in range(int((n - 4 * z) / 3)):
		output += '1 '
	for k in range(z):
		output += '0 '
	print(output)
main()


s = input()
m = input()
t = ''
for i in range(len(m)):
	if m[i] == 'n':
		t += '1' + ' '
for i in range(len(m)):
	if m[i] == 'z':
		t += '0' + ' '
t = t[0:-1]
print(t)


length = int(input())
stringValue = input()
storage = []
for x in stringValue:
	if x.upper() == 'Z':
		storage.append(0)
	elif x.upper() == 'N':
		storage.append(1)
storage.sort(reverse=True)
print(*storage)


n = map(int, input())
word = input()
res = []
for letter in word:
	if 'n' in letter:
		res.append(1)
	elif 'z' in letter:
		res.append(0)
for i in sorted(res, reverse=True):
	print(i, end=' ')


num = int(input())
let = str(input())
result = str(1).ljust(2, ' ') * let.count('n') + str(0).ljust(2, ' ') * let.count('z')
print(result)


s = int(input())
v = input()
a = v.count('z')
e = v.count('n')
i = e * '1' + a * '0'
print(' '.join(i))


len = int(input())
str1 = input()
li = list(str1)
countz = 0
countn = 0
for ch in li:
	if ch == 'z':
		countz += 1
	if ch == 'n':
		countn += 1
	else:
		continue
for i in range(countn):
	print('1', end=' ')
for i in range(countz):
	print('0', end=' ')


n = int(input())
s = input()
count = {'n': 0, 'z': 0, 'e': 0, 'r': 0, 'o': 0}
for i in range(n):
	count[s[i]] += 1
zerocnt = min(min(count['z'], count['e']), min(count['r'], count['o']))
onecnt = min(min(count['o'], count['n']), count['e'])
for i in range(onecnt):
	print('1', end=' ')
for i in range(zerocnt):
	print('0', end=' ')


l = int(input())
s = list(input())
z = s.count('z')
o = s.count('o')
zero = z
one = o - z
ans = []
for i in range(one):
	ans.append(1)
for i in range(zero):
	ans.append(0)
print(*ans)


n = int(input())
v = input()
dic = dict()
list0 = ['e', 'o', 'n', 'z', 'r']
for l in list0:
	dic[l] = 0
for l in v:
	dic[l] += 1
min1 = min(min(dic['o'], dic['n']), dic['e'])
dic['o'] -= min1
dic['n'] -= min1
dic['e'] -= min1
min2 = min(dic['z'], min(min(dic['e'], dic['r']), dic['o']))
for i in range(min1):
	print(1, end=' ')
for i in range(min2):
	print(0, end=' ')


lent = int(input())
st = str(input())
z = 0
e = 0
r = 0
o = 0
n = 0
for ch in st:
	if ch is 'z':
		z += 1
	if ch is 'e':
		e += 1
	if ch is 'r':
		r += 1
	if ch is 'o':
		o += 1
	if ch is 'n':
		n += 1
one = min(o, n, e)
o -= one
n -= one
e -= one
zero = min(z, e, r, o)
for i in range(one):
	print(1, end=' ')
for i in range(zero):
	print(0, end=' ')


N = int(input())
word = input()
zero = 0
un = 0
a = 2
for lettre in word:
	if lettre == 'n':
		un += 1
	if lettre == 'z':
		zero += 1
res = ''
for i in range(un):
	res += '1 '
for i in range(zero):
	res += '0 '
print(res)


def solution():
	n = int(input())
	word = input()
	d = {}
	for w in word:
		d[w] = d.get(w, 0) + 1
	arr = []
	while 'n' in d:
		if 'o' in d and 'n' in d and ('e' in d):
			arr.append('1')
			d['o'] -= 1
			if d['o'] == 0:
				del d['o']
			d['n'] -= 1
			if d['n'] == 0:
				del d['n']
			d['e'] -= 1
			if d['e'] == 0:
				del d['e']
		else:
			del d['n']
	while 'z' in d:
		if 'z' in d and 'e' in d and ('r' in d) and ('o' in d):
			arr.append('0')
			d['z'] -= 1
			if d['z'] == 0:
				del d['z']
			d['e'] -= 1
			if d['e'] == 0:
				del d['e']
			d['r'] -= 1
			if d['r'] == 0:
				del d['r']
			d['o'] -= 1
			if d['o'] == 0:
				del d['o']
		else:
			del d['z']
	print(' '.join(arr))
solution()


n = input()
s = input()
count = {}
l = 'zeron'
for i in range(len(l)):
	count.setdefault(l[i], 0)
for char in s:
	count[char] += 1
u = min(count['o'], count['e'])
y = min(count['n'], u)
x = min(u - y, count['r'], count['z'])
print('1 ' * y + '0 ' * x)


n = int(input())
s = input()
ze = s.count('z')
on = s.count('n')
p = [1 for i in range(on)]
q = [0 for i in range(ze)]
r = p + q
a = ''
for i in r:
	a += str(i) + ' '
print(a.strip())


input()
inp = input()
(zc, nc, ec, oc) = (0, 0, 0, 0)
for i in inp:
	if i == 'z':
		zc += 1
	elif i == 'n':
		nc += 1
	elif i == 'e':
		ec += 1
	elif i == 'o':
		oc += 1
for i in range(min(oc, ec)):
	if nc > 0:
		print(1, end=' ')
		nc -= 1
	else:
		print(0, end=' ')


def kolBykv(a):
	otv = [0, 0, 0, 0, 0]
	for x in a:
		if x == 'z':
			otv[0] += 1
		if x == 'e':
			otv[1] += 1
		if x == 'r':
			otv[2] += 1
		if x == 'o':
			otv[3] += 1
		if x == 'n':
			otv[4] += 1
	return otv
n = int(input())
a = input()
b = kolBykv(a)
otv = []
minn = b[3]
if b[4] < minn:
	minn = b[4]
if b[1] < minn:
	minn = b[1]
for i in range(minn):
	otv.append(1)
	b[4] -= 1
	b[3] -= 1
	b[1] -= 1
minn = b[0]
if b[1] < minn:
	minn = b[1]
if b[2] < minn:
	minn = b[1]
if b[3] < minn:
	minn = b[1]
for i in range(minn):
	otv.append(0)
for x in otv:
	print(x, end=' ')


n = int(input())
a = input()
zCounter = 0
eCounter = 0
rCounter = 0
oCounter = 0
nCounter = 0
for i in range(len(a)):
	if a[i] == 'z':
		zCounter += 1
	elif a[i] == 'e':
		eCounter += 1
	elif a[i] == 'r':
		rCounter += 1
	elif a[i] == 'o':
		oCounter += 1
	else:
		nCounter += 1
ones = min(oCounter, nCounter, eCounter)
oCounter -= ones
nCounter -= ones
eCounter -= ones
zeros = min(zCounter, eCounter, rCounter, oCounter)
print('1 ' * ones + '0 ' * zeros)


n = int(input())
s = str(input())
z = 0
o = 0
for i in range(n):
	if s[i] == 'z':
		z = z + 1
	elif s[i] == 'o':
		o = o + 1
c = []
if o >= z:
	o = o - z
	for i in range(o):
		c.append(1)
	for i in range(z):
		c.append(0)
elif z >= o:
	z = z - o
	for i in range(o):
		c.append(1)
	for i in range(z):
		c.append(0)
print(*c, sep=' ')


from collections import Counter
n = int(input())
freq = Counter(input())
one = min([freq[i] for i in 'one'])
for i in 'one':
	freq[i] -= one
zero = min([freq[i] for i in 'zero'])
print(('1 ' * one + '0 ' * zero).strip())


n = int(input())
string = input()
for i in range(string.count('n')):
	print('1', end=' ', flush=True)
for i in range(string.count('z')):
	print('0', end=' ', flush=True)


t = int(input())
e = str(input())
numz = e.count('z')
numone = int((t - numz * 4) / 3)
for c in range(numone):
	print('1', end=' ')
for d in range(numz):
	print('0', end=' ')


n = int(input())
string = input()
values = [string.count('n'), string.count('z')]
print('1 ' * values[0] + '0 ' * values[1])


n = int(input())
string = input()
z_count = 0
o_count = 0
string_1 = ''
for i in string:
	if i == 'z':
		z_count += 1
	elif i == 'n':
		o_count += 1
string = ''
for i in range(o_count):
	string += '1 '
for i in range(z_count):
	string += '0 '
print(string)


n = int(input())
str = input()
z = []
e = []
r = []
o = []
n = []
for i in str:
	if i == 'z':
		z.append(i)
	elif i == 'e':
		e.append(i)
	elif i == 'r':
		r.append(i)
	elif i == 'o':
		o.append(i)
	elif i == 'n':
		n.append(i)
for i in range(len(n)):
	print(1, end=' ')
for i in range(len(z)):
	print(0, end=' ')


def ans(s):
	l = len(s)
	z = 0
	e = 0
	r = 0
	o = 0
	n = 0
	m = 0
	f = 0
	t = 0
	for i in range(0, l, 1):
		if s[i] == 'z':
			z += 1
		if s[i] == 'e':
			e += 1
		if s[i] == 'r':
			r += 1
		if s[i] == 'o':
			o += 1
		if s[i] == 'n':
			n += 1
	m = abs(o - n)
	f = abs(e - n)
	sum = abs(l - e - n - o + m + f)
	t = sum // 4
	if n <= o and n <= e:
		for i in range(1, n + 1, 1):
			print(1, end=' ')
		for i in range(1, t + 1, 1):
			print(0, end=' ')
n = int(input())
s = str(input())
ans(s)


def sol(s):
	hash = {}
	for i in s:
		if i not in hash:
			hash[i] = 1
			continue
		hash[i] += 1
	zero = 0
	one = 0
	while 'o' in hash and 'n' in hash and ('e' in hash) and hash['o'] and hash['n'] and hash['e']:
		hash['o'] -= 1
		hash['n'] -= 1
		hash['e'] -= 1
		one += 1
	while 'z' in hash and 'o' in hash and ('r' in hash) and ('e' in hash) and hash['z'] and hash['e'] and hash['r'] and hash['o']:
		hash['z'] -= 1
		hash['e'] -= 1
		hash['r'] -= 1
		hash['o'] -= 1
		zero += 1
	for i in range(one):
		print(1, end=' ')
	for i in range(zero):
		print(0, end=' ')
	print()
input()
s = input()
sol(s)


n = int(input())
st = input()
a = [0] * 5
for i in st:
	if i == 'z':
		a[0] += 1
	elif i == 'e':
		a[1] += 1
	elif i == 'r':
		a[2] += 1
	elif i == 'o':
		a[3] += 1
	else:
		a[4] += 1
k = min(a[4], a[1], a[3])
print(str(str(str(1) + ' ') * k), end='')
print(str(str(str(0) + ' ') * min(a[2], a[1] - k, a[3] - k, a[0])))


char = input()
string = input()
z = 0
for i in string:
	if i == 'z':
		z = z + 1
char = int(char) - z * 4
one = int(char / 3)
for i in range(one):
	print(1, end=' ')
for i in range(z):
	print(0, end=' ')


n = int(input())
s = input()
s = list(s)
ans = []
for i in s:
	if i == 'z':
		ans.append('0')
	elif i == 'n':
		ans.append('1')
ans.sort(reverse=True)
print(' '.join(ans))


n = int(input())
v = input()
k = v.count('n')
l = v.count('z')
for i in range(k):
	print('1', end=' ')
for i in range(l):
	print('0', end=' ')


n = int(input())
st = input()
ncount = 0
zcount = 0
for ch in st:
	if ch == 'n':
		ncount += 1
	elif ch == 'z':
		zcount += 1
for i in range(ncount):
	print('1 ', end='')
for i in range(zcount):
	print('0 ', end='')


n = int(input())
a = input()
dict = dict()
dict['z'] = 0
dict['e'] = 0
dict['r'] = 0
dict['o'] = 0
dict['n'] = 0
for j in a:
	dict[j] += 1
ones = dict['n']
zeors = dict['z']
if ones == 0:
	print((zeors - 1) * '0 ' + ('0' if zeors != 0 else ''))
else:
	binary = ones * '1 ' + (zeors - 1) * '0 ' + ('0' if zeors != 0 else '')
	print(binary)


n = int(input())
s = input()
if len(s) == n:
	for i in s:
		if i == 'n':
			print(1, end=' ')
	for i in s:
		if i == 'z':
			print(0, end=' ')


n = int(input())
w = input()
d = {}
for i in w:
	if i in d:
		d[i] += 1
	else:
		d[i] = 1
zeros = 0
ones = 0
if 'z' in d:
	zeros = d['z']
if 'n' in d:
	ones = d['n']
for i in range(ones):
	print('1', end=' ')
for i in range(zeros):
	print('0', end=' ')


tamanho = int(input())
palavra = input()
zeros = 0
ums = 0
for i in range(tamanho):
	if palavra[i] == 'z':
		zeros = zeros + 1
	elif palavra[i] == 'n':
		ums = ums + 1
binario = ums + zeros
for x in range(ums):
	print(1, end=' ')
for y in range(zeros - 1):
	print(0, end=' ')
if zeros:
	print(0)


n = int(input())
s = str(input())
lis = []
for i in s:
	if i == 'n':
		lis.append(1)
for i in s:
	if i == 'z':
		lis.append(0)
k = ' '.join((str(v) for v in lis))
print(k)


n = int(input())
s = input()
ed = s.count('n')
zer = s.count('z')
print('1 ' * ed + '0 ' * zer)


n = int(input())
a = input()
z = 'zeron'
x = [0] * 5
for i in range(n):
	x[z.find(a[i])] += 1
for i in range(x[4]):
	print(1, end=' ')
for i in range(x[0]):
	print(0, end=' ')


n = int(input())
s = input()
a = s.count('z')
b = s.count('n')
l = [1] * b
k = [0] * a
l.extend(k)
for i in l:
	print(i, end=' ')


n = int(input())
cod = input()
k = cod.count('z')
print('1 ' * ((n - 4 * k) // 3) + '0 ' * k)


n = int(input())
s = input()
ones = 0
zeros = 0
for i in s:
	if i == 'z':
		zeros += 1
	if i == 'n':
		ones += 1
print(ones * '1 ' + zeros * '0 ')


n = int(input())
word = input()
oc = [0, 0, 0, 0, 0]
for i in word:
	if i == 'z':
		oc[0] += 1
	elif i == 'e':
		oc[1] += 1
	elif i == 'r':
		oc[2] += 1
	elif i == 'o':
		oc[3] += 1
	elif i == 'n':
		oc[4] += 1
z = min(oc[:4])
for i in range(4):
	oc[i] -= z
o = min(oc[1], min(oc[3:]))
for _ in range(o):
	print('1', end=' ')
for _ in range(z):
	print('0', end=' ')


n = int(input())
s = str(input())
a = s.count('n')
b = s.count('z')
i = 0
while i < a:
	print(1, end=' ')
	i += 1
i = 0
while i < b:
	print(0, end=' ')
	i += 1


n = input()
s = input()
w1 = s.count('n')
w2 = s.count('z')
print('1 ' * w1 + '0 ' * w2)


N = input()
word = input()
binary = '1' * word.count('n') + '0' * word.count('z')
binary = [c for c in binary]
print(' '.join((c for c in binary)))


n = int(input())
l = list((x for x in input()))
x = l.count('z')
y = l.count('n')
if y >= 1:
	for i in range(y):
		print('1')
if x >= 1:
	for i in range(x):
		print('0')


n = input()
u = input()
l = list(u)
zeros = 0
one = 0
for i in range(len(l)):
	if l[i] == 'z':
		zeros += 1
	elif l[i] == 'n':
		one += 1
out = ''
for i in range(one):
	out += '1 '
for i in range(zeros):
	out += '0 '
print(out)


s = int(input())
n = str(input())
a = 0
b = 0
c = 0
d = 0
e = 0
for i in range(s):
	if n[i] == 'o':
		a += 1
	elif n[i] == 'n':
		b += 1
	elif n[i] == 'e':
		c += 1
	elif n[i] == 'z':
		d += 1
	elif n[i] == 'r':
		e += 1
one = min(a, b, c)
zero = min(d, e, c - one, a - one)
m = '1 '
p = '0 '
print(m * one + p * zero)


n = int(input())
string = input()
ans = ''
for i in range(n):
	if string[i] == 'n':
		ans = '1 ' + ans
	elif string[i] == 'z':
		ans += '0 '
print(ans.strip(), flush=True)


n = int(input())
s = list(input())
from collections import Counter
counter = Counter(s)
z = counter['z']
o = (n - z * 4) // 3
while o > 0:
	print(1, end=' ')
	o = o - 1
while z > 0:
	print(0, end=' ')
	z = z - 1


n = int(input())
data = list(input())
zeros = data.count('z')
ones = data.count('n')
print('1 ' * ones + '0 ' * zeros)


import sys
n = int(sys.stdin.readline())
string = sys.stdin.readline()
ones = 0
zeros = 0
for i in range(n):
	if string[i] == 'n':
		ones += 1
	if string[i] == 'z':
		zeros += 1
output = ''
for _ in range(ones):
	output += '1 '
for _ in range(zeros):
	output += '0 '
print(output.rstrip() + '\n')


x = int(input())
string = input()
nz = string.count('z')
no = (x - nz * 4) // 3
print('1 ' * no, end='')
print('0 ' * nz)


n = int(input())
l = input()
res = []
for i in range(l.count('n')):
	res.append('1')
for i in range(l.count('z')):
	res.append('0')
print(' '.join(res))


import string
n = int(input())
s = input()
s = list(s)
one = s.count('n')
zero = s.count('z')
ans = []
for i in range(one):
	ans.append(1)
for i in range(zero):
	ans.append(0)
print(*ans)


k = int(input())
str = input()
z = str.count('z')
n = str.count('n')
for i in range(z + n):
	if i < n:
		print('1', end=' ')
	else:
		print('0', end=' ')


count = int(input())
l = input()
countn = l.count('n')
countr = l.count('r')
sum1 = '1 ' * countn
sum0 = '0 ' * countr
print(sum1 + sum0)


number = int(input())
word = str(input())
one = 0
zero = 0
for i in range(number):
	if word[i] == 'n':
		one += 1
	elif word[i] == 'z':
		zero += 1
print('1 ' * one + '0 ' * zero)


n = int(input())
string = input()
count_n = string.count('n')
count_z = string.count('z')
for i in range(count_n):
	print('1', end=' ')
for k in range(count_z):
	print('0', end=' ')


a = int(input())
s = input()
count0 = 0
count1 = 0
for i in range(a):
	if s[i] == 'z':
		count0 += 1
	elif s[i] == 'n':
		count1 += 1
for i in range(count1):
	print(1, end=' ')
for i in range(count0):
	print(0, end=' ')


from collections import Counter
l = [0, 0]
n = int(input())
cnt = Counter(input())
for c in 'zeron':
	if c not in cnt:
		cnt[c] = 0
for x in range(cnt['n'] + 1):
	y = min(cnt['z'], cnt['r'])
	y = min(y, min((cnt[c] - x for c in 'oe')))
	if 3 * x + 4 * y != n:
		continue
	if sum(l) <= x + y:
		l = [x, y]
print('1 ' * l[0] + '0 ' * l[1])


n = int(input())
s = input()
z = 0
e = 0
r = 0
o = 0
n = 0
for i in s:
	if i == 'z':
		z += 1
	if i == 'e':
		e += 1
	if i == 'r':
		r += 1
	if i == 'o':
		o += 1
	if i == 'n':
		n += 1
k = min(o, n, e)
o -= k
n -= k
e -= k
a = min(z, e, r, o)
print('1 ' * k, end='')
print('0 ' * a, end='')


num = int(input())
letts = input()
(zeros, ones) = (0, 0)
for lett in letts:
	if lett == 'z':
		zeros += 1
	if lett == 'n':
		ones += 1
print('1 ' * ones + '0 ' * zeros)


n = int(input())
b = input()
ch = 0
odin = b.count('n')
nul = b.count('z')
ch = '1' * odin + '0' * nul
for i in range(len(ch)):
	print(ch[i], end=' ')


i = int(input())
s = input()
chs = ['n', 'o', 'e', 'z', 'r']
freq = [s.count(ch) for ch in chs]
ones = min([freq[1], freq[0], freq[2]])
freq = [count - ones for count in freq[:3]] + freq[3:]
freq.pop(0)
if min(freq) > 0:
	zeroes = min(freq)
else:
	zeroes = 0
answer = '1' * ones + '0' * zeroes
print(' '.join([ch for ch in answer]))


from sys import stdin, stdout
from collections import Counter
rl = stdin.readline
wr = stdout.write
n = rl()
s = rl().strip()
zeros = s.count('z')
ones = s.count('n')
wr('1 ' * ones)
for i in range(zeros):
	wr(f'0') if i == zeros - 1 else wr(f'0 ')


n = int(input())
word = input()
string = []
for i in range(n):
	if word[i] == 'n':
		string.append('1')
	if word[i] == 'z':
		string.append('0')
string.sort(reverse=True)
myString = ' '.join(string)
print(myString)


n = int(input())
s = input()
n_count = s.count('n')
z_count = s.count('z')
while n_count:
	print('1', end=' ')
	n_count -= 1
while z_count:
	print('0', end=' ')
	z_count -= 1


n = int(input())
s = input()
(one, zero) = (0, 0)
for i in s:
	if i == 'n':
		one += 1
zero = int((n - one * 3) / 4)
summa = ''
for i in range(one):
	summa += '1 '
for i in range(zero):
	summa += '0 '
summa.strip()
print(summa)


n = int(input())
s = input()
Zero = 0
One = 0
for i in s:
	if i == 'z':
		Zero = Zero + 1
	if i == 'n':
		One = One + 1
if One > 0:
	while One != 0:
		print('1 ', end='')
		One = One - 1
if Zero > 0:
	while Zero != 0:
		print('0 ')
		Zero = Zero - 1


n = input()
str = input()
dict = {}
for ch in str:
	if ch in dict:
		dict[ch] += 1
	else:
		dict[ch] = 1
ones = 1000000000000
for ch in 'one':
	if ch in dict:
		ones = min(ones, dict[ch])
	else:
		ones = 0
zeros = 1000000000000
for ch in 'zero':
	if ch in dict:
		zeros = min(zeros, dict[ch])
	else:
		zeros = 0
while ones:
	print('1 ', end='')
	ones -= 1
while zeros:
	print('0 ', end='')
	zeros -= 1
print()


count = int(input())
s = input()
count_n = s.count('n')
count_r = s.count('r')
sum_1 = '1 ' * count_n
sum_0 = '0 ' * count_r
print(sum_1 + sum_0)


n = int(input())
inp = input()
d = {'z': 0, 'n': 0}
for i in inp:
	if i in ('z', 'n'):
		d[i] += 1
res = '1' * d['n'] + '0' * d['z']
for i in res:
	print(i, end=' ')


n = int(input())
s = input()
ss = []
a = s.count('n')
for i in range(a):
	ss.append(1)
b = s.count('z')
for i in range(b):
	ss.append(0)
print(' '.join(map(str, ss)))


c = int(input())
slovo = input()
count_z = slovo.count('z')
count_e = slovo.count('e')
count_r = slovo.count('r')
count_o = slovo.count('o')
count_n = slovo.count('n')
count_1 = min((count_o, count_n, count_e))
count_o -= count_1
count_n -= count_1
count_e -= count_1
count_0 = min((count_z, count_e, count_r, count_e))
print('1 ' * count_1, '0 ' * count_0, sep='')


n = int(input())
a = input()
z = a.count('z')
m = a.count('n')
for i in range(m):
	print('1', end=' ')
for j in range(z):
	print('0', end=' ')


n = int(input())
s = input()
l = []
for i in s:
	if i == 'r':
		l.append(0)
	elif i == 'n':
		l.append(1)
l.sort(reverse=True)
for i in l:
	print(i, end=' ')


n = input()
letters = input()

def t(letters):
	zeroes = 0
	for i in letters:
		if i == 'n':
			yield '1'
		elif i == 'z':
			zeroes += 1
	for zero in range(zeroes):
		yield '0'
print(' '.join(t(letters)))


n = int(input())
s = str(input())
a = s.count('n')
b = s.count('z')
t = ''
for i in range(a):
	t += '1' + ' '
for i in range(b):
	t += '0' + ' '
print(t)


n = int(input())

def split(word):
	return [char for char in word]
string = input()
l = split(string)
z = 0
for i in l:
	if i == 'z':
		z += 1
a = (n - 4 * z) // 3
for j in range(a):
	print(1, end=' ')
for i in range(z):
	print(0, end=' ')


n = int(input())
string = input()
one = 0
zero = 0
for i in string:
	if i == 'n':
		one += 1
	elif i == 'z':
		zero += 1
for i in range(one):
	print(1, end=' ')
for i in range(zero):
	print(0, end=' ')


n = int(input())
c = input()
z = 0
o = 0
for i in range(n):
	if c[i] == 'n':
		o += 1
	if c[i] == 'r':
		z += 1
print('1 ' * o + '0 ' * z)


n = int(input())
s = list(input())
count_n = s.count('n')
count_z = s.count('z')
ans = ''
ans += '1 ' * count_n
ans += '0 ' * count_z
print(ans)


n = int(input())
s = input()
c1 = 0
c2 = 0
for i in range(0, len(s), 1):
	if s[i] == 'z':
		c1 += 1
	elif s[i] == 'n':
		c2 += 1
while c2 != 0:
	print(1, end=' ')
	c2 = c2 - 1
while c1 != 0:
	print(0, end=' ')
	c1 = c1 - 1


import sys
n = int(input())
mstr = input()
ml = list(mstr)
(c_z, c_e) = (0, 0)
for i in range(len(ml)):
	if ml[i] == 'z':
		c_z += 1
	if ml[i] == 'n':
		c_e += 1
for i in range(c_e):
	print('1 ', end='')
for i in range(c_z):
	print('0 ', end='')


n = int(input())
string = input()
my_zero_one = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for sym in string:
	my_zero_one[sym] += 1
sequence = []
while True:
	if my_zero_one['o'] <= 0 or my_zero_one['n'] <= 0 or my_zero_one['e'] <= 0:
		break
	else:
		sequence.append(1)
		my_zero_one['o'] -= 1
		my_zero_one['n'] -= 1
		my_zero_one['e'] -= 1
while True:
	if my_zero_one['z'] <= 0 or my_zero_one['e'] <= 0 or my_zero_one['r'] <= 0 or (my_zero_one['o'] <= 0):
		break
	else:
		sequence.append(0)
		my_zero_one['z'] -= 1
		my_zero_one['e'] -= 1
		my_zero_one['r'] -= 1
		my_zero_one['o'] -= 1
print(*sequence)


q = int(input())
a = list(input())
output = []
one = 1
zero = 0
for i in range(q):
	if a[i] == 'z':
		output.append(zero)
	elif a[i] == 'n':
		output.append(one)
output.sort(reverse=True)
print(' '.join(map(str, output)))


numchar = int(input())
char = input()
numN = 0
numZ = 0
for x in char:
	if x == 'z':
		numZ += 1
	if x == 'n':
		numN += 1
if numN != 0:
	for x in range(numN):
		print('1 ', end='')
if numZ != 0:
	for x in range(numZ):
		print('0 ', end='')


n = input()
li = []
string = input()
a = string.count('z')
b = string.count('o')
c = a - b
st = '1' * (c * -1)
st = st + '0' * a
print(' '.join(st))


x = int(input())
s = input()
l = []
for i in range(s.count('z')):
	l.append(0)
for k in range(s.count('n')):
	l.append(1)
l.sort()
for i in reversed(l):
	print(i, end=' ')


import math
import sys
import collections
import itertools

def getdict(n):
	d = {}
	if type(n) is list:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = prime[1] = False
	r = [p for p in range(n + 1) if prime[p]]
	return r

def cdiv(n, k):
	return n // k + (n % k != 0)

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

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

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

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

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return collections.defaultdict(int)
n = ii()
d = collections.Counter(input())
t = min(d['o'], d['n'], d['e'])
r = ''
if t > 0:
	r += '1' * t
	d['o'] -= t
	d['n'] -= t
	d['e'] -= t
t = min(d['z'], d['e'], d['r'], d['o'])
if t > 0:
	r += '0' * t
[print(i, end=' ') for i in r]


n = int(input())
s = list(input())
out = ''
one = s.count('n')
zero = s.count('z')
for i in range(0, one):
	out = out + '1 '
for i in range(0, zero):
	out = out + '0 '
print(out)


a = int(input())
b = input()
c = b.count('z')
d = '0' * c
f = a - c * 4
x = f // 3
g = x * '1'
answer = g + d
babab = ' '.join(answer)
print(babab)


def count(s, x):
	count = 0
	for c in s:
		if c == x:
			count += 1
	return count
n = int(input())
s = input()
for i in range(count(s, 'n')):
	print(1, end=' ')
for i in range(count(s, 'z')):
	print(0, end=' ')
print('\n')


n = int(input())
a = list(input())
arr = []
counter = a.count('n')
counter2 = a.count('r')
for i in range(counter):
	arr.append(1)
for i in range(counter2):
	arr.append(0)
print(*arr)


k = int(input())
seq = input()
o = seq.count('o')
n = seq.count('n')
e = seq.count('e')
while e != n and e != o:
	if e > n:
		if e > o:
			e -= 1
		else:
			o -= 1
	elif n > o:
		n -= 1
	else:
		o -= 1
for i in range(n):
	print('1 ', end='')
z = seq.count('z')
r = seq.count('r')
zeros = [z, e, r, o]
men = min(zeros)
while men != z and men != e and (men != r) and (men != o):
	if z > men:
		z -= 1
	if e > men:
		e -= 1
	if r > men:
		r -= 1
	if o > men:
		r -= 1
for i in range(men):
	print('0 ', end='')
print()


num = input()
c = input().count
numZero = max(0, min(c('o'), c('r'), c('e'), c('z')))
numOne = max(0, min(c('o'), c('n'), c('e')))
myList = []
for i in range(numOne):
	myList.insert(0, '1')
for i in range(numZero):
	myList.insert(len(myList), '0')
print(' '.join(myList))


from collections import Counter
input()
line = list(input())
chars = list(line)
c = Counter(chars)
ones = c['n']
zeros = c['z']
str1 = ''
str2 = ''
for i in range(ones):
	if (i == ones - 1) & (zeros == 0):
		str1 = str1 + '1'
	else:
		str1 = str1 + '1 '
for j in range(zeros):
	if j == zeros - 1:
		str2 = str2 + '0'
	else:
		str2 = str2 + '0 '
print(str1 + str2)


a = input()
s = input()
b = list(map(lambda k: k, s))
z = 0
e = 0
r = 0
o = 0
n = 0
i = 0
while i < int(a):
	if b[i] == 'z':
		z = 1 + z
		i = i + 1
	elif b[i] == 'e':
		e = e + 1
		i = i + 1
	elif b[i] == 'r':
		r = r + 1
		i = i + 1
	elif b[i] == 'o':
		o = o + 1
		i = i + 1
	elif b[i] == 'n':
		n = n + 1
		i = i + 1
c = min(o, n, e)
o = o - c
n = n - c
e = e - c
p = []
q = 0
t = 0
d = min(z, e, r, o)
while q < c:
	p.append('1')
	q = q + 1
while t < d:
	p.append('0')
	t = t + 1
print(*p)


n = int(input())
s = input()
hs = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for i in s:
	hs[i] += 1
min_1 = min([hs['o'], hs['n'], hs['e']])
hs['o'] -= min_1
hs['n'] -= min_1
hs['e'] -= min_1
min_0 = min([hs['z'], hs['e'], hs['r'], hs['o']])
for i in range(min_1):
	print('1 ', end='')
for i in range(min_0):
	print('0 ', end='')


n = int(input())
a = input()
c = dict()
for i in 'zeron':
	c[i] = 0
for i in a:
	c[i] += 1
ur = min(c['z'], c['e'], c['r'], c['o'])
vr = min(c['o'], c['n'], c['e'])
wr = min(c['o'], c['e'])
res = [1] * vr
wr -= vr
res += [0] * min(wr, ur)
print(*res)


n = int(input())
w = input()
w = sorted(w, reverse=True)
zeros = 0
while w[zeros] == 'z':
	zeros += 1
ones = (n - zeros * 4) // 3
for i in range(ones):
	print(1, end=' ')
for i in range(zeros):
	print(0, end=' ')


n = int(input())
string = input()
list = []
count_1 = 0
count_0 = 0
for i in string:
	if string.__contains__('o') and string.__contains__('n') and string.__contains__('e'):
		count_1 += 1
		string = string.replace('o', '', 1)
		string = string.replace('n', '', 1)
		string = string.replace('e', '', 1)
		list.append(1)
	if string.__contains__('z') and string.__contains__('e') and string.__contains__('r') and string.__contains__('o'):
		count_0 += 1
		string = string.replace('z', '', 1)
		string = string.replace('e', '', 1)
		string = string.replace('r', '', 1)
		string = string.replace('o', '', 1)
		list.append(0)
list.sort()
list = list[::-1]
print(' '.join([str(x) for x in list]))


q = lambda : map(int, input().split())
(n,) = q()
a = input()
print('1 ' * a.count('n') + '0 ' * a.count('z'))


n = int(input())
text = input()
(nrz, nrn) = (0, 0)
for ch in text:
	if ch == 'z':
		nrz += 1
	elif ch == 'n':
		nrn += 1
for i in range(nrn):
	print(1, end=' ')
for i in range(nrz):
	print(0, end=' ')


thisfra = input()
slovo = input()
z = slovo.count('z')
o = slovo.count('o')
print('1 ' * (o - z) + '0 ' * z)


n = int(input())
x = input()
ansar = []
for i in range(n):
	if x[i] == 'n':
		ansar.append(1)
	elif x[i] == 'z':
		ansar.append(0)
ansar.sort()
print(*ansar[::-1], sep=' ')


n = int(input())
s = input()
counts = {'o': 0, 'n': 0, 'e': 0, 'z': 0, 'r': 0}
for i in range(n):
	counts[s[i]] += 1
ones = counts['n']
counts['o'] -= ones
counts['e'] -= ones
zeros = counts['o']
v = []
for i in range(ones):
	v.append('1')
for i in range(zeros):
	v.append('0')
print(' '.join(v))


length = int(input())
letters = input()
ones = letters.count('n')
zeroes = letters.count('z')
maxnum = ''
while ones != 0:
	maxnum = maxnum + '1'
	if ones != 1 or zeroes != 0:
		maxnum = maxnum + ' '
	ones = ones - 1
while zeroes != 0:
	maxnum = maxnum + '0'
	if zeroes != 1:
		maxnum = maxnum + ' '
	zeroes = zeroes - 1
print(maxnum)


a = int(input())
b = input()
c = 0
s = []
for i in range(a):
	if b[i] == 'z':
		c += 1
zero = a - c * 4
one = (a - c * 4) // 3
for i in range(one):
	s.append('1')
for i in range(c):
	s.append('0')
print(*s)


kol = int(input())
e = 0
z = 0
s = input()
for i in s:
	if i == 'n':
		e += 1
	if i == 'z':
		z += 1
while e != 0:
	print('1 ', end='')
	e -= 1
while z != 0:
	print('0 ', end='')
	z -= 1


n = int(input())
s = input()
z = s.count('z')
o = s.count('n')
print(' '.join(['1'] * o + ['0'] * z))


n = int(input())
st = input()
l = []
(z, e, r, o, n) = (st.count('z'), st.count('e'), st.count('r'), st.count('o'), st.count('n'))
one_min = min(o, n, e)
for i in range(one_min):
	l.append(1)
o = o - one_min
n = n - one_min
e = e - one_min
zero_min = min(z, e, r, o)
for i in range(zero_min):
	l.append(0)
print(*l)


o = int(input())
s = input()
n = s.count('n')
z = s.count('z')
res = n * '1 ' + z * '0 '
print(res[:-1])


n = int(input())
m = input()
ar = []
for i in m:
	ar.append(i)
d = ar.count('n')
f = ar.count('z')
b = []
for j in range(0, d):
	b.append('1')
for k in range(0, f):
	b.append('0')
s = ' '
print(s.join(b))


count = int(input())
st = input()
o = st.count('o')
n = st.count('n')
e = st.count('e')
z = st.count('z')
r = st.count('r')
ones = min(o, n, e)
ans = '1 ' * ones
ans += '0 ' * min(z, e - ones, r, o - ones)
print(ans)


a = input()
a = list(input())
one = a.count('n')
zero = a.count('z')
ans = []
for i in range(one):
	ans.append('1')
for i in range(zero):
	ans.append('0')
print(' '.join(ans))


c = int(input())
i = 0
j = 0
x = 0
a = input()
for x in range(c):
	if a[x] == 'n':
		i = i + 1
	elif a[x] == 'z':
		j = j + 1
for y in range(i):
	print('1', end=' ')
for z in range(j):
	print('0', end=' ')


n = int(input())
str1 = input()
(zeroes, ones) = (str1.count('z'), str1.count('n'))
while ones:
	ones -= 1
	print('1 ', end='')
while zeroes:
	zeroes -= 1
	print('0 ', end='')


x = int(input())
s = list(input())
a = s.count('z')
b = s.count('n')
print('1 ' * b, '0 ' * a)


input()
s = input()
z = s.count('z')
o = s.count('n')
print('1 ' * o, '0 ' * z)


from collections import defaultdict
n = int(input())
s = input()
d = defaultdict(int)
for i in s:
	d[i] += 1
res = ''
res += '1' * d['n']
res += '0' * d['z']
for i in res:
	print(i, end=' ')


t = int(input())
s = input()
noof1 = 0
noof0 = 0
no = 0
for i in range(t):
	if s[i] == 'n':
		noof1 = noof1 + 1
	elif s[i] == 'o':
		noof0 = noof0 + 1
	else:
		no = no + 1
noof0 = noof0 - noof1
for k in range(noof1):
	print('1')
for j in range(noof0):
	print('0')


import sys
pin = sys.stdin.readline
pout = sys.stdout.write
ran = range
t = int(pin())
s = pin()
total = []
if 'n' in s:
	count = s.count('n')
	for i in ran(count):
		total.append(1)
if 'z' in s:
	count1 = s.count('z')
	for i in ran(count1):
		total.append(0)
print(' '.join(map(str, total)))


Dict = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
count_one = 0
count_zero = 0
n = input()
s = input()
for i in s:
	Dict[i] = Dict[i] + 1
count_one = Dict['n']
Dict['n'] = 0
count_zero = Dict['z']
Dict['z'] = 0
for i in range(0, count_one):
	print('1 ', end=' ')
for i in range(0, count_zero):
	print('0 ', end=' ')


c = input()
s = input()
z = s.count('z')
n = s.count('n')
r = ''
for x in range(n):
	r += '1 '
for x in range(z):
	r += '0 '
print(r)


n = int(input())
k = input()
zero = []
one = []
k = [char for char in k]
for x in range(0, n):
	if k[x] == 'z':
		zero.append(0)
	elif k[x] == 'n':
		one.append(1)
k = one + zero
print(' '.join(map(str, k)))


n = int(input())
s = input()
cnt1 = cnt0 = 0
for i in s:
	if i == 'n':
		cnt1 += 1
	elif i == 'z':
		cnt0 += 1
print('1 ' * cnt1 + '0 ' * cnt0)


letters = int(input())
wordlist = list(input())
ntimes = wordlist.count('n')
ztimes = wordlist.count('z')
print(' '.join(sorted(ntimes * ['1'] + ztimes * ['0'], reverse=True)))


n = int(input())
s = input()
z = s.count('z')
o = (len(s) - z * 4) // 3
a = [1] * o + [0] * z
print(*a)


N = int(input())
str1 = input()
list1 = []
str1 = str1.lower()
str1len = len(str1)
z = str1.count('z')
str1len -= z * 4
one = str1len / 3
ii = 0
while ii < one:
	xx = '1'
	list1.append(xx)
	ii += 1
i = 0
while i < z:
	x = '0'
	list1.append(x)
	i += 1
for i in list1:
	print(i, end=' ')


n = int(input())
s = input()
one = s.count('n')
zero = (n - s.count('n') * 3) // 4
for i in range(one):
	print('1 ')
for i in range(zero):
	print('0 ')


n = int(input())
s = input()
k = '1 ' * s.count('n') + '0 ' * s.count('z')
print(k)


n = int(input())
l = list(input())
ans = ''
if 'n' in l:
	ones = l.count('n')
	ans = ans + ones * str(1)
if 'z' in l:
	zeros = l.count('z')
	ans = ans + zeros * str(0)
print(ans.replace('', ' ').strip())


n = int(input())
s = input()
d = {}
cnt0 = 0
cnt1 = 0
for i in s:
	cnt0 += i == 'z'
	cnt1 += i == 'n'
print('1 ' * cnt1, '0 ' * cnt0, sep='')


n = int(input())
q = list(input())
z = 0
e = 0
r = 0
o = 0
n = 0
for i in q:
	if i == 'z':
		z += 1
	elif i == 'e':
		e += 1
	elif i == 'o':
		o += 1
	elif i == 'n':
		n += 1
	elif i == 'r':
		r += 1
while n > 0 and o > 0 and (e > 0):
	print(1, end=' ')
	n -= 1
	o -= 1
	e -= 1
while z > 0 and e > 0 and (r > 0) and (o > 0):
	print(0, ' ')
	z -= 1
	e -= 1
	r -= 1
	o -= 1


N = int(input())
inp = str(input())
zeroes = 0
ones = 0
for i in range(len(inp)):
	if inp[i] == 'z':
		zeroes += 1
	elif inp[i] == 'n':
		ones += 1
while ones > 0:
	print('1', end=' ')
	ones -= 1
while zeroes > 0:
	print('0', end=' ')
	zeroes -= 1


import collections
n = int(input())
s = input()
cnt = collections.Counter(s)
one_cnt = zero_cnt = 0
if 'z' in cnt:
	zero_cnt = cnt['z']
if 'n' in cnt:
	one_cnt = cnt['n']
print(' '.join(list('1' * one_cnt + '0' * zero_cnt)))


input()
string = input().strip()
n = string.count('n')
z = string.count('z')
res = ''
for i in range(0, n):
	res = res + '1' + ' '
for i in range(0, z):
	res = res + '0' + ' '
print(res)


n = int(input(''))
s = list(input(''))
ones = s.count('n')
zeros = s.count('z')
ans = []
for i in range(ones):
	ans.append(1)
for i in range(zeros):
	ans.append(0)
print(*ans)


x = input()
st = input()
li = [0, 0, 0, 0, 0]
for i in st:
	if i == 'o':
		li[0] += 1
	elif i == 'n':
		li[1] += 1
	elif i == 'e':
		li[2] += 1
	elif i == 'z':
		li[3] += 1
	elif i == 'r':
		li[4] += 1
countone = 0
while li[0] != 0 and li[1] != 0 and (li[2] != 0):
	countone += 1
	li[0] -= 1
	li[1] -= 1
	li[2] -= 1
countzero = 0
while li[0] != 0 and li[2] != 0 and (li[3] != 0) and (li[4] != 0):
	countzero += 1
	li[0] -= 1
	li[2] -= 1
	li[3] -= 1
	li[4] -= 1
ans = []
for i in range(countone):
	ans.append(str(1))
for i in range(countzero):
	ans.append(str(0))
print(' '.join(ans))


n = int(input())
s = input()
t = ''
for i in range(s.count('n')):
	t += '1 '
for i in range(s.count('z')):
	t += '0 '
print(t.strip())


n = int(input())
s = input()
one_count = sum(map(lambda c: int(c == 'n'), s))
zero_count = sum(map(lambda c: int(c == 'z'), s))
print(' '.join(['1'] * one_count + ['0'] * zero_count))


number = input()
question = input()
z = 0
n = 0
for i in question:
	if i == 'n':
		n = n + 1
	elif i == 'z':
		z = z + 1
for i in range(n):
	print('1 ', end='')
for i in range(z):
	print('0 ', end='')


n = int(input())
s = input()
ones = s.count('n')
zeroes = s.count('z')
for i in range(ones):
	print('1', end=' ')
for i in range(zeroes):
	print('0', end=' ')


n = int(input())
I = input()
bit = []
for i in I:
	if i == 'n':
		bit.append(1)
for i in I:
	if i == 'z':
		bit.append(0)
for i in bit:
	print(i, end=' ')


n = int(input())
s = input()
symbols = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for i in s:
	symbols[i] += 1
print('1 ' * symbols['n'] + '0 ' * symbols['z'])


n = int(input())
s = input()
dic = {}
flag1 = 0
flag2 = 0
for i in range(n):
	dic[s[i]] = dic.get(s[i], 0) + 1
	if s[i] == 'n':
		flag1 = 1
	if s[i] == 'z':
		flag2 = 1
if flag1 == 1:
	p = dic['n']
	for i in range(p):
		print('1', end=' ')
if flag2 == 1:
	q = dic['z']
	for i in range(q):
		print('0', end=' ')


input()
st = input()
print(*[1] * st.count('n'), *[0] * st.count('z'))


a = int(input())
s = input()
r = s.count('r')
n = s.count('n')
if n >= 0 and r >= 0:
	print(' '.join('1' * n + '0' * r))
elif n >= 0 and r == 0:
	print(' '.join('1' * n))
else:
	print('0')


def func(s):
	count0 = 0
	count1 = 0
	lio = []
	s = list(s)
	for i in s:
		if i == 'n':
			count1 += 1
		elif i == 'z':
			count0 += 1
	for j in range(1, count1 + 1):
		lio.append('1')
	for j in range(1, count0 + 1):
		lio.append('0')
	ss = ''.join(lio)
	for i in ss:
		print(int(i), end=' ')
n = int(input())
s = str(input())
x = func(s)


num = int(input())
letters = list(input())
z = letters.count('z')
e = letters.count('e')
r = letters.count('r')
o = letters.count('o')
n = letters.count('n')
ones = min(o, n, e)
o -= ones
n -= ones
e -= ones
zero = min(z, e, r, o)
ans = ones * '1 ' + zero * '0 '
print(ans.strip())


import sys
from collections import Counter
readline = sys.stdin.readline
N = int(readline())
S = readline().strip()
C = Counter(S)
zero = C['r']
one = C['n']
ans = [1] * one + [0] * zero
print(*ans)


n = int(input())
s = input()
o = 0
z = 0
for i in s:
	if i == 'n':
		o += 1
	elif i == 'z':
		z += 1
print('1 ' * o, end='')
if z != 0:
	if o == 0:
		print('0 ' * z, end='')
	else:
		print('0')
		print(' 0' * (z - 1), end='')


n = int(input())
s = input()
print(' '.join('1' * min(s.count('o'), s.count('n'), s.count('e'))) + ' 0' * min(s.count('z'), s.count('e'), s.count('r'), s.count('o')))


n = int(input())
card_str = input()
z = card_str.count('z')
n = card_str.count('n')
for _ in range(n):
	print('1', end=' ')
for _ in range(z):
	print('0', end=' ')


n = int(input())
s = input()
d = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
res = []
for i in s:
	d[i] = d[i] + 1
while d['n'] > 0:
	if d['o'] and d['n'] and d['e']:
		res.append(1)
		d['o'] -= 1
		d['n'] -= 1
		d['e'] -= 1
	else:
		break
while d['z'] > 0:
	if d['z'] and d['e'] and d['r'] and d['o']:
		res.append(0)
		d['z'] -= 1
		d['e'] -= 1
		d['r'] -= 1
		d['o'] -= 1
	else:
		break
print(*res)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

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

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

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

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def main():
	t = 1
	rr = []
	for _ in range(t):
		n = I()
		c = collections.Counter(S())
		r = []
		while all((c[t] > 0 for t in 'one')):
			r.append(1)
			for t in 'one':
				c[t] -= 1
		while all((c[t] > 0 for t in 'zero')):
			r.append(0)
			for t in 'zero':
				c[t] -= 1
		rr.append(JA(r, ' '))
	return JA(rr, '\n')
print(main())


n = int(input())
letters = list(input())
count_z = 0
count_e = 0
count_r = 0
count_o = 0
count_n = 0
for letter in letters:
	if letter == 'z':
		count_z += 1
	elif letter == 'e':
		count_e += 1
	elif letter == 'r':
		count_r += 1
	elif letter == 'o':
		count_o += 1
	elif letter == 'n':
		count_n += 1
count_one = min(count_o, count_n, count_e)
count_o -= count_one
count_e -= count_one
count_zero = min(count_z, count_e, count_r, count_o)
num = []
while count_one > 0:
	num.append(1)
	count_one -= 1
while count_zero > 0:
	num.append(0)
	count_zero -= 1
print(*num)


n = int(input())
a = input()
k = a.count('z')
l = a.count('n')
if l >= 1:
	for _ in range(l):
		print('1')
if k >= 1:
	for _ in range(k):
		print('0')


import sys
input = sys.stdin.readline
from collections import defaultdict as dc
n = int(input())
s = input()
x = dc(int)
for i in s:
	x[i] += 1
z = min(x['z'], x['r'])
o = x['n']
l = ['1'] * o + ['0'] * z
print(*l)


n = int(input())
s = input()
one = '1'
zero = '0'
co = s.count('n')
cz = s.count('z')
arr = ''
if co != 0:
	arr = arr + str(one * co)
if cz != 0:
	arr = arr + str(zero * cz)
print(' '.join(arr))


long = int(input())
words = input()
n = 0
z = 0
s = ''
for i in range(long):
	if words[i] == 'z':
		z += 1
	elif words[i] == 'n':
		n += 1
for i in range(n):
	s += '1 '
for i in range(z):
	s += '0 '
print(s)


n = int(input())
s = input()
let = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for c in s:
	let[c] += 1
n1 = min(let['o'], let['n'], let['e'])
n0 = min(let['z'], let['e'] - n1, let['r'], let['o'] - n1)
print(('1 ' * n1 + '0 ' * n0)[:-1])


T = int(input())
string = input()
print(*[1] * string.count('n') + [0] * string.count('z'))


a = input()
b = input()
c = 0
d = 0
for i in b:
	if i == 'n':
		c += 1
	if i == 'z':
		d += 1
ans = '1 ' * c + '0 ' * d
print(ans)


v = int(input())
x = input()
z = x.count('z')
f = x.count('n')
for i in range(f):
	print('1', end=' ')
for i in range(z):
	print('0', end=' ')


n = int(input())
word = input()
letra_z = word.count('z')
letra_n = word.count('n')
out = ['1' for _ in range(letra_n)] + ['0' for _ in range(letra_z)]
print(*out)


n = int(input())
l = input()
if n > 2:
	k = l.count('z')
	o = len(l) - k * 4
	t = o // 3
	w = []
	if t > 0:
		for i in range(t):
			w.append(1)
	if k > 0:
		for i in range(k):
			w.append(0)
	for i in range(len(w)):
		print(w[i], end=' ')
else:
	print('0')


stringlenght = int(input())
letters = str(input())
i = int(0)
j = int(0)
zeroes = int(0)
ones = int(0)
answer = str('')
x = int(0)
firstLine = int(0)
while i < stringlenght:
	if letters[i] == 'z':
		zeroes += 1
	i += 1
while j < stringlenght:
	if letters[j] == 'n':
		ones += 1
	j += 1
while ones > 0:
	if firstLine > 0:
		answer += ' '
	firstLine += 1
	answer += str(1)
	ones -= 1
while zeroes > 0:
	if firstLine > 0:
		answer += ' '
	firstLine += 1
	answer += str(0)
	zeroes -= 1
print(answer)


loS = input()
letters = input()
for each_element in letters:
	if each_element == 'n':
		print(1, end=' ')
for each_element in letters:
	if each_element == 'z':
		print(0, end=' ')


import sys
n = int(input())
name = sys.stdin.readline().strip()
for j in range(name.count('n')):
	print(1, end=' ')
for i in range(name.count('z')):
	print(0, end=' ')


n = int(input())
s = list(input())
z = s.count('z')
o = s.count('n')
p = ''
i = 0
while i < o:
	p = p + '1 '
	i = i + 1
i = 0
while i < z:
	p = p + '0 '
	i = i + 1
print(p)


num = int(input())
list = input()
box_A = ''
box_B = ''
for box_C in list:
	if box_C == 'n':
		box_A = box_A + '1'
	elif box_C == 'z':
		box_B = box_B + '0'
print(' '.join(box_A + box_B))


n = int(input())
vards = input()
sk1 = vards.count('n')
sk0 = vards.count('z')
izn = '1 ' * sk1 + '0 ' * sk0
print(izn.strip())


from collections import Counter as counter
n = int(input())
output = ''
letters = list((char for char in input()))
z = letters.count('n')
for i in range(z):
	output += '1 '
n -= z * 3
x = n // 4
for i in range(x):
	output += '0 '
print(output)


N = int(input())
S = input()
z = 0
e = 0
r = 0
o = 0
n = 0
for i in range(len(S)):
	if S[i] == 'z':
		z += 1
	if S[i] == 'e':
		e += 1
	if S[i] == 'r':
		r += 1
	if S[i] == 'o':
		o += 1
	if S[i] == 'n':
		n += 1
cnt1 = 0
cnt2 = 0
x = min(o, n, e)
o -= x
n -= x
e -= x
cnt1 = x
y = min(z, e, r, o)
z -= y
e -= y
r -= y
o -= y
cnt2 = y
for i in range(cnt1):
	print('1', end=' ')
for i in range(cnt2):
	print('0', end=' ')


a = int(input())
b = input()
n = b.count('n')
e = b.count('e')
o = b.count('o')
z = b.count('z')
r = b.count('r')
mone = min(o, n, e)
n = n - mone
e = e - mone
o = o - mone
mzero = min(z, e, r, o)
print(('1 ' * mone + '0 ' * mzero)[:-1])


from collections import defaultdict
n = int(input())
arr = str(input())
check = defaultdict(lambda : 0)

def func():
	if check['o'] and check['n'] and check['e']:
		print(1, end=' ')
		check['o'] -= 1
		check['n'] -= 1
		check['e'] -= 1
		return 1
	if check['z'] and check['e'] and check['r'] and check['o']:
		print(0, end=' ')
		check['z'] -= 1
		check['e'] -= 1
		check['r'] -= 1
		check['o'] -= 1
		return 1
	return 0
for i in arr:
	check[i] += 1
while func():
	continue


n = int(input())
stri = sorted(list(input()))
z = stri.count('z')
n = stri.count('n')
for j in range(n):
	print(1, end=' ')
for j in range(z):
	print(0, end=' ')


from sys import stdin, stdout
n = int(stdin.readline())
arr = stdin.readline()
my_dict = {'z': 0, 'n': 0}
for i in arr:
	if i == 'z':
		my_dict['z'] += 1
	elif i == 'n':
		my_dict['n'] += 1
for k in range(my_dict['n']):
	stdout.write('1 ')
for j in range(my_dict['z']):
	stdout.write('0 ')


zero = 'zero'
one = 'one'
k_zero = 0
k_one = 0
n = int(input())
s = input()
for i in range(n):
	if s[i] == 'z':
		k_zero += 1
	if s[i] == 'n':
		k_one += 1
for i in range(k_one):
	print(1, end=' ')
for i in range(k_zero):
	print(0, end=' ')


from collections import Counter
n = input()
n = Counter(list(input()))
(count_one, count_zero) = (0, 0)
mini = min(n['o'], n['n'], n['e'])
count_one += mini
n['o'] -= mini
n['n'] -= mini
n['e'] -= mini
mini = min(n['z'], n['e'], n['r'], n['o'])
if mini <= 0:
	print('1 ' * count_one)
	exit(0)
else:
	count_zero += mini
print('1 ' * count_one + '0 ' * count_zero)


n = int(input())
s = input()
ans = '1' * s.count('n')
ans += '0' * s.count('z')
print(*list(ans))


n = int(input())
shuffle = list(input())
res = ''
for ch in shuffle:
	if ch == 'z':
		res += '0 '
	elif ch == 'n':
		res = '1 ' + res
print(res)


length = int(input())
string = input()
contador_0 = 0
contador_1 = 0
for letter in string:
	if letter == 'z':
		contador_0 += 1
	elif letter == 'n':
		contador_1 += 1
string = ''
for contador in range(contador_1):
	string += '1 '
for contador in range(contador_0):
	string += '0 '
string = ''.join(list(string)[:-1])
print(string)


n = int(input())
s = input()
res = {i: s.count(i) for i in set(s)}
cz = res['z'] if 'z' in res else 0
cn = res['n'] if 'n' in res else 0
r = ''
while cn > 0:
	if len(r) == 0:
		r += '1'
	else:
		r += ' 1'
	cn -= 1
while cz > 0:
	if len(r) == 0:
		r += '0'
	else:
		r += ' 0'
	cz -= 1
print(r)


input()
s = input()
ans = ''
for i in range(s.count('n')):
	ans += '1 '
for i in range(s.count('r')):
	ans += '0 '
print(ans.strip())


from sys import stdin
inp = stdin.readline
n = int(inp().strip())
s = inp().strip()
zeros = s.count('z')
ones = s.count('n')
if ones:
	print(*['1'] * ones, end=' ')
print(*['0'] * zeros)


n = int(input())
l = list(input())
r = l.count('n')
t = l.count('z')
y = l.count('r')
for i in range(r):
	print('1 ', end='')
for i in range(min(t, y)):
	print('0 ', end='')


N = int(input())
STR = input()
n = 0
z = 0
for i in range(N):
	if STR[i] == 'n':
		n += 1
	if STR[i] == 'z':
		z += 1
res = []
for i in range(n):
	res.append('1')
for i in range(z):
	res.append('0')
print(' '.join(res))


n = int(input())
strg = input()
arr = []
arr[:0] = strg
countn = 0
countz = 0
for i in range(n):
	if arr[i] == 'z':
		countz += 1
	elif arr[i] == 'n':
		countn += 1
while countn:
	print('1', end=' ')
	countn -= 1
while countz:
	print('0', end=' ')
	countz -= 1


n = int(input())
a = input()
a = list(a)
zeros = 0
ones = 0
for i in a:
	if i == 'z':
		zeros = zeros + 1
	elif i == 'n':
		ones = ones + 1
print('1 ' * ones + '0 ' * zeros)


a = int(input())
b = input()
c = list(b)
d1 = c.count('z')
d2 = c.count('e')
d3 = c.count('r')
d4 = c.count('o')
e = (d1 + 3 * d1) // 4
d5 = c.count('n')
e2 = (d5 * 2 + d5) // 3
e = int(e)
e2 = int(e2)
e4 = str(1)
e5 = str(0)
n = list(e4 * e2)
n1 = ' '.join(n)
n2 = list(e5 * e)
n3 = ' '.join(n2)
print(n1, n3)


n = int(input())
s = input()
sizeN = s.count('n')
sizeR = s.count('z')
l = []
for i in range(sizeN + sizeR):
	if i < sizeN:
		l.append('1')
	else:
		l.append('0')
print(' '.join(l))


n = int(input())
st = input()
zer = st.count('z')
one = (n - zer * 4) // 3
print(one * '1 ' + zer * '0 ')


from collections import defaultdict as df
p = df(int)
p['e'] = 0
p['z'] = 0
p['o'] = 0
p['n'] = 0
p['r'] = 0
n = int(input())
s = input().rstrip()
for i in s:
	if i in p:
		p[i] += 1
	else:
		p[i] = 1
h = min(p['o'], p['n'], p['e'])
p['0'] -= h
p['n'] -= h
p['e'] -= h
ans = []
for i in range(h):
	ans.append(1)
h = min(p['z'], p['e'], p['r'], p['o'])
for i in range(h):
	ans.append(0)
print(*ans)


n = int(input())
str = input()
os = str.count('o')
ns = str.count('n')
es = str.count('e')
zs = str.count('z')
rs = str.count('r')
min_ones = min([os, ns, es])
os -= min_ones
ns -= min_ones
es -= min_ones
min_zeros = min([os, es, zs, rs])
res = []
for x in range(min_ones):
	res.append('1')
for y in range(min_zeros):
	res.append('0')
print(' '.join(res))


import sys
s = sys.stdin.read().strip().split('\n')[1]
print(('1 ' * s.count('n') + '0 ' * s.count('r')).strip())


n = int(input())
s = input()
while len(s) != 0:
	if 'o' in s and 'n' in s and ('e' in s):
		print(1, end=' ')
		s = s.replace('o', '', 1)
		s = s.replace('n', '', 1)
		s = s.replace('e', '', 1)
	elif 'z' in s and 'e' in s and ('r' in s) and ('o' in s):
		print(0, end=' ')
		s = s.replace('z', '', 1)
		s = s.replace('e', '', 1)
		s = s.replace('r', '', 1)
		s = s.replace('o', '', 1)


n = int(input())
s = str(input())
if 'o' and 'n' and ('e' in s):
	b = s.count('n')
	for _ in range(b):
		print('1 ', end='')
if 'z' and 'e' and 'r' and ('o' in s):
	a = s.count('z')
	for _ in range(a):
		print('0 ', end='')


n = int(input())
s = input()
a = {}
for i in s:
	if i not in a:
		a[i] = 1
	else:
		a[i] += 1
if 'o' in a and 'n' in a and ('e' in a):
	o_min = min(a['o'], a['n'], a['e'])
	print(' '.join(('1' for i in range(o_min))), end=' ')
	a['e'] -= o_min
if 'z' in a and 'e' in a and ('r' in a) and ('o' in a):
	z_min = min(a['z'], a['e'], a['r'], a['o'])
	print(' '.join(('0' for i in range(z_min))))


lenth = int(input())
string = input()
(z, n) = (0, 0)
for _ in string:
	if _ == 'z':
		z += 1
	elif _ == 'n':
		n += 1
print(' '.join('1' * n + '0' * z))


n = input()
arr = list(input())
ones = 0
countZeros = [0] * 4
for letter in arr:
	if letter == 'n':
		ones += 1
	elif letter == 'z':
		countZeros[0] += 1
	elif letter == 'e':
		countZeros[1] += 1
	elif letter == 'r':
		countZeros[2] += 1
	else:
		countZeros[3] += 1
zeros = min(countZeros)
ans = []
for i in range(ones):
	ans.append('1')
for i in range(zeros):
	ans.append('0')
print(' '.join(ans))


n = int(input())
ao = 0
an = 0
ae = 0
az = 0
ar = 0
for i in input():
	if i == 'n':
		an += 1
	elif i == 'z':
		az += 1
for i in range(an):
	print(1, end=' ')
for i in range(az):
	print(0, end=' ')


n = int(input())
s = input()
z = 0
o = 0
for ch in s:
	if ch == 'z':
		z += 1
	elif ch == 'o':
		o += 1
one = o - z
while one > 0:
	print(1, end=' ')
	one -= 1
while z > 0:
	print(0, end=' ')
	z -= 1


n = int(input())
s = input()
z = s.count('z')
e = s.count('e')
r = s.count('r')
o = s.count('o')
m = s.count('n')
zero = 0
if z:
	e = e - z
	o = o - z
	r = r - z
	if e >= 0 and o >= 0 and (r >= 0):
		zero = z
one = 0
if m:
	o = o - m
	e = e - m
	if o >= 0 and e >= 0:
		one = m
if zero > 0 and one > 0:
	print(*list('1' * one), end=' ')
	print(*list('0' * zero))
elif zero > 0:
	print(*list('0' * zero))
else:
	print(*list('1' * one))


A = int(input())
B = input()
zero = 0
one = 0
for i in range(A):
	if B[i] == 'z':
		zero += 1
	elif B[i] == 'n':
		one += 1
print(one * '1 ' + zero * '0 ')


n = int(input())
string = input()
digits = []
for i in range(string.count('n')):
	digits.append('1')
zeroes = (len(string) - 3 * len(digits)) // 4
for i in range(zeroes):
	digits.append('0')
print(' '.join(digits))


n = int(input())
a = input()
d = dict()
m = 0
for i in a:
	d[i] = d.get(i, 0) + 1
for (k, v) in d.items():
	if k == 'n':
		for i in range(v):
			print('1', end=' ')
	if k == 'z':
		m = v
for i in range(m):
	print('0', end=' ')


from collections import defaultdict
n = int(input())
s = input()
f = defaultdict(int)
for i in s:
	f[str(i)] += 1
k = f['n']
g = f['z']
for i in range(k):
	print(1, end=' ')
for i in range(g):
	print(0, end=' ')


import math

def main():
	n = int(input())
	string = input()
	numN = 0
	numZ = 0
	for i in range(len(string)):
		if string[i] == 'z':
			numZ += 1
		elif string[i] == 'n':
			numN += 1
	for _ in range(numN):
		print('1', end=' ')
	for _ in range(numZ):
		print('0', end=' ')
	print()
main()


a = int(input())
d = input()
n = d.count('n')
e = d.count('e')
o = d.count('o')
one = []
zero = []
one.append(o)
one.append(n)
one.append(e)
kq = []
x = max(one)
if min(one) != 0:
	for i in range(0, min(one)):
		kq.append(1)
z = d.count('z')
r = d.count('r')
e = d.count('e') - min(one)
o = d.count('o') - min(one)
zero.append(z)
zero.append(e)
zero.append(r)
zero.append(o)
if min(zero) > 0:
	for i in range(0, min(zero)):
		kq.append(0)
kq = ' '.join((str(x) for x in kq))
print(kq)


n = int(input())
q = input()
o = q.count('n')
z = q.count('z')
for i in range(o):
	print('1', end=' ')
for j in range(z):
	print('0', end=' ')


number = int(input())
n = input()
z = n.count('z')
e = n.count('e')
r = n.count('r')
o = n.count('o')
nn = n.count('n')
temp = o
one = 0
zero = 0
while z > 0 and e > 0 and (r > 0) and (o > 0):
	zero += 1
	z = z - 1
	e = e - 1
	r = r - 1
	o = o - 1
while temp > 0 and nn > 0 and (e > 0):
	temp = temp - 1
	nn = nn - 1
	e = e - 1
	one += 1
for i in range(one):
	print(1, end=' ')
for i in range(zero):
	print(0, end=' ')


d = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0, 'e': 0}
input()
for i in input():
	d[i] += 1
one = 0
null = 0
m = min(d['o'], d['n'], d['e'])
if m <= d['o'] and d['n'] >= m and (d['e'] >= m):
	one += m
	d['e'] -= m
	d['o'] -= m
m = min(d['z'], d['e'], d['r'], d['o'])
if m >= d['z'] and m >= d['e'] and (m >= d['r']) and (m >= d['o']):
	null += m
print('1 ' * one, '0 ' * null)


n = int(input())
s = input()
(nr, nn) = (0, 0)
for i in s:
	if i == 'n':
		nn += 1
	elif i == 'r':
		nr += 1
ans = ''
for i in range(nn):
	ans += '1'
for i in range(nr):
	ans += '0'
for i in ans:
	print(i, end=' ')


n = int(input())
string = input()
print('1 ' * string.count('n'), end='')
print('0 ' * string.count('z'), end='')


l = int(input())
s = str(input())
print(('1 ' * s.count('n') + ' 0' * s.count('z')).replace('  ', ' '))


t = int(input())
letters = input()
z_count = letters.count('z')
n_count = letters.count('n')
bin_str = ''
for i in range(n_count):
	bin_str += '1 '
for i in range(z_count):
	bin_str += '0 '
bin_str = bin_str.strip()
print(bin_str)


N = int(input())
s = input()
zero = 0
one = 0
for i in s:
	if i == 'z':
		zero += 1
	elif i == 'n':
		one += 1
print('1 ' * one, '0 ' * zero, sep='')


n = int(input())
s = input()
k1 = 0
for i in s:
	if i == 'n':
		k1 += 1
print(k1 * '1 ', (n - k1 * 3) // 4 * '0 ', sep='')


input()
k = input()
for case in range(k.count('n')):
	print('1', end=' ')
for _ in range(k.count('z')):
	print('0', end=' ')


input()
s = input()
z = s.count('z')
n = s.count('n')
while n != 0:
	print(1, end=' ')
	n -= 1
while z != 0:
	print(0, end=' ')
	z -= 1


number = input()
Str = input()
n = 0
e = 0
z = 0
o = 0
r = 0
for x in Str:
	if x == 'n':
		n += 1
	elif x == 'e':
		e += 1
	elif x == 'z':
		z += 1
	elif x == 'o':
		o += 1
	elif x == 'r':
		r += 1
less = 100000
if less > o:
	less = o
if less > e:
	less = e
if less > n:
	less = n
if less > 0:
	print('1 ' * less, end='')
e -= less
o -= less
less = 100000
if less > o:
	less = o
if less > e:
	less = e
if less > z:
	less = z
if less > r:
	less = r
print('0 ' * less, end='')
print()


a = int(input())
s = input()
zero = 0
one = 0
st = ''
while s.find('z') != -1:
	s = s[0:s.find('z'):1] + s[s.find('z') + 1:]
	s = s[0:s.find('e'):1] + s[s.find('e') + 1:]
	s = s[0:s.find('r'):1] + s[s.find('r') + 1:]
	s = s[0:s.find('o'):1] + s[s.find('o') + 1:]
	zero = zero + 1
one = len(s) // 3
for number in range(one):
	st = st + '1 '
for number in range(zero):
	st = st + '0 '
st[st.rfind(' '):]
print(st)


def solve():
	_ = int(input())
	string = input()
	zeros = 0
	for letter in string:
		if letter == 'z':
			zeros += 1
		elif letter == 'n':
			print('1', end=' ')
	for _ in range(zeros):
		print('0', end=' ')
solve()


T = int(input())
string = input()
arr = [0] * 26

def o(c):
	return ord(c) - ord('a')
for e in string:
	arr[o(e)] += 1
mp = ['zero', 'one']
out = []

def one():
	if arr[o('o')] and arr[o('n')] and arr[o('e')]:
		arr[o('o')] -= 1
		arr[o('n')] -= 1
		arr[o('e')] -= 1
		return True
	return False

def zero():
	if arr[o('z')] and arr[o('e')] and arr[o('r')] and arr[o('o')]:
		arr[o('z')] -= 1
		arr[o('e')] -= 1
		arr[o('r')] -= 1
		arr[o('o')] -= 1
		return True
	return False
while one():
	out.append(1)
while zero():
	out.append(0)
print(*out)


import sys
n = int(input())
string = input()
ones = string.count('n')
zeroes = int((n - ones * 3) / 4)
rst = ''
for o in range(ones):
	rst += '1 '
for z in range(zeroes):
	rst += '0 '
print(rst)


(a, d) = (input(), input())
print(' '.join(['1'] * d.count('n')), ' '.join(['0'] * d.count('z')))


from typing import List
from collections import Counter

class Chess:

	def who_won(self):
		length = int(input())
		s = input()
		while len(s):
			one = []
			for i in 'one':
				if i in s:
					one.append(s.index(i))
			if len(one) == 3:
				for i in 'one':
					s = s.replace(i, '', 1)
				print(1, end=' ')
				continue
			zero = []
			for i in 'zero':
				zero.append(s.index(i))
			if len(zero) == 4:
				for i in 'zero':
					s = s.replace(i, '', 1)
				print(0, end=' ')
chess = Chess()
chess.who_won()


n = input()
let = input()
z = let.count('z')
nl = let.count('n')
t = z + nl
x = []
for i in range(nl):
	x.append(1)
for i in range(z):
	x.append(0)
s = [str(i) for i in x]
sX = str(' '.join(s))
print(sX)


n = input()
word = input()
count = {}
for c in word:
	if c not in count:
		count[c] = 0
	count[c] += 1
res = []
if 'n' in count:
	for i in range(count['n']):
		res.append('1')
if 'z' in count:
	for i in range(count['z']):
		res.append('0')
print(' '.join(res))


k = int(input())
list1 = []
str1 = input()
list1 = list(str1)
z = 0
e = 0
r = 0
o = 0
n = 0
dict1 = {}
list2 = []
for i in range(k):
	if list1[i] == 'z':
		z = z + 1
	dict1['z'] = z
	if list1[i] == 'e':
		e = e + 1
	dict1['e'] = e
	if list1[i] == 'r':
		r = r + 1
	dict1['r'] = r
	if list1[i] == 'o':
		o = o + 1
	dict1['o'] = o
	if list1[i] == 'n':
		n = n + 1
	dict1['n'] = n
while z != 0 and e != 0 and (r != 0) and (o != 0):
	list2.append(0)
	z -= 1
	e -= 1
	r -= 1
	o -= 1
while o != 0 and e != 0 and (n != 0):
	list2.append(1)
	o -= 1
	e -= 1
	n -= 1
list3 = list(list2[::-1])
for i in list3:
	print(i, end=' ')


a = int(input())
b = str(input())
s = b.count('n')
d = b.count('r')
q = str('1 ' * s)
w = str('0 ' * d)
print(q, w, sep='')


a = int(input())
string = input()
b = len(string)
mo = 0
for x in range(b):
	if string[x] == 'n':
		mo += 1
for x in range(mo):
	print(1, end=' ')
f = (a - 3 * mo) / 4
for x in range(int(f)):
	print(0, end=' ')


n = int(input())
a = input()
a = list(a)
c1 = 0
c0 = 0
for i in a:
	if i == 'z':
		c0 += 1
	elif i == 'n':
		c1 += 1
s = c1 * '1 ' + c0 * '0 '
print(s[0:len(s) - 1])


n = int(input())
s = input()
countN = s.count('n')
countZ = s.count('z')
ans = '1 ' * countN + '0 ' * countZ
print(ans.strip())


n = int(input())
string = input()
answer = []
holder = {'z': string.count('z'), 'e': string.count('e'), 'r': string.count('r'), 'o': string.count('o'), 'n': string.count('n')}
if 'n' in holder:
	while holder['n'] != 0:
		answer.append('one')
		holder['o'] -= 1
		holder['n'] -= 1
		holder['e'] -= 1
if 'z' in holder:
	while holder['z'] != 0:
		answer.append('zero')
		holder['z'] -= 1
		holder['e'] -= 1
		holder['r'] -= 1
		holder['o'] -= 1
digits = []
for i in range(len(answer)):
	if answer[i] == 'one':
		digits.append(str(1))
	else:
		digits.append(str(0))
print(' '.join(digits))


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

def rri():
	return int(rr())

def rrl():
	return list(map(int, rr().split()))

def rrt():
	return tuple(map(int, rr().split()))
from collections import defaultdict

def mus(d=0):
	return defaultdict(defaultdict(d))

def ms(x, y, d=0):
	return [[0] * y for i in range(x)]

def ar(x, d=0):
	return [d] * x

def ppm(m, n=0, x=0, y=0):
	print('\n'.join(('\t'.join((str(m[j][i]) for j in range(y or n))) for i in range(x or n))))

def ppa(a, n):
	print('\t'.join(map(str, a[0:n])))

def ppl(a=0, x=[1]):
	x[0] = a or x[0] + 1
	print('-' + '- -' * 14 + '-# ' + str(x[0] - 2) + ' #-' + '- -' * 14 + '-')

def yn(x):
	return 'YES' if x else 'NO'

def rnar():
	return (rri(), rrl())

def r2nar():
	return (rri(), rri(), rrl())

def read():
	return (rri(), rr())

def solve(n, s):
	z = s.count('z')
	n = s.count('n')
	z = ' '.join('0' * z)
	n = ' '.join('1' * n)
	answ = ' '.join((n, z))
	return answ
test_count = 1
for _ in range(test_count):
	input_data = read()
	result = solve(*input_data)
	print(result)


n = int(input())
s = input()
zeroes = s.count('z')
ones = s.count('n')
print('1 ' * ones, '0 ' * zeroes)


n = int(input())
a = list(input())
t = a.count('z')
s = a.count('n')
b = []
for i in range(s):
	b.append('1')
for j in range(t):
	b.append('0')
print(*b)


_ = int(input())
ans = list()
ans.append('')
ans.append('')
one = False
a = list(input())
for i in a:
	if i == 'n':
		ans[1] += '1'
		one = True
	elif i == 'z':
		ans[0] += '0'
if one:
	print(' '.join(ans[1] + ans[0]))
else:
	print(' '.join(ans[0]))


n = int(input())
line = input()
ans = ''
for j in range(line.count('n')):
	ans += '1 '
for j in range(line.count('z')):
	ans += '0 '
print(ans)


t = int(input())
command = input()
z = command.count('z')
n = command.count('n')
res = ''
for _ in range(0, n):
	res = res + '1 '
for _ in range(0, z):
	res = res + '0 '
print(res)


n = input()
letters = input()

def t(letters):
	for i in letters:
		if i == 'n':
			yield '1'
		elif i == 'z':
			yield '0'
print(' '.join(sorted(t(letters), reverse=True)))


from sys import stdin, stdout
l = int(stdin.readline())
s = stdin.readline()
stdout.write(' '.join(['1' for i in range(s.count('n'))] + ['0' for i in range(s.count('z'))]))


x = int(input())
n = input()
z = n.count('z')
o = n.count('n')
print(('1 ' * o + '0 ' * z).rstrip())


h = int(input())
s = input()
j = {'n': 0, 'z': 0}
for i in s:
	if i in j:
		j[i] += 1
print(j['n'] * '1 ' + j['z'] * '0 ')


n = int(input())
s = input()
var = s.count('n')
ver = s.count('z')
str = ' '
for i in range(var):
	str += '1'
	str += ' '
for i in range(ver):
	str += '0'
	str += ' '
print(str)


n = int(input())
a = list(input())
print(*[1] * a.count('n'), end=' ')
print(*[0] * a.count('z'), end=' ')


n = int(input())
k = input()
num = []

def split_char(str):
	return [char for char in str]
letters = split_char(k)
if len(letters) == n:
	for letter in letters:
		if letter == 'n':
			num.append(1)
		elif letter == 'z':
			num.append(0)
	num.sort(reverse=True)
	for n in num:
		print(n, end=' ')


n = int(input())
line = input()
zero = line.count('z')
one = line.count('n')
if zero + one:
	print('1 ' * one + '0 ' * zero)
else:
	print(0)


n = int(input())
m = input()
v = []
p = list(m)
z = 0
o = 0
for i in range(0, n):
	if p[i] == 'z':
		z = z + 1
		v.append('0')
	if p[i] == 'n':
		o = o + 1
		v.append('1')
v.sort()
v.reverse()
print(' '.join(v))


n = int(input())
string = input()
count_one = min(string.count('o'), string.count('n'), string.count('e'))
count_zero = (n - count_one * 3) // 4
s = '1 ' * count_one + '0 ' * count_zero
print(s[:-1])


n = int(input())
t = input()
l = {'o': 0, 'n': 0, 'e': 0, 'z': 0, 'r': 0}
for i in t:
	if i == 'o':
		l['o'] += 1
	if i == 'n':
		l['n'] += 1
	if i == 'e':
		l['e'] += 1
	if i == 'z':
		l['z'] += 1
	if i == 'r':
		l['r'] += 1
	t.replace(i, '', 1)
result = ''
while l['o'] > 0 and l['n'] > 0 and (l['e'] > 0):
	result += '1 '
	l['o'] -= 1
	l['n'] -= 1
	l['e'] -= 1
while l['z'] > 0 and l['e'] > 0 and (l['r'] > 0) and (l['o'] > 0):
	result += '0 '
	l['z'] -= 1
	l['e'] -= 1
	l['r'] -= 1
	l['o'] -= 1
print(result)


n = input()
n = int(n)
s = input()
d = {}
for i in range(n):
	d[s[i]] = d.get(s[i], 0) + 1
d['n'] = d.get('n', 0)
d['z'] = d.get('z', 0)
while d['n']:
	print(1, end=' ')
	d['n'] -= 1
while d['z']:
	print(0, end=' ')
	d['z'] -= 1


def main():
	import sys
	input = sys.stdin.readline
	n = int(input())
	arr = input()
	one = arr.count('n')
	zero = arr.count('z')
	ans = [1] * one + [0] * zero
	print(*ans)
	return 0
main()


n = int(input())
chars = list(input())
result = []
nums_of_z = 0
for char in chars:
	if char == 'z':
		nums_of_z += 1
while n > 0:
	if nums_of_z != 0:
		n -= 4
		nums_of_z -= 1
		result.append(0)
	else:
		n -= 3
		result.append(1)
result.reverse()
print(' '.join(map(str, result)))


u = int(input())
a = input()
n = 0
o = 0
z = 0
e = 0
r = 0
s = ''
for i in range(u):
	if a[i] == 'o':
		o += 1
	if a[i] == 'n':
		n += 1
	if a[i] == 'e':
		e += 1
	if a[i] == 'z':
		z += 1
	if a[i] == 'r':
		r += 1
mini = min(o, n, e)
for i in range(mini):
	s += '1 '
o = o - mini
e = e - mini
mini2 = min(z, e, r, o)
for i in range(mini2):
	s += '0 '
print(s)


def main():
	n = int(input())
	Rs = 0
	Ns = 0
	letters = input()
	for i in range(len(letters)):
		if letters[i] == 'r':
			Rs = Rs + 1
		elif letters[i] == 'n':
			Ns = Ns + 1
	while Ns > 0:
		print('1', end=' ')
		Ns = Ns - 1
	while Rs > 0:
		print('0', end=' ')
		Rs = Rs - 1
main()


n = int(input())
sp = list(input())
k = sp.count('z')
o = '1 ' * ((n - k * 4) // 3) + '0 ' * k
print(o[:-1])


k = int(input())
n = input()
t = n.count('n')
o = (k - t * 3) // 4
print('1 ' * t + '0 ' * o)


a = int(input())
b = str(input())
g = []
for i in range(0, len(b)):
	if b[i] == 'z':
		g.append(0)
	if b[i] == 'n':
		g.append(1)
g.sort()
g.reverse()
print(*g)


n = int(input())
a = input()
countz = 0
countn = 0
for i in range(n):
	if 'z' == a[i]:
		countz = countz + 1
	if 'n' == a[i]:
		countn = countn + 1
for i in range(countn):
	print('1', end=' ')
for j in range(countz):
	print('0 ', end=' ')


n = int(input())
letters = list(input())
letters.sort()
letters_dict = {'e': 0, 'n': 0, 'o': 0, 'r': 0, 'z': 0}
letters_set = list(set(letters))
letters_set.sort()
one = int()
zero = int()
letters_dict[letters_set[0]] = len(letters[:letters.index(letters_set[1])])
letters_dict[letters_set[1]] = len(letters[letters.index(letters_set[1]):letters.index(letters_set[2])])
if len(letters_set) == 3:
	letters_dict[letters_set[2]] = len(letters[letters.index(letters_set[2]):])
elif len(letters_set) == 4:
	letters_dict[letters_set[2]] = len(letters[letters.index(letters_set[2]):letters.index(letters_set[3])])
	letters_dict[letters_set[3]] = len(letters[letters.index(letters_set[3]):])
else:
	letters_dict[letters_set[2]] = len(letters[letters.index(letters_set[2]):letters.index(letters_set[3])])
	letters_dict[letters_set[3]] = len(letters[letters.index(letters_set[3]):letters.index(letters_set[4])])
	letters_dict[letters_set[4]] = len(letters[letters.index(letters_set[4]):])
if min(letters_dict['o'], letters_dict['n'], letters_dict['e']):
	one = min(letters_dict['o'], letters_dict['n'], letters_dict['e'])
	letters_dict['o'] -= one
	letters_dict['n'] -= one
	letters_dict['e'] -= one
if min(letters_dict['z'], letters_dict['e'], letters_dict['r'], letters_dict['o']):
	zero = min(letters_dict['z'], letters_dict['e'], letters_dict['r'], letters_dict['o'])
result_one = '1 ' * one
result_zero = '0 ' * zero
result = f'{result_one.strip()} {result_zero.strip()}'.strip()
print(result)


from sys import stdin, stdout
n = int(stdin.readline())
s = str(stdin.readline())
cnt = 0
for ch in s:
	if ch == 'n':
		cnt += 1
cnt2 = (n - cnt * 3) // 4
for i in range(0, cnt + cnt2):
	if i < cnt:
		print('1', end=' ')
	else:
		print('0', end=' ')


n = int(input())
k = input()
a = k.count('n')
b = k.count('z')
print('1 ' * a, '0 ' * b)


n = int(input())
s = input()
one = 0
zero = 0
l = []
for _ in s:
	if _ == 'n':
		one = one + 1
	if _ == 'z':
		zero = zero + 1
for i in range(one):
	print('1', end=' ')
for i in range(zero):
	print('0', end=' ')


n = input()
num = list(input())
x1 = num.count('n')
x2 = num.count('z')
binary = []
for i in range(x1):
	binary.append(1)
for i in range(x2):
	binary.append(0)
for i in binary:
	print(i, end=' ')


n = int(input())
cards = list(input())
zeros = cards.count('z')
ones = cards.count('o') - zeros
for i in range(ones):
	print(1, end=' ')
for i in range(zeros):
	print(0, end=' ')


n = int(input())
name = input()
num = n
ans = []
string = name
zs = string.count('z')
zeros = zs * 4
rem = num - zeros
ones = rem // 3
for i in range(ones):
	ans.append('1')
for j in range(zs):
	ans.append('0')
res = ' '.join(ans)
print(res)


n = int(input())
word = input()
ones = word.count('n')
zeros = word.count('z')
while ones != 0 or zeros != 0:
	if ones != 0:
		ones -= 1
		print('1 ', end='')
	if ones == 0 and zeros != 0:
		zeros -= 1
		print('0 ', end='')


a = int(input())
b = input()
c = b.count('z')
d = b.count('n')
e = '1' * d + '0' * c
e = ' '.join(e)
print(e)


n = int(input())
s = list(input())
x = y = 0
if 'z' in s:
	x = s.count('z')
if 'n' in s:
	y = s.count('n')
while y != 0:
	print('1', end=' ')
	y -= 1
while x != 0:
	print('0', end=' ')
	x -= 1


n = int(input())
letters = input()
zeros = 0
ones = 0
if 'z' in letters:
	zeros = letters.count('z')
if 'n' in letters:
	ones = letters.count('n')
print(' '.join('1' * ones + '0' * zeros))


_ = input()
cards = input()
counts = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for i in cards:
	counts[i] += 1
zeros = min(counts['z'], counts['e'], counts['r'], counts['o'])
ones = min(counts['o'], counts['n'], counts['e'])
print(('1 ' * ones + '0 ' * zeros).strip())


import sys
input = sys.stdin.readline
n = int(input())
s = input().strip()
zeros = s.count('z')
ones = (n - 4 * zeros) // 3
for _ in range(ones):
	print('1', end=' ')
for _ in range(zeros):
	print('0', end=' ')
print()


a = input()
b = input()
c = 0
d = 0
for i in b:
	c += 1
	if i == 'n':
		d += 1
c -= d * 3
c //= 4
for i in range(0, d):
	print(1, end=' ')
for i in range(0, c):
	print(0)


n = int(input())
s = input()
cnt = [0] * 128
for c in s:
	cnt[ord(c)] += 1
print('1 ' * cnt[ord('n')] + '0 ' * cnt[ord('z')])


n = int(input())
k = input()
(c, t) = (0, 0)
for i in k:
	if i == 'n':
		c += 1
	elif i == 'z':
		t += 1
for i in range(c):
	print('1', end=' ')
for i in range(t):
	print('0', end=' ')


n = int(input())
string = input()
zeros = 0
ones = 0
for i in range(n):
	zeros += string[i] == 'z'
	ones += string[i] == 'n'
num = '1' * ones + '0' * zeros
num = ' '.join(num)
print(num)


n = int(input())
s = input()
s = ''.join(sorted(s))
print('1 ' * s.count('n') + '0 ' * s.count('z'))


n = int(input())
str = list(input())
numb = []
str.sort()
k = str.count('z')
l = str.count('n')
c = [0 for i in range(k)]
d = [1 for i in range(l)]
numb = numb + c
numb = numb + d
numb.reverse()
for i in range(0, len(numb)):
	print(numb[i], end=' ')


stlen = input()
st = input()
zero = 0
one = 0
finallist = []
Z = st.count('z')
E = st.count('e')
R = st.count('r')
O = st.count('o')
N = st.count('n')
while Z > 0 and E > 0 and (R > 0) and (O > 0):
	Z = Z - 1
	E = E - 1
	R = R - 1
	O = O - 1
	zero = zero + 1
while O > 0 and N > 0 and (E > 0):
	O = O - 1
	N = N - 1
	E = E - 1
	one = one + 1
while one > 0:
	one = one - 1
	finallist.append(str(1))
while zero > 0:
	zero = zero - 1
	finallist.append(str(0))
print(' '.join(finallist))


n = int(input())
s = input()
ans = []
r = 0
for i in s:
	if i == 'r':
		r += 1
for i in s:
	if i == 'n':
		ans.append('1')
	elif i == 'z' and r > 0:
		ans.append('0')
		r -= 1
ans.sort(key=lambda x: -int(x))
x = ' '.join(ans)
print(x)


n = int(input())
s = input()
j = s.count('n')
x = s.count('z')
ans = [1] * j + [0] * x
print(*ans)


def canWriteOne(letters):
	return 'o' in letters and 'n' in letters and ('e' in letters)

def canWriteZero(letters):
	return 'z' in letters and 'e' in letters and ('r' in letters) and ('o' in letters)
n = int(input())
word = input()
letters = {}
for letter in word:
	if letter in letters:
		letters[letter] += 1
	else:
		letters[letter] = 1
result = []
while canWriteOne(letters):
	for char in 'one':
		letters[char] -= 1
		if letters[char] == 0:
			letters.pop(char)
	result.append('1')
while canWriteZero(letters):
	for char in 'zero':
		letters[char] -= 1
		if letters[char] == 0:
			letters.pop(char)
	result.append('0')
print(' '.join(result))


from sys import stdin, stdout
n = int(input())
s = input()
one = 0
zero = 0
for i in s:
	if i == 'z':
		zero += 1
	elif i == 'n':
		one += 1
for i in range(one):
	if zero == 0 and i == one - 1:
		print(1)
	else:
		print(1, end=' ')
for i in range(zero):
	if i == zero - 1:
		print(0)
	else:
		print(0, end=' ')


num = int(input())
letters = str(input())
countOne = 0
countZero = 0
for letter in letters:
	if letter == 'n':
		countOne += 1
	if letter == 'z':
		countZero += 1
for count in range(countOne):
	print(1, end=' ')
for count in range(countZero):
	print(0, end=' ')


n = int(input())
s = input()
x = s.count('r')
y = s.count('n')
for _ in range(y):
	print('1', end=' ')
for _ in range(x):
	print('0', end=' ')


a = int(input())
x = str(input())
z = x.count('z')
n = x.count('n')
s1 = 0
s2 = 0
while s2 < n:
	print(1, end=' ')
	s2 += 1
while s1 < z:
	print(0, end=' ')
	s1 += 1


isVerbose = False

def verbosity(msg):
	if isVerbose:
		print(msg)
inp_len = int(input())
inp_str = input()
count_o = inp_str.count('o')
count_n = inp_str.count('n')
count_e = inp_str.count('e')
count_ones = min(count_o, count_n, count_e)
verbosity(f'count_ones: {count_ones}')
inp_str.replace('e', '', count_ones)
inp_str.replace('o', '', count_ones)
count_z = inp_str.count('z')
count_e = inp_str.count('e')
count_r = inp_str.count('r')
count_o = inp_str.count('o')
count_zeros = min(count_z, count_e, count_r, count_o)
verbosity(f'count_zeros: {count_zeros}')
out_lst = count_ones * '1' + count_zeros * '0'
print(*out_lst)


n = int(input())
s = input()
counts = {}
for c in s:
	counts[c] = counts.get(c, 0) + 1
o = ['1'] * counts.get('n', 0) + ['0'] * ((n - 3 * counts.get('n', 0)) // 4)
print(' '.join(o))


n = int(input())
string = input()
li = []
for i in string:
	if i == 'z':
		li.append('0 ')
	elif i == 'n':
		li.append('1 ')
li.sort(reverse=True)
print(*li)


n = int(input())
s = list(input())
a = s.count('z')
b = s.count('n')
if b != 0:
	total = '1 ' * b + '0 ' * a
else:
	total = '0 ' * a
print(total)


n = int(input())
A = input()
ones = A.count('n')
zeroes = A.count('z')
print(*[1 for i in range(ones)], *[0 for i in range(zeroes)])


k = int(input())
s = input()
z = s.count('z')
n = s.count('n')
nn = ''
for i in range(n):
	nn = nn + '1'
for j in range(z):
	nn = nn + '0'
for i in nn:
	print(i, end=' ')


n = int(input())
s = input()
k = 0
l = 0
for i in s:
	if i == 'z':
		k += 1
	if i == 'n':
		l += 1
print(l * '1 ' + k * '0 ')


import math
q = 1
for _ in range(q):
	n = int(input())
	s = list(input())
	ones = 0
	zeros = 0
	for i in range(n):
		if s[i] == 'n':
			ones += 1
		if s[i] == 'z':
			zeros += 1
	for i in range(ones):
		print(1, end=' ')
	for i in range(zeros):
		print(0, end=' ')


num = input()
q = input()
n = 0
z = 0
result = []
for k in q:
	if k == 'n':
		n += 1
	elif k == 'z':
		z += 1
for i in range(n):
	result.append(1)
for j in range(z):
	result.append(0)
for k in result:
	print(k, end=' ')


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nlargest, nsmallest
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from fractions import Fraction
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
n = int(data())
c = C(data())
answer = []
for i in range(c['n']):
	if c['o'] > 0 and c['e'] > 0:
		answer.append('1')
		c['o'] -= 1
		c['e'] -= 1
	else:
		break
for i in range(c['z']):
	if c['e'] > 0 and c['r'] > 0 and (c['o'] > 0):
		answer.append('0')
		c['e'] -= 1
		c['r'] -= 1
		c['o'] -= 1
	else:
		break
out(*answer)


x = int(input())
y = list(input()).count('z') * 4
ans = ''
for i in range((x - y) // 3):
	ans += '1 '
for i in range(y // 4):
	ans += '0 '
print(ans.strip())


n = int(input())
s = input()
d = {'z': 0}
for x in s:
	if x not in d:
		d[x] = 0
	d[x] += 1
zero = d['z']
one = (n - 4 * zero) // 3
arr = ['1' for i in range(one)]
arr += ['0' for i in range(zero)]
print(*arr)


x = int(input())
t = input()
l = list(t)
z = l.count('z')
n = l.count('n')
print('1 ' * n, end='')
print('0 ' * z, end='')


n = int(input())
s = input()
a = [x for x in s]
cnt = [0] * 5
for x in a:
	if x == 'z':
		cnt[0] += 1
	elif x == 'e':
		cnt[1] += 1
	elif x == 'o':
		cnt[2] += 1
	elif x == 'r':
		cnt[3] += 1
	else:
		cnt[4] += 1
zero = min(cnt[0], cnt[3], cnt[2], cnt[1])
one = min(cnt[4], cnt[1] - zero, cnt[2] - zero)
for i in range(one):
	print(1, end=' ')
for i in range(zero):
	print(0, end=' ')


n = int(input())
s = input()
a = ''
for x in s:
	if x == 'z':
		a = a + '0'
	elif x == 'n':
		a = a + '1'
x = sorted(a, reverse=True)
for i in x:
	print(i, end=' ')


boosted = int(input(''))
string = input('')
zero = string.count('z')
one = string.count('n')
print('1 ' * one + '0 ' * zero)


def fun(st):
	print(st.count('n') * '1 ' + '0 ' * st.count('z'))
var = input()
st = input()
fun(st)


input()
S = list(input())
print('1 ' * S.count('n') + '0 ' * S.count('z'))


n = int(input())
text = input()
zero = text.count('z')
one = text.count('n')
print('1 ' * one + '0 ' * zero)


import math
from collections import *
import sys
from functools import reduce

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

def get_list():
	return list(get_ints())

def get_string():
	return list(input().strip().split())

def printxsp(*args):
	return print(*args, end='')

def printsp(*args):
	return print(*args, end=' ')
UGLYMOD = int(1000000000.0) + 7
SEXYMOD = 998244353
MAXN = int(100000.0)
n = int(input())
s = Counter(input())
ans = '1' * s['n'] + '0' * s['z']
print(' '.join(ans))


n = int(input())
s = str(input())
z = 0
ne = 0
for i in range(n):
	if s[i] == 'z':
		z += 1
	if s[i] == 'n':
		ne += 1
print('1 ' * ne + '0 ' * z)


input()
x = input()
print('1 ' * x.count('n') + '0 ' * x.count('r'))


import sys, math, queue
MOD = 10 ** 9 + 7
sys.setrecursionlimit(1000000)
n = int(input())
s = input()
z = s.count('z')
o = (n - 4 * z) // 3
print('1 ' * o + '0 ' * z)


from collections import Counter
n = int(input().strip())
s = input().strip()
co = Counter(s)
zs = co['z']
os = co['n']
s = ''
for x in range(os):
	s += '1 '
for x in range(zs):
	s += '0 '
print(s.strip())


a = int(input())
word = input()
(z, e, r, o, n) = (0, 0, 0, 0, 0)
for i in word:
	if i == 'z':
		z += 1
	elif i == 'e':
		e += 1
	elif i == 'r':
		r += 1
	elif i == 'o':
		o += 1
	elif i == 'n':
		n += 1
one = min(o, n, e)
o -= one
n -= one
e -= one
zero = min(z, e, r, o)
print('1 ' * one + '0 ' * zero)


n = int(input())
lets = list(input())
fin = []
lets.sort()
e = n = o = r = z = 0
for i in range(len(lets)):
	if lets[i] == 'e':
		e += 1
	elif lets[i] == 'n':
		n += 1
	elif lets[i] == 'o':
		o += 1
	elif lets[i] == 'r':
		r += 1
	elif lets[i] == 'z':
		z += 1
for i in range(n):
	print('1 ', end='')
for i in range(z):
	print('0 ', end='')
print('')


n = int(input())
letters = list(input())
output = []
for i in letters:
	if i == 'z':
		output.append(0)
	elif i == 'n':
		output.append(1)
output.sort(reverse=True)
for a in output:
	print(a, end=' ')


n = int(input())
s = input()
x = []
y = []
one = 'one'
one1 = []
for i in range(1):
	for j in one:
		one1.append(s.count(str(j)))
for i in range(1):
	for j in one:
		one1.append(s.count(str(j)))
for i in range(min(one1)):
	y.append('1 ')
y = ''.join(y)
zero = 'zero'
zero1 = []
for i in range(1):
	for j in zero:
		zero1.append(s.count(str(j)))
for i in range(min(zero1)):
	x.append('0 ')
x = ''.join(x)
print(y, x, sep='')


kol = int(input())
a = input()
one = 0
zero = 0
for i in range(kol):
	if a[i] == 'z':
		zero += 1
	if a[i] == 'n':
		one += 1
otv = '1 ' * one + '0 ' * zero
print(otv)


n = int(input())
s = input()
count = 0
count1 = 0
for i in range(len(s)):
	if s[i] == 'z':
		count += 1
	elif s[i] == 'n':
		count1 += 1
for k in range(count1):
	print('1 ', end='')
for j in range(count):
	print('0 ', end='')


n = int(input())
s = str(input())
one = 0
zero = 0
for i in s:
	if i == 'n':
		one += 1
	if i == 'z':
		zero += 1
st = '1 ' * one + '0 ' * zero
print(st)


import sys
cantidad = sys.stdin.readline()
line = sys.stdin.readline()
n = 0
lista = list()
o = 0
z = 0
for i in line:
	if i == 'n':
		n += 1
	elif i == 'z':
		z += 1
	elif i == 'o':
		o += 1
if n > 0:
	total = abs(n - o)
	for i in range(n):
		lista.append(1)
		o -= 1
for j in range(o):
	lista.append(0)
for i in lista:
	print(i, end=' ')


n = int(input())
s = input()
count = int
count = 0
s1 = ''
for i in s:
	if 'n' == i:
		count += 1
		s1 = s1 + '1 '
n = n - count * 3
n = int(n / 4)
for i in range(n):
	s1 = s1 + '0 '
print(s1)


from bisect import bisect_left as bl, bisect_right as br, insort
import sys
import heapq
from collections import defaultdict as dd, deque

def data():
	return sys.stdin.readline().strip()

def mdata():
	return map(int, data().split())
mod = 998244353
n = int(data())
s = input()
one = zero = 0
for i in s:
	if i == 'n':
		one += 1
	elif i == 'z':
		zero += 1
for i in range(one):
	print(1, end=' ')
for i in range(zero):
	print(0, end=' ')
print()


digit = int(input())
word = input().lower()
count_z = word.count('z')
count_e = word.count('e')
count_r = word.count('r')
count_o = word.count('o')
count_n = word.count('n')
count_1 = min(count_o, count_n, count_e)
count_o -= count_1
count_n -= count_1
count_e -= count_1
count_0 = min(count_z, count_e, count_r, count_o)
print('1 ' * count_1, '0 ' * count_0, sep='')


n = int(input())
s = list(input())
num = s.count('z')
n = n - num * 4
print(' '.join(n // 3 * ['1'] + num * ['0']))


s = int(input())
a = str(input())
n = 0
z = 0
r = 0
o = 0
e = 0
for i in range(s):
	if a[i] == 'n':
		n += 1
	if a[i] == 'z':
		z += 1
	if a[i] == 'r':
		r += 1
	if a[i] == 'o':
		o += 1
	if a[i] == 'e':
		e += 1
t = min(o, n, e)
o = o - t
n = n - t
e = e - t
w = min(z, e, r, o)
print('1 ' * t + '0 ' * w)


from sys import stdin
input = stdin.readlines()
lines = [line.rstrip() for line in input]

def main():
	digit = lines[0]
	letters = lines[1]
	z = 0
	m = 0
	for letter in letters:
		if letter is 'z':
			z += 1
		if letter is 'n':
			m += 1
	while m > 0:
		print(' 1 ')
		m -= 1
	while z > 0:
		print(' 0 ')
		z -= 1
main()


n = int(input())
s = list(input())
z = s.count('z')
l1 = [0] * z
o = s.count('n')
l2 = [1] * o
l = l2 + l1
print(*l)


n = int(input())
cards = input()
ones = 0
zeros = 0
for i in range(0, n):
	if cards[i] == 'n':
		ones += 1
	if cards[i] == 'z':
		zeros += 1
if ones >= 1:
	binary = '1'
	ones -= 1
	for i in range(ones):
		binary = binary + ' 1'
	for i in range(zeros):
		binary = binary + ' 0'
else:
	binary = '0'
	zeros -= 1
	for i in range(zeros):
		binary = binary + ' 0'
print(binary)


N = int(input())
s = input()
chislo = []
list_s = list(s)
for i in range(list_s.count('n')):
	chislo.append('1')
for i in range(list_s.count('z')):
	chislo.append('0')
print(' '.join(chislo))


n = int(input())
s = list(input())
o = ['']
o.append('1 ' * s.count('n'))
o.append('0 ' * s.count('z'))
print(''.join(o))


k = int(input())
s = input()
o = s.count('o')
n = s.count('n')
e = s.count('e')
z = s.count('z')
r = s.count('r')
max_ones = min(o, n, e)
zeros = min(o - max_ones, e - max_ones, z, r)
out = ['1' for i in range(max_ones)] + ['0' for j in range(zeros)]
print(' '.join(out))


n = int(input())
a = input()
value1 = 0
value0 = 0
for i in a:
	if i == 'z':
		value0 += 1
	elif i == 'n':
		value1 += 1
for i in range(value1):
	print('1', end=' ')
for i in range(value0):
	print('0', end=' ')


t1 = int(input())
t = input()
z = 0
o = 0
for i in range(len(t)):
	if t[i] == 'z':
		z += 1
	if t[i] == 'n':
		o += 1
r = [1] * o
l = [0] * z
print(*r, *l)


n = int(input())
s = input()
a = []
k = s.count('z')
for i in range(s.count('z')):
	a.append(0)
for i in range((n - k * 4) // 3):
	a.append(1)
a.sort(reverse=True)
for i in a:
	print(i, end=' ')


def maximo(a, b):
	if a > b:
		return int(b)
	else:
		return int(a)
x = int(input())
lista = list(input())
z = int(lista.count('z'))
e = int(lista.count('e'))
r = int(lista.count('r'))
o = int(lista.count('o'))
n = int(lista.count('n'))
zerosContador = maximo(z, maximo(e, maximo(r, o)))
oneContador = maximo(o, maximo(n, e))
for i in range(oneContador):
	print(1, end=' ')
for i in range(zerosContador):
	print(0, end=' ')


a = int(input())
b = input().strip()
z = 0
n = 0
for i in range(len(b)):
	if b[i] == 'z':
		z = z + 1
	if b[i] == 'n':
		n = n + 1
print(' '.join(['1'] * n + ['0'] * z))


t = int(input())
s = input()
a = [0, 0, 0, 0, 0]
for x in s:
	if x == 'z':
		a[0] += 1
	elif x == 'e':
		a[1] += 1
	elif x == 'r':
		a[2] += 1
	elif x == 'o':
		a[3] += 1
	else:
		a[4] += 1
z = a[0]
n = a[4]
a = []
for i in range(n):
	a.append(1)
for i in range(z):
	a.append(0)
ans = 0
print(*a)


input()
string = input()
zeros = 0
ones = 0
for char in string:
	if char == 'z':
		zeros += 1
	elif char == 'n':
		ones += 1
print('1 ' * ones + '0 ' * zeros)


n = int(input())
s = input()
res = ''
cnt_z = s.count('z')
cnt_e = s.count('e')
cnt_r = s.count('r')
cnt_o = s.count('o')
cnt_n = s.count('n')
while cnt_n > 0 and cnt_o > 0 and (cnt_e > 0):
	res += '1 '
	cnt_n -= 1
	cnt_o -= 1
	cnt_e -= 1
while cnt_z > 0 and cnt_o > 0 and (cnt_r > 0) and (cnt_e > 0):
	res += '0 '
	cnt_z -= 1
	cnt_o -= 1
	cnt_e -= 1
	cnt_r -= 1
print(res[:len(res) - 1])


number = input()
string = input()
zeros = string.count('z')
ones = string.count('n')
print('1 ' * ones + '0 ' * zeros)


def solve(test):
	ans = []
	n = int(input())
	s = input() + 'a'
	cnt = 0
	for i in range(n):
		if s[i] == 'n':
			cnt += 1
	for i in range(cnt):
		ans.append(1)
	for i in range((n - 3 * cnt) // 4):
		ans.append(0)
	print(*ans)
t = 1
for _ in range(t):
	solve(_ + 1)


n = int(input(''))
str = input('')
total_one = 0
total_zero = 0
letters = []
for i in str:
	if i == 'n':
		total_one += 1
	elif i == 'r':
		total_zero += 1
	letters.append(i)
result = '1 ' * total_one + '0 ' * total_zero
print(result)


n = int(input())
string = input()
string = list(string)
z = 0
o = 0
n = 0
e = 0
r = 0
for i in string:
	if i == 'z':
		z += 1
	elif i == 'o':
		o += 1
	elif i == 'n':
		n += 1
	elif i == 'e':
		e += 1
	elif i == 'r':
		r += 1
e = e - z
o = o - z
r = r - z
zero = []
for i in range(z):
	zero.append('0')
one = []
for i in range(o):
	one.append('1')
main = one + zero
for i in range(len(main)):
	print(main[i], end=' ')


import re
num_letters = input('')
letters = input('')
answer = ''
num_z = re.findall('[z]', letters)
num_n = re.findall('[n]', letters)
for _ in num_n:
	answer += ' 1'
for _ in num_z:
	answer += ' 0'
print(answer.lstrip())


a = int(input())
b = input()
c = ''
z = 0
n = 0
for i in range(a):
	if b[i] == 'z':
		z += 1
	elif b[i] == 'n':
		n += 1
for i in range(n + z):
	if n > 0:
		c += '1 '
		n -= 1
	else:
		c += '0 '
print(c)


t = int(input())
s = str(input())
z = s.count('z')
e = s.count('e')
r = s.count('r')
o = s.count('o')
n = s.count('n')
print('1 ' * min(o, n, e) + '0 ' * min(z, e - min(o, n, e), r, o - min(o, n, e)))


n = int(input())
s = input()
print(' '.join(['1'] * min(s.count('n'), s.count('o'), s.count('e'))), end='')
k = min(s.count('n'), s.count('o'), s.count('e'))
o = s.count('o') - k
e = s.count('e') - k
if k:
	print(end=' ')
print(' '.join(['0'] * min(o, e, s.count('r'), s.count('z'))), end=' ')


n = input()
a = list(map(str, input()))
b = 0
c = 0
for x in a:
	if x == 'e':
		b = b + 1
for x in a:
	if x == 'z':
		c = c + 1
d = b - c
print('1 ' * d + '0 ' * c)


from collections import Counter
n = input()
cards = input()
counts = Counter(cards)
ones = counts['n']
zeros = counts['z']
print(' '.join(['1'] * ones + ['0'] * zeros))


input()
n = input()
one = 0
zero = 0
for elem in n:
	if elem == '1' or elem == 'n':
		one += 1
	elif elem == '0' or elem == 'z':
		zero += 1
for i in range(0, one):
	print('1', end=' ')
for i in range(0, zero):
	print('0', end=' ')


daude = input()
daude = input()
daude = [i for i in daude]
nums = []
zeros = daude.count('z')
ones = daude.count('n')
for i in range(ones):
	nums.append('1')
for i in range(zeros):
	nums.append('0')
print(' '.join(nums))


elem = int(input())
string = input()
ar = []
for t in range(elem):
	ar.append(string[t])
count = 0
for x in ar:
	if x == 'z':
		count = count + 1
count2 = int((elem - 4 * count) / 3)
for x in range(count2):
	print(1, end=' ')
for x in range(count):
	print(0, end=' ')


size_n = int(input())
my_string = input()
z = 0
e = 0
r = 0
o = 0
n = 0
res = []
for letter in my_string:
	if letter == 'z':
		z += 1
	elif letter == 'e':
		e += 1
	elif letter == 'r':
		r += 1
	elif letter == 'o':
		o += 1
	elif letter == 'n':
		n += 1
while n != 0:
	if o > 0 and e > 0:
		o -= 1
		e -= 1
	else:
		break
	res.append(1)
	n -= 1
while z != 0:
	if e > 0 and r > 0 and (o > 0):
		e -= 1
		r -= 1
		o -= 1
	else:
		break
	res.append(0)
	z -= 1
print(*res)


amountOfLetters = int(input())
letters = input()
zeroes = letters.count('z')
ones = letters.count('n')
print('1 ' * ones + '0 ' * zeroes)


import collections
n = int(input())
y = collections.Counter(input())
(a, b) = (y['n'], y['z'])
if a != 0 and b != 0:
	print('1 ' * a + '0 ' * (b - 1) + '0')
elif a == 0:
	print('0 ' * (b - 1) + '0')
elif b == 0:
	print('1 ' * (a - 1) + '1')


number = int(input())
text = str(input())
z = text.count('n')
d = text.count('z')
if d == 0:
	print('1 ' * z)
elif z == 0:
	print('0 ' * d)
else:
	print('1 ' * z + '0 ' * d)


n = int(input())
l = list(input())
d = dict()
one = 0
zero = 0
for a in l:
	if a in d:
		d[a] += 1
	else:
		d[a] = 1
if d.get('n') is not None:
	one = d['n']
if d.get('z') is not None:
	zero = d['z']
[print(1, end=' ') for v in range(1, one + 1)] + [print(0, end=' ') for v in range(1, zero + 1)]


a = int(input())
b = input()
one = b.count('n')
zero = b.count('z')
for j in range(one):
	print(1, end=' ')
for k in range(zero):
	print(0, end=' ')


length = int(input())
word = str(input())
ones = 0
zeros = 0
for letter in word:
	if letter == 'z':
		zeros += 1
	elif letter == 'n':
		ones += 1
for _ in range(ones):
	print('1', end=' ')
for _ in range(zeros):
	print('0', end=' ')


c = input()
s = input()
counts = dict()
for i in s:
	if i in counts:
		counts[i] += 1
	else:
		counts[i] = 1
res = ''
if 'o' in counts and 'n' in counts and ('e' in counts):
	while counts['o'] > 0 and counts['n'] > 0 and (counts['e'] > 0):
		res += '1'
		counts['o'] -= 1
		counts['n'] -= 1
		counts['e'] -= 1
if 'z' in counts and 'e' in counts and ('r' in counts) and ('o' in counts):
	while counts['z'] > 0 and counts['e'] > 0 and (counts['r'] > 0) and (counts['o'] > 0):
		res += '0'
		counts['z'] -= 1
		counts['e'] -= 1
		counts['r'] -= 1
		counts['o'] -= 1
print(' '.join(list(res)))


n = int(input())
str = input()
p = 0
for c in str:
	if c == 'z':
		p += 1
m = (n - 4 * p) // 3
for i in range(m):
	print('1 ', end='')
for j in range(p):
	print('0 ', end='')


int(input())
s = list(input())
for _ in range(s.count('n')):
	print(1, end=' ')
for _ in range(s.count('z')):
	print(0, end=' ')


n = int(input())
name = input()
n_z = name.count('z')
n_o = name.count('n')
out = ''
for _ in range(n_o):
	out += '1' + ' '
for _ in range(n_z):
	out = out + '0' + ' '
print(out)


from sys import stdin, stdout
import heapq
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
import sys
sys.setrecursionlimit(10 ** 6)
threading.stack_size(2 ** 27)
fac_warm_up = False
printHeap = str()
memory_constrained = False
P = 10 ** 9 + 7

class MergeFind:

	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 prime_factors(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 is_prime(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

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

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

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

def nCr(n, r, MOD):
	global fac_warm_up, factorial_modP
	if not fac_warm_up:
		warm_up_fac(MOD)
		fac_warm_up = 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()))
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_search(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 = False
fac_warm_up_size = 10 ** 5 + 100
optimise_for_recursion = False

def main():
	n = get_int()
	st = list(stdin.readline().strip())
	zero = st.count('z')
	ones = st.count('n')
	display_list([1] * ones + [0] * zero)
if TestCases:
	for i in range(get_int()):
		main()
else:
	main() if not optimise_for_recursion else threading.Thread(target=main).start()


n = int(input())
st = input()
if n == 4:
	print(0)
elif n == 3:
	print(1)
else:
	if 'n' in st:
		for i in range(st.count('n')):
			print(1, end=' ')
	if 'z' in st:
		for i in range(st.count('z')):
			print(0, end=' ')


n = int(input())
s = input()
sz = ''
sn = ''
i = 0
while i < len(s):
	if s[i] == 'n' or s[i] == 'z':
		if s[i] == 'n':
			sn += '1 '
		elif s[i] == 'z':
			sz += '0 '
	i += 1
print(sn + sz)


n = int(input())
x = input()
l = list(x)
w = l.count('n')
x = ''
n = (n - w * 3) // 4
for i in range(w):
	x += '1 '
for i in range(n):
	x += '0 '
print(x)


k = int(input())
p = list(input())
k1 = 0
k0 = 0
for i in range(k):
	if p[i] == 'n':
		k1 += 1
	if p[i] == 'z':
		k0 += 1
i = 0
while i < k1:
	print(1, end=' ')
	i += 1
i = 0
while i < k0:
	print(0, end=' ')
	i += 1


n = int(input())
l = list(input())
(o, n, e, z, r) = (0, 0, 0, 0, 0)
for i in range(len(l)):
	if l[i] == 'n':
		n += 1
	elif l[i] == 'o':
		o += 1
	elif l[i] == 'e':
		e += 1
	elif l[i] == 'z':
		z += 1
	else:
		r += 1
while True:
	if o == 0 or e == 0:
		exit()
	elif o >= 1 and n >= 1 and (e >= 1):
		print(1, end=' ')
		o -= 1
		e -= 1
		n -= 1
	elif o >= 1 and z >= 1 and (r >= 1) and (e >= 1):
		print(0, end=' ')
		o -= 1
		z -= 1
		r -= 1
		e -= 1


n = input()
st = input()
counterr = 0
countern = 0
for i in st:
	if i == 'r':
		counterr += 1
	if i == 'n':
		countern += 1
for i in range(countern):
	print(1)
for i in range(counterr):
	print(0)


len = int(input())
str = input()
str = str.lower()
count = {}
c = 0
for i in range(len):
	count[str[i]] = c
for i in range(len):
	if str[i] == 'n':
		count[str[i]] += 1
	elif str[i] == 'z':
		count[str[i]] += 1
if str.find('n') != -1 and str.find('z') >= 0:
	if count['n'] >= 1 and count['z'] >= 1:
		print(('1 ' * count['n']).strip(), end='')
		print((' 0' * count['z']).rstrip())
elif str.find('n') != -1:
	if count['n'] >= 1:
		print(('1 ' * count['n']).strip(), end='')
elif str.find('z') >= 0:
	if count['z'] >= 1:
		print(('0 ' * count['z']).rstrip())


input()
l = list(input())
print('1 ' * (l.count('o') - l.count('z')), '0 ' * l.count('z'))


from sys import stdin, stdout
N = int(stdin.readline())
string = stdin.readline()
x = string.count('n')
y = string.count('z')
ans = [1] * x
ans += [0] * y
print(*ans)


n = input()
letters = input()
num_z = 0
num_n = 0
for letter in letters:
	if letter == 'z':
		num_z += 1
	elif letter == 'n':
		num_n += 1
ans = '1 ' * num_n + '0 ' * num_z
print(ans[:-1])


str_len = int(input())
stroka = input()
str_dict = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for sym in stroka:
	if sym not in str_dict:
		str_dict[sym] = 0
	else:
		str_dict[sym] += 1
ones = str_dict['n']
zeros = str_dict['z']
out_str = ''
out_str += '1 ' * ones
out_str += '0 ' * zeros
print(out_str[:-1])


k = int(input())
a = input()
z = 0
e = 0
r = 0
o = 0
n = 0
for x in a:
	if x == 'z':
		z += 1
	if x == 'e':
		e += 1
	if x == 'r':
		r += 1
	if x == 'z':
		z += 1
	if x == 'o':
		o += 1
	if x == 'n':
		n += 1
m1 = min(o, min(e, n))
print('1 ' * m1, end='')
o -= m1
e -= m1
n -= m1
m1 = min(z, min(e, min(r, o)))
print('0 ' * m1, end='')


n = int(input())
string = input()
NC = string.count('n')
ZC = (n - NC * 3) // 4
string = ''
for i in range(NC):
	string = string + '1 '
for i in range(ZC):
	string = string + '0 '
print(string)


n = int(input())
s = input()
N = s.count('n')
Z = s.count('z')
ans = '1 ' * N + '0 ' * Z
print(ans)


n = int(input())
letters = input()
list2 = list()
list1 = list()
for let in letters:
	list2.append(let)
if list2.count('n') == 0:
	for x in range(list2.count('z')):
		list1.append('0')
else:
	for k in range(list2.count('n')):
		list1.append('1')
	for x in range(list2.count('z')):
		list1.append('0')
print(' '.join(list1))


l = int(input())
s = str(input())
n = 0
z = 0
output = ''
for i in range(l):
	if s[i] == 'n':
		n += 1
	elif s[i] == 'z':
		z += 1
for i in range(n):
	output += '1 '
for i in range(z):
	output += '0 '
print(output)


a = [0] * 26
n = int(input())
s = input()
for i in range(len(s)):
	a[ord(s[i]) - 97] += 1
ones = a[ord('n') - 97]
zeros = a[ord('z') - 97]
for i in range(ones):
	print(1, end=' ')
for i in range(zeros):
	print(0, end=' ')


n = int(input())
if n >= 1 and n <= 10 ** 5:
	word = input()
	state = True
	for i in range(n):
		if word[i] != 'e' and word[i] != 'z' and (word[i] != 'r') and (word[i] != 'o') and (word[i] != 'n'):
			state = False
			break
	if state:
		word = str(word)
		counterO = 0
		counterN = 0
		counterZ = 0
		counterR = 0
		counterE = 0
		for i in word:
			if i == 'o':
				counterO += 1
			if i == 'n':
				counterN += 1
			if i == 'z':
				counterZ += 1
			if i == 'r':
				counterR += 1
			if i == 'e':
				counterE += 1
		min1 = min(counterO, counterN, counterE)
		if counterO != 0 and counterN != 0 and (counterE != 0):
			for i in range(min1):
				print(1, end=' ')
		counterO = counterO - min1
		counterE = counterE - min1
		min2 = min(counterO, counterZ, counterE, counterR)
		if counterZ != 0 and counterE != 0 and (counterR != 0) and (counterO != 0):
			for i in range(min2):
				print(0, end=' ')


a = int(input())
s = input()
col_z = s.count('z')
col_e = s.count('e')
col_r = s.count('r')
col_o = s.count('o')
col_n = s.count('n')
col_one = min(col_o, col_n, col_e)
col_o = col_o - col_one
col_n = col_n - col_one
col_e = col_e - col_one
col_zero = min(col_z, col_e, col_r, col_o)
print('1 ' * col_one, '0 ' * col_zero, sep='')


n = int(input())
str = input()
alph = [0] * 5
for i in str:
	if i == 'n':
		alph[0] += 1
	elif i == 'e':
		alph[2] += 1
	elif i == 'r':
		alph[3] += 1
	elif i == 'o':
		alph[1] += 1
	elif i == 'z':
		alph[4] += 1
one_check = alph[0:3]
one_check.sort()
min_one = one_check[0]
for i in range(0, 3):
	alph[i] -= min_one
zero_check = alph[1:len(alph)]
zero_check.sort()
min_zero = zero_check[0]
result = ''
for i in range(min_one):
	result += '1' + ' '
for i in range(min_zero):
	result += '0' + ' '
print(result)


x = int(input())
test = input()
z = 0
for i in test:
	if i == 'z':
		z += 1
l = len(test) - z * 4
one = l // 3
for i in range(one):
	print('1', end=' ')
for x in range(z):
	print('0', end=' ')


i1 = int(input())
st = list(input())
dic = {'o': st.count('o'), 'n': st.count('n'), 'e': st.count('e'), 'z': st.count('z'), 'r': st.count('r')}
n_o = min(dic['o'], dic['n'], dic['e'])
n_z = min(dic['z'], dic['e'] - n_o, dic['r'], dic['o'] - n_o)
print(*list(n_o * '1' + n_z * '0'))


a = int(input())
b = input()
c1 = b.count('o')
c2 = b.count('n')
c3 = b.count('e')
one = min(c1, c2, c3)
toone = '1 ' * one
z1 = b.count('z')
z2 = b.count('e')
z3 = b.count('r')
z4 = b.count('o')
zero = min(z1, z2, z3, z4)
tozero = '0 ' * zero
print(toone, tozero)


def main():
	from sys import stdin as i, stdout as o
	n = int(i.readline())
	s = i.readline()
	dict = {}
	for x in 'abcdefghijklmnopqrstuvwxyz':
		dict[x] = 0
	for i in range(n):
		dict[s[i]] += 1
	oc = min(dict['o'], dict['n'], dict['e'])
	zc = min(dict['z'], dict['r'], dict['e'], dict['o'])
	if oc > zc:
		for c in 'one':
			dict[c] -= oc
		zc = min(dict['z'], dict['r'], dict['e'], dict['o'])
	else:
		for c in 'zero':
			dict[c] -= zc
		oc = min(dict['o'], dict['n'], dict['e'])
	for i in range(oc):
		o.write('1 ')
	for i in range(zc):
		o.write('0 ')
main()


from sys import stdin, stdout
n = stdin.readline()
s = stdin.readline()
d = {}
for i in s:
	if i in d:
		d[i] += 1
	else:
		d[i] = 1
if 'n' in d:
	for i in range(d['n']):
		print('1', end=' ')
if 'z' in d:
	for i in range(d['z']):
		print('0', end=' ')


a = int(input())
b = str(input())
k = ''
for j in b:
	if j == 'n':
		k = '1 ' + k
	elif j == 'z':
		k = k + '0 '
if k[-1:] == ' ':
	t = k[:-1]
print(t)


o = input()
l = input()
(o, z) = (0, 0)
for i in range(len(l)):
	if l[i] == 'n':
		o += 1
	if l[i] == 'z':
		z += 1
s = '1 ' * o + '0 ' * z
print(s)


import os
import sys
from io import BytesIO, IOBase

def solution(n, s):
	res = ['1'] * s.count('n') + ['0'] * s.count('z')
	write(' '.join(res))

def main():
	n = r_int()
	s = input()
	solution(n, s)
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 input():
	return sys.stdin.readline().rstrip('\r\n')

def write(*args, end='\n'):
	for x in args[:-1]:
		sys.stdout.write(str(x) + ' ')
	sys.stdout.write(str(args[-1]))
	sys.stdout.write(end)

def r_array():
	return [int(x) for x in input().split()]

def r_int():
	return int(input())
main()


n = int(input())
s = input()
d = {'z': 0, 'n': 0}
res = []
for char in s:
	if char == 'z':
		d[char] += 1
	elif char == 'n':
		d[char] += 1
for i in range(d['n']):
	res.append('1')
for i in range(d['z']):
	res.append('0')
print(' '.join(res))


n = int(input())
x = input()
a = 0
b = 0
for i in x:
	if i == 'n':
		a += 1
	elif i == 'z':
		b += 1
array1 = [1] * a
array0 = [0] * b
for i in array1:
	print(i, end=' ')
for i in array0:
	print(i, end=' ')


input()
X = input()
Z = X.count('z')
N = X.count('n')
print('1 ' * N + '0 ' * Z)


n = input()
d = input()
u = ''
p = ''
for c in d:
	if c == 'r':
		u += '0 '
	elif c == 'n':
		p += '1 '
print(p + u)


d = {i: 0 for i in 'onezr'}
for i in input(0 * input()):
	d[i] += 1
o = min((d[i] for i in 'one'))
d['e'] -= o
d['o'] -= o
z = min((d[i] for i in 'zero'))
print(o * '1 ' + z * '0 ')


from math import *
n = int(input())
s = input()
c1 = 0
c2 = 0
for i in range(len(s)):
	if s[i] == 'z':
		c1 = c1 + 1
	elif s[i] == 'n':
		c2 = c2 + 1
for i in range(c2):
	print(1, end=' ')
for i in range(c1):
	print(0, end=' ')


no_of_letters = int(input(''))
cards = input('')
binary = ''
for letter in cards:
	if letter == 'n':
		binary += '1 '
for letter in cards:
	if letter == 'z':
		binary += '0 '
print(binary)


n = int(input())
l = input()
ll = list(l)
r = set(list(l))
a = 0
for i in range(n):
	if ll[i] == 'n':
		a += 1
for i in range(a):
	print(1)
for i in range(int((n - 3 * a) / 4)):
	print(0)


from collections import Counter, deque
from sys import stdin, setrecursionlimit
setrecursionlimit(10 ** 6)
input = stdin.readline
n = int(input().rstrip())
s = list(input().rstrip())
st = Counter(s)
one = min(st['o'], st['n'], st['e'])
st['o'] -= one
st['n'] -= one
st['e'] -= one
zero = min(st['o'], st['z'], st['e'], st['r'])
print(' '.join('1' * one + '0' * zero))


length = int(input())
letters = input()
noofones = 0
noofzeros = 0
array = [i for i in letters]
n = array.count('n')
e = array.count('e')
r = array.count('r')
o = array.count('o')
z = array.count('z')
while True:
	if o > 0 and n > 0 and (e > 0):
		noofones += 1
		o -= 1
		n -= 1
		e -= 1
	else:
		break
while True:
	if z > 0 and e > 0 and (r > 0) and (o > 0):
		noofzeros += 1
		o -= 1
		z -= 1
		e -= 1
		r -= 1
	else:
		break
out = '1 ' * noofones + '0 ' * noofzeros
print(out.strip())


length = int(input())
l = list(input())
z = 0
n = 0
lis = []
for i in range(length):
	if l[i] == 'z':
		lis.append(0)
	if l[i] == 'n':
		lis.append(1)
lis.sort()
for i in range(len(lis) - 1, -1, -1):
	print(lis[i], end=' ')


from collections import Counter
n = int(input())
s = input()
c = Counter(s)
binary = ''
ones = c['n']
zeros = c['z']
while ones != 0:
	ones -= 1
	binary += '1 '
while zeros != 0:
	zeros -= 1
	binary += '0 '
print(binary)


n = input()
l = input()
n = l.count('n')
z = l.count('z')
print(' '.join(['1'] * n + ['0'] * z))


n = int(input())
L = str(input())
one = 0
zero = 0
binary = []
for letter in L:
	if letter == 'n':
		one += 1
		binary.insert(0, 1)
	if letter == 'z':
		zero += 1
		binary.append(0)
for dig in binary:
	print(dig, end=' ')


n = int(input())
s = input()
x = 0
y = 0
for i in s:
	if i == 'n':
		x += 1
	if i == 'z':
		y += 1
print('1 ' * x, '0 ' * y, sep='')


n = int(input())
s = input()
n1 = s.count('n')
z = s.count('z')
arr = []
one = [1] * n1
zero = [0] * z
arr = one + zero
arr.sort(reverse=1)
for i in arr:
	print(i, end=' ')


n = int(input())
s = input()
if s.count('z') > 0:
	print('1 ' * s.count('n') + '0 ' * (s.count('z') - 1) + '0')
else:
	print('1 ' * (s.count('n') - 1) + '1')


n = int(input())
s = input()
n1 = 0
z1 = 0
if 'n' in s:
	n1 = s.count('n')
	if 'z' in s:
		z1 = s.count('z')
elif 'z' in s:
	z1 = s.count('z')
if n1 != 0:
	x = n1
	arr = [1] * x
	for i in range(z1):
		arr.append(0)
else:
	arr = [0] * z1
for i in arr:
	print(i, end=' ')


n = int(input())
s = str(input())
l = [0] * 27
for i in s:
	l[ord(i) - 97] += 1
o = l[ord('o') - 97]
n = l[ord('n') - 97]
e = l[ord('e') - 97]
z = l[ord('z') - 97]
r = l[ord('r') - 97]
if min(o, n, e) != 0:
	print(*[1] * min(o, n, e), end=' ')
	t = min(o, n, e)
	o = o - t
	n = n - t
	e = e - t
if min(o, r, z, e) != 0:
	print(*[0] * min(o, r, z, e))


words = ['z', 'n']
n = int(input())
p = []
q = []
m = input()
s = []
for x in range(n):
	if m[x] == words[0]:
		p.append(0)
	if m[x] == words[1]:
		q.append(1)
for x in range(len(q)):
	s.insert(x, q[x])
for x in range(len(p)):
	s.insert(len(q) + x, p[x])
print(*s, sep='  ')


n = int(input())
s = input()
n0 = 0
n1 = 0
for i in s:
	if i == 'z':
		n0 += 1
	elif i == 'n':
		n1 += 1
print('1 ' * n1 + '0 ' * n0)


n = int(input())
string = input()
arreglo = []
(z, e, r, o, n) = (string.count('z'), string.count('e'), string.count('r'), string.count('o'), string.count('n'))
one = min(o, n, e)
zero = min(z, r, o - one, e - one)
for i in range(one):
	arreglo.append('1')
for j in range(zero):
	arreglo.append('0')
print(' '.join(arreglo))


n = int(input())
st = input()
zero = st.count('o')
zcount = st.count('z')
ones = zero - zcount
for x in range(0, ones):
	print(1, end=' ')
for x in range(0, zcount):
	print(0, end=' ')


n = int(input())
s = input()
c1 = s.count('z')
c2 = s.count('r')
c3 = s.count('n')
(l1, l2) = ([], [])
for i in range(c3):
	l1.append('1')
for i in range(c1):
	l2.append('0')
l3 = l1 + l2
print(' '.join(l3))


a = int(input())
b = input()
z = b.count('z')
o = b.count('n')
print(' 1' * o, ' 0' * z, sep=' ')


n = input()
s = input()
contz = s.count('z')
contn = s.count('n')
n0 = [0] * contz
n1 = [1] * contn
if len(n1) != 0:
	print(' '.join(map(str, n1)), end='')
	print(' ', end='')
print(' '.join(map(str, n0)))


(num, string) = (int(input()), input())
lst_0 = ['0'] * string.count('z')
lst_1 = ['1'] * ((len(string) - string.count('z') * 4) // 3)
print(' '.join(lst_1) + ' ' + ' '.join(lst_0))


n = int(input())
a = input()
a = list(a)
b = 0
c = 0
for i in a:
	if i == 'z':
		c += 1
	elif i == 'n':
		b += 1
print('1 ' * b + '0 ' * c)


def solve(n, x):
	res = list()
	for i in range(n):
		if x[i] == 'z':
			res.append('0')
		elif x[i] == 'n':
			res.insert(0, '1')
	return ' '.join(res)
n = int(input())
x = input()
print(solve(n, x))


n = int(input())
s = input()
ones = 0
zeros = 0
for i in s:
	if i == 'n':
		ones += 1
	elif i == 'z':
		zeros += 1
ans = []
while ones != 0:
	ans.append('1')
	ones -= 1
while zeros != 0:
	ans.append('0')
	zeros -= 1
print(' '.join(ans))


x = int(input())
s = input()
z = e = r = o = n = 0
for i in s:
	if i == 'z':
		z += 1
	elif i == 'e':
		e += 1
	elif i == 'r':
		r += 1
	elif i == 'o':
		o += 1
	elif i == 'n':
		n += 1
if z == e == r == o:
	print('0 ' * z)
else:
	print('1 ' * (o - z) + '0 ' * z)


from collections import Counter
input()
cnt = Counter(input())
ans = []
while True:
	if all([cnt[c] > 0 for c in 'one']):
		ans.append(1)
		for c in 'one':
			cnt[c] -= 1
	elif all([cnt[c] > 0 for c in 'zero']):
		ans.append(0)
		for c in 'zero':
			cnt[c] -= 1
	else:
		break
print(*ans)


from collections import Counter, deque
from sys import stdin, setrecursionlimit
n = int(input())
str = input()
st = Counter(str)
one = 0
zero = 0
while st['o'] > 0 and st['n'] > 0 and (st['e'] > 0):
	st['o'] -= 1
	st['n'] -= 1
	st['e'] -= 1
	one += 1
while st['z'] > 0 and st['e'] > 0 and (st['r'] > 0) and (st['o'] > 0):
	st['z'] -= 1
	st['e'] -= 1
	st['r'] -= 1
	st['o'] -= 1
	zero += 1
print(' '.join('1' * one + '0' * zero))


str_len = int(input())
string = input()
n = 0
z = 0
l1 = []
for i in range(str_len):
	if string[i] == 'n':
		l1.append(1)
	if string[i] == 'z':
		l1.append(0)
l1.sort(reverse=True)
for i in range(len(l1)):
	print(l1[i], end=' ')


n = int(input())
string = input()
z_count = 0
n_count = 0
for letter in string:
	if letter == 'z':
		z_count += 1
	elif letter == 'n':
		n_count += 1
if n_count == 0:
	z_count == 1
autism_string = '1' * n_count + '0' * z_count
for letter in autism_string:
	print(letter, end=' ')


n = int(input())
s = input()
z = 0
k = 0
for i in range(0, n):
	if s[i] == 'z':
		z = z + 1
	if s[i] == 'n':
		k = k + 1
while k != 0:
	k = k - 1
	print('1' + ' ', end='')
while z != 0:
	z = z - 1
	print('0' + ' ', end='')


n = int(input())
s = input()
z = 0
e = 0
r = 0
o = 0
n = 0
for c in s:
	if c == 'z':
		z = z + 1
	elif c == 'e':
		e = e + 1
	elif c == 'r':
		r = r + 1
	elif c == 'o':
		o = o + 1
	else:
		n = n + 1
print('1 ' * n, end='')
print('0 ' * z, end='')


n = int(input())
l = list(input())
lt = []
for i in l:
	if i == 'n':
		lt.append(1)
	if i == 'z':
		lt.append(0)
lt.sort(reverse=True)
print(' '.join((str(x) for x in lt)))


n = int(input())
s = input()
z = s.count('z')
e = s.count('e')
r = s.count('r')
o = s.count('o')
n = s.count('n')
min_one = min(o, n, e)
o -= min_one
n -= min_one
e -= min_one
min_zero = min(z, e, r, o)
z -= min_zero
e -= min_zero
r -= min_zero
o -= min_zero
print(min_one * '1 ' + min_zero * '0 ')


(cnt_o, cnt_n, cnt_e) = (0, 0, 0)
(cnt_z, cnt_r) = (0, 0)
input()
for c in input():
	if c == 'o':
		cnt_o += 1
	elif c == 'n':
		cnt_n += 1
	elif c == 'e':
		cnt_e += 1
	elif c == 'z':
		cnt_z += 1
	elif c == 'r':
		cnt_r += 1
cnt_1 = min(cnt_o, min(cnt_n, cnt_e))
cnt_o -= cnt_1
cnt_n -= cnt_1
cnt_e -= cnt_1
cnt_0 = min(cnt_z, min(cnt_e, min(cnt_r, cnt_o)))
for _ in range(cnt_1):
	print(1, end=' ')
for _ in range(cnt_0):
	print(0, end=' ')


N = int(input())
sanket = input()
(z, e, r, o, n) = (0, 0, 0, 0, 0)
for i in sanket:
	if i == 'z':
		z += 1
	elif i == 'e':
		e += 1
	elif i == 'r':
		r += 1
	elif i == 'o':
		o += 1
	elif i == 'n':
		n += 1
if z != 0 and n != 0:
	print('1 ' * n + '0 ' * z)
elif z == 0:
	print('1 ' * n)
else:
	print('0 ' * z)


n = input()
s = input()
from collections import Counter

def process(s):
	counts = Counter(s)
	zeros = counts['z']
	ones = counts['n']
	res = ['1' for _ in range(ones)] + ['0' for _ in range(zeros)]
	return ' '.join(res)
print(process(s))


(_, s, d, c) = (input(), input(), {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}, 0)
for x in s:
	d[x] += 1
s = ''
for _ in range(min(d['o'], d['n'], d['e'])):
	s += '1 '
	c += 1
for _ in range(min(d['z'], d['e'] - c, d['r'], d['o'] - c)):
	s += '0 '
print(s)


n = int(input())
s = input()
zeros = s.count('z')
ones = s.count('o') - zeros
print('1 ' * ones + '0 ' * zeros)


n = int(input())
st = input()
l = []
for i in st:
	l.append(i)
z = l.count('z')
o = l.count('n')
for i in range(o):
	print(1, end=' ')
for i in range(z):
	print(0, end='\n')


n = int(input())
s = input()
s1 = []
for i in s:
	s1.append(i)
z = []
a = int(s1.count('z'))
b = int(s1.count('n'))
if a > 0 and b > 0:
	z.append(a)
	z.append(b)
elif a > 0:
	z.append(a)
else:
	z.append(b)
c = list(str(b * str(1) + a * str(0)))
print(' '.join(c))


n = int(input())
s = input()
ones = 0
for i in s:
	if i == 'n':
		ones += 1
for i in range(ones):
	print(1, end=' ')
for j in range((n - ones * 3) // 4):
	print(0, end=' ')


N = int(input())
frase = input()
ans = []
for i in frase:
	if i == 'n':
		ans.append('1')
	elif i == 'z':
		ans.append('0')
ans.sort(reverse=True)
ans = ' '.join(map(str, ans))
print(ans)


input()
s = input()
zero_count = s.count('z')
one_count = s.count('n')
ans = ''
for _ in range(one_count):
	ans += '1 '
for _ in range(zero_count):
	ans += '0 '
print(ans)


_ = input()
string = input()
n = string.count('n')
z = string.count('z')
print('1 ' * n + '0 ' * z)


n = int(input())
s = input()
d0 = s.count('z')
d1 = s.count('n')
for i in range(d1):
	print(1, end=' ')
for i in range(d0):
	print(0, end=' ')


n = input()
line = input()
ones = 0
zeros = 0
for i in line:
	if i == 'z':
		zeros += 1
	if i == 'n':
		ones += 1
res = ''
while ones:
	res += '1 '
	ones -= 1
while zeros:
	res += '0 '
	zeros -= 1
print(res)


input()
l = list(input())
c = '1' * l.count('n') + '0' * l.count('z')
for i in c:
	print(i, end=' ')


n = int(input())
z = input()
a1 = 0
a2 = 0
i = 0
while i < n:
	if z[i] == 'n':
		a1 += 1
	if z[i] == 'z':
		a2 += 1
	i += 1
i = 0
while i < a1:
	print(1, end=' ')
	i += 1
i = 0
while i < a2:
	print(0, end=' ')
	i += 1


n = int(input())
s = str(input())
a = 0
b = 0
for i in range(n):
	if s[i] == 'n':
		a += 1
	elif s[i] == 'z':
		b += 1
for i in range(a):
	print('1', end=' ')
for i in range(b):
	print('0', end=' ')


a = int(input())
b = str(input())
c = b.count('n')
d = b.count('z')
f = ''.rjust(c, '1')
g = f.ljust(d + c, '0')
g = g.replace('1', '1 ').replace('0', '0 ')
g = g[:-1]
print(g)


n = int(input())
s = input()[:n]
oc = s.count('n')
zc = s.count('z')
num = ''
for i in range(oc):
	num += '1 '
for i in range(zc):
	num += '0 '
print(num.rstrip())


a = input()
b = input()
c = ''
d = ''
for x in b:
	if x == 'r':
		d = d + '0 '
	elif x == 'n':
		c = c + '1 '
print(c + d)


n = int(input())
L = [i for i in input()]
ch = '1 ' * L.count('n') + '0 ' * L.count('r')
print(ch)


n = int(input())
s = input()
one = s.count('n')
zero = s.count('z')
l = []
while one:
	l.append('1')
	one = one - 1
while zero:
	l.append('0')
	zero = zero - 1
for i in range(len(l)):
	print(l[i], end=' ')


input()
let = list(input())
out = '1' * let.count('n') + '0' * let.count('z')
print(' '.join(list(out)))


from collections import Counter
n = int(input())
s = input()
counter = Counter(s)
ones = 0
zeros = 0
if counter.get('n'):
	ones += counter.get('n')
if counter.get('z'):
	zeros += counter.get('z')
result = [1] * ones + [0] * zeros
print(*result)


n = int(input())
st = input().strip()
d = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for el in st:
	d[el] += 1
for i in range(d['n']):
	print(1, end=' ')
for i in range(d['z']):
	print(0, end=' ')


input()
s = input()
(o, n, e, z, r) = (0, 0, 0, 0, 0)
for element in s:
	if element == 'o':
		o += 1
	elif element == 'n':
		n += 1
	elif element == 'e':
		e += 1
	elif element == 'z':
		z += 1
	elif element == 'r':
		r += 1
one = 0
zero = 0
one = min([o, n, e])
if one == 0:
	zero = min([z, r, o])
else:
	o -= one
	n -= one
	e -= one
	zero = min([z, r, e])
one_arr = [1] * one
zero_arr = [0] * zero
ans = []
ans.extend(one_arr)
ans.extend(zero_arr)
for i in ans:
	print(i, end=' ')


x = input()
string = input()
count = string.count('z')
length = int((len(string) - count * 4) / 3)
for x in range(length):
	print(1, end=' ')
for x in range(count):
	print(0, end=' ')


n = int(input())
s = input()
cn = 0
cz = 0
for i in s:
	if i == 'z':
		cz += 1
	elif i == 'n':
		cn += 1
a = []
for i in range(cn):
	a.append(1)
for i in range(cz):
	a.append(0)
print(' '.join(map(str, a)))


n = int(input())
s = input()
z = 0
e = 0
for i in range(n):
	if s[i] == 'z':
		z = z + 1
	elif s[i] == 'n':
		e = e + 1
ans = ''
for i in range(e):
	ans = ans + '1' + ' '
for i in range(z):
	ans = ans + '0' + ' '
print(ans)


n = int(input())
ch = input()
ph = ''
for i in range(ch.count('n')):
	ph = ph + '1' + ' '
for i in range(ch.count('z')):
	ph = ph + '0' + ' '
ph.rstrip(' ')
print(ph)


def result(n, s):
	answer = ''
	(counter_z, counter_e, counter_r, counter_o, counter_n) = (0, 0, 0, 0, 0)
	for i in range(n):
		if s[i] == 'z':
			counter_z += 1
		elif s[i] == 'e':
			counter_e += 1
		elif s[i] == 'r':
			counter_r += 1
		elif s[i] == 'o':
			counter_o += 1
		elif s[i] == 'n':
			counter_n += 1
	while min(counter_o, counter_n, counter_e) != 0:
		counter_o -= 1
		counter_n -= 1
		counter_e -= 1
		answer += '1 '
	while min(counter_z, counter_e, counter_r, counter_o) != 0:
		counter_z -= 1
		counter_e -= 1
		counter_r -= 1
		counter_o -= 1
		answer += '0 '
	return answer
n = int(input())
string = input()
print(result(n, string))


from collections import Counter

def program(n, m):
	dictionary = Counter(m)
	minimum = min(dictionary['n'], dictionary['e'], dictionary['o'])
	for i in 'one':
		dictionary[i] -= minimum
	minimum2 = min(dictionary['z'], dictionary['e'], dictionary['o'], dictionary['r'])
	string = '1 ' * minimum
	string += '0 ' * minimum2
	return string
n = int(input())
m = input()
print(program(n, m))


def main():
	tam = int(input())
	st = input()
	(z, n) = ZeN(st)
	st = ''
	for x in range(z + n):
		if x <= n - 1:
			if x == z + n - 1:
				st += '1'
			else:
				st += '1 '
		elif x == z + n - 1:
			st += '0'
		else:
			st += '0 '
	print(st)

def ZeN(st):
	z = 0
	n = 0
	for char in st:
		if char == 'z':
			z += 1
		if char == 'n':
			n += 1
	return (z, n)
main()


n = int(input())
shit = input()
print('1 ' * shit.count('n') + '0 ' * shit.count('z'))


n = int(input())
s = input()
zc = 0
oc = 0
for i in s:
	if i == 'n':
		oc = oc + 1
	elif i == 'z':
		zc = zc + 1
while oc:
	print(1, end=' ')
	oc -= 1
while zc:
	print(0, end=' ')
	zc -= 1


n = int(input())
binary_letters = input()
contains = dict()
for i in binary_letters:
	if i not in contains:
		contains[i] = 1
	else:
		contains[i] += 1
binary_notation = ''
if 'n' in contains:
	temp = ['1'] * contains['n']
	temp = ' '.join(temp)
	binary_notation += temp
if 'z' in contains:
	temp = ['0'] * contains['z']
	temp = ' '.join(temp)
	binary_notation += ' ' + temp
print(binary_notation)


n = int(input())
a = list(input())
z = 0
o = 0
for i in a:
	if i == 'z':
		z += 1
	elif i == 'o':
		o += 1
for i in range(o - z):
	print(1, end=' ')
for i in range(z):
	print(0, end=' ')
print('')


a = [None] * int(input())
a = list(input())
z = 0
e = 0
r = 0
o = 0
n = 0
for x in a:
	if x == 'z':
		z += 1
	elif x == 'e':
		e += 1
	elif x == 'r':
		r += 1
	elif x == 'o':
		o += 1
	elif x == 'n':
		n += 1
if o >= 0 and n >= 0 and (e >= 0):
	q = min(o, n, e)
if z >= 0 and e - q >= 0 and (r >= 0) and (o - q >= 0):
	s = min(z, e - q, r, o - q)
for x in range(q):
	print(1, end=' ')
for x in range(s):
	print(0, end=' ')


n = int(input())
k = input()
zero = k.count('z')
one = k.count('n')
print('1 ' * one + '0 ' * zero)


_ = input()
string = input()
n = z = 0
for i in string:
	if i == 'n':
		n += 1
	if i == 'z':
		z += 1
for i in range(n):
	print('1', end=' ')
for i in range(z):
	print('0', end=' ')


from itertools import chain

def foo(x):
	zc = x.count('z')
	oc = x.count('n')
	one = '1'
	zero = '0'
	oar = [one for x in range(oc)]
	zar = [zero for x in range(zc)]
	print(' '.join(chain(oar, zar)))
test = int(input())
first = input()
foo(first)


def solve(n, string):
	ones = string.count('n')
	zeros = string.count('z')
	return ' '.join(['1'] * ones + ['0'] * zeros)
n = int(input())
string = input()
y = solve(n, string)
print(y)


x = int(input())
arr = input()
res = []
for i in range(x):
	if arr[i] == 'n':
		res.append(1)
	if arr[i] == 'z':
		res.append(0)
res.sort(reverse=True)
print(*res, sep=' ')


StringLen = int(input())
String = input()
Ncount = 0
Zcount = 0
Output = list()
for x in range(StringLen):
	if String[x] == 'n':
		Ncount += 1
	elif String[x] == 'z':
		Zcount += 1
if Ncount > 0:
	for y in range(Ncount):
		Output.append('1')
	for z in range(Zcount):
		Output.append('0')
	s = ' '
	print(s.join(Output))
else:
	for z in range(Zcount):
		Output.append('0')
	s = ' '
	print(s.join(Output))


les = int(input())
Str = input()
one = 0
zero = 0
for i in Str:
	if i == 'n':
		one += 1
	elif i == 'z':
		zero += 1
ans = ''
for i in range(one):
	ans += '1 '
for i in range(zero):
	ans += '0 '
print(ans[:-1])


x = int(input())
a = input()
mass = [0, 0, 0, 0, 0]
for i in range(x):
	if a[i] == 'z':
		mass[0] += 1
	if a[i] == 'n':
		mass[4] += 1
d = mass[-1]
d2 = mass[0]
res = [1 for i in range(d)] + [0 for i2 in range(d2)]
print(*res)


N = int(input())
S = input()
from collections import defaultdict
di = defaultdict(int)
for s in S:
	di[s] += 1
one = di['n']
zero = (N - 3 * one) // 4
for i in range(one):
	print(1, end=' ')
for i in range(zero):
	print(0, end=' ')
print()


i = int(input())
s = str(input())
ones = s.count('n')
zeros = s.count('z')
txt = ''
for one in range(ones):
	txt += '1 '
for zero in range(zeros):
	txt += '0 '
print(txt)


input()
S = list(input())
Z = 0
O = 0
for i in S:
	if i == 'z':
		Z += 1
	if i == 'n':
		O += 1
print
print('1 ' * O + '0 ' * Z)


n = int(input())
t = input()
z = t.count('r')
p = t.count('n')
for _ in range(p):
	print(1, end=' ')
for _ in range(z):
	print(0, end=' ')


def cards(s):
	s = s.lower()
	z = s.count('z')
	n = s.count('n')
	res = ''
	if n != 0:
		for i in range(n):
			res += '1 '
	if z != 0:
		for i in range(z):
			res += '0 '
	res.strip()
	return res
n = input().strip()
s = input().strip()
print(cards(s))


from collections import Counter
n = int(input())
a = input()
a = list(a)
c = Counter(a)
m1 = min(c['o'], c['n'], c['e'])
c['o'] = c['o'] - m1
c['e'] = c['e'] - m1
m2 = min(c['z'], c['e'], c['r'], c['o'])
l = [1] * m1
l1 = [0] * m2
l = l + l1
print(*l)


from collections import Counter
a = input()
b = Counter(input())
ans = []
if b.get('n'):
	ans.extend(['1'] * b['n'])
ans.extend(['0'] * b['z'])
print(' '.join(ans))


ia = int(input())
x = input()
a = x.count('z')
b = x.count('e')
c = x.count('r')
d = x.count('o')
e = x.count('n')
z = min(a, b, c, d)
y = min(b, d, e)
print('1 ' * y + '0 ' * z)


n = int(input())
s = input()
a = s.count('z')
b = s.count('n')
k = []
if a > 0:
	for i in range(a):
		k.append(0)
if b > 0:
	for i in range(b):
		k.append(1)
k.sort()
k.reverse()
print(*k, sep=' ')


n = int(input())
s = input()
k1 = s.count('n')
k2 = s.count('z')
while k1 > 0:
	print(1, end=' ')
	k1 -= 1
while k2 > 0:
	print(0, end=' ')
	k2 -= 1


n = int(input())
x = input()
ones = x.count('n')
zeros = x.count('z')
t = []
for i in range(ones):
	t.append('1')
for j in range(zeros):
	t.append('0')
print(' '.join((str(x) for x in t)))


n = int(input())
s = input()
zero = s.count('z')
one = s.count('n')
b = ''
for o in range(one):
	b += '1 '
if zero == 0:
	b = b[:len(b) - 1]
else:
	for z in range(zero - 1):
		b += '0 '
	b += '0'
print(b)


n = int(input())
s = input()
z = 0
n = 0
for i in s:
	if i == 'z':
		z += 1
	if i == 'n':
		n += 1
lst = [1] * n
arr = [0] * z
print(*lst, *arr, sep=' ')


n = int(input())
s = input()
nzero = 0
none = 0
for i in s:
	if i == 'n':
		none = 1 + none
	if i == 'z':
		nzero = 1 + nzero
ans = ''
for o in range(0, none):
	ans = ans + '1' + ' '
for o in range(0, nzero):
	if o < nzero - 1:
		ans = ans + '0' + ' '
	else:
		ans = ans + '0'
print(ans)


n = int(input())
a = list(input())
d = {}
for i in a:
	if i in d:
		d[i] += 1
	else:
		d[i] = 1
if 'n' in d:
	for i in range(d['n']):
		print(1, end=' ')
if 'z' in d:
	for i in range(d['z']):
		print(0, end=' ')


n = int(input())
s = input()
ans = []
count = s.count('n')
for _ in range(count):
	ans.append(1)
count = s.count('z')
for _ in range(count):
	ans.append(0)
for i in ans:
	print(i, end=' ')
print()


n = int(input())
s = input()
c1 = s.count('n')
c0 = s.count('z')
dat = []
dat += ['1'] * c1
dat += ['0'] * c0
print(' '.join(dat))


z = 0
n = 0
in1 = int(input())
in2 = input()
for i in range(in1):
	if in2[i] == 'z':
		z = z + 1
	if in2[i] == 'n':
		n = n + 1
s = '1 ' * n + '0 ' * z
print(s)


n = int(input())
s = list(input())
o = s.count('o')
n = s.count('n')
e = s.count('e')
z = s.count('z')
r = s.count('r')
oc = min(n, min(o, e))
zc = min(min(z, e), min(o, e))
for i in range(oc):
	print(1, end=' ')
for i in range(zc):
	print(0, end=' ')


N = int(input())
string = input()[:N]
arr = ['one', 'zero']
value_dict = {'one': '1', 'zero': '0'}
count = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for char in string:
	count[char] += 1
output = ''
for val in arr:
	found = True
	while found:
		for char in val:
			if char not in count or count[char] == 0:
				found = False
				break
		if found:
			for char in val:
				count[char] -= 1
			if output:
				output += ' ' + value_dict[val]
			else:
				output += value_dict[val]
print(output)


lengs = int(input())
number = input()
countOfn = 0
countOfz = 0
for i in range(len(number)):
	if number[i] == 'z':
		countOfz += 1
	if number[i] == 'n':
		countOfn += 1
out = ''
for i in range(countOfn):
	out += '1 '
for i in range(countOfz):
	out += '0 '
print(out)


alphaDict = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
n = int(input())
s = input()
for x in s:
	alphaDict[x] += 1
result = [1] * min(alphaDict['o'], alphaDict['n'], alphaDict['e']) + [0] * alphaDict['z']
result = ' '.join(map(str, result))
print(result)


n = int(input())
d = {'z': 0, 'n': 0}
for x in input():
	if x not in d:
		d[x] = 0
	d[x] += 1
print(*list('1' * d['n'] + '0' * d['z']))


a = int(input())
b = input()
one = b.count('n')
zero = int((a - one * 3) // 4)
print('1 ' * one + '0 ' * zero)


n = int(input())
l = list(input())
z = l.count('z')
o = l.count('o')
r = l.count('r')
e = l.count('e')
n = l.count('n')
t = []
if n > 0:
	m = min(o, e, n)
	for i in range(m):
		t.append(1)
	n -= m
	o -= m
	e -= m
if z > 0:
	m = min(z, e, r, o)
	for i in range(m):
		t.append(0)
print(*t)


n = int(input())
string = input().strip()
counters = dict([(c, string.count(c)) for c in 'zeron'])
ones = ' '.join(['1'] * counters['n'])
zeros = ' '.join(['0'] * counters['z'])
text = '{} {}'.format(ones, zeros)
print(text)


n = int(input())
s = input()
x = s.count('n')
print('1 ' * x + '0 ' * ((len(s) - 3 * x) // 4))


n = int(input())
s = input()
d = {'n': 0, 'z': 0}
ans = ''
for i in s:
	if i == 'n':
		d['n'] += 1
	if i == 'z':
		d['z'] += 1
for i in range(d['n']):
	ans += '1 '
for i in range(d['z']):
	ans += '0 '
print(ans.strip())


L = int(input())
S = input()
n = S.count('n')
r = S.count('r')
ans = '1 ' * n + '0 ' * r
print(ans)


n = int(input())
str = input()
list1 = []
list2 = []
for i in str:
	if i == 'z':
		list1.append(0)
		n = n - 4
if n != 0:
	r = n // 3
	for i in range(r):
		list1.append(1)
list1.reverse()
print(*list1, sep=' ')


from collections import *
a = Counter(*[*open(0)][1:])
print('1 ' * (a.get('o', 0) - a.get('r', 0)) + '0 ' * a.get('r', 0))


count = int(input())
chars = input()
zeroes = ''
ones = ''
for char in chars:
	if char == 'z':
		zeroes += '0 '
	elif char == 'n':
		ones += '1 '
print(ones, zeroes, sep='')


import sys
input = sys.stdin.readline

def inp():
	return int(input())

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
from collections import Counter

def main():
	n = inp()
	s = insr()
	counter = Counter(s)
	one_count = counter['n']
	zero_count = counter['z']
	for i in range(one_count):
		print('1 ', end='')
	for i in range(zero_count):
		print('0 ', end='')
main()


n = int(input())
L = list(input())
dic_letters = {}
for i in range(len(L)):
	if L[i] in dic_letters:
		dic_letters[L[i]] += 1
	else:
		dic_letters[L[i]] = 1
nb_of_one = 0
if 'o' in dic_letters and 'n' in dic_letters and ('e' in dic_letters):
	while dic_letters['o'] > 0 and dic_letters['n'] > 0 and (dic_letters['e'] > 0):
		nb_of_one += 1
		dic_letters['o'] -= 1
		dic_letters['n'] -= 1
		dic_letters['e'] -= 1
nb_of_zero = 0
if 'z' in dic_letters and 'e' in dic_letters and ('r' in dic_letters) and ('o' in dic_letters):
	while dic_letters['z'] > 0 and dic_letters['e'] > 0 and (dic_letters['r'] > 0) and (dic_letters['o'] > 0):
		dic_letters['z'] -= 1
		dic_letters['e'] -= 1
		dic_letters['r'] -= 1
		dic_letters['o'] -= 1
		nb_of_zero += 1
string = ''
for i in range(nb_of_one):
	string += '1 '
for i in range(nb_of_zero):
	string += '0 '
print(string)


n = int(input())
s = input()
ncount = zeros = ones = eocount = 0
for i in s:
	if i == 'n':
		ones += 1
	elif i == 'z':
		zeros += 1
for i in range(ones):
	print(1, end=' ')
for i in range(zeros):
	if i != zeros - 1:
		print(0, end=' ')
	else:
		print(0)


slen = int(input())
string = input()
z = 0
n = 0
for i in string:
	if i == 'z':
		z += 1
	elif i == 'n':
		n += 1
for i in range(n):
	print(1, end=' ')
for i in range(z):
	print(0, end=' ')


n = int(input())
s = str(input())
o = 0
z = 0
e = 0
n = 0
r = 0
for i in s:
	if i == 'r':
		r += 1
	if i == 'n':
		n += 1
print(n * '1 ' + r * '0 ')


n = int(input())
s = input()
nz = 0
for l in s:
	if l == 'z':
		nz += 1
no = (n - 4 * nz) // 3
for i in range(no):
	print('1', end=' ')
for i in range(nz):
	print('0', end=' ')


l = input()
s = input()
a = 0
b = 0
for index in range(len(s)):
	if s[index] == 'n':
		a += 1
	if s[index] == 'z':
		b += 1
while a:
	(print(1, end=' '),)
	a -= 1
while b:
	(print(0, end=' '),)
	b -= 1


t = int(input())
s = input()
n = s.count('z')
m = n * 4
for i in range((t - m) // 3):
	print(1, end=' ')
for i in range(n):
	print(0, end=' ')
print()


n = int(input())
s = input()
c = s.count('n')
d = s.count('z')
f = '1 ' * c + '0 ' * d
print(f)


t = int(input())
n = input()
n = list(n)
p = n.count('r')
z = p * 4
if z == t:
	for i in range(0, p):
		print(0, end=' ')
	print()
else:
	t = t - z
	t = t // 3
	for i in range(0, t):
		print(1, end=' ')
	for i in range(0, p):
		print(0, end=' ')
	print()


l = int(input())
z = 0
n = 0
line = input()
for c in line:
	if c == 'z':
		z += 1
	elif c == 'n':
		n += 1
arr0 = [0 for i in range(z)]
arr1 = [1 for i in range(n)]
first = True
for x in arr1 + arr0:
	if first:
		first = False
		print(x, end='')
	else:
		print(' ' + str(x), end='')


(a, b) = (int(input()), input())
c = list(b)
num = []
for i in c:
	if i == 'z':
		num.append(0)
	if i == 'n':
		num.append(1)
c1 = c2 = 0
for i in num:
	if i == 1:
		c1 += 1
	if i == 0:
		c2 += 1
print('1 ' * c1, end='')
print('0 ' * c2, end='')


t = int(input())
s = input()
a = ''
while ('o' in s) & ('n' in s) & ('e' in s):
	s = s[:s.find('o')] + s[s.find('o') + 1:]
	s = s[:s.find('n')] + s[s.find('n') + 1:]
	s = s[:s.find('e')] + s[s.find('e') + 1:]
	a = a + '1 '
print(a + '0 ' * int(len(s) / 4))


n = int(input())
str = input()
nn = 0
nz = 0
for s in str:
	if s == 'n':
		nn += 1
	elif s == 'z':
		nz += 1
while nn > 0:
	print(1, end=' ')
	nn -= 1
while nz > 0:
	print(0, end=' ')
	nz -= 1


n = input()
s = input()
d = {'z': 0, 'n': 0}
for x in s:
	try:
		d[x] += 1
	except:
		print(end='')
res = []
for i in range(d['n']):
	res.append(1)
for i in range(d['z']):
	res.append(0)
s = ''
for x in range(len(res) - 1):
	s += str(res[x]) + ' '
s += str(res[-1])
print(s)


useless = input()
inp = input()
ns = 0
zs = 0
for c in inp:
	if c == 'n':
		ns += 1
	elif c == 'z':
		zs += 1
strr1 = '1 ' * ns
strr2 = '0 ' * zs
print((strr1 + strr2)[:-1])


n = int(input())
x = input()
f = 1
c_z = x.count('z')
c_n = x.count('n')
for i in range(c_n):
	print(1, end=' ')
for i in range(c_z):
	print(0, end=' ')


t = input()
m = input()
print(*[1] * m.count('n') + [0] * m.count('z'))


n = int(input())
s = list(input())
print(f"{'1 ' * s.count('n')}{'0 ' * s.count('z')}")


n = int(input())
s = input()
o = 0
r = 0
n = 0
e = 0
z = 0
for i in s:
	if i == 'o':
		o += 1
	if i == 'n':
		n += 1
	if i == 'e':
		e += 1
	if i == 'r':
		r += 1
	if i == 'z':
		z += 1
if o == n and n == e:
	for j in range(o):
		print(1, end=' ')
else:
	f = min(o, n, e)
	for j in range(f):
		print(1, end=' ')
	max = max(o, n, e)
	fz = min(z, max - f)
	for u in range(fz):
		print(0, end=' ')


n = int(input())
s = input()
a = ['1' for i in range(s.count('n'))]
a.extend(['0' for i in range(s.count('z'))])
print(' '.join(a))


n = input()
s = input()
z = 0
n = 0
res = []
for i in range(len(s)):
	if s[i] == 'z':
		res.append(0)
	elif s[i] == 'n':
		res.append(1)
res.sort(reverse=True)
for r in res:
	print(r, end=' ')


a = int(input())
o = 0
e = 0
z = 0
r = 0
n = 0
zero = 0
one = 0
s = input()
s = list(s)
for i in s:
	if i == 'o':
		o += 1
	elif i == 'n':
		n += 1
	if i == 'e':
		e += 1
	elif i == 'z':
		z += 1
	if i == 'r':
		r += 1
while z != 0 and e != 0 and (r != 0) and (o != 0):
	z -= 1
	e -= 1
	r -= 1
	o -= 1
	zero += 1
one = min(min(o, n), e)
for i in range(0, one):
	print(1, end=' ')
for i in range(0, zero):
	print(0, end=' ')


n = int(input())
d = dict()
s = input()
for i in s:
	if i in d:
		d[i] += 1
	else:
		d[i] = 1
n = r = 0
if 'n' in d:
	n = d['n']
if 'r' in d:
	r = d['r']
print('1 ' * n + '0 ' * r)


import sys
input = sys.stdin.readline

def getInt():
	return int(input())

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

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

def getStr():
	return input().strip()

def addDictList(d, key, val):
	if key not in d:
		d[key] = []
	d[key].append(val)

def addDictInt(d, key, val):
	if key not in d:
		d[key] = 0
	d[key] = val

def addDictCount(d, key):
	if key not in d:
		d[key] = 0
	d[key] += 1

def addDictSum(d, key, val):
	if key not in d:
		d[key] = 0
	d[key] += val
n = getInt()
s = getStr()
kN = False
kZ = 0
a1 = []
a0 = []
for i in range(n):
	if s[i] == 'n':
		a1.append(1)
	if s[i] == 'z':
		a0.append(0)
a = a1 + a0
print(*a)


n = int(input())
s = input()
from collections import Counter
d = {}
d = Counter(s)
if 'z' not in s:
	for _ in range(0, d['o']):
		print(1, end=' ')
elif 'n' not in s:
	for _ in range(0, d['z']):
		print(0, end=' ')
else:
	for _ in range(0, d['n']):
		print(1, end=' ')
	for _ in range(0, d['z']):
		print(0, end=' ')


a = int(input())
str = input()
count = 0
for i in str:
	if i == 'z':
		count = count + 1
l = len(str)
a = count
b = (l - 4 * count) // 3
for i in range(b):
	print(1, end=' ')
for i in range(a):
	print(0, end=' ')


n = int(input())
w = input()
w.upper()
a = 0
b = 0
for i in range(n):
	if w[i] == 'n':
		a = a + 1
	elif w[i] == 'z':
		b = b + 1
print('1 ' * a + '0 ' * b)


__author__ = 'Esfandiar'
n = int(input())
s = input()
a = s.count('n')
b = s.count('z')
for i in range(a):
	print(1, end=' ')
for i in range(b):
	print(0, end=' ')


x = input()
x = input()
print(x.count('n') * '1 ' + x.count('z') * '0 ')


import sys
from collections import Counter
n = int(sys.stdin.readline())
s = sys.stdin.readline().strip()
counter = Counter(s)
print('1 ' * counter['n'] + '0 ' * counter['z'])


n = int(input())
s = input()
n1 = s.count('n')
n2 = s.count('z')
for i in range(n1):
	print(1, end=' ')
for j in range(n2):
	print(0, end='')
	if j != n2 - 1:
		print(end=' ')


n = int(input())
s = input()
cn = s.count('n')
cz = s.count('z')
for x in range(cn):
	print('1', end=' ')
for x in range(cz):
	print('0', end=' ')


n = int(input())
s = str(input())
count = 0
count2 = 0
for i in range(n):
	if s[i] == 'n':
		count += 1
	if s[i] == 'z':
		count2 += 1
l = []
for i in range(count):
	l.append(1)
for i in range(count2):
	l.append(0)
print(*l)


n = int(input())
s = list(input())
ones = ['1' for _ in range(s.count('n'))]
zeros = ['0' for _ in range(s.count('z'))]
output = ones + zeros
print(' '.join(output))


n = input()
s = input()
z = s.count('z')
n = s.count('n')
a = [1] * n + [0] * z
a = [str(i) for i in a]
print(' '.join(a))


n = int(input())
s = input()
a1 = s.count('z')
a2 = s.count('n')
s1 = '1' * a2 + '0' * a1
for i in s1:
	print(i, end=' ')


l = int(input())
w = input()
o = w.count('n')
z = w.count('z')
for i in range(o):
	print(1, end=' ')
for i in range(z):
	print(0, end=' ')


x = int(input())
y = input()
one = y.count('n')
zero = (x - one * 3) // 4
if zero == 0:
	print('1 ' * (one - 1) + '1')
else:
	print('1 ' * one + '0 ' * (zero - 1) + '0')


def main():
	n = int(input())
	letters = input()
	z_count = 0
	n_count = 0
	for letter in letters:
		if letter == 'z':
			z_count += 1
		elif letter == 'n':
			n_count += 1
		else:
			pass
	lst = '0' * z_count + '1' * n_count
	output = []
	for item in lst:
		output += item
	output.sort(reverse=True)
	output = ' '.join(output)
	print(output)
main()


n = int(input())
a = input()
cn = 0
cz = 0
for i in range(n):
	if a[i] == 'n':
		cn += 1
	if a[i] == 'z':
		cz += 1
print('1 ' * cn + '0 ' * cz)


singleint = int(input())
letters = list(input())
op = ''
for _ in range(letters.count('n')):
	op = op + ' 1'
for _ in range(letters.count('z')):
	op = op + ' 0'
print(op.lstrip())


numofcards = input()
numofcards = int(numofcards)
cards = input()
zeros = 0
ones = 0
answer = []
for card in range(0, numofcards):
	if cards[card] == 'z':
		zeros = zeros + 1
	if cards[card] == 'n':
		ones = ones + 1
answer = '1 ' * ones + '0 ' * zeros
print(answer)


val = int(input())
x = input()
z = 0
n = 0
for i in range(len(x)):
	if x[i] == 'z':
		z = z + 1
	elif x[i] == 'n':
		n = n + 1
ans = []
for i in range(n):
	ans.append(1)
for i in range(z):
	ans.append(0)
print(*ans)


from collections import Counter
n = int(input())
arr_cnt = dict(Counter(input()))
num = 0
b = 0
if 'z' in arr_cnt:
	num = arr_cnt['z']
if 'n' in arr_cnt:
	b = arr_cnt['n']
final = ''
if b != 0:
	for i in range(b):
		final += '1 '
if num != 0:
	for i in range(num):
		final += '0 '
print(final)


_ = input()
cards = input()
binary = '1' * cards.count('n') + '0' * cards.count('z')
print(' '.join(binary))


m = int(input())
n = list(input())
zero = 0
one = 0
for i in n:
	if i == 'z':
		zero += 1
	if i == 'n':
		one += 1
l = []
for i in range(one + zero):
	if i < one:
		l.append('1')
	else:
		l.append('0')
a = ' '.join(l)
print(a)


useless = input()
one = 0
zero = 0
letters = list(input().strip().lower())
for letter in letters:
	if letter == 'n':
		one += 1
	elif letter == 'z':
		zero += 1
while one > 0:
	print(1, end=' ')
	one -= 1
while zero > 0:
	print(0, end=' ')
	zero -= 1


a = int(input())
s = input()
z = s.count('z')
e = s.count('e')
if z >= e:
	e = z - e
	z -= e
else:
	e -= z
s = '1 ' * e + '0 ' * z
print(s)


n = int(input())
str1 = input()
c1 = 0
c0 = 0
for i in range(0, len(str1)):
	if str1[i] == 'n':
		c1 += 1
	if str1[i] == 'z':
		c0 += 1
for i in range(0, c1):
	print(1, end=' ')
for i in range(0, c0):
	print(0, end=' ')


n = int(input())
s = input()
onelist = list()
o1 = s.count('o')
n1 = s.count('n')
e1 = s.count('e')
z0 = s.count('z')
r0 = s.count('r')
onelist.append(o1)
onelist.append(n1)
onelist.append(e1)
m = min(onelist)
mainlist = list()
for i in range(0, m):
	mainlist.append('1')
	mainlist.append(' ')
o1 = o1 - m
n1 = n1 - m
e1 = e1 - m
onelist.clear()
onelist.append(z0)
onelist.append(r0)
onelist.append(o1)
onelist.append(e1)
m = min(onelist)
for i in range(0, m):
	mainlist.append('0')
	mainlist.append(' ')
res = ''
print(res.join(mainlist))


(n, a) = (int(input()), input())
res = ''
res += '1' * a.count('n')
res += '0' * a.count('z')
print(' '.join(list(res)))


n = int(input())
mas = input()
mas = list(mas)
zeros = 0
ones = 0
for i in range(0, n):
	if mas[i] == 'z':
		zeros += 1
	if mas[i] == 'n':
		ones += 1
string = ''
while ones > 0 or zeros > 0:
	if ones > 0:
		string += '1 '
		ones -= 1
	else:
		string += '0 '
		zeros -= 1
print(string)


n = int(input())
a = input().count('z')
print(' '.join((n - 4 * a) // 3 * '1' + a * '0'))


n = int(input())
s = input()
z = 0
o = 0
final = ''
for x in list(s):
	if x == 'z':
		z += 1
	elif x == 'n':
		o += 1
	else:
		pass
z = z * [0]
o = o * [1]
for c in o:
	final += str(c)
	final += ' '
for c in z:
	final += str(c)
	final += ' '
print(final)


n = int(input())
s = input()
l = []
count_n = s.count('n')
count_z = s.count('z')
for i in range(count_n):
	l.append('1')
for i in range(count_z):
	l.append('0')
for i in range(len(l)):
	print(l[i], end=' ')


n = int(input())
a = input()
z = a.count('z')
o = a.count('n')
while o != 0:
	o -= 1
	print(1, end=' ')
while z != 0:
	z -= 1
	print(0, end=' ')


_ = input()
s = input()
freq = {}
z = 0
o = 0
for x in s:
	if x == 'n':
		o += 1
	elif x == 'z':
		z += 1
for x in range(o):
	print(1, end=' ')
for x in range(z):
	print(0, end=' ')


n = input()
letters = input()
a = [0, 0, 0, 0, 0]
for letter in letters:
	if letter == 'z':
		a[0] += 1
	if letter == 'e':
		a[1] += 1
	if letter == 'r':
		a[2] += 1
	if letter == 'o':
		a[3] += 1
	if letter == 'n':
		a[4] += 1
ones = min(a[1], a[3], a[4])
a[1] -= ones
a[3] -= ones
a[4] -= ones
zeros = a[0]
for i in range(ones + zeros):
	print(1, end=' ') if i < ones else print(0, end=' ')


n = int(input())
s = input()
one = s.count('n')
print('1 ' * one + '0 ' * ((n - 3 * one) // 4))


length = input()
string = input()
number = ''
for char in string:
	if char == 'n':
		number += '1'
	if char == 'z':
		number += '0'
print(' '.join(reversed(sorted(number))))


n = int(input())
s = input()
zer = 0
on = 0
for i in s:
	if i == 'z':
		zer += 1
	if i == 'n':
		on += 1
final = ''
while on > 0:
	print(1, end=' ')
	on -= 1
while zer > 0:
	print(0, end=' ')
	zer -= 1


n = int(input())
string = input()
countz = string.count('z')
countn = string.count('n')
if countn > 0:
	for i in range(0, countn, 1):
		print(1, end=' ')
if countz > 0:
	for i in range(0, countz, 1):
		print(0, end=' ')


n = int(input())
k = str(input())
m = 0
l = 0
for i in range(n):
	if k[i] == 'n':
		m += 1
	if k[i] == 'z':
		l += 1
t = [1] * m
s = [0] * l
print(*t, *s)


n = int(input())
s = input()
zero = s.count('z')
one = s.count('n')
s = '1' * one + '0' * zero
print(' '.join((str(i) for i in s)))


i = input()
s = input()
n = s.count('n')
z = s.count('z')
e = s.count('e')
r = s.count('r')
o = s.count('o')
ones = min(min(o, n), e)
zero = min(min(z, r), o + e - ones * 2)
for i in range(ones):
	print('1', end=' ')
for i in range(zero):
	print('0', end=' ')


n = int(input())
a = input()
b = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for i in range(n):
	b[a[i]] += 1
x = []
c = min(b['o'], b['n'], b['e'])
x += [1] * c
b['o'] -= c
b['n'] -= c
b['e'] -= c
x += [0] * min(b['z'], b['e'], b['r'], b['o'])
print(*sorted(x)[::-1])


n = input()
s = input()
zero = 0
one = 0
for ch in s:
	if ch == 'z':
		zero += 1
	if ch == 'n':
		one += 1
for i in range(one):
	print(1, end=' ')
for i in range(zero):
	print(0, end=' ')


a = int(input())
s = input()
d = 0
try:
	d = min(s.count('o'), s.count('n'), s.count('e'))
except:
	pass
ot = ''
ot += '1' * d
dd = 0
try:
	dd = s.count('z')
except:
	pass
ot += '0' * dd
print(' '.join(list(ot)))


def MaxOneOrZero(n, word):
	result = ''
	if word.__contains__('o') and word.__contains__('n') and word.__contains__('e'):
		cant = [word.count('o'), word.count('n'), word.count('e')]
		num = min(cant)
		for _ in range(num):
			if result == '':
				result += '1'
			else:
				result += ' 1'
	if word.__contains__('z') and word.__contains__('e') and word.__contains__('r') and word.__contains__('o'):
		cant = [word.count('z'), word.count('e'), word.count('r'), word.count('o')]
		num = min(cant)
		for _ in range(num):
			if result == '':
				result += '0'
			else:
				result += ' 0'
	return result
n = int(input())
word = input()
print(MaxOneOrZero(n, word))


from collections import *
n = int(input())
s = input()
c = Counter(s)
one = min(c['o'], c['n'], c['e'])
c['o'] -= min(c['o'], c['n'], c['e'])
c['n'] -= min(c['o'], c['n'], c['e'])
c['e'] -= min(c['o'], c['n'], c['e'])
zero = min(c['o'], c['r'], c['e'], c['z'])
ans = [0] * (zero + one)
for i in range(one):
	ans[i] = 1
print(' '.join((str(e) for e in ans)))


n = int(input())
string = input()
l = [0] * 26
q = []
for i in range(n):
	l[ord(string[i]) - 97] += 1
while max(l) != 0:
	if l[13] >= 2 and l[8] >= 1 and (l[4] >= 1):
		q.append(9)
		l[13] -= 2
		l[8] -= 1
		l[4] -= 1
	elif l[4] >= 1 and l[8] >= 1 and (l[6] >= 1) and (l[7] >= 1) and (l[19] >= 1):
		q.append(8)
		l[4] -= 1
		l[8] -= 1
		l[6] -= 1
		l[7] -= 1
		l[19] -= 1
	elif l[18] >= 1 and l[4] >= 2 and (l[21] >= 1) and (l[13] >= 1):
		q.append(7)
		l[18] -= 1
		l[4] -= 2
		l[21] -= 1
		l[13] -= 1
	elif l[18] >= 1 and l[8] >= 1 and (l[23] >= 1):
		q.append(6)
		l[18] -= 1
		l[8] -= 1
		l[23] -= 1
	elif l[5] >= 1 and l[8] >= 1 and (l[21] >= 1) and (l[4] >= 1):
		q.append(5)
		l[5] -= 1
		l[8] -= 1
		l[21] -= 1
		l[4] -= 1
	elif l[5] >= 1 and l[14] >= 1 and (l[20] >= 1) and (l[17] >= 1):
		q.append(4)
		l[5] -= 1
		l[14] -= 1
		l[20] -= 1
		l[17] -= 1
	elif l[19] >= 1 and l[7] >= 1 and (l[17] >= 1) and (l[4] >= 2):
		q.append(3)
		l[19] -= 1
		l[7] -= 1
		l[17] -= 1
		l[4] -= 2
	elif l[19] >= 1 and l[22] >= 1 and (l[14] >= 1):
		q.append(2)
		l[19] -= 1
		l[22] -= 1
		l[14] -= 1
	elif l[14] >= 1 and l[13] >= 1 and (l[14] >= 1):
		q.append(1)
		l[14] -= 1
		l[13] -= 1
		l[4] -= 1
	else:
		q.append(0)
		l[25] -= 1
		l[4] -= 1
		l[17] -= 1
		l[14] -= 1
q = sorted(q, reverse=True)
for i in range(len(q)):
	print(q[i], end=' ')


n = int(input())
s = input()
countOne = s.count('n')
countZero = s.count('z')
result = '1 ' * countOne + '0 ' * countZero
print(result)


import sys
input = sys.stdin.readline
t = 1
for _ in range(t):
	n = int(input())
	a = input()
	n_count = a.count('n')
	z_count = a.count('z')
	for i in range(n_count):
		print('1', end=' ')
	for i in range(z_count):
		print('0', end=' ')
	print()


n = int(input())
ans = list(map(str, input()))
d = {}
for i in ans:
	if i in d:
		d[i] += 1
	else:
		d[i] = 1
(count, count1) = (0, 0)
if 'z' in d and 'r' in d and ('e' in d) and ('o' in d):
	count = min(d['z'], d['e'], d['r'], d['o'])
	d['z'] -= count
	d['e'] -= count
	d['r'] -= count
	d['o'] -= count
if 'o' in d and 'n' in d and ('e' in d):
	count1 = min(d['o'], d['n'], d['e'])
	d['o'] -= count1
	d['n'] -= count1
	d['e'] -= count1
print('1 ' * count1 + '0 ' * count)


import collections
n = int(input())
a = input()
d = collections.Counter(a)
ans = []
count = d['n']
for i in range(0, count):
	ans.append(1)
count1 = d['z']
for i in range(0, count1):
	ans.append(0)
print(*ans, sep=' ')


import sys

def solve():
	n = int(input())
	stri = input()
	number_of_zero = 0
	if 'z' in stri:
		number_of_zero = stri.count('z')
	number_of_one = (n - number_of_zero * 4) / 3
	ans = ''
	for x in range(int(number_of_one)):
		ans += '1 '
	for x in range(int(number_of_zero)):
		ans += '0 '
	return ans
ans = solve()
print(ans)


def solve(s, n):
	one = 0
	zero = 0
	for i in s:
		if i == 'z':
			zero += 1
		if i == 'n':
			one += 1
	for i in range(one):
		print('1 ', end='')
	for j in range(zero):
		print('0  ', end='')
n = int(input())
s = input()
solve(s, n)


n = int(input())
s = str(input())
zc = s.count('z')
nc = s.count('n')
ans = [str(1) if i < nc else str(0) for i in range(nc + zc)]
print(' '.join(ans))


n = int(input())
word = input()
dicionario = {'o': 0, 'n': 0, 'e': 0, 'z': 0, 'e': 0, 'r': 0}
for e in word:
	dicionario[e] += 1
ans = []
while dicionario['o'] > 0 and dicionario['n'] > 0 and (dicionario['e'] > 0):
	ans.append(1)
	dicionario['o'] -= 1
	dicionario['n'] -= 1
	dicionario['e'] -= 1
while dicionario['z'] > 0 and dicionario['e'] > 0 and (dicionario['r'] > 0) and (dicionario['o'] > 0):
	ans.append(0)
	dicionario['z'] -= 1
	dicionario['e'] -= 1
	dicionario['r'] -= 1
	dicionario['o'] -= 1
print(*ans)


fauInput = input()
getInput = input()
n = getInput.count('n')
z = getInput.count('z')
output = '1 ' * n + '0 ' * z
print(output)


n = int(input())
s = input()
one = 0
for i in s:
	if i == 'n':
		one += 1
s = '1 ' * one + ('0 ' * int((n - one * 3) / 4)).strip()
print(s)


def Cards():
	size = int(input())
	binary = input()
	z_num = binary.count('z')
	n_num = binary.count('n')
	return '1 ' * n_num + '0 ' * z_num
print(Cards())


n = int(input())
cards = input()
letters = {'o': 0, 'n': 0, 'e': 0, 'z': 0, 'r': 0}
for character in cards:
	letters[character] += 1
final_binary_str = ['1'] * letters['n'] + ['0'] * letters['z']
print(' '.join(final_binary_str))


n = int(input())
s = input()
count = [0] * 5
for i in range(n):
	if s[i] == 'z':
		count[0] += 1
	elif s[i] == 'e':
		count[1] += 1
	elif s[i] == 'r':
		count[2] += 1
	elif s[i] == 'o':
		count[3] += 1
	else:
		count[4] += 1
a = []
lol = count[4]
for i in range(lol):
	a.append(1)
	count[4] -= 1
	count[3] -= 1
	count[1] -= 1
for i in range(count[0]):
	a.append(0)
print(*a)


n = int(input())
s = input()
ones = s.count('n')
zeros = s.count('z')
print('1 ' * ones, end='')
print('0 ' * zeros)


n = int(input())
g = input()
x = g.count('z')
for i in range((n - x * 4) // 3):
	print(1, end=' ')
for i in range(x):
	print(0, end=' ')


n = int(input())
s = input()
one = s.count('n')
zero = s.count('r')
result = []
for i in range(one):
	result.append(1)
for j in range(zero):
	result.append(0)
print(*result, sep=' ')


def f():
	n = int(input())
	string = input()
	(o, z) = (0, 0)
	for i in string:
		if i == 'z':
			z += 1
		if i == 'n':
			o += 1
	output = ''
	for _ in range(o):
		output += '1 '
	for _ in range(z):
		output += '0 '
	length = len(output)
	print(output[0:length])
f()


cnt = input()
string = input()
num_zero = string.count('z')
num_one = string.count('n')
total = '1' * num_one + '0' * num_zero
for _ in total:
	print(_, end=' ')


n = int(input())
s = input()
s = list(s)
l = []
o = s.count('o')
n = s.count('n')
e = s.count('e')
m = min(o, n, e)
for i in range(m):
	l.append(int('1'))
z = s.count('z')
e = s.count('e')
r = s.count('r')
p = min(z, e, r)
for i in range(p):
	l.append(int('0'))
for i in l:
	print(i, end=' ')


from collections import Counter
n = int(input().strip())
d = Counter()
s = input()
for letter in s:
	d[letter] += 1
for _ in range(d['n']):
	print('1 ', end='')
for _ in range(d['z']):
	print('0 ', end='')
print()


x = input()
inp = input()
z = 0
n = 0
for i in inp:
	if i == 'z':
		z += 1
	elif i == 'n':
		n += 1
new = ''
for i in range(n):
	new += '1 '
for i in range(z):
	new += '0 '
print(new)


n = int(input())
a = list(input())
b = a.count('n')
c = a.count('r')
for i in range(b):
	print(1, end=' ')
for i in range(c):
	print(0, end=' ')


n: int = input()
s = input(str())
a = len(s)
i = 0
cn = 0
cz = 0
while i < a:
	if s[i] == 'n':
		cn += 1
	if s[i] == 'z':
		cz += 1
	i = i + 1
while cn > 0:
	print('1 ', end='')
	cn -= 1
while cz > 0:
	print('0 ', end='')
	cz -= 1


n = int(input())
a = str(input())
print(a.count('n') * '1 ', end='')
print(a.count('z') * '0 ')


n = int(input())
s = input()
ones = s.count('n')
zeros = s.count('r')
for _ in range(ones):
	print(1, end=' ')
for _ in range(zeros):
	print(0, end=' ')


n = int(input())
s = input()
a = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for i in s:
	a[i] += 1
mx = a['e']
if a['o'] < mx:
	mx = a['o']
if a['z'] >= a['r']:
	a['z'] = a['r']
else:
	a['r'] = a['z']
(n0, n1) = (0, 0)
if a['n'] <= mx:
	n1 = a['n']
	mx -= a['n']
	if a['z'] <= mx:
		n0 = a['z']
	else:
		n0 = mx
else:
	n1 = mx
	mx = 0
an = ''
for i in range(n1):
	an += '1 '
for i in range(n0):
	an += '0 '
print(an[:-1])


x = int(input())
chislo = input()
z = chislo.count('z')
n = chislo.count('n')
print(n * '1 ' + z * '0 ')


words = ['z', 'e', 'r', 'o', 'n']
n = int(input())
p = []
q = []
w = []
m = input()
s = []
y = 0
for x in range(n):
	if m[x] == words[0]:
		p.append(0)
	if m[x] == words[4]:
		q.append(1)
for x in range(len(q)):
	s.insert(x, q[x])
for x in range(len(p)):
	s.insert(len(q) + x, p[x])
print(*s, sep='  ')


n = input()
s = input()
cer = 0
uno = 0
for i in s:
	if i == 'n':
		uno += 1
	if i == 'z':
		cer += 1
for i in range(uno):
	print('1', end=' ')
for i in range(cer):
	print('0', end=' ')


cards = int(input())
reader = input()
(z, n) = (0, 0)
result = ''
i = 0
for i in range(cards):
	if reader[i] == 'z':
		z = z + 1
	elif reader[i] == 'n':
		n = n + 1
	i = i + 1
for _ in range(n):
	result = result + '1' + ' '
for _ in range(z):
	result = result + '0' + ' '
print(result)


n = int(input())
s = input()
from collections import defaultdict
d = defaultdict(int)
for i in s:
	d[i] += 1
zero = min(d['z'], d['r'])
one = d['n']
a = d['e']
b = d['o']
ans = ['1'] * one + ['0'] * zero
print(*ans, sep=' ')


n = int(input())
s = input()
one = s.count('n')
zero = s.count('z')
result = '1' * one + '0' * zero
print(' '.join(list(result)))


a = int(input())
b = list(input())
print(b.count('n') * '1 ', end='')
if b.count('z') > 0:
	print((b.count('z') - 1) * '0 ', end='')
	print('0')
else:
	pass


angka = int(input())
masukan = input()
one = 0
zero = 0
for i in range(angka):
	if masukan[i] == 'n':
		one += 1
	elif masukan[i] == 'z':
		zero += 1
for i in range(one):
	print('1', end=' ')
for i in range(zero):
	print('0', end=' ')


n = int(input())
s = input()
a = []
for i in s:
	if 'n' == i:
		a.append(1)
for i in s:
	if 'z' == i:
		a.append(0)
print(*a)


n = int(input())
st = input().strip()
n2 = len(st)
dic = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for i in st:
	dic[i] += 1
a = 0
for i in range(dic['n']):
	print(1, end=' ')
	a += 1
	if a == n:
		break
else:
	for i in range(dic['z']):
		print(0, end=' ')
		a += 1
		if a == n:
			break


n = int(input())
s = list(input())
result = []
zero = 'z'
one = 'n'
nZ = s.count('z')
nO = s.count('n')
for i in range(nO):
	result.append('1')
for i in range(nZ):
	result.append('0')
print(*result, sep=' ')


n = int(input())
q = input()
q = list(q)
w = q.count('z')
e = q.count('n')
s = []
for i in range(e):
	s.append(1)
for i in range(w):
	s.append(0)
print(*s)


tamanho = int(input())
palavra = input()
resolvido = ''
one = palavra.count('n')
zeros = palavra.count('z')
for i in range(one):
	resolvido += '1 '
for j in range(zeros):
	resolvido += '0 '
print(resolvido[:-1])


n = int(input())
abc = ' '
s = input()
z = s.count('z')
e = s.count('e')
r = s.count('r')
o = s.count('o')
n = s.count('n')
e = s.count('e')
a = min(o, n, e)
o = o - a
if a > 0:
	for i in range(a):
		abc = abc + '1'
if o > 0:
	a1 = min(z, e, r, o)
	if a1 > 0:
		for i in range(a1):
			abc = abc + '0'
for i in range(len(abc)):
	print(abc[i], end=' ')


MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from math import *
(n,) = I()
s = input()
k = s.count('n')
print('1 ' * k + '0 ' * ((n - k * 3) // 4))


l = int(input())
countz = 0
countn = 0
while True:
	string = input()
	if len(string) != l:
		print('try again dumbass')
		continue
	else:
		break
countz = list(string).count('z')
countn = list(string).count('n')
print('1 ' * countn + '0 ' * countz)


n = int(input())
s = input()
zeros = s.count('z')
ens = s.count('n')
answer = '1' * ens + '0' * zeros
print(' '.join(answer))


leng = int(input())
s = input()
z = 0
n = 0
for x in range(0, leng):
	if s[x] == 'z':
		z += 1
	elif s[x] == 'n':
		n += 1
o = ''
for x in range(0, n):
	o = o + '1 '
for x in range(0, z):
	o = o + '0 '
print(o)


n = int(input())
s = input()
ones = s.count('n')
zeros = s.count('r')
print(*[1] * ones, *[0] * zeros)


n = int(input())
word = input()
(z, e, r, o, n) = (0, 0, 0, 0, 0)
for i in word:
	if i == 'z':
		z += 1
	elif i == 'e':
		e += 1
	elif i == 'r':
		r += 1
	elif i == 'o':
		o += 1
	elif i == 'n':
		n += 1
temp1 = min([o, n, e])
o -= temp1
n -= temp1
e -= temp1
temp2 = min([z, e, r, o])
print(*[1 for i in range(temp1)] + [0 for i in range(temp2)])


n = int(input())
s = str(input())
count1 = s.count('n')
count2 = s.count('r')
arr = [1] * count1
arr1 = [0] * count2
arr = arr + arr1
print(*arr)


n = int(input())
s = input()
d = {}
for i in s:
	if i in d:
		d[i] += 1
	else:
		d[i] = 1
if 'n' in d:
	for i in range(d['n']):
		print(1, end=' ')
if 'z' in d:
	for i in range(d['z']):
		print(0, end=' ')
print()


n = int(input())
s = input().rstrip()
z = s.count('z')
n = s.count('n')
ans = [1] * n + [0] * z
print(' '.join([str(item) for item in ans]))


from math import floor
b = input()
a = input()
z = 0
e = 0
r = 0
o = 0
n = 0
mas = []
for i in range(len(a)):
	if a[i] == 'z':
		z += 1
	if a[i] == 'e':
		e += 1
	if a[i] == 'r':
		r += 1
	if a[i] == 'o':
		o += 1
	if a[i] == 'n':
		n += 1
if o > 0 and n > 0 and (e > 0):
	f = min(o, n, e)
	for i in range(f):
		mas.append(1)
	o -= f
	n -= f
	e -= f
if z > 0 and e > 0 and (r > 0) and (o > 0):
	s = min(z, e, r, o)
	for i in range(s):
		mas.append(0)
print(*mas)


t = int(input())
a = input()
z = a.count('z')
e = a.count('e')
r = a.count('r')
o = a.count('o')
n = a.count('n')
num = []
for i in range(n):
	num.append('1')
for j in range(z):
	num.append('0')
number = ' '.join(num)
print(number)


def f(s):
	h = {}
	for c in 'zeron':
		h[c] = 0
	for c in s:
		h[c] = h[c] + 1
	ones = min(h['o'], h['n'], h['e'])
	h['o'] -= ones
	h['n'] -= ones
	h['e'] -= ones
	zeros = min(h['z'], h['e'], h['r'], h['o'])
	out = [1] * ones
	out += [0] * zeros
	return out
n = int(input())
s = input()
ans = f(s)
print(' '.join([str(x) for x in ans]))


from collections import defaultdict
n = int(input())
string = input()
d = defaultdict()
(d['z'], d['r'], d['n']) = (0, 0, 0)
d['z'] = string.count('z')
d['r'] = string.count('r')
d['n'] = string.count('n')
s = ' '
num = d['n'] * '1' + min(d['z'], d['r']) * '0'
num = s.join(num)
print(num)


t = int(input())
s = input()
z = 0
n = 0
for ch in s:
	if ch is 'z':
		z = z + 1
	elif ch is 'n':
		n += 1
res = ['1'] * n + ['0'] * z
print(' '.join(res))


a = int(input())
string = input()
c = string.count('z')
d = string.count('n')
while d > 0:
	print('1 ', end='')
	d -= 1
while c > 0:
	print('0 ', end='')
	c -= 1


import math
import os
import random
import re
import sys
m = int(input())
s = str(input())
ones = s.count('n')
zeros = s.count('z')
ans = ones * ' 1' + zeros * ' 0'
print(ans.lstrip())


_ = input()
s = input()
d = {}
one = 'one'
zero = 'zero'
for i in s:
	d[i] = d.get(i, 0) + 1
m_one = min([d.get(char, 0) for char in one])
d['o'] = max(d.get('o', 0) - m_one, 0)
d['e'] = max(d.get('e', 0) - m_one, 0)
m_zero = min([d.get(char, 0) for char in zero])
print('1 ' * m_one + '0 ' * m_zero)


from collections import Counter
n = int(input())
x = list(str(input()))
k = Counter(x)
a = k['n']
b = k['z']
w = '1 ' * a + '0 ' * b
print(w, end=' ')


n = int(input())
m = input()
e = []
z = []
for i in range(n):
	if m[i] == 'n':
		e.append('1')
	if m[i] == 'z':
		z.append('0')
print(*e, *z)


n = int(input())
s = str(input())
z = 0
o = 0
for i in range(len(s)):
	if s[i] == 'z':
		z = z + 1
	elif s[i] == 'n':
		o = o + 1
for j in range(o):
	print('1', end=' ')
for k in range(z):
	print('0', end=' ')


n = int(input())
s = input()
l = {i: s.count(i) for i in set(list(s))}
p = min(l.get('o', 0), l.get('n', 0), l.get('e', 0))
k = max(0, min(l.get('z', 0), l.get('e', 0) - p, l.get('r', 0), l.get('o') - p))
x = ['1'] * p + ['0'] * k
print(' '.join(x))


from collections import defaultdict
n = int(input())
d = defaultdict(int)
s = input()
for x in s:
	d[x] += 1
arr = [0] * 10
arr[0] = d['z']
arr[2] = d['w']
arr[4] = d['u']
arr[6] = d['x']
arr[8] = d['g']
arr[5] = d['f'] - arr[4]
arr[7] = d['v'] - arr[5]
arr[3] = d['h'] - arr[8]
arr[1] = d['o'] - arr[2] - arr[4] - arr[0]
arr[9] = (d['n'] - arr[7] - arr[1]) // 2
ans = []
for x in range(9, -1, -1):
	for y in range(arr[x]):
		ans += [x]
print(*ans)


n = int(input())
s = input()
a = s.count('n')
b = s.count('z')
s1 = '1' * a
s2 = '0' * b
res = s1 + s2
for i in res:
	print(i, end=' ')


n = int(input())
lettres = input()
print('1 ' * lettres.count('n') + '0 ' * lettres.count('z'))


def main():
	len_of_line = int(input())
	line = input()
	amount_of_z = line.count('z')
	len_of_line -= amount_of_z * 4
	for i in range(len_of_line // 3):
		print(1, end=' ')
	for i in range(amount_of_z):
		print(0, end=' ')
main()


def num_search(n: int, s: str):
	counter = 0
	list_1 = []
	for i in range(len(s)):
		if s[i] == 'z':
			n -= 4
			counter += 1
	k = n // 3
	return ' '.join(k * ['1'] + counter * ['0'])
print(num_search(int(input()), input()))


n = int(input())
s = input()
o = s.count('o')
m = s.count('n')
e = s.count('e')
z = s.count('z')
r = s.count('r')
a = min(o, m, e)
b = min(z, e - a, r, o - a)
print('1 ' * a + '0 ' * b)


n = int(input())
s = list(input())
s.sort()
l = []
o = s.count('o')
n = s.count('n')
e = s.count('e')
z = s.count('z')
r = s.count('r')
l.append(o)
l.append(n)
l.append(e)
one = min(l)
l = []
l.append(z)
l.append(e - one)
l.append(r)
l.append(o - one)
zero = min(l)
l = []
for i in range(one):
	l.append(1)
for i in range(zero):
	l.append(0)
print(*l)


n = int(input())
s = input()
a = s.count('n')
b = s.count('z')
s1 = '1' * a + '0' * b
l = list(s1)
print(' '.join(map(str, l)))


(a, b) = (int(input()), input())
x = b.count('n')
y = b.count('z')
print(x * '1 ' + y * '0 ')


input()
thing = input()
num_z = thing.count('r')
num_o = thing.count('e') - num_z
res = ''
for i in range(num_o):
	res += '1 '
for i in range(num_z):
	res += '0 '
print(res[:-1])


length = int(input())
string = input()
z = 0
n = 0
while length >= 1:
	length = length - 1
	if string[length] == 'z':
		z = z + 1
	elif string[length] == 'n':
		n = n + 1
print('1 ' * n + '0 ' * z)


n = int(input())
s = input()
freq = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for c in s:
	freq[c] += 1
o = ''
o += '1 ' * freq['n']
o += '0 ' * freq['z']
print(o)


n = int(input())
cards = input()
d = dict()
ones = ''
zeros = ''
for i in cards:
	if i in d:
		d[i] += 1
	else:
		d[i] = 1
if 'n' in d:
	ones = d['n'] * '1'.split()
if 'z' in d:
	zeros = d['z'] * '0'.split()
print((' '.join(ones) + ' ' + ' '.join(zeros)).strip())


n = int(input())
s = list(input())
a = s.count('n')
n = (n - 3 * a) // 4
print('1 ' * a + '0 ' * n)


_ = int(input())
keyword = input()
z = keyword.count('z')
n = keyword.count('n')
print(*list(n * '1'), *list(z * '0'))


N = int(input())
string = input()
n_zero = string.count('z')
n_one = (N - string.count('z') * 4) // 3
ans = ''
for i in range(n_one):
	ans = ans + '1 '
for i in range(n_zero):
	ans = ans + '0 '
print(ans)


n = int(input())
s = input().strip()
dic = {}
for i in range(n):
	if s[i] not in dic:
		dic[s[i]] = 1
		continue
	dic[s[i]] += 1
e = dic.get('e', 0)
r = dic.get('r', 0)
n = dic.get('n', 0)
o = dic.get('o', 0)
z = dic.get('z', 0)
tmp1 = min(e, r, z, o)
tmp2 = min(o - tmp1, n, e - tmp1)
for j in range(tmp2):
	print(1, ' ')
for k in range(tmp1):
	print(0, ' ')


import collections, heapq, bisect, math

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

def solve(s):
	count = collections.Counter(s)
	out = ['1'] * count['n'] + ['0'] * count['z']
	return ' '.join(out)
q = 1
tests = []
for test in range(1):
	n = input()
	s = input()
	print(solve(s))


n = int(input())
a = list(input())
d = dict()
d['z'] = 0
d['e'] = 0
d['r'] = 0
d['o'] = 0
d['n'] = 0
for i in a:
	d[i] += 1
o = min(d['o'], d['n'], d['e'])
if o == 0:
	o = -1
else:
	d['o'] -= o
	d['n'] -= o
	d['e'] -= o
z = min(d['z'], d['e'], d['r'], d['o'])
if z == 0:
	z = -1
if o != -1:
	print('1 ' * o, end='')
if z != -1:
	print('0 ' * z)


n = int(input())
a = input()
b = 0
c = 0
for i in range(n):
	if a[i] == 'n':
		b = b + 1
	elif a[i] == 'z':
		c = c + 1
d = [1] * b
e = [0] * c
d = d + e
print(*d)


n = int(input())
inputstring = input()
inputlist = list(inputstring)
outputlist = []
inputlist.sort()
outputlist.append('1 ' * inputlist.count('n'))
outputlist.append('0 ' * inputlist.count('z'))
print(''.join(outputlist))


n = int(input(''))
s = input('')
n_counter = 0
o_counter = 0
z_counter = 0
e_counter = 0
r_counter = 0
ans = []
for i in s:
	if i == 'n':
		n_counter += 1
	elif i == 'o':
		o_counter += 1
	elif i == 'z':
		z_counter += 1
	elif i == 'e':
		e_counter += 1
	elif i == 'r':
		r_counter += 1
if z_counter != 0 and r_counter != 0 and (e_counter != 0) and (o_counter != 0):
	for i in range(min([z_counter, r_counter, e_counter, o_counter])):
		ans.append(0)
		z_counter -= 1
		e_counter -= 1
		r_counter -= 1
		o_counter -= 1
if o_counter != 0 and n_counter != 0 and (e_counter != 0):
	for i in range(min([o_counter, n_counter, e_counter])):
		ans.append(1)
ans = sorted(ans, reverse=True)
print(*ans)


n = int(input())
s = input()
nz = s.count('z')
ne = s.count('e')
nr = s.count('r')
no = s.count('o')
nn = s.count('n')
ne = s.count('e')
mino = 0
noo = False
if nn < ne and nn < no:
	mino = nn
elif ne < no:
	mino = ne
else:
	mino = no
	noo = True
for i in range(0, mino):
	print('1 ', end='')
minz = 0
if noo:
	no = mino - no
	if nz < no and nz < nr and (nz < ne):
		minz = nz
	elif ne < nr and ne < no:
		minz = ne
	elif nr < no:
		minz = nr
	else:
		minz = no
for i in range(0, minz):
	print('0 ', end='')
else:
	if nz < no and nz < nr and (nz < ne):
		minz = nz
	elif ne < nr and ne < no:
		minz = ne
	elif nr < no:
		minz = nr
	else:
		minz = no
for i in range(0, minz):
	print('0 ', end='')


a = int(input())
ls = input()
ones = 0
zeros = 0
for i in range(len(ls)):
	if ls[i] == 'n':
		ones += 1
	elif ls[i] == 'z':
		zeros += 1
for i in range(ones):
	print(1, end=' ')
for i in range(zeros):
	print(0, end=' ')


n = int(input())
s = input()
o = n = e = z = r = 0
CountOne = 0
CountZero = 0
for i in s:
	if i == 'o':
		o += 1
	if i == 'n':
		n += 1
	if i == 'e':
		e += 1
	if i == 'z':
		z += 1
	if i == 'r':
		r += 1
while o >= 1 and n >= 1 and (e >= 1):
	CountOne += 1
	o -= 1
	n -= 1
	e -= 1
while z >= 1 and e >= 1 and (r >= 1) and (o >= 1):
	CountZero += 1
	z -= 1
	e -= 1
	r -= 1
	o -= 1
s2 = ''
for i in range(CountOne):
	s2 += '1'
for i in range(CountZero):
	s2 += '0'
for i in s2:
	print(i, end=' ')


var = input()
st = input()
one = st.count('n')
zero = st.count('z')
print('1 ' * one + '0 ' * zero)


import sys
from collections import defaultdict
input = lambda : sys.stdin.readline().rstrip()
n = int(input())
s = input()
d = defaultdict(int)
one = s.count('n')
zero = s.count('z')
for i in range(one):
	print('1', end=' ')
for i in range(zero):
	print('0', end=' ')


n = int(input())
cart = input()
cdic = {}
cdic['z'] = 0
cdic['e'] = 0
cdic['r'] = 0
cdic['o'] = 0
cdic['n'] = 0
num = []
for c in cart:
	cdic[c] += 1
ones = cdic['e'] - cdic['z']
zeros = cdic['z']
for i in range(ones):
	print(1, end=' ')
for i in range(zeros):
	print(0, end=' ')


a = input()
string = input()
out = ''
n_cnt = 0
z_cnt = 0
for ch in string:
	if ch == 'n':
		n_cnt += 1
	elif ch == 'z':
		z_cnt += 1
flag = True
for _ in range(n_cnt):
	if flag:
		out += '1'
		flag = False
	else:
		out += ' 1'
for _ in range(z_cnt):
	if flag:
		out += '0'
		flag = False
	else:
		out += ' 0'
print(out)


mod = 10 ** 9 + 7
from sys import stdin, stdout
import bisect
from bisect import bisect_left as bl
from bisect import bisect_right as br
import itertools
import collections
import math
import heapq
from random import randint as rn

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

def ncr(n, r, p):
	t = fact[n] * (ifact[r] * ifact[n - r] % p) % p
	return t

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

def sin():
	return input()

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

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

def main():
	t = int(input())
	s = sin()
	a = []
	for i in s:
		if i == 'n':
			a.append(1)
		if i == 'z':
			a.append(0)
	a = sorted(a, reverse=True)
	print(*a, sep=' ')
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')
main()


N = int(input())
line = input()
ones = line.count('o') - line.count('z')
zeros = line.count('z')
for _ in range(ones):
	print('1', end=' ')
for _ in range(zeros):
	print('0', end=' ')


a = int(input())
b = input()
c = ''
k = ''
p = 0
y = []
m = ''
while p != a:
	p += 1
	for i in b:
		if i == 'n':
			c += '1'
			b = b.replace('n', '', 1)
			b = b.replace('o', '', 1)
			b = b.replace('e', '', 1)
		elif i == 'z':
			c += '0'
			b = b.replace('z', '', 1)
			b = b.replace('e', '', 1)
			b = b.replace('r', '', 1)
			b = b.replace('o', '', 1)
for j in c:
	y.append(j)
y.sort(reverse=True)
m = ' '.join(y)
print(m)


n = int(input())
s = input()
countOne = s.count('n')
countZero = s.count('z')
res = '1 ' * countOne + '0 ' * countZero
print(res)


n = int(input())
s = input()
countOne = 0
countZero = 0
for i in s:
	if i == 'z':
		countZero += 1
	elif i == 'n':
		countOne += 1
result = '1 ' * countOne + '0 ' * countZero
print(result)


t = int(input())
s = input()
z = s.count('z')
e = s.count('e')
r = s.count('r')
o = s.count('o')
n = s.count('n')
one = zero = 0
while o > 0 and n > 0 and (e > 0):
	one += 1
	o -= 1
	n -= 1
	e -= 1
while z > 0 and r > 0 and (e > 0) and (o > 0):
	zero += 1
	o -= 1
	z -= 1
	e -= 1
	r -= 1
print('1 ' * one, end='')
print('0 ' * zero, end='')


n = int(input())
lettrs = input()
n_zeros = lettrs.count('z')
n_ones = lettrs.count('n')
print(('1 ' * n_ones + '0 ' * n_zeros).strip())


n = int(input())
str = input()
one = str.count('n')
zero = str.count('z')
print('1 ' * one + '0 ' * zero)


(n, a) = (int(input()), input())
(x, y) = (a.count('z'), a.count('n'))
print(('1' * y + '0' * x).replace('', ' ')[1:-1])


from __future__ import print_function
n = input()
word = input()
word = [x for x in word]
h = {}
for i in word:
	if i in h:
		h[i] += 1
	else:
		h[i] = 1
if 'n' in h:
	for i in range(0, h['n']):
		print('1 ', end='')
if 'z' in h:
	for i in range(0, h['z']):
		print('0 ', end='')
print()


num = int(input(''))
string = input('')
if num == len(string):
	zero = string.count('z')
	one = string.count('n')
	for i in range(one):
		print('1 ', end='')
	for i in range(zero):
		print('0 ', end='')


n = int(input())
s = input().strip()
c1 = 0
c2 = 0
for i in s:
	if i == 'z':
		c1 += 1
	elif i == 'n':
		c2 += 1
s1 = [1] * c2 + [0] * c1
for k in s1:
	print(k, end=' ')


import sys
input()
i = input()
r = ' '.join(('1' for _ in range(i.count('n'))))
r += ' ' + ' '.join(('0' for _ in range(i.count('r'))))
print(r)


S = ''
n = int(input())
zero = one = 0
a = []
a = input()
for i in range(n):
	if a[i] == 'z':
		zero += 1
	elif a[i] == 'n':
		one += 1
sum = zero + one
rez = 0
for i in range(one, 0, -1):
	S += '1'
	S += ' '
for i in range(zero, 0, -1):
	S += '0'
	S += ' '
print(S)


n = int(input())
s = list(input())
b = list()
for a in s:
	if a == 'z':
		b += '0'
	if a == 'n':
		b += '1'
b.sort(reverse=True)
print(' '.join(b))


n = int(input())
card = input()
zc = 0
oc = 0
for i in card:
	if i == 'z':
		zc += 1
	elif i == 'n':
		oc += 1
print(*[1] * oc + [0] * zc)


count_of_words = int(input())
word = input()
Zcount = word.count('z')
Ncount = word.count('n')
i = int(0)
for i in range(Ncount):
	print(1, end=' ')
i = int(0)
for i in range(Zcount):
	print(0, end=' ')


c = int(input())
z = 0
o = 0
zero = '0'
one = '1'
x = input()[:c]
li = list(x)
for j in li:
	if j == 'z':
		z += 1
	if j == 'n':
		o += 1
ones = one * o
zeros = zero * z
lio = list(ones)
liz = list(zeros)
if z == 0:
	print(*lio)
elif o == 0:
	print(*liz)
else:
	print(*lio, *liz, sep=' ')


n = int(input())
s = input()
cnt = [s.count('z'), s.count('n')]
print('1 ' * cnt[1] + '0 ' * cnt[0])


input()
s = input()
(l, ll) = ([], [])
n = s.count('n')
z = s.count('z')
l = [1] * n
ll = [0] * z
print(*l + ll)


def inp_n():
	return int(input())

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

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

def is_odd(n):
	if n & 1:
		return True
	return False
n = inp_n()
v = input()
hmap = {}
for el in ('z', 'e', 'r', 'o', 'n'):
	hmap[el] = 0
for el in v:
	hmap[el] += 1
one = hmap['n']
zero = hmap['z']
l = []
for i in range(one):
	l.append(1)
for i in range(zero):
	l.append(0)
print(*l)


n = int(input())
st = input()
n_num = st.count('n')
z_num = st.count('z')
s = ''
for i in range(n_num):
	s += '1 '
for j in range(z_num):
	s += '0 '
print(s)


n = int(input())
cards = list(input())
ans = ''
o = cards.count('o')
e = cards.count('e')
r = cards.count('r')
n = cards.count('n')
z = cards.count('z')
ans += '1' * n
ans += '0' * min(z, r)
ans = ' '.join(list(ans))
print(ans)


class Numero:

	def __init__(self, string):
		self.qtd_z = string.count('z')
		self.qtd_n = string.count('n')
n = int(input())
string = Numero(input())
ans = '1' * string.qtd_n + '0' * string.qtd_z
print(' '.join(ans))


n = input()
word = input()
countn = 0
countz = 0
for i in range(len(word)):
	if word[i] == 'z':
		countz = countz + 1
	elif word[i] == 'n':
		countn = countn + 1
out = list()
while countn >= 1:
	out.append('1')
	countn = countn - 1
while countz >= 1:
	out.append('0')
	countz = countz - 1
z = ' '.join(out)
print(z)


from collections import Counter
input()
myCounter = Counter(str(input()))
result = [str(1) for _ in range(myCounter['n'])] + [str(0) for _ in range(myCounter['z'])]
print(' '.join(result))


from datetime import date
from math import factorial
import functools
from heapq import *
from collections import deque
import collections
import math
from collections import defaultdict, Counter
import sys
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7
inf = float('inf')

def main():
	n = int(input())
	s = list(input())
	d = Counter(s)
	ans = []
	while True:
		if d['n'] > 0:
			ans.append(1)
			d['n'] -= 1
		elif d['n'] == 0 and d['r'] > 0:
			ans.append(0)
			d['r'] -= 1
		else:
			break
	print(*ans)
main()


nz = 0
no = 0
nn = 0
ne = 0
nr = 0
N = int(input())
str1 = input()
for i in range(len(str1)):
	if str1[i] == 'n':
		nn += 1
	if str1[i] == 'r':
		nr += 1
noofzero = nr
noofone = nn
for i in range(noofone):
	print('1 ', end='')
for i in range(noofzero):
	print('0 ', end='')
print()


n = int(input())
s = input()
z = 0
m = 0
for i in range(n):
	if s[i] == 'z':
		z = z + 1
	elif s[i] == 'n':
		m = m + 1
while m > 0:
	print(f'{1} ')
	m = m - 1
while z > 0:
	print(f'{0} ')
	z = z - 1


n = input()
t = input()
(c, o) = ([t.count('z'), t.count('e'), t.count('r'), t.count('o'), t.count('n')], [0, 0])
while True:
	if c[0] == 0 or c[1] == 0 or c[2] == 0 or (c[3] == 0):
		break
	c[0] -= 1
	c[1] -= 1
	c[2] -= 1
	c[3] -= 1
	o[0] += 1
while True:
	if c[1] == 0 or c[3] == 0 or c[4] == 0:
		break
	c[1] -= 1
	c[3] -= 1
	c[4] -= 1
	o[1] += 1
print(('1 ' * o[1] + '0 ' * o[0]).rstrip())


test = int(input())
s = input()
(o, n, e, z, r) = (0, 0, 0, 0, 0)
for i in range(len(s)):
	if s[i] == 'o':
		o += 1
	if s[i] == 'n':
		n += 1
	if s[i] == 'e':
		e += 1
	if s[i] == 'z':
		z += 1
	if s[i] == 'r':
		r += 1
while True:
	if o > 0 and n > 0 and (e > 0):
		print('1', end=' ')
		o -= 1
		n -= 1
		e -= 1
		continue
	elif z > 0 and r > 0:
		print('0', end=' ')
		z -= 1
		r -= 1
		continue
	else:
		break


import math
import cmath
from decimal import *
from fractions import *
m = int(input())
n = e = o = z = r = 0
s = input()
for x in s:
	if x == 'n':
		n += 1
	elif x == 'e':
		e += 1
	elif x == 'o':
		o += 1
	elif x == 'z':
		z += 1
	elif x == 'r':
		r += 1
so1 = min(min(e, o), n)
so0 = min(min(e, o) - so1, min(z, r))
for _ in range(so1):
	print('1', end=' ')
for _ in range(so0):
	print('0', end=' ')


def frequency(str):
	freq = {}
	for i in str:
		if i in freq:
			freq[i] += 1
		else:
			freq[i] = 1
	return freq
n = int(input())
s = input()
d = frequency(s)
a = d.get('z')
b = d.get('n')
if b != None:
	for i in range(b):
		(print(1, end=' '),)
if a != None:
	for j in range(a):
		print(0, end=' ')


n = int(input())
s = input()
count_zero = 0
count_one = 0
for S in s:
	if S == 'n':
		count_one += 1
	elif S == 'z':
		count_zero += 1
one = '1 ' * count_one
zero = '0 ' * count_zero
print(one + zero[:-1])


n = int(input())
s = input()
from collections import Counter
c = Counter(s)
t = min(c['o'], c['n'], c['e'])
ans = t * [1]
c['o'] -= t
c['n'] -= t
c['e'] -= t
ans += [0] * min(c['z'], c['e'], c['r'], c['e'])
print(*ans)


from __future__ import division, print_function
import os
import 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
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))
from math import sqrt, floor, factorial, gcd, log
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations
from math import gcd
from bisect import bisect
input = lambda : sys.stdin.readline().rstrip('\r\n')
read = lambda : list(map(int, input().strip().split(' ')))

def solve():
	n = int(input())
	s = input()
	for i in range(s.count('n')):
		print('1', end=' ')
	for i in range(s.count('z')):
		print('0', end=' ')
solve()


n = int(input())
s = input()
zeros = s.count('z')
o_count = s.count('o')
ones = o_count - zeros
num = ''
for _ in range(ones):
	num += '1'
for _ in range(zeros):
	num += '0'
print(' '.join(list(num)))


import sys
from collections import Counter
fin = sys.stdin
fout = sys.stdout
lines = (line.strip() for line in fin)
n = int(next(lines))
letters = next(lines)
counter = Counter(letters)
ones = counter['n']
zeros = counter['z']
output = [1] * ones + [0] * zeros
print(*output, file=fout)


n = int(input())
s = input()
nOne = s.count('n')
nZero = s.count('z')
temp = ['1'] * nOne + ['0'] * nZero
print(*temp)


n = int(input())
input_string = input()
zero_count = 0
for char in input_string:
	if char == 'r':
		zero_count += 1
one_count = int((n - zero_count * 4) / 3)
output = []
for i in range(0, one_count):
	output.append('1 ')
for i in range(0, zero_count):
	output.append('0 ')
print(''.join(output))


n = int(input())
s = input()
(kz, kn) = (0, 0)
for i in s:
	if i == 'n':
		kn += 1
	elif i == 'z':
		kz += 1
print('1 ' * kn + '0 ' * kz)


import math as mt
import sys, string, bisect
input = sys.stdin.readline
import random
from collections import deque, defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
t = I()
s = input().strip()
l = []
l += [1] * s.count('n')
l += [0] * s.count('z')
print(*l)


n1 = int(input())
a = input()
z = a.count('z')
e = a.count('e')
r = a.count('r')
o = a.count('o')
n = a.count('n')
no = ''
m = min(o, n, e)
o = o - m
n = n - m
e = e - m
for x in range(m):
	no += str(1) + ' '
s = min(z, e, r, o)
for x in range(s):
	no += str(0) + ' '
print(no)


length = input()
string = input()
z = 0
n = 0
for i in string:
	if i == 'z':
		z += 1
	elif i == 'n':
		n += 1
result = []
for i in range(0, n):
	result.append('1')
for i in range(0, z):
	result.append('0')
res = ' '.join(result)
print(res)


a = int(input())
string = input()
string = list(string)
(N, Z) = (0, 0)
for i in range(a):
	if string[i] == 'n':
		N = N + 1
	if string[i] == 'z':
		Z = Z + 1
g = 0
while N > 0 or Z > 0:
	if g == 0:
		g = 1
		if N > 0:
			string = '1'
			N = N - 1
		if Z > 0 and N == 0:
			string = '0'
			Z = Z - 1
	else:
		if N > 0:
			string = string + ' ' + '1'
			N = N - 1
		if Z > 0 and N == 0:
			string = string + ' ' + '0'
			Z = Z - 1
print(string)


from sys import stdin
N = int(stdin.readline())
s = stdin.readline().rstrip()
d = {}
for i in s:
	if i in d:
		d[i] += 1
	else:
		d[i] = 1
num_z = 0
num_o = 0
if 'z' in d:
	num_z = d['z']
if 'n' in d:
	num_o = d['n']
print('1 ' * num_o + '0 ' * num_z)


from itertools import combinations
n = int(input())
s = list(input())
a = []
for i in s:
	if i == 'n':
		a.append('1')
	elif i == 'z':
		a.append('0')
a.sort(reverse=True)
print(' '.join(a))


n = int(input())
a = str(input())
B = list()
C = list()
for i in range(0, n):
	if a[i] == 'z':
		B.append(0)
	elif a[i] == 'n':
		C.append(1)
print(*C, *B, sep=' ')


n = int(input())
s = input()
a = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for i in s:
	a[i] += 1
print(*list(a['n'] * '1'), *list(a['z'] * '0'), sep=' ')


num = int(input())
s = input().lower()
a = s.count('n')
b = s.count('z')
c = '1' * a + '0' * b
print(' '.join(c))


n = int(input())
s = input()
zeroes = 0
ones = 0
for i in s:
	if i == 'z':
		zeroes += 1
	elif i == 'n':
		ones += 1
print(' '.join('1' * ones + '0' * zeroes))


n = int(input())
A = input()
a = []
for i in A:
	a.append(i)
k1 = a.count('n')
k0 = a.count('z')
for i in range(k1):
	print(1, end=' ')
for i in range(k0):
	print(0, end=' ')


n = int(input())
s = input()
cn = 0
for i in s:
	if i == 'n':
		cn += 1
cz = (n - cn * 3) // 4
for i in range(cn):
	print(1, end=' ')
for i in range(cz):
	print(0, end=' ')


m = int(input())
s = input()
dct = {'n': 0, 'z': 0, 'e': 0, 'r': 0, 'o': 0}
for i in range(m):
	dct[s[i]] += 1
while dct['n'] > 0:
	flag = 1
	if dct['o'] > 0:
		flag = 1
	else:
		flag = 0
		break
	if dct['e'] > 0:
		flag = 1
	else:
		flag = 0
		break
	if flag == 1:
		dct['o'] -= 1
		dct['n'] -= 1
		dct['e'] -= 1
		print(1, ' ', end='')
min = dct['e']
if min < dct['o']:
	min = dct['o']
if min < dct['z']:
	min = dct['z']
if min < dct['r']:
	min = dct['r']
for i in range(min):
	print(0, ' ', end='')


num = int(input())
letters = str(input())
onecounter = 0
zerocounter = 0
for i in range(0, len(letters)):
	if letters[i] == 'n':
		onecounter = onecounter + 1
	elif letters[i] == 'z':
		zerocounter = zerocounter + 1
for i in range(0, onecounter):
	print('1', end=' ')
for i in range(0, zerocounter):
	print('0', end=' ')


n = int(input())
s = input()
quant_n = 0
for i in range(n):
	if s[i] == 'n':
		quant_n += 1
for i in range(quant_n):
	print(1, end=' ')
	n -= 3
for i in range(n // 4):
	print(0, end=' ')


input()
a = input()
print(('1 ' * (a.count('e') - a.count('r')) + '0 ' * a.count('r'))[:-1])


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

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

def F():
	return float(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def summarizeList(l):
	sl = sorted(l)
	a = sl[0]
	c = 1
	res = []
	for x in sl[1:]:
		if x == a:
			c += 1
		else:
			res.append([a, c])
			a = x
			c = 1
	res.append([a, c])
	return res

def main():
	n = I()
	l = list(S())
	l = summarizeList(l)
	one_num = zero_num = 0
	for (x, c) in l:
		if x == 'n':
			one_num = c
		elif x == 'z':
			zero_num = c
	a = ['1'] * one_num
	b = ['0'] * zero_num
	return ' '.join(a) + ' ' + ' '.join(b)
print(main())


n = int(input())
word = input()
count_z = 0
if 'z' in word:
	count_z = int(word.count('z'))
count_one = 0
if len(word) > count_z:
	count_one = (len(word) - count_z * 4) / 3
	count_one = int(count_one)
result = []
if count_one:
	for i in range(count_one):
		result.append(1)
if count_z:
	for i in range(count_z):
		result.append(0)
print(*result, sep=' ')


n = int(input())
a = input()
from collections import Counter
c = Counter(a)
r = c['r']
o1 = c['o'] - r
for i in range(o1):
	print(1, end=' ')
for i in range(r):
	print(0, end=' ')


string_length = int(input())
string = input()
ones = 0
for character in string:
	if character == 'n':
		ones += 1
zeros = int((string_length - ones * 3) / 4)
number = ['1' for _ in range(ones)] + ['0' for _ in range(zeros)]
number = ' '.join(number)
print(number)


n = int(input())
string = input()
zeros = (n - string.count('n') * 3) // 4
for i in range(string.count('n')):
	print(1, end=' ')
for i in range(zeros):
	print(0, end=' ')


n = int(input())
s1 = input()
if n != len(s1):
	print('error')
else:
	one = s1.count('n')
	zero = s1.count('z')
	for i in range(one):
		print('1', end=' ')
	for j in range(zero):
		print('0', end=' ')


n = int(input())
s = input()
c1 = s.count('n')
c2 = s.count('z')
ans = ''
for i in range(c1):
	ans += '1' + ' '
for y in range(c2):
	ans += '0' + ' '
print(ans)


n = int(input())
s = input()
a = 0
for i in range(0, n):
	if s[i] == 'z':
		a = a + 1
b = (n - 4 * a) // 3
c = a + b
for i in range(0, c):
	if b > 0:
		print(1, end=' ')
		b = b - 1
	elif a > 0:
		print(0, end=' ')
		a = a - 1


from sys import stdin
from collections import deque
from math import sqrt, floor, ceil, log, log2, log10, pi

def ii():
	return int(stdin.readline())

def fi():
	return float(stdin.readline())

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

def fmi():
	return map(float, stdin.readline().split())

def li():
	return [x for x in mi()]

def si():
	return stdin.readline()
n = ii()
a = si()
o = a.count('n')
z = a.count('z')
while o:
	print(1, end=' ')
	o -= 1
while z:
	print(0, end=' ')
	z -= 1


n = int(input())
letters = input()
charCount = dict()
charCount['n'] = 0
charCount['z'] = 0
for letter in letters:
	if letter == 'n':
		charCount['n'] += 1
	elif letter == 'z':
		charCount['z'] += 1
ones = charCount['n']
zeros = charCount['z']
output = ''
for i in range(ones):
	output += '1 '
for i in range(zeros):
	output += '0 '
print(output)


def read(t=int):
	return list(map(t, input().strip().split(' ')))
q = read()[0]
s = read(str)[0]
z = s.count('z')
n = s.count('n')
ans = [1 for i in range(n)] + [0 for i in range(z)]
ans = [str(i) for i in ans]
print(' '.join(ans))


a = int(input())
b = input()
(o, z) = (0, 0)
for i in b:
	if i == 'n':
		o += 1
	elif i == 'z':
		z += 1
	else:
		continue
print('1 ' * o + '0 ' * z)


import sys
input = sys.stdin.readline
n = int(input())
s = input()
z = s.count('z')
e = s.count('e')
r = s.count('r')
o = s.count('o')
n = s.count('n')
cnt_one = min((o, n, e))
cnt_zero = min((z, e, r, o))
max_len = max((cnt_one + cnt_zero, e, o))
if max_len == cnt_one + cnt_zero:
	print(*[1] * cnt_one, *[0] * cnt_zero)
else:
	print(*[1] * max_len)


n = int(input())
s = input()
ans = ''
k = 0
t = 0
for i in range(n):
	if s[i] == 'n':
		k += 1
	if s[i] == 'z':
		t += 1
ans = k * '1' + t * '0'
print(' '.join(ans))


x = int(input())
s = input()
z = o = 0
for i in s:
	if i == 'z':
		z += 1
	elif i == 'o':
		o += 1
if z == o:
	print('0 ' * z)
else:
	print('1 ' * (o - z) + '0 ' * z)


string_length = int(input())
string = input()
dictionary = {'o': 0, 'n': 0, 'e': 0, 'z': 0, 'r': 0}
for i in string:
	dictionary[i] += 1
answer = ''
for i in range(dictionary['n']):
	answer += '1 '
for i in range(dictionary['z']):
	answer += '0 '
print(answer)


t = int(input())
s = input()
n = s.count('n')
o = s.count('o')
print('1 ' * n + '0 ' * (o - n))


n = int(input())
string = input()
(z, e, r, o, n) = (0, 0, 0, 0, 0)
(one, zero) = (0, 0)
for i in string:
	if i == 'z':
		z += 1
	elif i == 'e':
		e += 1
	elif i == 'r':
		r += 1
	elif i == 'o':
		o += 1
	elif i == 'n':
		n += 1
one += min(o, n, e)
o -= min(o, n, e)
n -= min(o, n, e)
e -= min(o, n, e)
zero += min(z, e, r, o)
res = []
for _ in range(one):
	res.append(1)
for _ in range(zero):
	res.append(0)
print(*res)


n = int(input())
s = input()
ones = s.count('n')
zeros = s.count('z')
arr = []
arr += ['1'] * ones
arr += ['0'] * zeros
print(*arr)


n = int(input())
cards = input()
one_amount = 0
zero_amount = 0
for card in cards:
	if card == 'n':
		one_amount += 1
	elif card == 'z':
		zero_amount += 1
print('1 ' * one_amount + '0 ' * zero_amount)


n = int(input())
s = input()
cnt_0 = s.count('z')
cnt_1 = s.count('n')
if cnt_1 > 0:
	print('1 ' * cnt_1, end=' ')
if cnt_0 > 0:
	print('0 ' * cnt_0, end=' ')
print('')


n = int(input())
sentence = input()
sum_n = 0
sum_z = 0
for i in sentence:
	if i == 'z':
		sum_z += 1
	elif i == 'n':
		sum_n += 1
print('1 ' * sum_n + '0 ' * sum_z)


n = int(input())
line = input()
list = [0, 0, 0, 0, 0]
for character in line:
	if character == 'o':
		list[0] = list[0] + 1
	elif character == 'n':
		list[1] = list[1] + 1
	elif character == 'e':
		list[2] = list[2] + 1
	elif character == 'z':
		list[3] = list[3] + 1
	elif character == 'r':
		list[4] = list[4] + 1
one = min(list[0], list[1], list[2])
list[0] = list[0] - one
list[1] = list[1] - one
list[2] = list[2] - one
zero = min(list[3], list[4], list[0], list[2])
for step in range(one):
	print('1 ', end='')
for step in range(zero):
	print('0 ', end='')
print('')


input()
s = input()
count_one = s.count('n')
count_zero = s.count('z')
print('1 ' * count_one + '0 ' * count_zero)


cnt = 0
cnt1 = 0
k = int(input())
n = input()
for x in n:
	if x == 'z':
		cnt += 1
	elif x == 'n':
		cnt1 += 1
for i in range(cnt1):
	print(1, end=' ')
for i in range(cnt):
	print(0, end=' ')


from collections import Counter as c
n = int(input())
str1 = input()
g = c(str1)
value = g['n']
value1 = g['z']
list1 = ['1'] * value + ['0'] * value1
print(' '.join(list1))


n = int(input())
s = list(str(input()))
q = []
ss = set(s)
for i in range(s.count('o') - s.count('z')):
	print('1', end=' ')
for i in range(s.count('z')):
	print('0', end=' ')


n = int(input())
s = list(input())
a = ''
n1 = s.count('n')
r = s.count('r')
e = s.count('e')
o = s.count('o')
z = s.count('z')
m = min(n1, e)
m = min(m, o)
while m > 0:
	m -= 1
	a += '1 '
	e -= 1
	o -= 1
	n -= 1
m = min(z, o)
m = min(m, e)
m = min(m, r)
while m > 0:
	m -= 1
	a += '0 '
print(a)


k = int(input())
s = input()
d = {'n': 0, 'z': 0}
l = []
for i in range(k):
	if s[i] == 'n' or (s[i] == 'z' and s[i] in d):
		d[s[i]] += 1
if d['n'] > 0:
	while d['n'] > 0:
		l.append(1)
		d['n'] -= 1
if d['z'] > 0:
	while d['z'] > 0:
		l.append(0)
		d['z'] -= 1
print(*l)


n = int(input())
s = list(input())
my_dict = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
for x in s:
	my_dict[x] += 1
one = min(my_dict['o'], my_dict['n'], my_dict['e'])
zero = min(my_dict['z'], my_dict['r'], my_dict['e'] - one, my_dict['o'] - one)
for i in range(one):
	print(1, end=' ')
for i in range(zero):
	print(0, end=' ')


import sys
from collections import Counter

def main():
	n = int(sys.stdin.readline())
	s = sys.stdin.readline().rstrip()
	c = Counter(s)
	ones = c['n']
	zeros = c['z']
	l = ['1'] * ones
	l.extend(['0'] * zeros)
	print(' '.join(l))
main()


n = int(input())
s = input()
one = 0
for i in s:
	if i == 'n':
		one += 1
zero = (len(s) - one * 3) // 4
print('1 ' * one + '0 ' * zero)


n = int(input())
x = input()
z = x.count('z')
n = x.count('n')
for i in range(n):
	print('1', end=' ')
for j in range(z):
	if j == z - 1:
		print('0')
		break
	print('0', end=' ')
if z == 0 and n == 0:
	print('0')


a = int(input())
c1 = 0
c2 = 0
for i in input():
	if i == 'z':
		c2 += 1
	elif i == 'n':
		c1 += 1
for i in range(c1):
	print('1 ', end='')
for i in range(c2):
	print('0 ', end='')


n = int(input())
s = input()
n = 0
z = 0
for i in s:
	if i == 'n':
		n += 1
	if i == 'z':
		z += 1
t = n + z
while n:
	if n - 1 != 0:
		print(1, end=' ')
	elif z != 0:
		print(1, end=' ')
	else:
		print(1)
	n -= 1
while z:
	if z - 1 != 0:
		print(0, end=' ')
	else:
		print(0)
	z -= 1


x = int(input())
y = input()
z = 0
coutz = 0
coutn = 0
while z < x:
	if y[z] == 'z':
		coutz += 1
	if y[z] == 'n':
		coutn += 1
	z += 1
while coutn:
	print('1', end=' ')
	coutn -= 1
while coutz:
	print('0', end=' ')
	coutz -= 1


n = int(input())
cards = input()
output = []
for char in cards:
	if char == 'n':
		output.append('1')
	elif char == 'z':
		output.append('0')
output = ' '.join(sorted(output, reverse=True))
print(output)


n = int(input())
st = list(input())
c_n = st.count('n')
c_z = st.count('z')
lp = []
for _ in range(c_n):
	lp.append(1)
for _ in range(c_z):
	lp.append(0)
print(*lp, sep=' ')


size = int(input())
cards = input()
ones = cards.count('n')
zeros = cards.count('z')
binary = '1' * ones + '0' * zeros
for i in binary:
	print(i, end=' ')


line = int(input())
s = input()
z = 0
n = 0
maxbin = ''
for i in s:
	if i == 'n':
		z += 1
	elif i == 'z':
		n += 1
for i in range(z):
	maxbin += '1 '
for i in range(n):
	maxbin += '0 '
maxbin = maxbin[:-1]
print(maxbin)


import sys
from collections import defaultdict, deque
from math import sqrt

def input():
	return sys.stdin.readline()[:-1]
n = int(input())
s = input()
print('1 ' * s.count('n') + '0 ' * s.count('z'))


n = int(input())
s = list(input())
cntone = s.count('n')
cntzero = s.count('z')
s = []
for i in range(cntone):
	s.append(1)
for i in range(cntzero):
	s.append(0)
print(*s)


def get_int_input():
	return int(input())

def get_string_input():
	return input()

def main():
	n = get_int_input()
	zeros = get_string_input()
	z = zeros.count('z')
	ones = int((n - 4 * z) / 3)
	output = ''
	for i in range(ones):
		if i == 0:
			output += '1'
		else:
			output += ' 1'
	for j in range(z):
		if ones == 0 and j == 0:
			output += '0'
		else:
			output += ' 0'
	print(output)
main()


n = int(input())
s = input()
ans = []
for i in range(s.count('z')):
	ans.append(0)
for j in range(s.count('n')):
	ans.append(1)
ans.sort(reverse=True)
print(*ans)


N = int(input())
S = input()
C = {}
for c in S:
	C[c] = C.get(c, 0) + 1
ans = [1] * C.get('n', 0) + [0] * C.get('z', 0)
print(*ans)


from math import *
from sys import *
from collections import defaultdict
import os, sys
from io import IOBase, BytesIO
M = 10 ** 9 + 7

def pow(a, b):
	res = 1
	while b > 0:
		if b & 1:
			res *= a
		a *= a
		b >>= 1
	return res

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

def inv(a, m):
	return powmod(a, m - 2, m)

def factor(n):
	potentional_p = 3
	itog_list = {}
	if n % 2 == 0:
		itog_list[2] = 0
	while n % 2 == 0:
		n = n // 2
		itog_list[2] += 1
	while n - 1:
		if potentional_p > n ** 0.5:
			if n in itog_list:
				itog_list[n] += 1
			else:
				itog_list[n] = 1
			return itog_list
		while n % potentional_p == 0:
			n = n // potentional_p
			if potentional_p in itog_list:
				itog_list[potentional_p] += 1
			else:
				itog_list[potentional_p] = 1
		potentional_p += 2
	return itog_list

def main():
	t = int(input())
	a = input()
	zero = a.count('z')
	one = a.count('n')
	arr = [1] * one + [0] * zero
	print(*arr)
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
		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')
main()


len_w = int(input())
word = str(input())
l_z = word.count('z')
l_n = word.count('n')
if l_z >= 1:
	if l_n == 0:
		print(('0 ' * l_z).strip())
	if l_n >= 1:
		print((' 1' * l_n).strip(), ('0 ' * l_z).strip())
else:
	print((' 1' * l_n).strip())


input()
a = input()
result = ''
for i in range(0, a.count('n')):
	result += ' 1'
for i in range(0, a.count('z')):
	result += ' 0'
print(result)


n = input()
s = input()
d = {}
for i in s:
	if i not in d:
		d[i] = 1
	else:
		d[i] += 1
if 'z' in d:
	c1 = d['o'] - d['z']
	c0 = d['z']
else:
	c1 = d['o']
	c0 = 0
for _ in range(c1):
	print('1', end=' ')
for _ in range(c0):
	print('0', end=' ')


a = int(input())
b = str(input())
c = ([1] * (b.count('o') - b.count('z')), [0] * b.count('z'))
print(*c[0], *c[1])


n = int(input())
l = input()
freq = {}
a = []
for i in l:
	if i in freq:
		freq[i] += 1
	else:
		freq[i] = 1
if 'n' in freq:
	z = freq['n']
	a += ['1'] * z
	freq['o'] -= z
	freq['e'] -= z
if 'z' in freq:
	x = freq['z']
	a += ['0'] * x
	freq['r'] -= x
	freq['e'] -= x
	freq['o'] -= x
print(' '.join(a))


(n, a) = (int(input()), input())
(countZ, countN) = (0, 0)
for i in range(len(a)):
	if a[i] == 'z':
		countZ += 1
	if a[i] == 'n':
		countN += 1
for i in range(countN):
	print(1, end=' ')
for i in range(countZ):
	print(0, end=' ')


number = int(input())
letters = input()
n = letters.count('n')
e = letters.count('e')
o = letters.count('o')
z = letters.count('z')
r = letters.count('r')
mone = min(o, n, e)
n = n - mone
e = e - mone
o = o - mone
mzero = min(z, e, r, o)
print(('1 ' * mone + '0 ' * mzero)[:-1])


def main():
	x = int(input())
	s = input()
	res = ''
	z = s.count('z')
	e = s.count('e')
	r = s.count('r')
	o = s.count('o')
	n = s.count('n')
	min1 = min(n, e, o)
	for i in range(0, min1):
		res += '1 '
	o -= min1
	e -= min1
	zeroes = min(z, e, r, o)
	for i in range(0, zeroes):
		res += '0 '
	print(res)
main()


n1 = int(input())
v = list(input())
n = v.count('n')
z = v.count('z')
one = n
zero = z
for num in range(one):
	print('1', end=' ')
for num1 in range(zero):
	print('0', end=' ')


n = int(input())
s = input()
a = s.count('z')
b = (n - a * 4) // 3
print('1 ' * b + '0 ' * a)


(n, s) = (input(), input())
(ones, zeros) = (s.count('n'), s.count('z'))
print(*[1] * ones, *[0] * zeros)


import sys
input = sys.stdin.readline
N = int(input())
S = input().rstrip()
ones = S.count('n')
zeros = S.count('z')
ans = ['1'] * ones + ['0'] * zeros
print(' '.join(ans))


n = int(input())
a = input()
m = 0
n = 0
i = 0
for i in a:
	p = i
	if p == 'z':
		n = n + 1
	elif p == 'n':
		m = m + 1
	else:
		pass
while m > 0 or n > 0:
	if m > 0:
		print('1', end=' ')
		m = m - 1
		continue
	print('0', end=' ')
	n = n - 1


import sys
import os
from io import IOBase, BytesIO

def main():
	total = int(input())
	s = input()
	cnt = 0
	(o, n) = (0, 0)
	for i in s:
		if i == 'o':
			o += 1
		elif i == 'n':
			n += 1
	for i in range(n):
		print('1', end=' ')
	for i in range(o - n):
		print('0', end=' ')
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):
		py2 = round(0.5)
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2 == 1:
			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))

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

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

def input():
	return sys.stdin.readline().strip()
main()


n = int(input())
l = input()
comp = 0
comp1 = 0
for i in l:
	if i == 'n':
		comp1 += 1
	elif i == 'z':
		comp += 1
print(comp1 * '1 ' + comp * '0 ')


num = int(input())
word = input()
count_Z = word.count('z')
count_E = word.count('e')
count_R = word.count('r')
count_O = word.count('o')
count_N = word.count('n')
one = min(count_O, count_N, count_E)
count_O -= one
count_N -= one
count_E -= one
zero = min(count_Z, count_E, count_R, count_O)
print('1 ' * one, '0 ' * zero, sep='')


length = int(input())
string = list(input())
l = []
count = 0
a = string.count('n')
for i in range(a):
	print(1, end=' ')
a = string.count('z')
for i in range(a):
	print(0, end=' ')


n = int(input(''))
a = input('')
z = 0
for c in a:
	if c == 'z':
		z = z + 1
n = n - 4 * z
o = n // 3
for i in range(o):
	print('1', end=' ')
for j in range(z):
	print('0', end=' ')


n = int(input())
n1 = input()
s = n1[:n]
one = s.count('n')
zero = s.count('z')
j = '1' * one
k = '0' * zero
w = j + k
print(' '.join(w))


k = input()
n = input()
n = list(n)
l = []
m = ['n', 'z']
for i in n:
	if i == m[0]:
		l.append(1)
	elif i == m[1]:
		l.append(0)
l.sort(reverse=True)
for i in l:
	print(i, end=' ')


n = int(input())
s = input()
countN = 0
countZ = 0
for i in s:
	if i == 'n':
		countN += 1
	elif i == 'z':
		countZ += 1
ans = '1 ' * countN + '0 ' * countZ
print(ans.strip())


n = int(input())
s = input()
k = s.count('n')
l = (n - 3 * k) // 4
for i in range(k):
	print(1, end=' ')
for j in range(l):
	print(0, end=' ')


n = input()
a = input()
d = {}
for i in a:
	if i in d:
		d[i] += 1
	else:
		d[i] = 1
zeros = 0
if 'r' in d:
	zeros = d['r']
one = 0
if 'n' in d:
	one = d['n']
print('1 ' * one + '0 ' * zeros)


_ = input()
words = input()
count = 0
count2 = 0
for i in words:
	if i == 'n':
		count += 1
	if i == 'z':
		count2 += 1
print('1 ' * count + '0 ' * count2)


n = int(input())
s = list(input())
z = 0
o = 0
for i in s:
	if i == 'z':
		z += 1
	if i == 'n':
		o += 1
k = '1 ' * o + '0 ' * z
print(k)


import sys
data = sys.stdin.readlines()
zeros = [ch for ch in data[1]].count('z')
ones = [ch for ch in data[1]].count('n')
sys.stdout.write(('1 ' * ones + '0 ' * zeros)[:-1])


n = int(input())
a = input()
f = [0] * 6
for i in range(n):
	if a[i] == 'z':
		f[0] += 1
	elif a[i] == 'e':
		f[1] += 1
	elif a[i] == 'r':
		f[2] += 1
	elif a[i] == 'o':
		f[3] += 1
	else:
		f[4] += 1
for i in range(f[4]):
	print(1, end=' ')
for i in range(f[0]):
	print(0, end=' ')


s = int(input())
n = input()
count = 0
count1 = 0
for i in range(0, s):
	if n[i] == 'n':
		count += 1
	if n[i] == 'z':
		count1 += 1
print('1 ' * count, '0 ' * count1)