You are given a non-empty string s=s_1s_2... s_n, which consists only of lowercase Latin letters. Polycarp does not like a string if it contains at least one string "one" or at least one string "two" (or both at the same time) as a substring. In other words, Polycarp does not like the string s if there is an integer j (1 ≤ j ≤ n-2), that s_{j}s_{j+1}s_{j+2}="one" or s_{j}s_{j+1}s_{j+2}="two".

For example:

  * Polycarp does not like strings "oneee", "ontwow", "twone" and "oneonetwo" (they all have at least one substring "one" or "two"), 
  * Polycarp likes strings "oonnee", "twwwo" and "twnoe" (they have no substrings "one" and "two"). 



Polycarp wants to select a certain set of indices (positions) and remove all letters on these positions. All removals are made at the same time.

For example, if the string looks like s="onetwone", then if Polycarp selects two indices 3 and 6, then "onetwone" will be selected and the result is "ontwne".

What is the minimum number of indices (positions) that Polycarp needs to select to make the string liked? What should these positions be?

Input

The first line of the input contains an integer t (1 ≤ t ≤ 10^4) — the number of test cases in the input. Next, the test cases are given.

Each test case consists of one non-empty string s. Its length does not exceed 1.5⋅10^5. The string s consists only of lowercase Latin letters.

It is guaranteed that the sum of lengths of all lines for all input data in the test does not exceed 1.5⋅10^6.

Output

Print an answer for each test case in the input in order of their appearance.

The first line of each answer should contain r (0 ≤ r ≤ |s|) — the required minimum number of positions to be removed, where |s| is the length of the given line. The second line of each answer should contain r different integers — the indices themselves for removal in any order. Indices are numbered from left to right from 1 to the length of the string. If r=0, then the second line can be skipped (or you can print empty). If there are several answers, print any of them.

Examples

Input


4
onetwone
testme
oneoneone
twotwo


Output


2
6 3
0

3
4 1 7 
2
1 4


Input


10
onetwonetwooneooonetwooo
two
one
twooooo
ttttwo
ttwwoo
ooone
onnne
oneeeee
oneeeeeeetwooooo


Output


6
18 11 12 1 6 21 
1
1 
1
3 
1
2 
1
6 
0

1
4 
0

1
1 
2
1 11 

Note

In the first example, answers are:

  * "onetwone", 
  * "testme" — Polycarp likes it, there is nothing to remove, 
  * "oneoneone", 
  * "twotwo". 



In the second example, answers are: 

  * "onetwonetwooneooonetwooo", 
  * "two", 
  * "one", 
  * "twooooo", 
  * "ttttwo", 
  * "ttwwoo" — Polycarp likes it, there is nothing to remove, 
  * "ooone", 
  * "onnne" — Polycarp likes it, there is nothing to remove, 
  * "oneeeee", 
  * "oneeeeeeetwooooo".

Difficulty: MEDIUM
Tags: Dynamic programming

Greedy algorithms
Skill types: Dynamic programming

Greedy algorithms

Starter code:

Solutions:
t = int(input())
for _ in range(t):
	s = input()
	i = 0
	R = []
	while i < len(s):
		if i + 4 < len(s) and s[i:i + 5] == 'twone':
			R.append(i + 2 + 1)
			i += 5
		elif i + 2 < len(s) and (s[i:i + 3] == 'one' or s[i:i + 3] == 'two'):
			R.append(i + 1 + 1)
			i += 3
		else:
			i += 1
	print(len(R))
	for i in R:
		print(i, end=' ')
	print()


def solve():
	s = input()
	l = len(s)
	ans = []
	cur1 = cur2 = ''
	va = {'t', 'tw', 'two'}
	va2 = {'o', 'on', 'one'}
	for i in range(l):
		if cur1 + s[i] in va:
			cur1 += s[i]
		elif s[i] in va:
			cur1 = s[i]
		else:
			cur1 = ''
		if cur2 + s[i] in va2:
			cur2 += s[i]
		elif s[i] in va2:
			cur2 = s[i]
		else:
			cur2 = ''
		if cur1 == 'two':
			if i + 1 >= l or s[i + 1] != 'o':
				ans.append(i + 1)
				cur1 = 'tw'
				cur2 = ''
			else:
				ans.append(i)
				cur1 = ''
		elif cur2 == 'one':
			ans.append(i)
			cur2 = ''
	print(len(ans))
	print(*ans)
t = int(input())
for _ in range(t):
	solve()


from collections import defaultdict, deque
from itertools import permutations
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
from copy import deepcopy
int_input = lambda : int(stdin.readline())
string_input = lambda : stdin.readline()
multi_int_input = lambda : map(int, stdin.readline().split())
multi_input = lambda : stdin.readline().split()
list_input = lambda : list(map(int, stdin.readline().split()))
string_list_input = lambda : list(string_input())
MOD = pow(10, 9) + 7
test = int_input()
for _ in range(test):
	n = string_input()
	result = set([])
	c = 0
	for i in range(len(n)):
		if i + 2 < len(n):
			if n[i] + n[i + 1] + n[i + 2] == 'two':
				if i + 4 < len(n):
					if n[i + 3] == 'n' and n[i + 4] == 'e':
						result.add(i + 2)
						c += 1
					else:
						result.add(i + 1)
						c += 1
				else:
					result.add(i + 1)
					c += 1
			if n[i] + n[i + 1] + n[i + 2] == 'one':
				if i not in result:
					result.add(i + 1)
					c += 1
	print(c)
	for elements in result:
		print(elements + 1, end=' ')
	print()


out = []
for i in range(int(input())):
	(s, ans) = (list(input()), [])
	for j in range(2, len(s)):
		tem = ''.join(s[j - 2:j + 1])
		if tem == 'one':
			ans.append(str(j))
			s[j - 1] = 'o'
		elif tem == 'two':
			if j < len(s) - 2 and ''.join(s[j:j + 3]) == 'one':
				s[j] = 'n'
				ans.append(str(j + 1))
			else:
				s[j - 1] = 'n'
				ans.append(str(j))
	out.append(str(len(ans)))
	out.append(' '.join(ans))
print('\n'.join(out))


import sys, math

def input():
	return sys.stdin.readline()[:-1]

def main():
	q = int(input())
	for _ in range(q):
		s = input()
		n = len(s)
		a = set([])
		if n >= 5:
			for k in range(n - 4):
				if s[k:k + 5] == 'twone':
					a.add(k + 3)
		if n >= 3:
			for k in range(n - 2):
				if s[k:k + 3] == 'two' and k + 3 not in a:
					a.add(k + 2)
				elif s[k:k + 3] == 'one' and k + 1 not in a:
					a.add(k + 2)
		if len(a) > 0:
			print(len(a))
			print(*a)
		else:
			print(0)
			print('')
main()


t = int(input())
for _ in range(t):
	s = input() + 5 * '_'
	n = len(s)
	x = -1
	a = []
	for i in range(n):
		if i > x:
			if s[i:i + 5] == 'twone':
				a.append(i + 3)
				x = i + 4
			elif s[i:i + 3] == 'one' or s[i:i + 3] == 'two':
				a.append(i + 2)
				x = i + 2
	print(len(a))
	print(*a)


def f(a, s, ii):
	ss = ''
	aa = []
	for i in range(ii, len(s)):
		if a[i] == -1:
			ss += s[i]
			aa.append(i)
		if len(ss) > 4:
			break
	return (ss, aa)
for i in range(int(input())):
	s = input()
	l = len(s)
	s += 'ssssss'
	ar = [-1] * len(s)
	for j in range(l):
		if ar[j] == -1:
			(ss, aa) = f(ar, s, j)
			if ss[0] == 't' and ss[1] == 'w' and (ss[2] == 'o') and (ss[3] == 'n') and (ss[4] == 'e'):
				ar[aa[2]] = aa[2]
			elif ss[0] == 't' and ss[1] == 'w' and (ss[2] == 'o'):
				ar[aa[1]] = aa[1]
			elif ss[0] == 'o' and ss[1] == 'n' and (ss[2] == 'e'):
				ar[aa[1]] = aa[1]
	ans = []
	for j in range(len(ar)):
		if ar[j] != -1:
			ans.append(ar[j] + 1)
	print(len(ans))
	print(*ans)


for _ in [0] * int(input()):
	s = input()
	i = 0
	r = []
	while i < len(s):
		if 'one' == s[i:i + 3]:
			r += (i + 2,)
		if 'twone' == s[i:i + 5]:
			r += (i + 3,)
			i += 4
		if 'two' == s[i:i + 3]:
			r += (i + 2,)
		i += 1
	print(len(r), *r)


def f():
	s = list(input())
	delN = set()
	delW = []

	def checkOne(i):
		if s[i - 1] != 'o':
			return
		if s[i + 1] != 'e':
			return
		delN.add(i)

	def checkTwo(i):
		if s[i - 1] != 't':
			return
		if s[i + 1] != 'o':
			return
		delW.append(i)
	l = len(s)
	if l <= 2:
		print(0)
		print()
		return
	for i in range(1, l - 1):
		if s[i] == 'n':
			checkOne(i)
		if s[i] == 'w':
			checkTwo(i)
	ans = []
	for p in delW:
		if p + 2 in delN:
			ans.append(p + 1)
			delN.discard(p + 2)
		else:
			ans.append(p)
	for p in delN:
		ans.append(p)
	print(len(ans))
	print(' '.join((str(s + 1) for s in ans)))
t = int(input())
for i in range(t):
	f()


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
t = int(input())
for _ in range(t):
	s = input()
	ans = set()
	for i in range(len(s) - 2):
		if i + 1 not in ans:
			if s[i] == 't' and s[i + 1] == 'w' and (s[i + 2] == 'o'):
				try:
					if s[i + 3] == 'o':
						ans.add(i + 2)
					else:
						try:
							if s[i + 3] == 'n' and s[i + 4] == 'e':
								ans.add(i + 3)
							else:
								ans.add(i + 2)
						except:
							ans.add(i + 2)
				except:
					ans.add(i + 2)
			if s[i] == 'o' and s[i + 1] == 'n' and (s[i + 2] == 'e') and (i + 2 not in ans) and (i + 3 not in ans):
				ans.add(i + 2)
	print(len(ans))
	print(*ans)


for i in range(int(input())):
	k = input()
	a = k.replace('one', '123').replace('two', '123')
	l = []
	for j in range(len(k)):
		if a[j] == '2':
			if j > 1 and a[j - 2] == 'w':
				l.append(j)
			else:
				l.append(j + 1)
	print(len(l))
	print(*l)


rr = lambda : input().strip()
rri = lambda : int(rr())
rrm = lambda : [int(x) for x in rr().split()]

def sol():
	s = input()
	n = len(s)
	if n < 3:
		print(0)
		print()
		return 0
	if n > 4:
		res = 0
		ind = []
		i = 0
		while i < n - 4:
			if s[i] + s[i + 1] + s[i + 2] == 'two':
				res += 1
				if s[i + 3] + s[i + 4] == 'ne':
					ind.append(str(i + 2 + 1))
					i += 5
				else:
					ind.append(str(i + 1 + 1))
					i += 3
			elif s[i] + s[i + 1] + s[i + 2] == 'one':
				res += 1
				ind.append(str(i + 1 + 1))
				i += 3
			else:
				i += 1
		while i < n - 2:
			if s[i] + s[i + 1] + s[i + 2] == 'one' or s[i] + s[i + 1] + s[i + 2] == 'two':
				res += 1
				ind.append(str(i + 1 + 1))
				i += 3
			else:
				i += 1
		print(res)
		if res > 0:
			inds = ' '.join(ind)
			print(inds)
		else:
			print()
		return 0
	i = 0
	res = 0
	ind = []
	while i < n - 2:
		if s[i] + s[i + 1] + s[i + 2] == 'one' or s[i] + s[i + 1] + s[i + 2] == 'two':
			res += 1
			ind.append(str(i + 1 + 1))
			i += 3
		else:
			i += 1
	print(res)
	if res > 0:
		inds = ' '.join(ind)
		print(inds)
	else:
		print()
	return 0
T = rri()
for _ in range(T):
	ans = sol()


t = int(input())
for i in range(t):
	s = input()
	li = set()
	i = 0
	while i < len(s) - 2:
		if s[i] == 't' and s[i + 1] == 'w' and (s[i + 2] == 'o'):
			if i + 4 < len(s):
				if s[i + 2] == 'o' and s[i + 3] == 'n' and (s[i + 4] == 'e'):
					li.add(i + 3)
					i += 3
					continue
			li.add(i + 2)
			i += 3
			continue
		if s[i] == 'o' and s[i + 1] == 'n' and (s[i + 2] == 'e'):
			li.add(i + 2)
			i += 3
			continue
		i += 1
	print(len(li))
	for i in li:
		print(i, end=' ')
	print()


import re
for _ in range(int(input())):
	s = input()
	a = s.count('twone')
	b = s.count('one') - a
	c = s.count('two') - a
	o1 = set([m.start() + 2 for m in re.finditer('twone', s)])
	o2 = [m.start() + 1 for m in re.finditer('two', s)]
	o3 = [m.start() + 1 for m in re.finditer('one', s)]
	final = list(o1)
	for p in o2:
		if p + 1 not in o1:
			final.append(p)
	for p in o3:
		if p - 1 not in o1:
			final.append(p)
	print(a + b + c)
	print(' '.join([str(x + 1) for x in final]))


for _ in range(int(input())):
	s = input()
	l = []
	for i in range(len(s) - 2):
		if s[i] == 'o' and s[i + 1] == 'n' and (s[i + 2] == 'e'):
			if len(l) > 0 and l[-1][1] and (i - 1 == l[-1][0]):
				l.pop()
				l.append([i, False])
			else:
				l.append([i + 1, False])
		elif s[i] == 't' and s[i + 1] == 'w' and (s[i + 2] == 'o'):
			l.append([i + 1, True])
	print(len(l))
	if len(l) > 0:
		for i in l:
			print(i[0] + 1, end=' ')
		print()


for _ in range(int(input())):
	s = input()
	pos = 0
	a = []
	while pos < len(s):
		if pos + 2 < len(s) and s[pos] == 'o' and (s[pos + 1] == 'n') and (s[pos + 2] == 'e'):
			a.append(pos + 2)
			pos += 3
		elif pos + 2 < len(s) and s[pos] == 't' and (s[pos + 1] == 'w') and (s[pos + 2] == 'o'):
			if pos + 4 < len(s) and s[pos + 3] == 'n' and (s[pos + 4] == 'e'):
				a.append(pos + 3)
				pos += 5
			else:
				a.append(pos + 2)
				pos += 3
		else:
			pos += 1
	print(len(a))
	for i in range(0, len(a)):
		print(a[i], end=' ')
	print()


def one_two(s):
	ch1 = 'one'
	ch2 = 'two'
	ch3 = 'twone'
	final = ''
	i = 0
	count = 0
	l = []
	while i < len(s):
		if s[i:i + 5] == ch3:
			l.append(i + 3)
			i = i + 5
		elif s[i:i + 3] == ch1 or s[i:i + 3] == ch2:
			l.append(i + 2)
			i = i + 3
		else:
			i = i + 1
	print(len(l))
	print(*l)
n = int(input())
for i in range(0, n):
	s = input()
	one_two(s)


import sys
reader = (line.rstrip() for line in sys.stdin)

def func(s):
	I_del = set()
	n = len(s)
	for i in range(n - 2):
		if s[i:i + 3] == 'one':
			if i in I_del:
				continue
			I_del.add(i + 1)
		elif s[i:i + 3] == 'two':
			if s[i + 3:i + 5] == 'ne':
				I_del.add(i + 2)
			else:
				I_del.add(i + 1)
	return [i + 1 for i in I_del]
t = int(next(reader))
for _ in range(t):
	s = next(reader)
	ans = func(s)
	print(len(ans))
	print(*ans)


t = int(input())
for _ in range(t):
	s = input()
	if len(s) < 3:
		print(0)
		print()
	elif len(s) == 3:
		if s == 'one' or s == 'two':
			print(1)
			print(1)
		else:
			print(0)
			print()
	else:
		l = s
		ans = []
		for i in range(len(s) - 2):
			if l[i] == 'o' and l[i + 1] == 'n' and (l[i + 2] == 'e'):
				if i >= 2:
					if l[i - 1] == 'w' and l[i - 2] == 't':
						ans.append(i + 1)
					else:
						ans.append(i + 2)
				else:
					ans.append(i + 2)
			elif l[i] == 't' and l[i + 1] == 'w' and (l[i + 2] == 'o'):
				if i <= len(l) - 5:
					if l[i + 3] == 'n' and l[i + 4] == 'e':
						ans.append(i + 3)
					else:
						ans.append(i + 2)
				else:
					ans.append(i + 2)
		ans = list(set(ans))
		print(len(ans))
		if len(ans) == 0:
			print()
		else:
			for i in range(len(ans)):
				if i != len(ans) - 1:
					print(ans[i], end=' ')
				else:
					print(ans[-1])


for _ in range(int(input())):
	s = input()
	ans = []
	for i in range(len(s)):
		if 2 <= i <= len(s) - 2 and s[i - 2:i + 3] == 'twone':
			ans.append(i + 1)
		elif i >= 2 and s[i - 2:i + 1] == 'two':
			ans.append(i)
		elif i <= len(s) - 2 and s[i:i + 3] == 'one':
			ans.append(i + 2)
	print(len(ans))
	print(*ans)


import sys
tests = int(sys.stdin.readline())
for _ in range(tests):
	stringg = str(sys.stdin.readline())
	if stringg.count('one') == 0 and stringg.count('two') == 0:
		print('0')
		print()
	else:
		cnt = 0
		indexesBothResult = []
		indexesBoth = []
		indexes = []
		for (index, value) in enumerate(stringg):
			if stringg[index:index + len('twone')] == 'twone':
				cnt += 1
				indexesBoth.append(index + 2)
				indexesBoth.append(index)
				indexesBothResult.append(index + 3)
		for (index, value) in enumerate(stringg):
			if stringg[index:index + len('two')] == 'two':
				if index not in indexesBoth:
					cnt += 1
					indexes.append(index + 2)
		for (index, value) in enumerate(stringg):
			if stringg[index:index + len('one')] == 'one':
				if index not in indexesBoth:
					cnt += 1
					indexes.append(index + 2)
		print(cnt)
		for i in range(len(indexesBothResult)):
			print(indexesBothResult[i], end=' ')
		for i in range(len(indexes)):
			print(indexes[i], end=' ')
		print()


for _ in range(int(input())):
	s = list(input())
	ans = []
	n = len(s)
	a = 0
	if len(s) < 3:
		print(0)
		print('')
	else:
		i = 0
		while i < n - 2:
			if s[i] + s[i + 1] + s[i + 2] == 'one':
				ans.append(i + 1)
				a += 1
				i += 3
			elif s[i] + s[i + 1] + s[i + 2] == 'two':
				if i + 4 < n and s[i + 3] + s[i + 4] == 'ne':
					ans.append(i + 2)
					a += 1
					i += 5
				else:
					ans.append(i + 1)
					i += 3
					a += 1
			else:
				i += 1
		print(a)
		for i in ans:
			print(i + 1, end=' ')
		print('')


N = int(input())
for _ in range(N):
	s = input()
	ln = len(s)
	s = list(s + 'aaaa')
	ans = 0
	pos = []
	i = 0
	while i < ln:
		if s[i:i + 5] == list('twone'):
			ans += 1
			pos.append(i + 3)
			i += 5
			continue
		elif s[i:i + 3] == list('two'):
			ans += 1
			pos.append(i + 2)
			i += 3
			continue
		elif s[i:i + 3] == list('one'):
			ans += 1
			pos.append(i + 2)
			i += 3
			continue
		else:
			i += 1
	print(ans)
	if ans == 0:
		print()
	else:
		for j in range(len(pos) - 1):
			print(pos[j], end=' ')
		print(pos[-1])


def twelve(s):
	dellst = []
	i = 0
	while i <= len(s) - 3:
		if s[i:i + 3] == 'one':
			dellst += [i + 2]
			i += 3
		elif s[i:i + 3] == 'two':
			if i <= len(s) - 5:
				if s[i:i + 5] == 'twone':
					dellst += [i + 3]
					i += 5
				else:
					dellst += [i + 2]
					i += 3
			else:
				dellst += [i + 2]
				i += 3
		else:
			i += 1
	return dellst
m = int(input())
for i in range(m):
	s = input()
	k = twelve(s)
	print(len(k))
	print(*k)


for k in range(int(input())):
	s = input().replace('twone', 'tw_ne').replace('one', 'o_e').replace('two', 't_o')
	a = [i + 1 for i in range(len(s)) if s[i] == '_']
	print(len(a))
	if len(a) != 0:
		print(*a)
	else:
		print()


for _ in range(int(input())):
	s = input()
	s = s.replace('twone', 'tw?ne')
	s = s.replace('one', 'o?e')
	s = s.replace('two', 't?o')
	ans = 0
	ans_i = []
	for i in range(len(s)):
		if s[i] == '?':
			ans += 1
			ans_i.append(i + 1)
	print(ans)
	if len(ans_i) != 0:
		print(*ans_i)


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__

def solve():
	s = input()
	ans = []
	n = len(s)
	used = [0] * n
	for i in range(n):
		if i <= n - 5 and s[i] == 't' and (s[i:i + 5] == 'twone'):
			ans.append(i + 3)
			used[i + 2] = 1
			used[i] = 1
		if i <= n - 3 and (not used[i]) and (s[i] == 't') and (s[i:i + 3] == 'two'):
			ans.append(i + 2)
		if i <= n - 3 and (not used[i]) and (s[i] == 'o') and (s[i:i + 3] == 'one'):
			ans.append(i + 2)
	print(len(ans))
	print(*ans)
t = int(input())
for i in range(t):
	solve()


tc = int(input())
for t in range(tc):
	s = input()
	n = len(s)
	one = []
	two = []
	for i in range(n - 2):
		if s[i:i + 3] == 'one':
			one.append(i + 1)
		if s[i:i + 3] == 'two':
			two.append(i + 1)
	ans = []
	while True:
		if len(one) == 0 and len(two) == 0:
			break
		elif len(one) == 0:
			ans.append(two[0] + 1)
			del two[0]
		elif len(two) == 0:
			ans.append(one[0] + 1)
			del one[0]
		elif one[0] >= two[0] + 3:
			ans.append(two[0] + 1)
			del two[0]
		elif two[0] >= one[0] + 3:
			ans.append(one[0] + 1)
			del one[0]
		else:
			ans.append(two[0] + 2)
			del one[0]
			del two[0]
	print(len(ans))
	for x in ans:
		print(x, end=' ')
	print()


import sys
import math
from collections import defaultdict, Counter, deque
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')
t = int(input())
for i in range(t):
	s = list(input())
	l = []
	l1 = len(s)
	if l1 > 2:
		cur = deque()
		cur.extend([s[0], s[1]])
		a = deque(['o', 'n', 'e'])
		b = deque(['t', 'w', 'o'])
	for j in range(2, l1):
		cur.append(s[j])
		if cur == a:
			l.append(j)
		elif cur == b:
			if j + 1 < l1 and s[j + 1] == 'o':
				l.append(j)
			else:
				l.append(j + 1)
				cur[2] = '$'
		cur.popleft()
	print(len(l))
	print(*l)


t = int(input())
for _ in range(t):
	answer = []
	s = input()
	n = len(s)
	i = 0
	while i < n - 2:
		if s[i:i + 3] == 'one':
			answer.append(i + 2)
			i += 3
		elif s[i:i + 3] == 'two':
			if i + 4 < n and s[i:i + 5] == 'twone':
				answer.append(i + 3)
				i += 5
			else:
				answer.append(i + 2)
				i += 3
		else:
			i += 1
	print(len(answer))
	print(*answer)


t = int(input())
for _ in range(t):
	s = input()
	l = len(s)
	res = 0
	arr = []
	i = 0
	while i < l:
		if i < l - 4 and s[i:i + 5] == 'twone':
			arr.append(i + 3)
			i += 5
		elif i < l - 2:
			if s[i:i + 3] == 'two':
				arr.append(i + 2)
				i += 3
			elif s[i:i + 3] == 'one':
				arr.append(i + 2)
				i += 3
			else:
				i += 1
		else:
			i += 1
	print(len(arr))
	print(*arr)


for _ in range(int(input())):
	arr = input()
	ln = len(arr)
	ans = []
	i = 0
	while i < ln:
		if arr[i] == 'o':
			if i + 2 < ln and arr[i + 1] == 'n' and (arr[i + 2] == 'e'):
				if i - 1 >= 0 and arr[i - 1] == 'o':
					ans.append(i + 2)
				else:
					ans.append(i + 1)
				i += 3
				continue
		if arr[i] == 't':
			if i + 2 < ln and arr[i + 1] == 'w' and (arr[i + 2] == 'o'):
				if i + 3 < ln and arr[i + 3] == 'n':
					ans.append(i + 3)
				elif i - 1 >= 0 and arr[i - 1] == 't':
					ans.append(i + 2)
				else:
					ans.append(i + 1)
				i += 3
				continue
		i += 1
	print(len(ans))
	print(' '.join([str(x) for x in ans]))


t = int(input())
for _ in range(t):
	s = input()
	ans = []
	i = 2
	while i < len(s):
		if s[i - 2:i + 1] == 'one':
			ans.append(i)
			i += 3
		elif s[i - 2:i + 1] == 'two':
			if i + 1 < len(s) and s[i + 1] == 'n':
				ans.append(i + 1)
			else:
				ans.append(i)
			i += 3
		else:
			i += 1
	print(len(ans))
	print(*ans)


for _ in range(int(input())):
	s = input().strip()
	cnt = 0
	res = [i + 2 for i in range(len(s)) if s.startswith('twone', i)]
	cnt += len(res)
	s = s.replace('twone', 'tw1ne')
	res1 = [m + 1 for m in range(len(s)) if s.startswith('one', m)]
	res.extend(res1)
	x = len(res1)
	s = s.replace('one', 'o1e')
	res2 = [b + 1 for b in range(len(s)) if s.startswith('two', b)]
	y = len(res2)
	res.extend(res2)
	cnt += x + y
	print(cnt)
	s = ''
	for i in range(len(res)):
		res[i] += 1
		s += str(res[i]) + ' '
	print(s)


for _ in range(int(input())):
	a = list(input())
	ret = []
	for (i, ch) in enumerate(a):
		if ch == 'o' and i - 2 >= 0 and (i + 2 < len(a)) and (''.join(a[i - 2:i + 3]) == 'twone'):
			ret.append(i + 1)
			a[i] = 'z'
	stack = []
	for (i, ch) in enumerate(a):
		if len(stack) >= 2 and stack[-2][0] + stack[-1][0] + ch in ('one', 'two'):
			mid = stack.pop()
			ret.append(mid[1] + 1)
			stack.append((ch, i))
		else:
			stack.append((ch, i))
	print(len(ret))
	print(*ret)


T = int(input(''))
for v in range(T):
	a = input('')
	n = len(a)
	p = []
	t = []
	for i in range(n - 2):
		if a[i:i + 3] == 'one':
			p.append(i)
		if a[i:i + 3] == 'two':
			p.append(i)
	if len(p) == 0:
		print(0)
		continue
	ans = 0
	i = 0
	fin = []
	while i < len(p) - 1:
		if p[i + 1] != p[i] + 2:
			fin.append(p[i] + 2)
			ans = ans + 1
			i += 1
		else:
			fin.append(p[i] + 3)
			ans = ans + 1
			i += 2
	if len(p) > 1:
		if p[-1] != p[-2] + 2:
			fin.append(p[-1] + 2)
			ans = ans + 1
	else:
		ans = ans + 1
		fin.append(p[0] + 2)
	print(ans)
	if ans != 0:
		for h in fin:
			print(h, end=' ')
		print('')
	else:
		print('')


def fastio():
	import sys
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip('\r\n')
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()
IND = 10 ** 20
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from math import gcd
from collections import defaultdict as dd
(t,) = I()
while t:
	t -= 1
	s = input() + '############'
	a = []
	i = 0
	while i < len(s) - 5:
		if s[i:i + 5] == 'twone':
			a.append(i + 1 + 2)
			i = i + 5
		elif s[i:i + 3] == 'one':
			a.append(i + 2)
			i += 2
		elif s[i:i + 3] == 'two':
			a.append(i + 2)
			i += 2
		else:
			i += 1
	print(len(a))
	print(*a)


t = int(input())
for _ in range(t):
	s = input()
	s = 't*o'.join('o*e'.join('tw*ne'.join(s.split('twone')).split('one')).split('two'))
	l = [str(i + 1) for i in range(len(s)) if s[i] == '*']
	print(len(l))
	print(' '.join(l))


from sys import stdin
import math

def input():
	return stdin.readline()[:-1]
for _ in range(int(input())):
	s = list(input())
	pos = []
	i = 0
	while i + 2 < len(s):
		if s[i] == 'o' and s[i + 1] == 'n' and (s[i + 2] == 'e'):
			pos.append(i + 1 + 1)
			i += 3
		elif i + 4 < len(s) and s[i] == 't' and (s[i + 1] == 'w') and (s[i + 2] == 'o') and (s[i + 3] == 'n') and (s[i + 4] == 'e'):
			pos.append(i + 2 + 1)
			i += 5
		elif s[i] == 't' and s[i + 1] == 'w' and (s[i + 2] == 'o'):
			pos.append(i + 1 + 1)
			i += 3
		else:
			i += 1
	print(len(pos))
	print(' '.join(map(str, pos)))


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')

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()
for _ in range(int(ri())):
	s = ri()
	ts = set()
	oss = set()
	for i in range(len(s)):
		if s[i] == 't' and i + 2 <= len(s) - 1 and (s[i + 1] == 'w') and (s[i + 2] == 'o'):
			ts.add(i)
		if s[i] == 'o' and i + 2 <= len(s) - 1 and (s[i + 1] == 'n') and (s[i + 2] == 'e'):
			oss.add(i)
	ans = []
	cnt = 0
	for i in ts:
		if i + 2 in oss:
			ans.append(i + 2 + 1)
			cnt += 1
		else:
			ans.append(i + 2)
	for i in oss:
		if i - 2 not in ts:
			ans.append(i + 2)
	print(len(ts) - cnt + cnt + len(oss) - cnt)
	print(*ans)


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
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 types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

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

def power(a, b):
	ans = 1
	while b > 0:
		if b % 2 == 1:
			ans *= a
		a *= a
		b //= 2
	return ans

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

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

def solve():
	s = list(inp())
	n = len(s)
	pos1 = 'twone'
	pos2 = 'one'
	pos3 = 'two'
	for i in range(0, n - 5 + 1):
		if s[i:i + 5] == list(pos1):
			s[i + 2] = '.'
	for i in range(0, n - 3 + 1):
		if s[i:i + 3] == list(pos2):
			s[i + 1] = '.'
	for i in range(0, n - 3 + 1):
		if s[i:i + 3] == list(pos3):
			s[i + 1] = '.'
	ans = []
	for i in range(n):
		if s[i] == '.':
			ans.append(i + 1)
	print(len(ans))
	print(' '.join((str(ans[i]) for i in range(len(ans)))))
testcase(int(inp()))


def solve():
	S = input()
	l = 0
	ans = []
	while l < len(S) - 2:
		if S[l] == 'o':
			if S[l + 1] == 'n' and S[l + 2] == 'e':
				ans.append(l + 1)
				l += 3
			else:
				l += 1
		elif S[l] == 't':
			if S[l + 1] == 'w' and S[l + 2] == 'o':
				if l < len(S) - 4 and S[l + 3] == 'n' and (S[l + 4] == 'e'):
					ans.append(l + 2)
					l += 5
				else:
					ans.append(l + 1)
					l += 3
			else:
				l += 1
		else:
			l += 1
	if ans == []:
		print(0)
		print()
	else:
		print(len(ans))
		print(' '.join(map(lambda x: str(x + 1), ans)))

	def check():
		T = ''
		for (i, s) in enumerate(S):
			if i in ans:
				continue
			else:
				T += s
		for (a, b, c) in zip(T, T[1:], T[2:]):
			if a + b + c in {'one', 'two'}:
				print('error')
				assert 1 == 2
T = int(input())
for _ in range(T):
	solve()


for _ in range(int(input())):
	s = input()
	twone = []
	one = []
	two = []
	n = len(s)
	for i in range(n - 5 + 1):
		if s[i:i + 5] == 'twone':
			twone.append(i)
	for i in range(n - 3 + 1):
		if s[i:i + 3] == 'one':
			one.append(i)
	for i in range(n - 3 + 1):
		if s[i:i + 3] == 'two':
			two.append(i)
	print(len(one) + len(two) - len(twone))
	twoneset = set(twone)
	for num in one:
		if num - 2 not in twoneset:
			print(num + 2, end=' ')
	for num in two:
		if num not in twoneset:
			print(num + 2, end=' ')
	for num in twone:
		print(num + 3, end=' ')
	print()


import sys
I = sys.stdin.readline
for _ in range(int(I())):
	s = I()
	i = 0
	idx = []
	while i < len(s) - 2:
		if s[i:i + 5] == 'twone':
			idx.append(i + 3)
			i += 4
		elif s[i:i + 3] in ('one', 'two'):
			idx.append(i + 2)
		i += 1
	print(len(idx))
	print(*idx)


from sys import stdin, stdout
from collections import Counter
for _ in range(int(stdin.readline())):
	s = list(input())
	n = len(s)
	ans = []
	for i in range(n - 4):
		sub = s[i:i + 5]
		if sub == list('twone'):
			ans += [i + 3]
			s[i + 2] = ' '
	for i in range(n - 2):
		sub = s[i:i + 3]
		if sub in [list('one'), list('two')]:
			ans += [i + 2]
			s[i + 1] = ' '
	print(len(ans))
	print(*ans)


t = int(input())
for i in range(t):
	s = input()
	ar = list(s)
	p = 0
	length = len(s)
	ans = 0
	al = []
	b1 = False
	b2 = False
	b3 = False
	b4 = False
	for j in range(length):
		if b4 == True:
			if ar[j] == 'o':
				ans += 1
				b4 = False
				b3 = False
				if j != length - 1 and ar[j + 1] == 'o':
					ar[j - 1] = 0
					al.append(j)
				else:
					ar[j] = 0
					al.append(j + 1)
			else:
				b4 = False
				b3 = False
		if b3 == True:
			if ar[j] == 'w':
				b4 = True
			else:
				b3 = False
		if ar[j] == 't':
			b3 = True
		if b2 == True:
			if ar[j] == 'e':
				ans += 1
				b2 = False
				b1 = False
				if j != length - 1 and ar[j + 1] == 'e':
					ar[j - 1] = 0
					al.append(j)
				else:
					ar[j] = 0
					al.append(j + 1)
			else:
				b2 = False
				b1 = False
		if b1 == True:
			if ar[j] == 'n':
				b2 = True
			else:
				b1 = False
		if ar[j] == 'o':
			b1 = True
	print(ans)
	for j in al:
		print(j, end=' ')
	print()


for _ in range(int(input())):
	s = input()
	l = len(s)
	x = 0
	y = []
	i = 0
	while i < l - 2:
		if s[i:i + 5] == 'twone':
			x += 1
			y.append(i + 3)
			i += 5
		elif s[i:i + 3] == 'one' or s[i:i + 3] == 'two':
			x += 1
			y.append(i + 2)
			i += 3
			continue
		else:
			i += 1
			continue
	print(x)
	if y != []:
		print(' '.join((str(z) for z in y)))
	else:
		print('')


t = int(input())
for _ in range(t):
	s = list(input())
	n = len(s)
	ans = []
	for i in range(n - 4):
		sub = ''.join(s[i:i + 5])
		if sub == 'twone':
			s[i + 2] = '%'
			ans.append(i + 3)
	for i in range(n - 2):
		sub = ''.join(s[i:i + 3])
		if sub == 'one' or sub == 'two':
			s[i + 1] = '%'
			ans.append(i + 2)
	print(len(ans))
	print(' '.join(map(str, ans)))


t = int(input())
for i in range(t):
	s = input()
	ans = 0
	positions = []
	pos = 0
	while pos < len(s):
		template = 'twone'
		if s[pos:pos + len(template)] == template:
			positions.append(str(pos + 3))
			ans += 1
			pos += len(template)
			continue
		template = 'one'
		if s[pos:pos + len(template)] == template:
			positions.append(str(pos + 2))
			ans += 1
			pos += len(template)
			continue
		template = 'two'
		if s[pos:pos + len(template)] == template:
			positions.append(str(pos + 2))
			ans += 1
			pos += len(template)
			continue
		pos += 1
	print(ans)
	print(' '.join(positions))


import sys as __sys

def what_should_delete(string):
	should_delete = [False] * len(string)
	for i in range(0, len(string) - 2):
		if string[i:i + 3] == 'one':
			if not should_delete[i]:
				should_delete[i + 1] = True
		if string[i:i + 3] == 'two':
			if i + 3 < len(string) and string[i + 3] == 'o':
				index_to_delete = i + 1
			else:
				index_to_delete = i + 2
			should_delete[index_to_delete] = True
	return tuple(filter(lambda i: should_delete[i], range(len(string))))

def __main():
	t = int(input())
	for i_t in range(t):
		s = __read_line()
		result = what_should_delete(s)
		print(len(result))
		print(*[i + 1 for i in result])

def __read_line():
	result = __sys.stdin.readline()
	assert result[-1] == '\n'
	return result[:-1]

def __read_ints():
	return map(int, __read_line().split())
__main()


t = int(input())
lot = [input() for x in range(t)]

def main(string):
	lst = [[0, []]] * (len(string) + 1)
	i = 0
	li = 0
	while i < len(string):
		if string[i:i + 3] in ['one', 'two']:
			o = optimal(string[i:i + 3], string, i, len(string))
			index = o[0]
			lst[i][0] += 1
			lst[i][1].append(str(index + 1))
			i = o[1]
		lst[li + 1] = lst[li]
		i += 1
		li += 1
	return lst[-2]

def optimal(word, string, i, l):
	if l - (i + 2) > 1:
		if l - (i + 2) >= 3:
			if string[i + 2:i + 2 + 3] == 'one':
				return [i + 2, i + 4]
		if string[i + 3] == word[-1]:
			return [i + 1, i + 1]
	if i > 0:
		if string[i - 1] == word[0]:
			return [i + 1, i + 1]
	return [i, i]
for i in lot:
	m = main(i)
	print(m[0])
	print(' '.join(m[1]))


for _ in range(int(input())):
	st = input()
	deleted = set()
	for i in range(2, len(st) - 2):
		if st[i - 2] == 't' and st[i - 1] == 'w' and (st[i] == 'o') and (st[i + 1] == 'n') and (st[i + 2] == 'e'):
			deleted.add(i)
	for i in range(len(st) - 2):
		if i not in deleted and st[i] == 'o' and (st[i + 1] == 'n') and (st[i + 2] == 'e'):
			deleted.add(i + 1)
		elif i + 2 not in deleted and st[i] == 't' and (st[i + 1] == 'w') and (st[i + 2] == 'o'):
			deleted.add(i + 1)
	print(len(deleted))
	for i in deleted:
		print(i + 1, end=' ')
	print()


import sys
input = sys.stdin.readline
Q = int(input())
Query = [input().rstrip() for _ in range(Q)]
for S in Query:
	L = len(S)
	if L < 3:
		print(0)
		print()
	else:
		A = []
		for i in range(1, L - 1):
			if S[i - 1:i + 2] == 'one':
				A.append((i, 1))
			elif S[i - 1:i + 2] == 'two':
				A.append((i, 2))
		if len(A) == 0:
			print(0)
			print()
		else:
			ans = []
			skip = False
			for j in range(len(A) - 1):
				if skip:
					skip = False
				elif A[j + 1][0] - A[j][0] == 2 and A[j + 1][1] == 1 and (A[j][1] == 2):
					skip = True
					ans.append(A[j][0] + 1)
				else:
					ans.append(A[j][0])
			if not skip:
				ans.append(A[-1][0])
			print(len(ans))
			print(' '.join([str(a + 1) for a in ans]))


t = int(input())
while t > 0:
	t -= 1
	s = input()
	cnt = 0
	a = list()
	i = 0
	while i < len(s) - 2:
		if s[i] == 'o' and s[i + 1] == 'n' and (s[i + 2] == 'e'):
			a.append(i + 2)
			i += 3
			cnt += 1
		elif s[i] == 't' and s[i + 1] == 'w' and (s[i + 2] == 'o'):
			if i + 3 < len(s) and s[i + 3] == 'o':
				a.append(i + 2)
			else:
				a.append(i + 3)
			i += 3
			cnt += 1
		else:
			i += 1
	print(cnt)
	print(' '.join(map(str, a)))


for i in range(int(input())):
	s = input()
	lst = list()
	s1 = list()
	for i in range(len(s)):
		s1.append(s[i])
	for i in range(len(s) - 2):
		if s1[i] == 'o':
			if s1[i + 1] == 'n' and s1[i + 2] == 'e':
				lst.append(i + 2)
		if s1[i] == 't':
			if s1[i + 1] == 'w' and s1[i + 2] == 'o':
				try:
					if s[i + 3] == 'n':
						lst.append(i + 3)
						s1[i + 2] = 'p'
					else:
						lst.append(i + 2)
				except:
					lst.append(i + 2)
	if len(lst) == 0:
		print(0)
		print()
	else:
		print(len(lst))
		print(*lst, sep=' ')


def solve():
	s = input()
	l = len(s)
	i = 0
	ans = []
	while i < l:
		if i + 5 <= l:
			if s[i:i + 5] == 'twone':
				ans.append(i + 3)
				i += 4
				continue
		if i + 3 <= l:
			if s[i:i + 3] == 'two' or s[i:i + 3] == 'one':
				ans.append(i + 2)
				i += 2
		i += 1
	print(len(ans))
	for a in ans:
		print(a, end=' ')
	print()
t = int(input())
while t > 0:
	solve()
	t -= 1


from math import *
from copy import *
from string import *
from sys import stdin
from sys import maxsize
from operator import *
from itertools import *
from collections import Counter
from collections import defaultdict

def solve(s):
	n = len(s)
	l = list(s)
	one = s.count('one')
	two = s.count('two')
	total = one + two
	llen = total * 3
	if total == 0:
		print(0)
		print()
	else:
		(i, ans) = (0, 0)
		L = []
		s += 'zzzzz'
		l = list(s)
		while i < n:
			curr = ''.join(l[i:i + 6])
			if curr == 'onetwo':
				l[i + 1] = 'z'
				L.append(i + 2)
				i += 1
				ans += 1
			elif curr == 'oneone':
				l[i + 1] = 'z'
				L.append(i + 2)
				i += 1
				ans += 1
			elif curr == 'twotwo':
				l[i + 1] = 'z'
				L.append(i + 2)
				i += 1
				ans += 1
			elif l[i:i + 5] == list('twone'):
				l[i + 2] = 'z'
				L.append(i + 3)
				i += 1
				ans += 1
			elif curr == 'onezzz':
				l[i + 1] = 'z'
				L.append(i + 2)
				i += 1
				ans += 1
			elif curr == 'twozzz':
				l[i + 1] = 'z'
				i += 1
				L.append(i + 2)
				ans += 1
			elif l[i:i + 3] == list('two'):
				l[i + 1] = 'z'
				L.append(i + 2)
				i += 1
				ans += 1
			elif l[i:i + 3] == list('one'):
				l[i + 1] = 'z'
				L.append(i + 2)
				i += 1
				ans += 1
			else:
				i += 1
		print(ans)
		print(*L)
T = int(input())
for _ in range(T):
	s = input()
	solve(s)


def main():
	r = []
	for _ in range(int(input())):
		s = input().replace('twone', 'tw_ne').replace('one', 'o_e').replace('two', 't_o')
		n = s.count('_')
		r.append(str(n))
		if n:
			r.append(' '.join(map(str, [i for (i, c) in enumerate(s, 1) if c == '_'])))
	print('\n'.join(r))
main()


for _ in range(int(input())):
	s = input()
	c = []
	s = s.replace('twone', 'tw+ne')
	s = s.replace('two', 't+o')
	s = s.replace('one', 'o+e')
	for i in range(len(s)):
		if s[i] == '+':
			c.append(i + 1)
	print(len(c))
	print(*c)


from sys import stdin, stdout
ans = []
for i in range(int(input())):
	s = stdin.readline()
	(cnt, ans_tmp, j, l) = (0, [], 0, len(s) - 2)
	while j <= l - 2:
		tmp = s[j] + s[j + 1] + s[j + 2]
		if j <= l - 4 and tmp + s[j + 3] + s[j + 4] == 'twone':
			ans_tmp.append(str(j + 3))
			ans_tmp.append(' ')
			cnt += 1
			j += 5
		elif tmp in ['one', 'two']:
			ans_tmp.append(str(j + 2))
			ans_tmp.append(' ')
			cnt += 1
			j += 3
		else:
			j += 1
	ans += [str(cnt), '\n'] + ans_tmp + ['\n']
stdout.write(''.join(ans))


n = int(input())
for i in range(n):
	d = []
	s = list(input())
	a = s
	i = 1
	while i < len(s) - 1:
		if a[i] == 'n' and a[i - 1] == 'o' and (a[i + 1] == 'e'):
			d.append(i + 1)
			i += 2
		elif a[i] == 'w' and a[i - 1] == 't' and (a[i + 1] == 'o'):
			if i == len(s) - 2:
				d.append(i + 1)
				i += 2
			elif a[i + 2] == 'n':
				d.append(i + 2)
				i += 3
			else:
				d.append(i + 1)
				i += 2
		else:
			i += 1
	print(len(d))
	print(*d)


for tests in range(int(input())):
	A = input()
	num = 0
	x = []
	for s in range(len(A) - 2):
		if A[s:s + 3] == 'one':
			if num == 0 or x[-1] != s + 1:
				x.append(s + 2)
				num += 1
		elif A[s:s + 3] == 'two':
			if A[s:s + 5] == 'twone':
				x.append(s + 3)
			else:
				x.append(s + 2)
			num += 1
	print(num)
	if num == 0:
		print('')
	else:
		print(' '.join((str(k) for k in x)))


import sys
from collections import Counter
from math import *
for _ in range(int(input())):
	s = input()
	n = len(s)
	li1 = []
	li2 = []
	li3 = []
	i = 0
	while i + 5 <= n:
		if s[i:i + 5] == 'twone':
			li3.append(i + 2)
			i += 5
			continue
		if s[i:i + 3] == 'one':
			li1.append(i + 1)
			i += 3
			continue
		if s[i:i + 3] == 'two':
			li2.append(i + 1)
			i += 3
			continue
		i += 1
	while i + 3 <= n:
		if s[i:i + 3] == 'one':
			li1.append(i + 1)
			i += 3
		if s[i:i + 3] == 'two':
			li2.append(i + 1)
			i += 3
		i += 1
	print(len(li1) + len(li2) + len(li3))
	for i in sorted(li1 + li2 + li3):
		print(i + 1, end=' ')
	print()


import sys, math
MOD = 10 ** 9 + 7
for _ in range(int(input())):
	s = input() + 'x'
	r = []
	for i in range(len(s)):
		if s[i:i + 3] == 'two':
			if s[i:i + 5] != 'twone':
				r.append(i + 2)
			else:
				r.append(i + 3)
		elif s[i:i + 3] == 'one':
			if s[i - 2:i + 3] != 'twone':
				r.append(i + 2)
	print(len(r))
	print(*r)


T = int(input())
for i in range(T):
	s = [x for x in input().strip()]
	p1 = 0
	r = 0
	A = []
	while p1 < len(s) - 2:
		if p1 < len(s) - 4 and s[p1:p1 + 5] == ['t', 'w', 'o', 'n', 'e']:
			r += 1
			A.append(str(p1 + 3))
			p1 += 5
		elif s[p1:p1 + 3] == ['t', 'w', 'o']:
			r += 1
			A.append(str(p1 + 2))
			p1 += 3
		elif s[p1:p1 + 3] == ['o', 'n', 'e']:
			r += 1
			A.append(str(p1 + 2))
			p1 += 3
		else:
			p1 += 1
	print(r)
	print(' '.join(A))


import math
t = int(input())
for _ in range(t):
	s = list(input())
	n = len(s)
	ans = []
	for i in range(len(s) - 1):
		if s[i] == 't' and s[i + 1] == 'w':
			j = i + 2
			c = 0
			while j < n and s[j] == 'o':
				j += 1
				c += 1
				if c == 2:
					ans.append(i + 2)
					break
			if c == 1:
				ans.append(j)
	s = s[::-1]
	for i in range(len(s) - 1):
		if s[i] == 'e' and s[i + 1] == 'n':
			j = i + 2
			c = 0
			while j < n and s[j] == 'o':
				j += 1
				c += 1
				if c == 2:
					ans.append(n - i - 1)
					break
			if c == 1:
				ans.append(n - j + 1)
	ans = set(ans)
	print(len(ans))
	print(*ans)


def find(s, string):
	inds = []
	for i in range(len(s)):
		if i + len(string) > len(s):
			break
		if s[i:i + len(string)] == string:
			inds.append(i)
	return set(inds)
t = int(input())
for i in range(t):
	s = input()
	ones = find(s, 'one')
	twos = find(s, 'two')
	both = find(s, 'twone')
	inds = []
	for item in ones:
		if item - 2 not in both:
			inds.append(item + 1)
	for item in twos:
		if item not in both:
			inds.append(item + 1)
	for item in both:
		inds.append(item + 2)
	print(len(inds))
	print(' '.join((str(x + 1) for x in inds)))


for _ in range(int(input())):
	s = input()
	cnt = 0
	ans = []
	pv1 = None
	pv2 = None
	k = 0
	n = len(s)
	for i in range(n):
		k += 1
		if s[i] == 'e' or s[i] == 'o':
			if pv1 and pv2:
				if s[i] == 'e' and pv1 == 'n' and (pv2 == 'o'):
					cnt += 1
					if i == n - 1:
						ans.append(i + 1)
						break
					if s[i + 1] == 'e':
						ans.append(i)
						pv1 = s[i]
					else:
						ans.append(i + 1)
				elif s[i] == 'o' and pv1 == 'w' and (pv2 == 't'):
					cnt += 1
					if i == n - 1:
						ans.append(i + 1)
						break
					if s[i + 1] == 'n':
						ans.append(i + 1)
					elif s[i + 1] == 'o':
						ans.append(i)
						pv1 = s[i]
					else:
						ans.append(i + 1)
				else:
					pv2 = pv1
					pv1 = s[i]
			else:
				pv2 = pv1
				pv1 = s[i]
		else:
			pv2 = pv1
			pv1 = s[i]
	print(cnt)
	print(*ans)


t = int(input())
while t:
	t -= 1
	a = input()
	l = len(a)
	s = ['z', 'z']
	(flag1, flag2) = (0, 0)
	co = 0
	flag3 = 0
	res = []
	for i in range(l):
		s.append(a[i])
		if flag1 == 1:
			if a[i] == 'e':
				ind_[2] = i
				flag3 = 1
			else:
				co += 1
				if flag3 == 1:
					res.append(ind_[1])
					flag3 = 0
				else:
					res.append(ind_[2])
					flag3 = 0
				flag1 = 0
				continue
		if flag2 == 1:
			if a[i] == 'o':
				ind_[2] = i
				flag3 = 1
			else:
				co += 1
				if flag3 == 1:
					res.append(ind_[1])
					flag3 = 0
				else:
					if a[i] == 'n':
						s.append('z')
					res.append(ind_[2])
					flag3 = 0
				flag2 = 0
				continue
		if s[-3] + s[-2] + s[-1] == 'one':
			ind_ = [i - 1, i, 1 + i]
			flag1 = 1
			flag2 = 0
		elif s[-3] + s[-2] + s[-1] == 'two':
			ind_ = [i - 1, i, i + 1]
			flag2 = 1
			flag1 = 0
	if flag1 == 1 or flag2 == 1:
		co += 1
		res.append(ind_[1])
	print(co)
	print(*res)


t = int(input().strip())
for _ in range(t):
	s = input().strip()
	l = len(s)
	count = 0
	ps = []
	for (i, c) in enumerate(s):
		if i == 0 or i == l - 1:
			continue
		elif c == 'n' and s[i - 1:i + 2] == 'one':
			if s[i - 3:i + 2] != 'twone':
				ps.append(str(i + 1))
				count += 1
		elif c == 'w' and s[i - 1:i + 2] == 'two':
			if s[i - 1:i + 4] != 'twone':
				ps.append(str(i + 1))
				count += 1
			else:
				ps.append(str(i + 2))
				count += 1
	print(count)
	print(' '.join(ps))


for _ in range(int(input())):
	s = '*' + input()
	i = 0
	ans = []
	while i != -1:
		i = s.find('twone', i)
		if i != -1:
			i += 2
			ans.append(i)
	ans_set = set(ans)
	i = 0
	while i != -1:
		i = s.find('two', i)
		if i != -1:
			if i + 2 not in ans_set:
				ans.append(i + 1)
			i += 2
	i = 0
	while i != -1:
		i = s.find('one', i)
		if i != -1:
			if i not in ans_set:
				ans.append(i + 1)
			i += 2
	ans = set(ans)
	print(len(ans))
	if ans:
		print(*ans)


t = int(input())
for _ in range(t):
	s = input().strip()
	s = s.replace('twone', 'tw*ne')
	s = s.replace('two', 't*o')
	s = s.replace('one', 'o*e')
	ans = [str(i + 1) for (i, c) in enumerate(s) if c == '*']
	print(len(ans))
	print(' '.join(ans))


t = int(input())
for j in range(t):
	s = input()
	s1 = 'one'
	s2 = 'two'
	res1 = [i for i in range(len(s)) if s.startswith(s1, i) and (not s.startswith(s2, i - 2))]
	res2 = [i for i in range(len(s)) if s.startswith(s2, i) and (not s.startswith(s1, i + 2))]
	res3 = [i for i in range(len(s)) if s.startswith(s1, i) and s.startswith(s2, i - 2)]
	if len(res1) + len(res2) + len(res3) == 0:
		print(0)
		print()
		continue
	print(len(res1) + len(res2) + len(res3))
	for i in range(len(res1)):
		print(res1[i] + 2, end=' ')
	for i in range(len(res2)):
		print(res2[i] + 2, end=' ')
	for i in range(len(res3)):
		print(res3[i] + 1, end=' ')
	print()


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

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 ItoS(nn):
	return chr(nn + 97)

def GI(V, E, Directed=False, index=0):
	org_inp = []
	g = [[] for i in range(n)]
	for i in range(E):
		inp = LI()
		org_inp.append(inp)
		if index == 0:
			inp[0] -= 1
			inp[1] -= 1
		if len(inp) == 2:
			(a, b) = inp
			g[a].append(b)
			if not Directed:
				g[b].append(a)
		elif len(inp) == 3:
			(a, b, c) = inp
			aa = (inp[0], inp[2])
			bb = (inp[1], inp[2])
			g[a].append(bb)
			if not Directed:
				g[b].append(aa)
	return (g, org_inp)

def show(*inp, end='\n'):
	if show_flg:
		print(*inp, end=end)
YN = ['Yes', 'No']
mo = 10 ** 9 + 7
inf = float('inf')
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
input = lambda : sys.stdin.readline().rstrip()
show_flg = False
show_flg = True
t = I()
for _ in range(t):
	s = input()
	n = len(s)
	ans = []
	i = 0
	while i < n:
		if s[i] == 'o':
			if i < n - 1 and s[i + 1] == 'n':
				if i < n - 2 and s[i + 2] == 'e':
					ans += [i + 1 + 1]
		elif s[i] == 't':
			if i < n - 1 and s[i + 1] == 'w':
				if i < n - 2 and s[i + 2] == 'o':
					if i < n - 3 and s[i + 3] == 'n':
						if i < n - 4 and s[i + 4] == 'e':
							ans += [i + 2 + 1]
							i = i + 4
						else:
							ans += [i + 1 + 1]
							i = i + 1
					else:
						ans += [i + 1 + 1]
						i = i + 1
		i += 1
	print(len(ans))
	print(*ans)


import re
nn = int(input())
for _ in range(nn):
	s = input()
	idx = [m.start(0) + 3 for m in re.finditer('twone', s)]
	s = s.replace('twone', '11111')
	idx += [m.start(0) + 2 for m in re.finditer('two', s)]
	idx += [m.start(0) + 2 for m in re.finditer('one', s)]
	print(len(idx))
	print(*idx)


q = int(input())
for rqere in range(q):
	s = input()
	n = len(s)
	biore = [1] * n
	odpo = []
	if n < 3:
		print(0)
		print('')
	else:
		for i in range(2, n - 2):
			if s[i - 2:i + 3] == 'twone':
				biore[i] = 0
				odpo.append(i + 1)
		nowe = []
		for i in range(n):
			if biore[i] == 1:
				nowe += [[s[i], i + 1]]
		wynik = len(s) - len(nowe)
		for i in range(len(nowe) - 2):
			slo = nowe[i][0] + nowe[i + 1][0] + nowe[i + 2][0]
			if slo == 'one' or slo == 'two':
				wynik += 1
				odpo.append(nowe[i + 1][1])
		print(wynik)
		print(*odpo)


import sys

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

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

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

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7
for _ in range(INT()):
	S = list(input())
	N = len(S)
	ans = []
	for i in range(N - 3, -1, -1):
		if S[i] == 'o' and S[i + 1] == 'n' and (S[i + 2] == 'e'):
			if i >= 2 and S[i - 2] == 't' and (S[i - 1] == 'w'):
				S[i] = ''
				ans.append(i + 1)
			else:
				S[i + 1] = ''
				ans.append(i + 2)
		elif S[i] == 't' and S[i + 1] == 'w' and (S[i + 2] == 'o'):
			S[i + 1] = ''
			ans.append(i + 2)
	print(len(ans))
	print(*ans)


t = int(input())
for _ in range(t):
	string = input()
	indices = []
	i = 0
	while i < len(string) - 2:
		if i + 5 <= len(string) and string[i:i + 5] == 'twone':
			indices.append(i + 2 + 1)
			i += 4
		elif string[i:i + 3] == 'one' or string[i:i + 3] == 'two':
			indices.append(i + 1 + 1)
			i += 1
		else:
			i += 1
	print(len(indices))
	print(*indices, sep=' ')


for i in range(int(input())):
	s = input()
	k1 = 0
	k2 = 0
	count = 0
	l = []
	j = len(s) - 1
	while j > 1:
		if s[j - 2] == 'o' and s[j - 1] == 'n' and (s[j] == 'e'):
			j -= 3
			count += 1
			if j > 0 and s[j - 1] == 't' and (s[j] == 'w'):
				l.append(j + 2)
			else:
				l.append(j + 3)
		elif s[j - 2] == 't' and s[j - 1] == 'w' and (s[j] == 'o'):
			j -= 3
			count += 1
			l.append(j + 3)
		else:
			j -= 1
	print(count)
	print(*l)


for _ in range(int(input())):
	s = input()
	n = len(s)
	total = 0
	indices = []
	i = 0
	s = s + 'abcdxf'
	while i < n:
		if s[i:i + 5] == 'twone':
			indices.append(i + 3)
			i += 5
		elif s[i:i + 3] in ['two', 'one']:
			if s[i + 3] in ['e', 'o']:
				indices.append(i + 2)
			else:
				indices.append(i + 3)
			i += 3
		else:
			i += 1
	print(len(indices))
	print(' '.join((str(k) for k in indices)))


for _ in range(int(input())):
	ans = 0
	s = input()
	arr = []
	n = len(s)
	z = 1
	for i in range(1, n - 1):
		if s[i - 1] == 'o':
			if s[i] == 'n':
				if s[i + 1] == 'e':
					if z == 1:
						ans += 1
						arr.append(i + 1)
					else:
						z = 1
		if s[i - 1] == 't':
			if s[i] == 'w':
				if s[i + 1] == 'o':
					if i <= n - 4:
						if s[i + 2] == 'n' and s[i + 3] == 'e':
							ans += 1
							arr.append(i + 2)
							z = 0
						else:
							ans += 1
							arr.append(i + 1)
					else:
						arr.append(i + 1)
						ans += 1
	print(ans)
	print(*arr)


import os
import sys
from io import BytesIO, IOBase
import math
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')
for _ in range(int(input())):
	s = input()
	n = len(s)
	total = 0
	p = []
	i = 0
	s = s + 'abcdxf'
	while i < n:
		if s[i:i + 5] == 'twone':
			p.append(i + 3)
			i += 5
		elif s[i:i + 3] in ['two', 'one']:
			if s[i + 3] in ['e', 'o']:
				p.append(i + 2)
			else:
				p.append(i + 3)
			i += 3
		else:
			i += 1
	print(len(p))
	print(*p, end=' ')
	print()


t = int(input())
for _ in range(0, t):
	s = input()
	n = len(s)
	ans = []
	i = 0
	sto = 'twone'
	so = 'one'
	st = 'two'
	while i < n - 2:
		if i + 5 <= n and s[i:i + 5] == sto:
			ans.append(i + 3)
			i += 5
		elif s[i:i + 3] == so:
			ans.append(i + 2)
			i += 3
		elif s[i:i + 3] == st:
			ans.append(i + 2)
			i += 3
		else:
			i += 1
	print(len(ans))
	print(*ans)


for tc in range(int(input())):
	s = list(input())
	temp = []
	i = 0
	f = 1
	a = 1
	while i < len(s):
		if s[i] == 'o':
			if ''.join(s[i:i + 3]) == 'one':
				c = 1
				temp.append(i + 1)
				k = i + 3
				f = 1
				if f:
					i += 3
				else:
					i = k
				a = 3
				continue
		elif s[i] == 't':
			if ''.join(s[i:i + 5]) == 'twone':
				c = 0
				temp.append(i + 2)
				i += 5
				continue
			elif ''.join(s[i:i + 3]) == 'two':
				temp.append(i + 1)
				k = i + 3
				f = 1
				if f:
					i += 3
				else:
					i = k
				continue
		i = i + 1
	l = list(set(temp))
	print(len(l))
	if len(l) == 0:
		print()
	else:
		for i in range(len(l)):
			if i != len(l) - 1:
				print(l[i] + 1, end=' ')
			else:
				print(l[i] + 1)


x = int(input())
for _ in range(x):
	a = input()
	b = len(a)
	lol = []
	if b >= 3:
		i = 0
		j = 1
		k = 2
		while i < b - 2 and k < b:
			if (a[i] + a[j] + a[k] == 'one' or a[i] + a[j] + a[k] == 'two') and k < b:
				f = 0
				if a[i] + a[j] + a[k] == 'two' and k < b - 2:
					if a[k] + a[k + 1] + a[k + 2] == 'one':
						lol.append(k + 1)
						f = 1
						i = k + 3
						j = i + 1
						k = j + 1
				if f == 0:
					lol.append(j + 1)
					i += 1
					j += 1
					k += 1
			else:
				i += 1
				j += 1
				k += 1
	print(len(lol))
	print(*lol)


t = int(input())
for _ in range(t):
	s = input() + '   '
	i = 0
	ans = []
	while i < len(s) - 3:
		if s[i] == 'o':
			if s[i + 1] == 'n':
				if s[i + 2] == 'e':
					ans.append(i + 1)
					i += 2
				else:
					i += 1
		elif s[i] == 't':
			if s[i + 1] == 'w':
				if s[i + 2] == 'o':
					if s[i + 3] == 'n':
						ans.append(i + 2)
						i += 3
					else:
						ans.append(i + 1)
						i += 2
				else:
					i += 1
		i += 1
	if len(ans) == 0:
		print(0)
		print()
	else:
		print(len(ans))
		for i in ans:
			print(i + 1, end=' ')
		print()


for _ in range(int(input())):
	l = input()
	g = list()
	for i in range(len(l)):
		try:
			if l[i:i + 3] == 'two':
				try:
					if l[i:i + 5] == 'twone':
						g.append(str(i + 2 + 1))
						continue
				except:
					pass
			if l[i:i + 3] == 'two':
				g.append(str(i + 1 + 1))
				continue
			if l[i:i + 3] == 'one':
				try:
					if l[i - 2:i + 3] == 'twone':
						continue
				except:
					pass
				g.append(str(i + 1 + 1))
				continue
		except:
			pass
	print(len(g))
	print(' '.join(g))


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')
testcases = int(input())
for j in range(testcases):
	string1 = input()
	setty = set([])
	for s in range(len(string1) - 2):
		stringy = string1[s:s + 3]
		if stringy == 'two':
			if s + 4 <= len(string1) - 1 and string1[s + 3] != 'o':
				setty.add(str(s + 3))
			else:
				setty.add(str(s + 2))
		elif stringy == 'one':
			if s - 1 >= 0 and string1[s - 1] != 'o':
				setty.add(str(s + 1))
			else:
				setty.add(str(s + 2))
	print(len(setty))
	newy = [k for k in setty]
	print(' '.join(setty))


import sys

def main():
	for tc in range(int(input())):
		s = list(input())
		ans = []
		for i in range(len(s) - 2):
			x = ''.join(s[i:i + 3])
			y = ''
			if i < len(s) - 4:
				y = ''.join(s[i + 2:i + 5])
			if x == 'one':
				ans.append(i + 2)
				s[i + 1] = '#'
			elif x == 'two':
				if y == 'one':
					ans.append(i + 3)
					s[i + 2] = '#'
				else:
					ans.append(i + 2)
					s[i + 1] = '#'
		print(len(ans))
		print(*ans)
get_array = lambda : list(map(int, sys.stdin.readline().split()))
get_ints = lambda : map(int, sys.stdin.readline().split())
input = lambda : sys.stdin.readline().strip()
main()


import math
a = int(input())
c = []
for i in range(a):
	b = input()
	c.append(b)

def onesfind(s):
	x = []
	for i in range(max(len(s) - 2, 0)):
		if s[i] == 'o' and s[i + 1] == 'n' and (s[i + 2] == 'e'):
			x.append(i)
	return x

def twosfind(s):
	x = []
	for i in range(max(len(s) - 2, 0)):
		if s[i] == 't' and s[i + 1] == 'w' and (s[i + 2] == 'o'):
			x.append(i)
	return x

def twonesfind(s):
	x = []
	for i in range(max(len(s) - 4, 0)):
		if s[i] == 't' and s[i + 1] == 'w' and (s[i + 2] == 'o') and (s[i + 3] == 'n') and (s[i + 4] == 'e'):
			x.append(i)
	return x
for i in range(len(c)):
	(pone, ptwo, ptwone) = (onesfind(c[i]), twosfind(c[i]), twonesfind(c[i]))
	two = list(set(ptwo[:]) - set(ptwone[:]))
	twone = ptwone[:]
	for i in range(len(ptwone)):
		ptwone[i] += 2
	one = list(set(pone[:]) - set(ptwone[:]))
	oneplustwo = []
	for i in one:
		oneplustwo.append(i + 2)
	for i in two:
		oneplustwo.append(i + 2)
	for i in twone:
		oneplustwo.append(i + 3)
	print(len(oneplustwo))
	print(*oneplustwo)


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

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

def si():
	return input()

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

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

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

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

def getKey(item):
	return item[0]

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

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

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

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

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

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

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

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

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

def main():
	for _ in range(ii()):
		s = si()
		n = len(s)
		cnt = 0
		ans = []
		f = [0] * n
		for i in range(n):
			g = 0
			if i + 5 <= n and f[i] == 0:
				if s[i:i + 5] == 'twone':
					cnt += 1
					ans.append(i + 3)
					for j in range(i, i + 5):
						f[j] = 1
					g = 1
			if i + 3 <= n and f[i] == 0 and (g == 0):
				if s[i:i + 3] == 'two' or s[i:i + 3] == 'one':
					cnt += 1
					ans.append(i + 2)
					for j in range(i, i + 3):
						f[j] = 1
		print(cnt)
		print(*ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

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

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


from collections import *
for _ in range(int(input())):
	s = input()
	s += 'yy'
	d = defaultdict(lambda : 0)
	a = list()
	s1 = 0
	for i in range(len(s)):
		if s[i] == 'o':
			if s1 == 0 or s1 == 1:
				s1 = 1
			else:
				s1 = 1
		elif s[i] == 'n':
			if s1 == 1:
				s1 = 2
			else:
				s1 = 0
		elif s[i] == 'e':
			if s1 == 2:
				s1 = 3
			else:
				s1 = 0
		else:
			s1 = 0
		if s1 == 3:
			i1 = i - 4
			i2 = i - 3
			if s[i1] == 't' and s[i2] == 'w':
				d[i - 2] = 1
				a.append(i - 1)
			else:
				d[i - 1] = 1
				a.append(i)
			s1 = 0
	s1 = 0
	for i in range(len(s)):
		if d[i] == 0:
			if s[i] == 't':
				if s1 == 0 or s1 == 1:
					s1 = 1
				else:
					s1 = 1
			elif s[i] == 'w':
				if s1 == 1:
					s1 = 2
				else:
					s1 = 0
			elif s[i] == 'o':
				if s1 == 2:
					s1 = 3
				else:
					s1 = 0
			else:
				s1 = 0
			if s1 == 3:
				d[i - 1] = 1
				a.append(i)
				s1 = 0
	print(len(a))
	print(*a)


t = int(input())
for _ in range(t):
	s = input()
	a = s.count('one')
	b = s.count('two')
	c = s.count('twone')
	if a + b == 0:
		print(0)
		print(' ')
	else:
		count = a + b - c
		i = 0
		ans = []
		while i < len(s) - 2:
			if s[i:i + 5] == 'twone':
				ans.append(str(i + 3))
				i += 5
			elif s[i:i + 3] == 'one' or s[i:i + 3] == 'two':
				ans.append(str(i + 2))
				i += 3
			else:
				i += 1
		print(count)
		print(' '.join(ans))


import math
t = int(input())
while t:
	t += -1
	s = input()
	s = list(s)
	ans = []
	for i in range(len(s) - 2):
		if s[i] == 'o' and s[i + 1] == 'n' and (s[i + 2] == 'e'):
			if i > 0:
				if s[i - 1] == 'o':
					ans.append(i + 2)
					s[i + 1] = '!'
				else:
					ans.append(i + 1)
					s[i] = '!'
			else:
				ans.append(i + 1)
				s[i] = '!'
	for i in range(len(s) - 2):
		if s[i] == 't' and s[i + 1] == 'w' and (s[i + 2] == 'o'):
			ans.append(i + 2)
	print(len(ans))
	print(*ans)


for i in range(int(input())):
	seg = list(input())
	ind = []
	i = 0
	while i < len(seg) - 2:
		if seg[i] not in ('t', 'o'):
			i += 1
		elif seg[i:i + 5] == ['t', 'w', 'o', 'n', 'e']:
			ind += [i + 3]
			i += 5
		elif seg[i:i + 3] == ['t', 'w', 'o'] or seg[i:i + 3] == ['o', 'n', 'e']:
			ind += [i + 2]
			i += 3
		else:
			i += 1
	print(len(ind))
	print(*ind)


t = int(input())
for i in range(t):
	s = input()
	d = []
	cnt = 0
	for i in range(len(s) - 2):
		if cnt <= 0:
			flag = True
		if s[i:i + 3] == 'one':
			if flag == True:
				d.append(i + 2)
		elif s[i:i + 3] == 'two':
			if i <= len(s) - 5:
				if s[i + 2:i + 5] == 'one':
					d.append(i + 3)
					flag = False
					cnt = 3
				else:
					d.append(i + 2)
			else:
				d.append(i + 2)
		cnt -= 1
	print(len(d))
	print(*d)


t = int(input())
for i in range(t):
	s = list(input())
	l = len(s)
	ans = []
	i = 0
	while i < l:
		flag = 0
		if i <= l - 5:
			k = s[i:i + 5]
			a = ['t', 'w', 'o', 'n', 'e']
			if a == k:
				ans.append(i + 3)
				i += 4
				flag = 1
		if i <= l - 3:
			k = s[i:i + 3]
			a = ['t', 'w', 'o']
			b = ['o', 'n', 'e']
			if k == a or k == b:
				ans.append(i + 2)
				i += 2
				flag = 1
		if flag == 0:
			i += 1
	print(len(ans))
	print(*ans)


import os
import sys
import bisect
from math import gcd, ceil
from heapq import heapify, heappop, heappush
from io import BytesIO, IOBase

def main():
	for _ in range(int(input())):
		s = input()
		one = set([i + 1 for i in range(len(s)) if s.startswith('one', i)])
		two = set([i + 3 for i in range(len(s)) if s.startswith('two', i)])
		ans = set()
		for x in one:
			if x in two:
				ans.add(x)
		for x in one:
			if x not in ans:
				ans.add(x + 1)
		for y in two:
			if y not in ans:
				ans.add(y - 1)
		if len(ans) == 0:
			print(0)
		else:
			print(len(ans))
			for x in ans:
				print(x, end=' ')
			print('')
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 = lambda s: self.buffer.write(s.encode()) if self.writable else None

	def read(self):
		if self.buffer.tell():
			return self.buffer.read().decode('ascii')
		return os.read(self._fd, os.fstat(self._fd).st_size).decode('ascii')

	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().decode('ascii')

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

def print(*args, sep=' ', end='\n', file=sys.stdout, flush=False):
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(end)
	if flush:
		file.flush()
(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
sys.setrecursionlimit(10000)
main()


t = int(input())
for tt in range(t):
	s = input().strip()
	arr = []
	for i in s:
		arr.append(i)
	ans = []
	for i in range(len(s)):
		if i + 4 < len(s):
			if arr[i] == 't' and arr[i + 1] == 'w' and (arr[i + 2] == 'o') and (arr[i + 3] == 'n') and (arr[i + 4] == 'e'):
				arr[i + 2] = 'x'
				ans.append(i + 2)
		else:
			break
	for i in range(len(s)):
		if i + 2 < len(s):
			if arr[i] == 'o' and arr[i + 1] == 'n' and (arr[i + 2] == 'e'):
				arr[i + 1] == 'x'
				ans.append(i + 1)
			elif arr[i] == 't' and arr[i + 1] == 'w' and (arr[i + 2] == 'o'):
				arr[i + 2] == 'x'
				ans.append(i + 1)
	print(len(ans))
	for i in ans:
		print(i + 1, end=' ')
	print()


t = int(input())
for i in range(t):
	s = input()
	n = len(s)
	j = 0
	ans = []
	while j < n:
		if s[j:j + 5] == 'twone':
			ans.append(j + 2 + 1)
			j += 5
		elif s[j:j + 3] == 'two':
			ans.append(j + 1 + 1)
			j += 3
		elif s[j:j + 3] == 'one':
			ans.append(j + 1 + 1)
			j += 3
		else:
			j += 1
	print(len(ans))
	print(*ans)


t = int(input())
while t > 0:
	t -= 1
	s = list(input().strip())
	n = len(s)
	change = 0
	ans = []
	for i in range(n - 4):
		if ''.join(s[i:i + 5]) == 'twone':
			s[i + 2] = '-'
			change += 1
			ans.append(i + 3)
	for i in range(n - 2):
		val = ''.join(s[i:i + 3])
		if val == 'one' or val == 'two':
			s[i + 1] = '-'
			change += 1
			ans.append(i + 2)
	if change > 0:
		print(change)
		print(' '.join(map(str, ans)))
	else:
		print(change)
		print()