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


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	s = input()
	n = len(s)
	check = [0] * n
	ans = []
	for i in range(n):
		if s[i:i + 5] == 'twone':
			ans.append(str(i + 3))
			for j in range(i, i + 5):
				check[j] = 1
	for i in range(n):
		if check[i]:
			continue
		if s[i:i + 3] == 'one':
			ans.append(str(i + 2))
		if s[i:i + 3] == 'two':
			ans.append(str(i + 2))
	print(s.count('one') + s.count('two') - s.count('twone'))
	print(' '.join(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 case in range(int(input())):
	k = input()
	b = 0
	c = []
	k = k.replace('twone', 'tw.ne')
	k = k.replace('one', 'o.e')
	k = k.replace('two', 't.o')
	for j in range(len(k)):
		c.append(j + 1) if k[j] == '.' else ''
	print(k.count('.'))
	print(*c)


t = int(input())
for i in range(t):
	ch = input()
	n = len(ch)
	tab = [0] * (n + 1)
	L = []
	s = set()
	for j in range(1, n - 1):
		if ch[j - 1] == 't' and ch[j] == 'w' and (ch[j + 1] == 'o'):
			if j + 3 < n and ch[j + 2] == 'n' and (ch[j + 3] == 'e'):
				L.append(j + 2)
				tab[j + 2] = 1
			else:
				L.append(j + 1)
		if ch[j - 1] == 'o' and ch[j] == 'n' and (ch[j + 1] == 'e'):
			if tab[j] == 0:
				if j - 3 >= 0 and ch[j - 3] == 't' and (ch[j - 2] == 'w'):
					L.append(j)
				else:
					L.append(j + 1)
	s = ''
	if L == []:
		print(0)
		print()
	else:
		print(len(L))
		for j in range(len(L)):
			s += str(L[j]) + ' '
		print(s)


def find_ans(s):
	n = len(s)
	i = 0
	ans = 0
	index = []
	while i < n:
		if i + 5 <= n:
			if s[i] == 't' and s[i + 1] == 'w' and (s[i + 2] == 'o') and (s[i + 3] == 'n') and (s[i + 4] == 'e'):
				ans += 1
				index.append(i + 2 + 1)
				i += 5
				continue
		if i + 3 <= n:
			if s[i] == 't' and s[i + 1] == 'w' and (s[i + 2] == 'o'):
				ans += 1
				index.append(i + 1 + 1)
				i += 3
				continue
			elif s[i] == 'o' and s[i + 1] == 'n' and (s[i + 2] == 'e'):
				ans += 1
				index.append(i + 1 + 1)
				i += 3
				continue
		i += 1
	print(ans)
	print(*index)
for _ in range(int(input())):
	find_ans(input())


N = int(input())
for case in range(N):
	s = input()
	s = s + '      '
	arr = []
	i = 0
	while i < len(s) - 5:
		if s[i:i + 5] == 'twone':
			arr.append(i + 3)
			i += 5
		elif s[i:i + 3] == 'one' or s[i:i + 3] == 'two':
			arr.append(i + 2)
			i += 3
		else:
			i += 1
	print(len(arr))
	print(*arr)


from math import *
from collections import *
import sys
sys.setrecursionlimit(10 ** 9)
mod = 10 ** 9 + 7
t = int(input())
for y in range(t):
	a = input()
	n = len(a)
	i = 0
	ch = 0
	ans = []
	while i <= n - 3:
		if a[i:i + 3] == 'one':
			ch += 1
			ans.append(i + 2)
			i += 3
		elif a[i:i + 3] == 'two':
			if i <= n - 5:
				if a[i:i + 5] == 'twone':
					ans.append(i + 3)
				else:
					ans.append(i + 2)
			else:
				ans.append(i + 2)
			ch += 1
			i += 3
		else:
			i += 1
	print(ch)
	for i in ans:
		print(i, end=' ')
	print()


t = int(input())
for _ in range(t):
	s = input().strip()
	n = len(s)
	arr = []
	i = 0
	while i < n:
		if s[i:i + 3] == 'one':
			arr.append(i + 1)
		elif s[i:i + 3] == 'two':
			if s[i + 2:i + 5] == 'one':
				arr.append(i + 2)
				i += 2
			else:
				arr.append(i + 1)
		i += 1
	print(len(arr))
	arr = ' '.join([str(i + 1) for i in arr])
	print(arr)


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)


t = int(input())
for _ in range(t):
	s = input()
	n = len(s)
	checked = set()
	sol = []
	cnt = 0
	for i in range(n - 4):
		if s[i:i + 5] == 'twone':
			checked.add(i)
			checked.add(i + 2)
			cnt += 1
			sol.append(i + 2 + 1)
	for i in range(n - 2):
		if i in checked:
			continue
		if s[i:i + 3] in ('one', 'two'):
			cnt += 1
			sol.append(i + 1 + 1)
	print(cnt)
	print(*sol)


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


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


import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')

def oneLineArrayPrint(arr):
	print(' '.join([str(x) for x in arr]))
t = int(input())
for _ in range(t):
	s = list(input())
	ans = []
	for i in range(len(s)):
		if ''.join(s[i:i + 5]) == 'twone':
			ans.append(i + 3)
			s[i + 2] = 'z'
		elif ''.join(s[i:i + 3]) == 'one':
			ans.append(i + 2)
		elif ''.join(s[i:i + 3]) == 'two':
			ans.append(i + 2)
	print(len(ans))
	oneLineArrayPrint(ans)


for _ in range(int(input())):
	a = input()
	n = len(a)
	d = set()
	for i in range(n - 4):
		if a[i:i + 5] == 'twone':
			d.add(i + 2 + 1)
	for i in range(n - 2):
		if a[i:i + 3] == 'two' and i + 2 + 1 not in d or (a[i:i + 3] == 'one' and i + 1 not in d):
			d.add(i + 1 + 1)
	print(len(d))
	print(' '.join(list(map(str, d))))


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


for _ in range(int(input())):
	l = list(input())
	n = len(l)
	cnt = []
	for i in range(n - 2):
		if i + 5 <= n:
			if l[i:i + 5] == list('twone'):
				l[i + 2] = ' '
				cnt.append(i + 3)
				continue
		if l[i:i + 3] == list('one'):
			l[i + 1] = ' '
			cnt.append(i + 2)
		if l[i:i + 3] == list('two'):
			l[i + 1] = ' '
			cnt.append(i + 2)
	print(len(cnt))
	print(*cnt)


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


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


import sys
from collections import defaultdict
t = int(sys.stdin.readline())
for _ in range(t):
	s = sys.stdin.readline()[:-1]
	n = len(s)
	if n < 3:
		print(0)
		print('')
		continue
	(one, two) = (0, 1)
	arr = []
	dic = defaultdict(int)
	for i in range(1, n - 1):
		if s[i] == 'w':
			if s[i - 1] == 't' and s[i + 1] == 'o':
				if i + 3 < n:
					if s[i + 1:i + 4] == 'one':
						arr.append(i + 2)
						dic[i + 1] = 1
					else:
						arr.append(i + 1)
					continue
				else:
					arr.append(i + 1)
					continue
			continue
		if s[i] == 'n':
			if s[i - 1] == 'o' and s[i + 1] == 'e' and (dic[i - 1] == 0):
				arr.append(i + 1)
	print(len(arr))
	print(*arr)


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


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


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()
	dp = []
	i = 2
	while i < len(s):
		if s[i - 2] + s[i - 1] + s[i] == 'one':
			dp.append(i - 1 + 1)
		elif s[i - 2] + s[i - 1] + s[i] == 'two':
			if i < len(s) - 2:
				if s[i + 1] + s[i + 2] == 'ne':
					dp.append(i + 1)
					i += 2
				else:
					dp.append(i - 1 + 1)
			else:
				dp.append(i - 1 + 1)
		i += 1
	dp = list(dp)
	print(len(dp))
	print(*dp)


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


from sys import stdout
printn = lambda x: stdout.write(x)
inn = lambda : int(input())
inl = lambda : list(map(int, input().split()))
inm = lambda : map(int, input().split())
DBG = True
BIG = 999999999
R = 10 ** 9 + 7

def ddprint(x):
	if DBG:
		print(x)
t = inn()
for _ in range(t):
	s = input().strip()
	ln = len(s)
	a = []
	i = 0
	while i < ln - 2:
		if s[i] == 't' and s[i + 1] == 'w' and (s[i + 2] == 'o'):
			if i < ln - 3 and s[i + 3] == 'o':
				a.append(i + 1)
				i += 2
			else:
				a.append(i + 2)
				i += 3
		elif s[i] == 'o' and s[i + 1] == 'n' and (s[i + 2] == 'e'):
			if i < ln - 3 and s[i + 3] == 'e':
				a.append(i + 1)
				i += 2
			else:
				a.append(i + 2)
				i += 3
		else:
			i += 1
	print(len(a))
	for (i, x) in enumerate(a):
		printn((' ' if i > 0 else '') + str(x + 1))
	print('')


import sys
input = sys.stdin.readline
for i in range(int(input())):
	g = input()
	s = list(g)
	ans = []
	for i in range(len(s)):
		if s[i] == 't' and s[i + 1] == 'w' and (s[i + 2] == 'o') and (s[i + 3] == 'n') and (s[i + 4] == 'e'):
			ans.append(i + 3)
			s[i + 2] = 'd'
		elif s[i] == 't' and s[i + 1] == 'w' and (s[i + 2] == 'o'):
			ans.append(i + 2)
		elif s[i] == 'o' and s[i + 1] == 'n' and (s[i + 2] == 'e'):
			ans.append(i + 2)
	print(len(ans))
	print(*ans)


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


from sys import stdin, stdout
import heapq
import cProfile
from collections import Counter, defaultdict, deque
from functools import reduce
import math

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

def main():
	st = input()
	n = len(st)
	i = 0
	ans = []
	while i < n:
		if 'twone' == st[i:i + 5]:
			i += 3
			ans.append(i)
		if st[i:i + 3] in ('one', 'two'):
			i += 2
			ans.append(i)
		i += 1
	print(len(ans))
	print(*ans)
TestCases = True
if TestCases:
	for i in range(get_int()):
		main()
else:
	main()


t = int(input())
for _ in range(t):
	s = input()
	(A, B, C) = (0, 0, 0)
	j = 0
	a = []
	while j < len(s) - 2:
		if s[j:j + 3] == 'one':
			a.append(j + 1)
			j += 3
		elif s[j:j + 3] == 'two':
			if j < len(s) - 4:
				if s[j + 3:j + 5] == 'ne':
					a.append(j + 2)
					j += 5
				else:
					a.append(j + 1)
					j += 3
			else:
				a.append(j + 1)
				j += 3
		else:
			j += 1
	print(len(a))
	for l in a:
		print(l + 1, end=' ')
	print()


t = int(input())
while t:
	t -= 1
	a = input()
	n = len(a)
	ans = []
	for i in range(n):
		if a[i] == 'o':
			if i < n - 2 and a[i + 1] == 'n' and (a[i + 2] == 'e'):
				if i > 0 and a[i - 1] == 'o':
					ans += [i + 2]
				else:
					ans += [i + 1]
			elif i - 2 >= 0 and a[i - 1] == 'w' and (a[i - 2] == 't'):
				if i < n - 1 and a[i + 1] == 'o':
					ans += [i]
				else:
					ans += [i + 1]
	print(len(ans))
	if len(ans):
		print(*ans)
	else:
		print()


t = int(input())
for i in range(t):
	e = input()
	o = 0
	t = 0
	ot = 0
	l = set()
	k = 0
	for jk in range(len(e)):
		qw = 0
		if k < len(e) - 2:
			if e[k:k + 3] == 'one':
				o += 1
				l.add(k + 2)
				k = k + 3
				continue
			elif e[k:k + 3] == 'two':
				t += 1
				if k < len(e) - 4:
					if e[k:k + 5] == 'twone':
						ot += 1
						l.add(k + 3)
						k = k + 5
						continue
				l.add(k + 2)
				qw = 1
				k = k + 3
				continue
		k = k + 1
	print(o + t)
	print(*l)


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)


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)


ones = 'one'
one = 0
twos = 'two'
two = 0
for i in range(int(input())):
	(one, two) = (0, 0)
	s = input()
	cnt = 0
	a = list()
	for j in range(len(s)):
		if s[j] == ones[one]:
			one += 1
		elif s[j] == ones[0]:
			one = 1
		else:
			one = 0
		if s[j] == twos[two]:
			two += 1
		elif s[j] == twos[0]:
			two = 1
		else:
			two = 0
		if two == 3:
			if j < len(s) - 1 and s[j + 1] == 'n':
				one = 0
				a.append(j + 1)
			else:
				a.append(j)
			two = 0
			cnt += 1
		if one == 3:
			a.append(j)
			one = 0
			cnt += 1
			two = 0
	print(cnt)
	print(*a)


for t in range(int(input())):
	st = input()
	li = []
	length = len(st) - 2
	i = 0
	while i < length:
		if st[i] == 'o':
			if st[i:i + 3] == 'one':
				li.append(i + 1)
				i = i + 2
		elif st[i] == 't':
			if i < length - 2 and st[i:i + 5] == 'twone':
				li.append(i + 2)
				i = i + 4
			elif st[i:i + 3] == 'two':
				li.append(i + 1)
				i = i + 2
		i = i + 1
	print(len(li))
	for i in li:
		print(i + 1, end=' ')
	print()


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


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


from sys import stdin, stdout
T = int(stdin.readline().strip())
lines = []
for _ in range(T):
	s = stdin.readline().strip()
	c = 0
	pos = []
	(i, j) = (0, len(s))
	while i < j:
		if s[i:i + 5] == 'twone':
			c += 1
			pos.append(str(i + 3))
			i += 5
		elif s[i:i + 3] == 'two' or s[i:i + 3] == 'one':
			c += 1
			pos.append(str(i + 2))
			i += 3
		else:
			i += 1
	lines.append('{}\n'.format(c))
	lines.append(' '.join(pos) + '\n')
stdout.writelines(lines)


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


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)


from sys import stdin, stdout
import math
import heapq
import collections
input = stdin.readline

def inputnum():
	return int(input())

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

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

def inputstring():
	return [x for x in input()]

def inputstrings():
	return [x for x in input().split()]

def inputstringnum():
	return [ord(x) - ord('a') for x in input()]

def inputmatrixchar(rows):
	arr2d = [[j for j in input().strip()] for i in range(rows)]
	return arr2d

def inputmatrixint(rows):
	arr2d = []
	for _ in range(rows):
		arr2d.append([int(i) for i in input().split()])
	return arr2d
t = int(input())
for q in range(t):
	s = input()
	a = []
	i = 0
	while i < len(s) - 2:
		if s[i:i + 5] == 'twone':
			a.append(i + 3)
			i += 5
		elif s[i:i + 3] == 'two':
			a.append(i + 2)
			i += 3
		elif s[i:i + 3] == 'one':
			a.append(i + 2)
			i += 3
		else:
			i += 1
	print(len(a))
	print(*a)


T = int(input())
anwer = ''
for t in range(T):
	string = list(input())
	n = len(string)
	remove = list()
	count = 0
	twone = list('twone')
	one = list('one')
	two = list('two')
	for i in range(n):
		if i != 0:
			if i + 3 < n:
				if string[i - 1:i + 4] == twone:
					string[i + 1] = ' '
					remove.append(i + 2)
					count += 1
					continue
				s = string[i - 1:i + 2]
				if s == one or s == two:
					string[i] = ' '
					remove.append(i + 1)
					count += 1
					continue
			elif i + 1 < n:
				s = string[i - 1:i + 2]
				if s == one or s == two:
					string[i] = ' '
					remove.append(i + 1)
					count += 1
					continue
	anwer += str(count) + '\n'
	for r in remove:
		anwer += str(r) + ' '
	anwer += '\n'
print(anwer)


import sys
import math as mt
t = int(input())
for _ in range(t):
	s = input()
	s1 = 'twone'
	ind = {}
	i = 0
	n = len(s)
	l1 = []
	while i < n - 4:
		k = 0
		for j in range(i, i + 5):
			if s[j] == s1[k]:
				k += 1
			else:
				break
		if k == 5:
			ind[i + 2] = 1
			i += 4
		i += 1
	sn = ''
	i1 = 0
	for i in range(n):
		if ind.get(i, -1) == -1:
			l1.append([s[i], i])
	s2 = 'two'
	s3 = 'one'
	i = 0
	while i < len(l1) - 2:
		k = 0
		for j in range(i, i + 3):
			if l1[j][0] == s2[k]:
				k += 1
			else:
				break
		if k == 3:
			ind[l1[i + 1][1]] = 1
			i += 2
		else:
			k = 0
			for j in range(i, i + 3):
				if l1[j][0] == s3[k]:
					k += 1
				else:
					break
			if k == 3:
				ind[l1[i + 1][1]] = 1
				i += 2
		i += 1
	print(len(ind))
	for i in ind:
		print(i + 1, end=' ')
	print()


for _ in range(int(input())):
	s = input()
	x = len(s)
	ans = []
	i = 0
	while i < x:
		if s[i:i + 5] == 'twone':
			ans.append(i + 2)
			i += 5
		elif s[i:i + 3] == 'two':
			ans.append(i + 1)
			i += 1
		elif s[i:i + 3] == 'one':
			ans.append(i + 1)
			i += 1
		else:
			i += 1
	print(len(ans))
	for an in ans:
		print(an + 1, end=' ')
	print()


from sys import stdin
for _ in range(int(input())):
	s = list(stdin.readline().rstrip())
	l = len(s)
	z = []
	for i in range(1, l - 1):
		if s[i] == 'n':
			if s[i - 1] == 'o' and s[i + 1] == 'e':
				z.append(i + 1)
				s[i - 1] = s[i + 1] = s[i] = '-'
		if s[i] == 'w':
			if len(s) - 1 - i - 3 >= 0:
				if s[i - 1] == 't' and s[i + 1] == 'o':
					if s[i + 2] == 'n' and s[i + 3] == 'e':
						z.append(i + 2)
						s[i - 1] = s[i] = s[i + 1] = s[i + 2] = s[i + 3] = '-'
					else:
						z.append(i + 1)
						s[i - 1] = s[i] = s[i + 1] = '-'
			elif s[i - 1] == 't' and s[i + 1] == 'o':
				z.append(i + 1)
				s[i - 1] = s[i] = s[i + 1] = '-'
	print(len(z))
	print(*z)


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


for _ in [0] * int(input()):
	ins = input()
	lens = len(ins)
	pos = 0
	answer = []
	while pos < lens:
		if ins[pos:pos + 5] == 'twone':
			answer.append(pos + 3)
			pos += 5
		elif ins[pos:pos + 3] == 'two':
			answer.append(pos + 2)
			pos += 3
		elif ins[pos:pos + 3] == 'one':
			answer.append(pos + 2)
			pos += 3
		else:
			pos += 1
	print(len(answer))
	print(*answer)


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


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


for _ in range(int(input())):
	a = input()
	a += 'z'
	b = [0] * len(a)
	d = 1
	while d < len(a) - 1:
		d += 1
		if a[d - 2] + a[d - 1] + a[d] in ['one', 'two']:
			b[d - 1] += 1
	for i in range(len(b) - 1):
		if b[i] == 1 and b[i + 2] == 1:
			b[i] = 0
			b[i + 2] = 0
			b[i + 1] = 1
	print(b.count(1))
	for i in range(len(b)):
		if b[i] == 1:
			print(i + 1, end=' ')
	print()


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


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


t = int(input())
for _ in range(t):
	s = list(input())
	n = len(s)
	ans = []
	i = 0
	while i < n:
		if ''.join(s[i:i + 5]) == 'twone':
			ans.append(i + 3)
			s[i + 2] = '?'
			i += 5
		elif ''.join(s[i:i + 3]) == 'one':
			ans.append(i + 2)
			s[i + 1] = '?'
			i += 3
		elif ''.join(s[i:i + 3]) == 'two':
			ans.append(i + 2)
			s[i + 1] = '?'
			i += 3
		else:
			i += 1
	print(len(ans))
	print(' '.join(map(str, ans)))


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


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


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


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)


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


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


t = int(input())
for i in range(t):
	s = input()
	n = len(s)
	ans = [''] * n
	ansn = 0
	i = 0
	while i < n:
		if i < n - 2:
			if i < n - 4 and s[i:i + 5] == 'twone':
				ans[i + 2] = str(i + 3) + ' '
				ansn += 1
				i += 4
			elif i < n - 2 and (s[i:i + 3] == 'one' or s[i:i + 3] == 'two'):
				ans[i + 1] = str(i + 2) + ' '
				ansn += 1
				i += 2
		i += 1
	print(ansn)
	print(''.join(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)


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


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


from sys import *
from math import *
t = int(input())
for _ in range(t):
	s = input()
	n = len(s)
	o = 'one'
	t = 'two'
	ans = []
	for i in range(n - 2):
		x = s[i:i + 3]
		if x == o:
			f = 0
			if i > 0:
				if s[i - 1] == 'o':
					f = 1
					ans.append(i + 2)
			if f == 0:
				ans.append(i + 1)
		if x == t:
			f = 0
			if i + 3 <= n - 1:
				if s[i + 3] == 'o':
					f = 1
					ans.append(i + 2)
			if f == 0:
				ans.append(i + 3)
	ans.sort()
	ans1 = []
	if len(ans) > 0:
		ans1 = [ans[0]]
		for i in range(1, len(ans)):
			if ans[i] != ans[i - 1]:
				ans1.append(ans[i])
	print(len(ans1))
	print(*ans1)


t = int(input())
for i in range(t):
	so = input()
	s = list(so)
	count = []
	form = ''
	validarr = ['one', 'two', 'twone']
	j = 0
	inde = 0
	n = len(s)
	while j < len(s):
		if s[j] == 't':
			if j + 2 < n:
				if ''.join(s[j:j + 3]) in validarr:
					if j + 5 <= n:
						if ''.join(s[j:j + 5]) in validarr:
							count.append(j + 3)
							inde += 1
							j += 5
						else:
							count.append(j + 2)
							inde += 1
							j += 3
					else:
						count.append(j + 2)
						inde += 1
						j += 3
				else:
					j += 1
			else:
				j += 2
		elif s[j] == 'o':
			if j + 3 <= n:
				if ''.join(s[j:j + 3]) in validarr:
					count.append(j + 2)
					inde += 1
					j += 3
				else:
					j += 1
			else:
				j += 2
		else:
			j += 1
	print(inde)
	if inde == 0:
		print('')
	else:
		print(*count)


from sys import stdin
R = lambda : list(stdin.readline().rstrip('\n'))
for _ in range(int(input())):
	a = R() + ['x'] * 3
	v = []
	for i in range(len(a) - 2):
		if a[i] + a[i + 1] + a[i + 2] == 'two':
			if a[i + 2] + a[i + 3] + a[i + 4] == 'one':
				v += (i + 3,)
				a[i + 2] = 'x'
			else:
				v += (i + 2,)
				a[i + 1] = 'x'
		elif a[i] + a[i + 1] + a[i + 2] == 'one':
			v += (i + 2,)
			a[i + 1] = 'x'
	print(len(v))
	print(*v)


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
readline = sys.stdin.readline
T = int(readline())
Ans = [None] * T
so = ord('o')
sn = ord('n')
se = ord('e')
st = ord('t')
sw = ord('w')
inf = 10 ** 9 + 7
for qu in range(T):
	S = list(map(ord, readline().strip()))
	N = len(S)
	Ans = []
	for i in range(2, N - 2):
		s = S[i]
		if s != so:
			continue
		if S[i - 2] == st and S[i - 1] == sw and (S[i + 1] == sn) and (S[i + 2] == se):
			S[i] = 0
			Ans.append(i + 1)
	for i in range(1, N - 1):
		s = S[i]
		if S[i - 1] == so and S[i] == sn and (S[i + 1] == se):
			Ans.append(i + 1)
		if S[i - 1] == st and S[i] == sw and (S[i + 1] == so):
			Ans.append(i + 1)
	sys.stdout.write(str(len(Ans)))
	sys.stdout.write('\n')
	sys.stdout.write(' '.join(map(str, Ans)))
	sys.stdout.write('\n')


for t in range(int(input())):
	s = input()
	out = set([])
	for i in range(len(s)):
		if s[i] == 'o':
			if i + 2 < len(s):
				if s[i + 1] == 'n' and s[i + 2] == 'e':
					if i - 1 >= 0 and s[i - 1] == 'o':
						out.add(i + 2)
					else:
						out.add(i + 1)
			if i - 2 >= 0:
				if s[i - 2] == 't' and s[i - 1] == 'w':
					if i + 1 < len(s) and s[i + 1] == 'o':
						out.add(i)
					else:
						out.add(i + 1)
	print(len(out))
	print(*out)


for _ in range(int(input())):
	s = input().replace('twone', 'tw_ne').replace('one', 'o_e').replace('two', 't_o')
	r = [i for (i, j) in enumerate(s, 1) if j == '_']
	print(len(r))
	print(*r)


for _ in [0] * int(input()):
	a = input()
	f = []
	prev_o = -1
	for j in range(len(a) - 2):
		if a[j] == 't' and a[j + 1] == 'w' and (a[j + 2] == 'o'):
			if j + 3 is not len(a) and a[j + 3] == 'n':
				f.append(j + 2 + 1)
				prev_o = j + 2
			else:
				f.append(j + 1 + 1)
		elif a[j] == 'o' and a[j + 1] == 'n' and (a[j + 2] == 'e') and (prev_o is not j):
			f.append(j + 1 + 1)
	print(len(f))
	print(*f)


for _ in range(int(input())):
	l = list(input())
	ans = 0
	for t in range(2, len(l) - 2):
		if l[t] == 'o' and l[t - 1] == 'w' and (l[t - 2] == 't'):
			if l[t + 1] == 'n' and l[t + 2] == 'e':
				ans += 1
				l[t] = '1'
	for t in range(1, len(l) - 1):
		if l[t] == 'n' and l[t - 1] == 'o' and (l[t + 1] == 'e'):
			ans += 1
			l[t] = '1'
		if l[t] == 'w' and l[t - 1] == 't' and (l[t + 1] == 'o'):
			ans += 1
			l[t] = '1'
	print(ans)
	for t in range(len(l)):
		if l[t] == '1':
			print(t + 1, end=' ')
	print()


from sys import stdin, stdout
import math, sys, heapq
from itertools import permutations, combinations
from collections import defaultdict, deque, OrderedDict
from os import path
import random
import bisect as bi

def yes():
	print('YES')

def no():
	print('NO')
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

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

	def In():
		return map(int, input().split())
else:

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

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

def dict(a):
	d = {}
	for x in a:
		if d.get(x, -1) != -1:
			d[x] += 1
		else:
			d[x] = 1
	return d

def find_gt(a, x):
	i = bi.bisect_right(a, x)
	if i != len(a):
		return i
	else:
		return -1

def main():
	try:
		l = list(input())
		(s1, s2, s3) = ('one', 'two', 'twone')
		(i, n) = (0, len(l))
		ans_path = []
		while i < n:
			if i + 4 < n:
				t = ''.join(l[i:i + 5])
				if t == s3:
					ans_path.append(i + 2)
					i += 5
				else:
					t = ''.join(l[i:i + 3])
					if t == s1 or t == s2:
						ans_path.append(i + 1)
						i += 3
					else:
						i += 1
			elif i + 2 < n:
				t = ''.join(l[i:i + 3])
				if t == s1 or t == s2:
					ans_path.append(i + 1)
					i += 3
				else:
					i += 1
			else:
				break
		print(len(ans_path))
		for x in ans_path:
			print(x + 1, end=' ')
		print()
	except:
		pass
M = 998244353
P = 1000000007
Ma = 100000000000
for _ in range(I()):
	main()


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


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


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)


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


from sys import stdin
input = lambda : stdin.readline()
from math import ceil, sqrt, gcd
for _ in range(int(input())):
	s = list(input().strip())
	z = []
	for i in range(len(s) - 2):
		if i < len(s) - 4 and s[i] + s[i + 1] + s[i + 2] + s[i + 3] + s[i + 4] == 'twone':
			z.append(i + 3)
			s[i + 2] = '1'
		elif s[i] + s[i + 1] + s[i + 2] in ['one', 'two']:
			z.append(i + 2)
			s[i + 1] = '1'
	print(len(z))
	print(*z)


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)


from sys import stdin as inp
from math import gcd, sqrt, floor, ceil, log2
from bisect import bisect_left as bi
for _ in range(int(inp.readline())):
	s = list(inp.readline().strip())
	n = len(s)
	ind = []
	c = 0
	for i in range(n - 4):
		if s[i:i + 5] == list('twone'):
			ind.append(i + 2)
			s[i + 2] = ''
	c = 0
	i = 0
	while i < n - 2:
		x = ''
		j = i
		while len(x) < 3 and j < n:
			x += s[j]
			j += 1
		if x == 'one' or x == 'two':
			ind.append(i + 1)
			s[i + 1] = ''
			i += 2
		else:
			i += 1
	print(len(ind))
	for i in range(len(ind)):
		ind[i] += 1
	print(*ind)


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


for _ in range(int(input())):
	s = input()
	i = 0
	rms = []
	while i < len(s):
		if 'twone' == s[i:i + 5]:
			rms.append(i + 3)
			i += 5
		elif 'one' == s[i:i + 3] or 'two' == s[i:i + 3]:
			rms.append(i + 2)
			i += 3
		else:
			i += 1
	print(len(rms))
	print(' '.join(map(str, rms)))


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)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	s = input()
	i = 0
	req = 0
	ans = []
	while i < len(s):
		if s[i:i + 5] == 'twone':
			req += 1
			ans.append(i + 3)
			i += 5
		elif s[i:i + 3] == 'one' or s[i:i + 3] == 'two':
			req += 1
			ans.append(i + 2)
			i += 3
		else:
			i += 1
	print(req)
	print(*ans)


def main():
	N = int(input())
	for _ in range(N):
		S = list(map(str, input()))
		S += 'XXXXX'
		res = []
		for i in range(len(S) - 5):
			if S[i] == 'o' and S[i + 1] == 'n' and (S[i + 2] == 'e'):
				S[i + 1] = 'X'
				res.append(i + 1)
				continue
			if S[i] == 't' and S[i + 1] == 'w' and (S[i + 2] == 'o') and (S[i + 3] == 'n') and (S[i + 4] == 'e'):
				S[i + 2] = 'X'
				res.append(i + 2)
				continue
			if S[i] == 't' and S[i + 1] == 'w' and (S[i + 2] == 'o'):
				S[i + 1] = 'X'
				res.append(i + 1)
				continue
		print(len(res))
		print(' '.join([str(i + 1) for i in res]))
main()


for _ in range(int(input())):
	s = input()
	j = []
	(c1, c2, c3) = (0, 0, 0)
	for i in range(len(s) - 4):
		if s[i:i + 5] == 'twone':
			c1 += 1
			j.append(i + 3)
	for i in range(len(s) - 2):
		if s[i:i + 3] == 'one' and (i >= 2 and s[i - 2:i + 3] != 'twone' if i >= 2 else True):
			c2 += 1
			j.append(i + 2)
		if s[i:i + 3] == 'two' and (i < len(s) - 2 and s[i:i + 5] != 'twone' if i < len(s) - 2 else True):
			c3 += 1
			j.append(i + 2)
	print(c1 + c2 + c3)
	print(*j)


from sys import stdout, stdin, setrecursionlimit
from io import BytesIO, IOBase
from collections import *
from itertools import *
from random import *
from bisect import *
from string import *
from queue import *
from heapq import *
from math import *
from re import *
from os import *

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 = read(self._fd, max(fstat(self._fd).st_size, 8192))
			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 = read(self._fd, max(fstat(self._fd).st_size, 8192))
			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:
			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')
(stdin, stdout) = (IOWrapper(stdin), IOWrapper(stdout))

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

def fast():
	return stdin.readline().strip()

def zzz():
	return [int(i) for i in fast().split()]
(z, zz) = (fast, lambda : map(int, z().split()))
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def output(answer, end='\n'):
	stdout.write(str(answer) + end)
dx = [-1, 1, 0, 0, 1, -1, 1, -1]
dy = [0, 0, 1, -1, 1, -1, -1, 1]
num = int(z())
for _ in range(num):
	arr = list(fast())
	n = len(arr)
	c21 = list('twone')
	c2 = list('two')
	c1 = list('one')
	res = []
	for i in range(n):
		try:
			if arr[i:i + 5] == c21:
				arr[i + 2] = str(i)
				res.append(i + 3)
		except:
			pass
		try:
			if arr[i:i + 3] == c2:
				arr[i + 1] = str(i)
				res.append(i + 2)
			if arr[i:i + 3] == c1:
				arr[i + 1] = str(i)
				res.append(i + 2)
		except:
			pass
	print(len(res))
	print(*res)


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

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import Counter
import math
import bisect
m = int(input())
for _ in range(m):
	s = input()
	n = len(s)
	c = []
	i = 0
	while i < n:
		if s[i] == 't':
			if i + 4 < n and s[i:i + 5] == 'twone':
				c.append(i + 2 + 1)
				i += 5
			elif i + 2 < n and s[i:i + 3] == 'two':
				c.append(i + 1 + 1)
				i += 3
			else:
				i += 1
		elif s[i] == 'o':
			if i + 2 < n and s[i:i + 3] == 'one':
				c.append(i + 1 + 1)
				i += 3
			else:
				i += 1
		else:
			i += 1
	print(len(c))
	print(*(c if len(c) >= 1 else ''))


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


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)


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


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


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


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


from sys import stdin

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

def intput():
	return int(input())

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

def intsput():
	return map(int, sinput())
t = intput()
one = list('one')
two = list('two')
for _ in range(t):
	s = input()
	s = list(s)
	cnt = 0
	targets = []
	for i in range(len(s) - 2):
		inspect = s[i:i + 3]
		if inspect == one:
			if i == 0 or s[i - 1] != 'o':
				cnt += 1
				targets.append(i + 1)
				s[i] = '.'
			else:
				cnt += 1
				targets.append(i + 2)
				s[i + 1] = '.'
		elif inspect == two:
			if i == len(s) - 3 or s[i + 3] != 'o':
				cnt += 1
				targets.append(i + 3)
				s[i + 2] = '.'
			else:
				cnt += 1
				targets.append(i + 2)
				s[i + 1] = '.'
	print(cnt)
	print(*targets)


import math
t = int(input())
for i in range(t):
	s = input()
	n = len(s)
	p = s.count('one') + s.count('two') - s.count('twone')
	print(p)
	if p == 0:
		print()
	else:
		j = 0
		while j < n - 2:
			if s[j] == 'o' and s[j + 1] == 'n' and (s[j + 2] == 'e'):
				print(j + 2, end=' ')
				j += 3
			elif j < n - 4 and s[j] == 't' and (s[j + 1] == 'w') and (s[j + 2] == 'o') and (s[j + 3] == 'n') and (s[j + 4] == 'e'):
				print(j + 3, end=' ')
				j += 5
			elif s[j] == 't' and s[j + 1] == 'w' and (s[j + 2] == 'o'):
				print(j + 2, end=' ')
				j += 3
			else:
				j += 1
		print()


t = int(input())
l2 = []
for i in range(t):
	s = input()
	k = list(s)
	c = 0
	l1 = []
	c1 = 0
	while c1 < len(k) - 2:
		if s[c1:c1 + 3] == 'one':
			l1.append(c1 + 2)
			c1 += 3
			c += 1
		elif s[c1:c1 + 3] == 'two':
			if s[c1 + 2:c1 + 5] == 'one':
				l1.append(c1 + 3)
				c1 += 5
				c += 1
			else:
				l1.append(c1 + 2)
				c1 += 3
				c += 1
		else:
			c1 += 1
			pass
	l1.append(c)
	l2.append(l1)
for k in range(t):
	print(l2[k][len(l2[k]) - 1])
	for i in range(len(l2[k]) - 1):
		print(l2[k][i], end=' ')
	print()


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


t = int(input())
for i in range(t):
	a = input()
	b = len(a)
	d = []
	j = 0
	c = 0
	while j < b:
		if j < b - 4:
			if a[j:j + 5] == 'twone':
				c = c + 1
				d.append(j + 3)
				j = j + 5
				continue
		if j < b - 2:
			if a[j:j + 3] == 'two':
				c = c + 1
				d.append(j + 2)
				j = j + 3
				continue
		if j < b - 2:
			if a[j:j + 3] == 'one':
				c = c + 1
				d.append(j + 2)
				j = j + 3
				continue
		j = j + 1
	print(c)
	print(*d)


for _ in range(int(input())):
	s = list(input())
	ans = []
	for i in range(len(s) - 2):
		(a, b, c) = (s[i], s[i + 1], s[i + 2])
		if a + b + c == 'one':
			ans.append(i + 2)
			s[i + 1] = '#'
		elif a + b + c == 'two':
			if i < len(s) - 4:
				(d, e) = (s[i + 3], s[i + 4])
				if d + e == 'ne':
					ans.append(i + 3)
					s[i + 2] = '#'
				else:
					ans.append(i + 2)
					s[i + 1] = '#'
			else:
				ans.append(i + 2)
				s[i + 1] = '#'
	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)))


t = int(input())
for i in range(t):
	s = input()
	ss = []
	c = 0
	j = 0
	while j < len(s) - 2:
		if s[j:j + 5] == 'twone':
			ss.append(j + 3)
			c = c + 1
			j = j + 5
		elif s[j:j + 3] == 'two':
			ss.append(j + 2)
			c = c + 1
			j = j + 3
		elif s[j:j + 3] == 'one':
			ss.append(j + 2)
			c = c + 1
			j = j + 3
		else:
			j = j + 1
	print(c)
	print(' '.join(map(str, ss)))


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


import sys
input = sys.stdin.readline
from math import *

def sod(n):
	r = 0
	while n > 0:
		r += n % 10
		n //= 10
	return r
t = int(input())
while t > 0:
	t -= 1
	s = list(input().rstrip())
	p = 'one'
	g = {}
	j = 0
	n = len(s)
	f = []
	for i in range(n):
		if s[i] == p[j]:
			j += 1
			if j == 3:
				j = 0
				if i - 3 >= 0 and s[i - 2] == s[i - 3] == 'o':
					f.append(i)
					g[i - 1] = 1
				else:
					f.append(i - 1)
					g[i - 2] = 1
		elif s[i] == p[0]:
			j = 1
		else:
			j = 0
	p = 'two'
	j = 0
	for i in range(n):
		if s[i] == p[j] and i not in g:
			j += 1
			if j == 3:
				j = 0
				f.append(i)
				g[i - 1] = 1
		elif s[i] == p[0] and i not in g:
			j = 1
		else:
			j = 0
	print(len(f))
	print(*f)


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)


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())
Ans = ''
for p in range(t):
	s = input()
	l = len(s)
	i = 0
	ans = 0
	ind = ''
	while i < len(s) - 2:
		if i + 4 < len(s) and s[i:i + 5] == 'twone':
			ind += str(i + 3) + ' '
			ans += 1
			i += 5
		elif i + 2 < len(s) and s[i:i + 3] == 'one':
			ind += str(i + 2) + ' '
			ans += 1
			i += 3
		elif i + 2 < len(s) and s[i:i + 3] == 'two':
			ind += str(i + 2) + ' '
			ans += 1
			i += 3
		else:
			i += 1
	Ans += str(ans) + '\n' + ind + '\n'
print(Ans)


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


def onetwo(string):
	blanck = []
	i = 0
	while i < len(string):
		if 'twone' in string[i:i + 5]:
			blanck.append(i + 1 + 2)
			i += 3
		if string[i:i + 3] in ('one', 'two'):
			blanck.append(i + 1 + 1)
		i += 1
	print(len(blanck))
	print(*blanck)
	return ''
	blanck = list(set(blanck))
	print(len(blanck))
	print(*blanck)
	return ''
for i in range(int(input())):
	print(onetwo(input()))


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)


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)


N = int(input())
for _ in range(N):
	s = list(input())
	le = len(s)
	res = []
	b = 0
	while b < le - 2:
		if s[b:b + 3] == list('one') or s[b:b + 3] == list('two'):
			if b + 4 < le and s[b:b + 5] == list('twone'):
				res.append(b + 3)
				s[b + 2] = 'a'
				b = b + 5
			else:
				res.append(b + 2)
				s[b + 1] = 'a'
				b = b + 3
		else:
			b = b + 1
	print(len(res))
	print(' '.join(list(map(str, res))))


for yut in range(int(input())):
	s = input()
	n = len(s)
	l = 0
	count = 0
	cont = []
	b = True
	while l < n:
		b = True
		if l + 5 <= n:
			if s[l:l + 5] == 'twone':
				count += 1
				cont.append(str(l + 3))
				l += 4
				b = False
		if l > n - 1:
			break
		if b:
			if l + 3 <= n:
				if s[l:l + 3] == 'two' or s[l:l + 3] == 'one':
					count += 1
					cont.append(str(l + 2))
					l += 2
		l += 1
	print(count)
	print(' '.join(cont))


for _ in range(int(input())):
	lis = list(input()) + ['#'] + ['#']
	n = len(lis)
	i = 2
	aa = []
	an = 0
	while i < n:
		ch = lis[i - 2] + lis[i - 1] + lis[i]
		if ch == 'one':
			an += 1
			aa.append(i)
		elif ch == 'two':
			c = 0
			j = i
			while i < n and lis[i] == 'o':
				i += 1
				c += 1
			if lis[i] + lis[i + 1] == 'ne' and c == 1:
				aa.append(j + 1)
				lis[j] = '#'
			else:
				aa.append(j)
				lis[j - 1] = '#'
			an += 1
		i += 1
	print(an)
	print(*aa)


for t in range(int(input())):
	s = input()
	i = 0
	removed_positions = list()
	while s.find('one', i) != -1:
		j = s.find('one', i)
		if s[j - 2:j + 1] == 'two':
			removed_positions.append(j + 1)
		else:
			removed_positions.append(j + 2)
		i = j + 3
	i = 0
	while s.find('two', i) != -1:
		j = s.find('two', i)
		if s[j + 2:j + 5] != 'one':
			removed_positions.append(j + 2)
		i = j + 3
	print(len(removed_positions))
	print(*removed_positions)


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


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


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


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 random
import math
from collections import defaultdict
import itertools
from sys import stdin, stdout
import sys
import operator
from decimal import Decimal
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.buffer.readline())

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

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

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def BI():
	return sys.stdin.buffer.readline().rstrip()

def SI():
	return sys.stdin.buffer.readline().rstrip().decode()

def main():
	mod = 10 ** 9 + 7
	for _ in range(int(input())):
		s = input()
		oj = s.find('one')
		tj = s.find('two')
		l = len(s)
		ans = ''
		if oj == -1 and tj == -1:
			print(0)
			print('')
		elif oj == -1:
			ans += str(tj + 2) + ' '
			cnt = 1
			while tj < l - 2:
				tj = s.find('two', tj + 3)
				if tj != -1:
					cnt += 1
					ans += str(tj + 2) + ' '
				else:
					break
			print(cnt)
			print(ans)
		elif tj == -1:
			ans += str(oj + 2) + ' '
			cnt = 1
			while oj < l - 2:
				oj = s.find('one', oj + 3)
				if oj != -1:
					cnt += 1
					ans += str(oj + 2) + ' '
				else:
					break
			print(cnt)
			print(ans)
		else:
			os = [oj + 2]
			ts = [tj + 2]
			while oj < l - 2:
				oj = s.find('one', oj + 3)
				if oj != -1:
					os.append(oj + 2)
				else:
					break
			while tj < l - 2:
				tj = s.find('two', tj + 3)
				if tj != -1:
					ts.append(tj + 2)
				else:
					break
			ans = ''
			for tis in ts:
				if tis + 2 in os:
					ans += str(tis + 1) + ' '
					os.remove(tis + 2)
				else:
					ans += str(tis) + ' '
			for ois in os:
				ans += str(ois) + ' '
			print(len(ts) + len(os))
			print(ans)
main()


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)


s = int(input())

def find_answer(string):
	n = len(string)
	if 'one' not in string and 'two' not in string:
		return []
	res = []
	if string[:3] == 'one':
		res.append('2')
	if string[1:4] == 'one':
		res.append('3')
	for i in range(n - 2):
		if string[i:i + 5] == 'twone':
			res.append(str(i + 3))
		elif string[i:i + 3] == 'two':
			res.append(str(i + 2))
		elif i >= 2 and string[i - 2:i + 3] != 'twone' and (string[i:i + 3] == 'one'):
			res.append(str(i + 2))
	return res
for _ in range(s):
	string = str(input())
	ans = find_answer(string)
	print(len(ans))
	print(' '.join(ans))


import sys
import collections
from collections import Counter
import itertools
import math
import timeit

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

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

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def flin(d, x, default=-1):
	left = right = -1
	for i in range(len(d)):
		if d[i] == x:
			if left == -1:
				left = i
			right = i
	if left == -1:
		return (default, default)
	else:
		return (left, right)

def ceil(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)

def ddl():
	return collections.defaultdict(list)
t = ii()
for _ in range(t):
	s = input()
	res = []
	i = 0
	while i + 2 < len(s):
		if f'{s[i]}{s[i + 1]}{s[i + 2]}' == 'two':
			if i + 4 < len(s):
				if f'{s[i + 3]}{s[i + 4]}' == 'ne':
					res.append(i + 3)
					i = i + 5
					continue
			res.append(i + 2)
			i = i + 3
		elif f'{s[i]}{s[i + 1]}{s[i + 2]}' == 'one':
			res.append(i + 2)
			i = i + 3
		else:
			i += 1
	print(len(res))
	prr(res, ' ')


import sys
input = sys.stdin.readline
n = int(input())
for i in range(n):
	s = input().rstrip()
	sl = list(s)
	ans = set()
	for i in range(len(s) - 2):
		if s[i:i + 3] == 'one' or s[i:i + 3] == 'two':
			ans.add(i + 2)
	for i in range(len(s) - 4):
		if s[i:i + 5] == 'twone':
			ans.add(i + 3)
			ans.remove(i + 2)
			ans.remove(i + 4)
	print(len(ans))
	print(*ans)


t = int(input())
for nt in range(t):
	s = input()
	i = 0
	count = 0
	ans = []
	while i < len(s) - 2:
		if s[i] == 't' and s[i + 1] == 'w' and (s[i + 2] == 'o') and (i + 4 >= len(s)):
			count += 1
			ans.append(i + 2)
			break
		elif s[i] == 't' and s[i + 1] == 'w' and (s[i + 2] == 'o') and (s[i + 3] == 'n') and (s[i + 4] == 'e'):
			count += 1
			ans.append(i + 3)
			i += 5
		elif s[i] == 't' and s[i + 1] == 'w' and (s[i + 2] == 'o'):
			count += 1
			ans.append(i + 2)
			i += 3
		elif s[i] == 'o' and s[i + 1] == 'n' and (s[i + 2] == 'e'):
			count += 1
			ans.append(i + 2)
			i += 3
		else:
			i += 1
	print(count)
	print(*ans)


n = int(input())
for i in range(n):
	s = input()
	sl = list(s)
	ans = set()
	for i in range(len(s) - 2):
		if s[i:i + 3] == 'one' or s[i:i + 3] == 'two':
			ans.add(i + 2)
	for i in range(len(s) - 4):
		if s[i:i + 5] == 'twone':
			ans.add(i + 3)
			ans.remove(i + 2)
			ans.remove(i + 4)
	print(len(ans))
	print(*ans)


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


for _ in range(int(input())):
	Answer = []
	X = input()
	Size = len(X)
	Check = [0] * Size
	for i in range(Size - 2):
		if X[i] + X[i + 1] + X[i + 2] == 'one':
			Check[i] += 1
	for i in range(Size - 2):
		if X[i] + X[i + 1] + X[i + 2] == 'two':
			Check[i] += 3
			Check[i + 2] += 4
	i = 0
	while i < Size - 2:
		if Check[i] in [2, 5]:
			Answer.append(i + 1)
			i += 2
		elif Check[i] == 3 and Check[i + 2] != 5 or Check[i] == 1:
			Answer.append(i + 2)
			i += 2
		else:
			i += 1
	print(len(Answer))
	print(*Answer)


t = int(input())
for i in range(t):
	ss = list(input())
	n = len(ss)
	ans = []
	pos = -1
	for i in range(4, n):
		if ss[i - 4] == 't' and ss[i - 3] == 'w' and (ss[i - 2] == 'o') and (ss[i - 1] == 'n') and (ss[i] == 'e'):
			ans.append(i - 2)
			ss[i - 2] = '0'
	for i in range(2, n):
		if ss[i - 2] == 't' and ss[i - 1] == 'w' and (ss[i] == 'o'):
			ans.append(i - 1)
			ss[i - 1] = '0'
		if ss[i - 2] == 'o' and ss[i - 1] == 'n' and (ss[i] == 'e'):
			ans.append(i - 1)
			ss[i - 1] = '0'
	print(len(ans))
	for i in ans:
		print(i + 1, end=' ')
	print('')


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


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)


t = int(input())
for i in range(t):
	s = list(input())
	cnt = 0
	ind = []
	for i in range(len(s)):
		if i + 5 <= len(s):
			if ''.join(s[i:i + 5]) == 'twone':
				s[i + 2] = '#'
				cnt += 1
				ind.append(i + 3)
				continue
		if i + 2 < len(s) and s[i] + s[i + 1] + s[i + 2] == 'one':
			s[i + 1] = '#'
			cnt += 1
			ind.append(i + 2)
		elif i + 2 < len(s) and s[i] + s[i + 1] + s[i + 2] == 'two':
			s[i + 1] = '#'
			cnt += 1
			ind.append(i + 2)
	print(cnt)
	print(*ind)


def f(s):
	i = 0
	start = 0
	a = list(s)
	r = []
	while i != -1:
		i = s.find('twone', start)
		if i != -1:
			a[i + 2] = 'z'
			r.append(i + 2 + 1)
			start = i + 5
	s = ''.join(a)
	i = 0
	start = 0
	while i != -1:
		i = s.find('two', start)
		if i != -1:
			a[i + 1] = 'z'
			r.append(i + 1 + 1)
			start = i + 2
	s = ''.join(a)
	i = 0
	start = 0
	while i != -1:
		i = s.find('one', start)
		if i != -1:
			a[i + 1] = 'z'
			r.append(i + 1 + 1)
			start = i + 2
	print(len(r))
	print(*r)
t = int(input())
for i in range(t):
	s = input()
	f(s)


T = int(input())

def solve(s):
	s = [i for i in s]
	pos = []
	N = len(s)
	for i in range(N - 2):
		if i + 4 < N 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)
			s[i + 2] = 'k'
		elif s[i] == 'o' and s[i + 1] == 'n' and (s[i + 2] == 'e'):
			pos.append(i + 1)
			s[i + 1] = 'k'
		elif s[i] == 't' and s[i + 1] == 'w' and (s[i + 2] == 'o'):
			pos.append(i + 1)
			s[i + 1] = 'k'
	print(len(pos))
	for i in pos:
		print(i + 1, end=' ')
	print('')
for i in range(T):
	solve(input())


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


n = int(input())
for _ in range(n):
	s = input()
	i = 0
	j = 1
	k = 2
	ans = 0
	lis = []
	while k < len(s):
		s_i = s[i]
		s_j = s[j]
		s_k = s[k]
		if s_i == 'o' and s_j == 'n' and (s_k == 'e'):
			ans += 1
			lis.append(j + 1)
			i += 2
			j += 2
			k += 2
		elif s_i == 't' and s_j == 'w' and (s_k == 'o'):
			if k + 2 < len(s):
				if s[k + 1] == 'n' and s[k + 2] == 'e':
					ans += 1
					lis.append(k + 1)
					i = k + 1
					j = k + 2
					k = k + 3
				else:
					ans += 1
					lis.append(j + 1)
					i += 2
					j += 2
					k += 2
			else:
				ans += 1
				lis.append(j + 1)
				i += 2
				j += 2
				k += 2
		else:
			i += 1
			j += 1
			k += 1
	print(ans)
	print(*lis)


def examA():
	T = I()
	ans = []
	for _ in range(T):
		N = I()
		k = 0
		cur = 0
		n = copy.deepcopy(N)
		while True:
			if n // 10 > 0:
				cur += 9
				k += 1
			else:
				break
			n //= 10
		curN = 0
		for i in range(k + 1):
			curN += n * 10 ** i
		if N >= curN:
			cur += n
		else:
			cur += n - 1
		ans.append(cur)
	for v in ans:
		print(v)
	return

def examB():
	T = I()
	for _ in range(T):
		N = I()
		A = LI()
		cur = 0
		maxA = 0
		for i in range(N):
			if A[i] % 2 == 0:
				if A[i] > maxA:
					maxA = A[i]
			else:
				A[i] = 0
		while maxA > 0:
			maxne = 0
			for i in range(N):
				if maxA == A[i]:
					A[i] //= 2
				if A[i] % 2 == 0:
					if A[i] > maxne:
						maxne = A[i]
				else:
					A[i] = 0
			maxA = maxne
			cur += 1
		print(cur)
	return

def examC():
	T = I()
	ans = []
	for _ in range(T):
		S = SI()
		N = len(S)
		cur = []
		k = 0
		while k < N - 2:
			if k < N - 4:
				if S[k:k + 5] == 'twone':
					cur.append(k + 3)
					k += 5
					continue
			if S[k:k + 3] == 'one':
				cur.append(k + 2)
				k += 3
			elif S[k:k + 3] == 'two':
				cur.append(k + 2)
				k += 3
			else:
				k += 1
		print(len(cur))
		print(' '.join(map(str, cur)))
	return

def examD():
	T = I()
	for _ in range(T):
		N = I()
		S = [SI() for _ in range(N)]
	return
import sys, copy, bisect, itertools, heapq, math
from heapq import heappop, heappush, heapify
from collections import Counter, defaultdict, deque

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

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

def LSI():
	return list(map(str, sys.stdin.readline().split()))

def LS():
	return sys.stdin.readline().split()

def SI():
	return sys.stdin.readline().strip()
mod = 10 ** 9 + 7
inf = float('inf')
examC()


t = int(input())
for i in range(t):
	s = input()
	l = len(s)
	rem = []
	ans = 0
	skip = 0
	for j in range(l - 2):
		if skip > 0:
			skip -= 1
			continue
		if j <= l - 5 and s[j:j + 5] == 'twone':
			ans += 1
			rem.append(j + 3)
			skip = 4
		elif s[j:j + 3] == 'two':
			ans += 1
			rem.append(j + 2)
		elif s[j:j + 3] == 'one':
			ans += 1
			rem.append(j + 2)
	print(ans)
	if ans == 0:
		print()
	else:
		for j in rem:
			print(j, end=' ')
		print()


import math
import os
import sys
input = lambda : sys.stdin.readline().strip('\r\n')

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

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

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

def cout(ans):
	sys.stdout.write(str(ans))

def endl():
	sys.stdout.write(str('\n'))

def ende():
	sys.stdout.write(str(' '))

def countDigit(n):
	return math.floor(math.log(n, 10) + 1)

def main():
	for _ in range(int(input())):
		s = string()
		a = []
		cnt = 0
		i = 0
		while i < len(s) - 2:
			if s[i] == 't':
				if s[i + 1] == 'w':
					if s[i + 2] == 'o':
						cnt += 1
						if i < len(s) - 4 and s[i + 3] == 'n':
							if s[i + 4] == 'e':
								a.append(i + 3)
								i += 4
							else:
								a.append(i + 2)
								i += 2
						else:
							a.append(i + 2)
							i += 2
			elif s[i] == 'o':
				if s[i + 1] == 'n':
					if s[i + 2] == 'e':
						cnt += 1
						a.append(i + 2)
						i += 2
			i += 1
		if cnt == 0:
			cout(cnt)
		else:
			cout(cnt)
			endl()
			for i in a:
				cout(i)
				ende()
		endl()
main()


for _ in range(int(input())):
	s = input()
	ans = []
	flag = 0
	for (ind, sym) in enumerate(s):
		if 0 <= ind - 2 and ind + 2 < len(s):
			if s[ind - 2:ind] + s[ind] + s[ind + 1:ind + 3] == 'twone':
				ans.pop()
				ans.append(ind + 1)
				flag = 1
			elif 0 <= ind - 1 and ind + 1 < len(s):
				if s[ind - 1:ind] + s[ind] + s[ind + 1:ind + 2] == 'one' or s[ind - 1:ind] + s[ind] + s[ind + 1:ind + 2] == 'two':
					if flag == 1:
						flag = 0
					else:
						ans.append(ind + 1)
		elif 0 <= ind - 1 and ind + 1 < len(s):
			if s[ind - 1:ind] + s[ind] + s[ind + 1:ind + 2] == 'one' or s[ind - 1:ind] + s[ind] + s[ind + 1:ind + 2] == 'two':
				if flag == 1:
					flag = 0
				else:
					ans.append(ind + 1)
	print(len(ans))
	print(*ans)


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)


import sys, math, bisect
input = sys.stdin.readline
from random import randint
inf = float('inf')
mod = 10 ** 9 + 7

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

def gcd(a, b):
	return int(math.gcd(a, b))

def tobinary(n):
	return bin(n)[2:]

def binarySearch(a, x):
	i = bisect.bisect_left(a, x)
	if i != len(a) and a[i] == x:
		return i
	else:
		return -1

def lowerBound(a, x):
	i = bisect.bisect_left(a, x)
	if i:
		return i - 1
	else:
		return -1

def upperBound(a, x):
	i = bisect.bisect_right(a, x)
	if i != len(a) + 1 and a[i - 1] == x:
		return i - 1
	else:
		return -1

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

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

def isPrime(n, k=5):
	if n < 2:
		return True
	for i in range(0, k):
		a = randint(1, n - 1)
		if pow(a, n - 1, n) != 1:
			return False
	return True
from collections import deque, defaultdict, Counter
import heapq, string
for _ in range(int(input())):
	s = input()
	n = len(s)
	dp = [0] * n
	for i in range(2, n - 2):
		if s[i] == 'o':
			if [s[i - 1], s[i - 2]] == ['w', 't'] and [s[i + 1], s[i + 2]] == ['n', 'e']:
				if sum(dp[i - 2:i + 2]) == 0:
					dp[i] = 1
	for i in range(2, n):
		if s[i] == 'o':
			if [s[i - 1], s[i - 2]] == ['w', 't']:
				if sum(dp[i - 2:i + 1]) == 0:
					dp[i - 1] = 1
	for i in range(2, n):
		if s[i] == 'e':
			if [s[i - 1], s[i - 2]] == ['n', 'o']:
				if sum(dp[i - 2:i + 1]) == 0:
					dp[i - 1] = 1
	print(sum(dp))
	for i in range(n):
		if dp[i] == 1:
			print(i + 1, end=' ')
	print()


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


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()
	rem = []
	i = 0
	while i < len(s):
		if s[i:i + 5] == 'twone':
			rem.append(i + 3)
			i += 4
			continue
		if s[i:i + 3] in ('one', 'two'):
			rem.append(i + 2)
			i += 2
			continue
		i += 1
	print(len(rem))
	print(*rem)


import os
import sys
from io import BytesIO, IOBase
import re

def solution(s):
	res = [m.start() + 3 for m in re.finditer('twone', s)]
	ss = s.replace('twone', '-----')
	ones = [m.start() + 2 for m in re.finditer('one', ss)]
	res.extend(ones)
	two = [m.start() + 2 for m in re.finditer('two', ss)]
	res.extend(two)
	write(len(res))
	write(*res)

def main():
	for _ in range(r_int()):
		s = input()
		solution(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:
		sys.stdout.write(str(x) + ' ')
	sys.stdout.write(end)

def r_array():
	return [int(x) for x in input().split()]

def r_int():
	return int(input())
main()


import sys
from collections import defaultdict as dd
from collections import Counter as cc
from queue import Queue
import math
import itertools
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
for _ in range(int(input())):
	w = input()
	q = list(w)
	e = []
	for i in range(len(w) - 4):
		if ''.join(q[i:i + 5]) == 'twone':
			e.append(i + 3)
			q[i + 2] = 'a'
	for i in range(len(w) - 2):
		if ''.join(q[i:i + 3]) == 'two':
			e.append(i + 2)
			q[i + 1] = 'a'
	for i in range(len(w) - 2):
		if ''.join(q[i:i + 3]) == 'one':
			e.append(i + 2)
			q[i + 1] = 'a'
	print(len(e))
	print(*e)


t = int(input())
l = []
for i in range(t):
	l.append(str(input()))
for i in l:
	r = 0
	p = []
	j = 0
	while j < len(i) - 2:
		if i[j:j + 5] == 'twone':
			r += 1
			p.append(j + 3)
			j += 5
		elif i[j:j + 3] == 'one':
			r += 1
			p.append(j + 2)
			j += 3
		elif i[j:j + 3] == 'two':
			r += 1
			p.append(j + 2)
			j += 3
		else:
			j += 1
	if r == 0:
		print(0)
		print()
	else:
		print(r)
		print(' '.join(map(str, p)))


import sys
for _ in range(int(input())):
	s = sys.stdin.readline()
	to_eliminate = []
	r = 0
	lens = 0
	rs = ''
	for x in s:
		lens += 1
		if lens >= 3 and x == 'o' and (s[lens - 2] == 'w') and (s[lens - 3] == 't'):
			to_eliminate += [lens - 1]
			r += 1
		if x == 'e' and lens >= 3 and (s[lens - 2] == 'n') and (s[lens - 3] == 'o'):
			if lens >= 5 and s[lens - 4] == 'w' and (s[lens - 5] == 't'):
				to_eliminate.pop()
				to_eliminate += [lens - 2]
			else:
				to_eliminate += [lens - 1]
				r += 1
	print(r)
	print(*to_eliminate)


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


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


from sys import stdin
t = int(stdin.readline())
while t:
	t -= 1
	s = input()
	rem = []
	i = 0
	while i < len(s) - 2:
		if i + 4 < len(s) and s[i:i + 5] == 'twone':
			rem.append(i + 2 + 1)
			i += 5
		elif s[i:i + 3] == 'two':
			rem.append(i + 1 + 1)
			i += 3
		elif s[i:i + 3] == 'one':
			rem.append(i + 1 + 1)
			i += 3
		else:
			i += 1
	print(len(rem))
	print(*rem)


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)


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	s = stdin.readline()[:-1]
	lst = []
	n = len(s)
	i = 1
	while i < n - 1:
		if s[i] == 'o' and (i > 1 and i < n - 2):
			if s[i + 1:i + 3] == 'ne' and s[i - 2:i] == 'tw':
				lst.append(i)
				i += 2
		elif s[i] == 'n':
			if s[i - 1:i + 2] == 'one':
				lst.append(i)
				i += 1
		elif s[i] == 'w':
			if s[i - 1:i + 2] == 'two':
				lst.append(i)
		i += 1
	length = len(lst)
	for i in range(1, length):
		if lst[i] - lst[i - 1] == 1:
			lst[i - 1] = 0
			length -= 1
	stdout.write(str(length) + '\n')
	for i in lst:
		if i:
			stdout.write(str(i + 1) + ' ')
	stdout.write('\n')


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


for _ in range(int(input())):
	s = input()
	(result, c, j) = (list(), 0, 0)
	while j < len(s) - 2:
		if s[j:j + 5] == 'twone':
			result.append(j + 3)
			c += 1
			j += 5
		elif s[j:j + 3] == 'two':
			result.append(j + 2)
			c += 1
			j += 3
		elif s[j:j + 3] == 'one':
			result.append(j + 2)
			c += 1
			j += 3
		else:
			j += 1
	print(c)
	print(' '.join(map(str, result)))


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)


t = int(input())
for i in range(t):
	(x, ans) = (str(input()), [])
	next = -1
	for i in range(len(x) - 2):
		if i < next:
			continue
		if x[i] == 't' and x[i + 1] == 'w' and (x[i + 2] == 'o'):
			if i + 3 <= len(x) - 1 and x[i + 3] == 'o':
				ans.append(i + 2)
			else:
				ans.append(i + 3)
				next = i + 3
		if x[i] == 'o' and x[i + 1] == 'n' and (x[i + 2] == 'e'):
			ans.append(i + 2)
			next = i + 3
	print(len(ans))
	for i in range(len(ans)):
		print(ans[i], end=' ')
	print('')
	ans.clear


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


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


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


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


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

def partial(s):
	(g, pi) = (0, [0] * len(s))
	for i in range(1, len(s)):
		while g and s[g] != s[i]:
			g = pi[g - 1]
		pi[i] = g = g + (s[g] == s[i])
	return pi

def match(s, pat):
	pi = partial(pat)
	(g, idx) = (0, [])
	for i in range(len(s)):
		while g and pat[g] != s[i]:
			g = pi[g - 1]
		g += pat[g] == s[i]
		if g == len(pi):
			idx.append(i + 1 - g)
			g = pi[g - 1]
	return idx

def string_find(s, pat):
	pi = partial(pat)
	g = 0
	for i in range(len(s)):
		while g and pat[g] != s[i]:
			g = pi[g - 1]
		g += pat[g] == s[i]
		if g == len(pi):
			return True
	return False

def main():
	t = int(input())
	for _ in range(t):
		s = list(input())
		i1 = set(match(s, 'twone'))
		i2 = set(match(s, 'one'))
		i3 = set(match(s, 'two'))
		for i in i1:
			i2.remove(i + 2)
			i3.remove(i)
		print(len(i1) + len(i2) + len(i3))
		print(*map(lambda x: x + 3, i1), *map(lambda x: x + 2, i2), *map(lambda x: x + 2, i3))
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()


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


from collections import Counter
from collections import defaultdict
import math
import random
import heapq as hq
from math import sqrt

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

def iinp():
	return int(input())
mod = int(1000000000.0) + 7
a = 'twone'
b = 'one'
c = 'two'
for _ in range(iinp()):
	s = input()
	n = len(s)
	i = 0
	ans = []
	while i < n:
		if s[i] == 't':
			if i < n - 2 and s[i] + s[i + 1] + s[i + 2] == 'two':
				if i < n - 4 and s[i + 3] + s[i + 4] == 'ne':
					ans.append(str(i + 3))
					i += 5
				else:
					ans.append(str(i + 2))
					i += 3
			else:
				i += 1
		elif i < n - 2 and s[i] == 'o':
			if s[i] + s[i + 1] + s[i + 2] == 'one':
				ans.append(str(i + 2))
				i += 3
			else:
				i += 1
		else:
			i += 1
	print(len(ans))
	print(' '.join(ans))


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


def test(s):
	n = len(s)
	d = set()
	for i in range(n - 4):
		if s[i:i + 5] == 'twone':
			d.add(i + 2 + 1)
	for i in range(n - 2):
		if s[i:i + 3] == 'two' and i + 2 + 1 not in d or (s[i:i + 3] == 'one' and i + 1 not in d):
			d.add(i + 1 + 1)
	print(len(d))
	print(' '.join(list(map(str, d))))
for i in range(int(input())):
	test(input())


t = int(input())
while t != 0:
	t -= 1
	s = input()
	l = []
	n = len(s)
	for i in range(n - 4):
		if s[i] == 't' and s[i + 1] == 'w' and (s[i + 2] == 'o') and (s[i + 3] == 'n') and (s[i + 4] == 'e'):
			l.append(i + 2)
			s = s[:i + 2] + 'q' + s[i + 3:]
	for i in range(n - 2):
		if s[i] == 't' and s[i + 1] == 'w' and (s[i + 2] == 'o'):
			l.append(i + 1)
		elif s[i] == 'o' and s[i + 1] == 'n' and (s[i + 2] == 'e'):
			l.append(i + 1)
	print(len(l))
	for i in l:
		print(i + 1, end=' ')
	print()


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)


from sys import maxsize, stdout, stdin, stderr
mod = int(1000000000.0 + 7)

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

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

def S():
	return input().strip()

def grid(r, c):
	return [lint() for i in range(r)]
from collections import defaultdict, Counter
import math
import heapq
from heapq import heappop, heappush
import bisect
from itertools import groupby

def gcd(a, b):
	while b:
		a %= b
		tmp = a
		a = b
		b = tmp
	return a

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

def check_prime(n):
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False
	return True

def Bs(a, x):
	i = 0
	j = 0
	left = 0
	right = len(a)
	flag = False
	while left < right:
		mi = (left + right) // 2
		if a[mi] <= x:
			left = mi + 1
			i += 1
		else:
			right = mi
			j += 1
	if left > 0 and a[left - 1] == x:
		return (i - 1, j)
	else:
		return (-1, -1)
t = I()
for _ in range(t):
	s = input()
	ans = 0
	d = defaultdict(lambda : False)
	a = []
	i = 0
	while i < len(s) - 2:
		if s[i:i + 3] == 'two':
			ans += 1
			a.append(i + 2)
			d[i + 2] = True
			i += 2
		elif s[i:i + 3] == 'one':
			if not d[i]:
				ans += 1
				a.append(i + 2)
			else:
				a.pop()
				a.append(i + 1)
			i += 3
		else:
			i += 1
	print(ans)
	print(*a)


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)


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


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


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


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


for _ in range(int(input())):
	s = input()
	n = len(s)
	one = 0
	two = 0
	twone = 0
	li = [0] * (n + 1)
	for i in range(n - 2):
		if s[i:i + 3] == 'one':
			one += 1
			li[i + 1] = 1
	for i in range(2, n):
		if s[i - 2:i + 1] == 'two':
			two += 1
			li[i + 1] = 2
	for i in range(2, n - 2):
		if s[i - 2:i + 3] == 'twone':
			twone += 1
			li[i + 1] = 3
	print(one + two - twone)
	for i in range(1, n + 1):
		if li[i] == 1:
			print(i + 1, end=' ')
		elif li[i] == 2:
			print(i - 1, end=' ')
		elif li[i] == 3:
			print(i, end=' ')
	if one + two - twone == 0:
		print()


n = int(input())
for i in range(n):
	j = 0
	s1 = input()
	l1 = []
	ans = []
	for i in range(len(s1)):
		l1.append(s1[i])
	c = 0
	j = 0
	while j < len(s1) - 2:
		if l1[j] == 't' and l1[j + 1] == 'w' and (l1[j + 2] == 'o'):
			l1[j + 2] = '-'
			if j + 3 < len(l1) and l1[j + 3] != 'o':
				l1[j + 2] = '-'
				ans.append(j + 2 + 1)
			else:
				l1[j + 1] = '-'
				ans.append(j + 2)
			j = j + 2
		elif l1[j] == 'o' and l1[j + 1] == 'n' and (l1[j + 2] == 'e'):
			l1[j + 2] = '-'
			if j + 3 < len(l1) and l1[j + 3] != 'e':
				l1[j + 2] = '-'
				ans.append(j + 2 + 1)
			else:
				l1[j + 1] = '-'
				ans.append(j + 2)
			j = j + 2
		j = j + 1
	print(len(ans))
	print(*ans)


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


MOD = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
for _ in range(ii()):
	s = ls()
	x = len(s)
	sind = set()
	for i in range(2, x - 2):
		temp = s[i - 2] + s[i - 1] + s[i] + s[i + 1] + s[i + 2]
		if temp == 'twone':
			s[i] = '-'
			sind.add(i + 1)
	for i in range(1, x - 1):
		temp = s[i - 1] + s[i] + s[i + 1]
		if temp in ['two', 'one']:
			sind.add(i + 1)
	print(len(sind))
	print(*list(sind))


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


for _ in [0] * int(input()):
	s = input()
	ans = ''
	NumAns = 0
	i = 0
	N = len(s)
	while i <= N - 3:
		if s[i:i + 3] == 'one':
			NumAns += 1
			ans += str(i + 1 + 1) + ' '
			i = i + 3
		elif s[i:i + 3] == 'two':
			if i + 5 <= N and s[i:i + 5] == 'twone':
				ans += str(i + 2 + 1) + ' '
				i = i + 5
				NumAns += 1
			else:
				ans += str(i + 1 + 1) + ' '
				i = i + 3
				NumAns += 1
		else:
			i += 1
	print(NumAns)
	if NumAns > 0:
		print(ans[:-1])


t = int(input())
for _ in range(t):
	string = input().strip()
	remove = []
	i = 0
	while i < len(string) - 2:
		if i < len(string) - 4 and string[i:i + 5] == 'twone':
			remove.append(i + 2)
			i += 3
		elif string[i:i + 3] == 'one':
			remove.append(i + 1)
			i += 2
		elif string[i:i + 3] == 'two':
			if i + 3 < len(string) and string[i + 3] == 'n':
				remove.append(i + 2)
				i += 3
			else:
				remove.append(i + 1)
				i += 2
		else:
			i += 1
	print(len(remove))
	print(' '.join(map(str, [e + 1 for e in remove])))


import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
t = 1
t = int(input())
for _ in range(t):
	s = input()
	ans = []
	i = 0
	while i < len(s):
		if s[i:i + 5] == 'twone':
			ans.append(i + 3)
			i += 5
		elif s[i:i + 3] == 'two':
			ans.append(i + 2)
			i += 3
		elif s[i:i + 3] == 'one':
			ans.append(i + 2)
			i += 3
		else:
			i += 1
	print(len(ans))
	print(*ans)


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

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

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

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

def get_list_of_list(n):
	return [list(map(int, sys.stdin.readline().strip().split())) for _ in range(n)]

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

def myceil(x, y):
	return (x + y - 1) // y

def Solution(s):
	n = len(s)
	op = 0
	indices = []
	i = 0
	while i < n - 2:
		tmp = s[i:i + 3]
		flg = True
		if i < n - 4:
			tmp2 = s[i:i + 5]
			if tmp2 == 'twone':
				flg = False
				op += 1
				indices.append(i + 3)
				i += 5
		if flg:
			if tmp == 'one' or tmp == 'two':
				op += 1
				indices.append(i + 2)
				i += 3
			else:
				i += 1
	if len(indices) and indices[-1] < n and (s[indices[-1]] == s[indices[-1] - 1]):
		indices[-1] -= 1
	print(op)
	print(*indices)

def main():
	for _ in range(get_int()):
		Solution(get_string())
main()


def main():

	def solve():
		ss = input()
		i = 0
		res = []
		while i < len(ss) - 2:
			if ss[i:i + 5] == 'twone':
				res.append(i + 3)
				i += 5
			elif ss[i:i + 3] == 'one' or ss[i:i + 3] == 'two':
				res.append(i + 2)
				i += 3
			else:
				i += 1
		print(len(res))
		print(' '.join(map(str, res)))
	q = int(input())
	for _ in range(q):
		solve()
main()


from sys import stdin

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

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

def linput():
	return list(map(int, stdin.readline().split()))
for _ in range(input()):
	us = set()
	s = stdin.readline()
	m = len(s) - 2
	i = 0
	while i < m:
		if s[i] == 't':
			if s[i + 1] == 'w' and s[i + 2] == 'o':
				if i < m - 2 and s[i + 3] == 'n' and (s[i + 4] == 'e'):
					us.add(i + 2)
				else:
					us.add(i + 1)
				i += 2
		elif s[i] == 'o':
			if s[i + 1] == 'n' and s[i + 2] == 'e':
				us.add(i + 1)
				i += 2
		i += 1
	print(len(us))
	for u in us:
		print(u + 1, end=' ')
	print()


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


def solve(string):
	n = len(string)
	i = 0
	ans = []
	while i < n:
		if i + 4 < n and string[i:i + 5] == 'twone':
			ans.append(i + 2 + 1)
			i += 5
		elif i + 2 < n and (string[i:i + 3] == 'one' or string[i:i + 3] == 'two'):
			ans.append(i + 1 + 1)
			i += 3
		else:
			i += 1
	print(len(ans))
	print(' '.join(list(map(str, ans))))
for _ in range(int(input())):
	solve(input())


t = int(input())
for _ in range(t):
	s = input()
	ind = []
	n = len(s)
	tot = 0
	ans = set()
	for i in range(n - 2):
		if s[i:i + 3] == 'one':
			tot += 1
			ans.add(i + 1)
		if s[i:i + 3] == 'two':
			tot += 1
			ans.add(i + 1)
	for i in range(n - 4):
		if s[i:i + 5] == 'twone':
			tot -= 1
			ans.remove(i + 1)
			ans.remove(i + 3)
			ans.add(i + 2)
	print(tot)
	for i in ans:
		print(i + 1, end=' ')
	print()
	continue
	tt = []
	oo = []
	for i in range(0, n):
		if s[i] == 't':
			try:
				tt.append(tt[-1] + 1)
			except:
				tt.append(1)
		else:
			tt.append(0)
		if s[i] == 'o':
			try:
				oo.append(tt[-1] + 1)
			except:
				oo.append(1)
		else:
			oo.append(0)
	oo2 = [0] * n
	ee = [0] * n
	for i in range(n - 1, -1, -1):
		if s[i] == 'o':
			try:
				oo2[i] = 1 + oo[i + 1]
			except:
				oo2[i] = 1
		else:
			oo2[i] = 0
		if s[i] == 'e':
			try:
				ee[i] = 1 + ee[i + 1]
			except:
				ee[i] = 1
		else:
			ee[i] = 0
	tot = 0
	for i in range(n - 2):
		if s[i:i + 3] == 'one':
			tot += min(oo[i], ee[i + 2])
		elif s[i:i + 3] == 'two':
			tot += min(tt[i], oo2[i + 2])
	st = 0
	for i in range(n):
		if i < n - 1:
			if s[i:i + 2] == 'tw':
				st = 1
				ind = i
		if st and s[i] == 'o':
			st += 1
		if st and s[i] != 'o':
			if i < n - 1:
				if s[i:i + 2] == 'ne' and st > 1:
					ans = 0
					ans += min(tt[ind], oo2[ind + 2])
					ans += min(ee[i + 1], oo[i - 1])
					if st - 1 < ans:
						tot -= ans
						tot += st - 1
			st = 0
	print(tot)


import re

def abc(s: str):
	out = []
	a = re.finditer('twone', s)
	for i in a:
		out.append(i.span()[0] + 3)
	s = s.replace('twone', 'fffff')
	b = re.finditer('two', s)
	for i in b:
		out.append(i.span()[0] + 2)
	c = re.finditer('one', s)
	for i in c:
		out.append(i.span()[0] + 2)
	return out
n = int(input())
out = []
for i in range(n):
	s = input()
	ans = abc(s)
	if not ans:
		out.append('0\n')
	else:
		out.append(str(len(ans)) + '\n' + ' '.join(list(map(str, ans))))
for i in out:
	print(i)


import math
import sys
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
ilele = lambda : map(int, input().split())
alele = lambda : list(map(int, input().split()))
for _ in range(int(input())):
	S = input()
	Ans = []
	x = len(S)
	count = 0
	for i in range(x):
		f = 0
		g = 0
		if S[i] == 'o':
			if i >= 2:
				if S[i - 1] == 'w' and S[i - 2] == 't':
					f = 1
			if i + 2 < x:
				if S[i + 1] == 'n' and S[i + 2] == 'e':
					g = 1
		if f == 1 and g == 0:
			Ans.append(i)
			count += 1
		elif f == 0 and g == 1:
			Ans.append(i + 2)
			count += 1
		elif f == 1 and g == 1:
			Ans.append(i + 1)
			count += 1
	print(count)
	print(*Ans)


for _ in range(int(input())):
	s = input()
	i = 0
	c = 0
	l = []
	while i < len(s):
		if s[i:i + 3] == 'one':
			c += 1
			l.append(i + 2)
		elif s[i:i + 3] == 'two':
			if i + 4 < len(s):
				if s[i + 3] == 'n' and s[i + 4] == 'e':
					c += 1
					l.append(i + 3)
					i += 2
				else:
					c += 1
					l.append(i + 2)
			else:
				c += 1
				l.append(i + 2)
		i += 1
	print(c)
	for j in l:
		print(j, end=' ')
	print()


from sys import stdin, stdout
(ans, pos) = ([], 0)
for i in range(int(input())):
	s = stdin.readline()
	(cnt, 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.append(str(j + 3))
			ans.append(' ')
			cnt += 1
			j += 5
		elif tmp in ['one', 'two']:
			ans.append(str(j + 2))
			ans.append(' ')
			cnt += 1
			j += 3
		else:
			j += 1
	ans.append('\n')
	ans.insert(pos, str(cnt))
	ans.insert(pos + 1, '\n')
	pos = len(ans)
stdout.write(''.join(ans))


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


for _ in range(int(input())):
	s = input().replace('twone', 'tw_ne').replace('one', 'o_e').replace('two', 't_o')
	r = s.count('_')
	print(r)
	if r == 0:
		print('')
	else:
		print(*[i for (i, c) in enumerate(s, 1) if c == '_'])


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


from sys import stdin
a = lambda : stdin.readline()
for _ in range(int(a())):
	s = [*a()]
	n = len(s) - 1
	(result, res, i) = (0, [], 0)
	app = res.append
	while i < n - 2:
		x = ''.join(s[i:i + 3])
		if x == 'one':
			result += 1
			app(i + 2)
		elif x == 'two':
			if i != n - 3:
				if s[i + 3] == 'o':
					app(i + 2)
				else:
					s[i + 2] = 'x'
					app(i + 3)
				result += 1
			else:
				result += 1
				app(i + 3)
		else:
			i = i
		i += 1
	print(result)
	print(*res)


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)


for i in range(int(input())):
	q = set()
	s = input() + '?????'
	for i in range(len(s)):
		if s[i] == 't':
			if s[i:i + 5] == 'twone':
				q.add(i + 3)
	s = s.replace('twone', '?????')
	for i in range(len(s)):
		if s[i] == 'o':
			if s[i:i + 3] == 'one':
				q.add(i + 2)
		elif s[i] == 't':
			if s[i:i + 3] == 'two':
				q.add(i + 2)
	print(len(q))
	print(*q)


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


t = int(input())
for ti in range(t):
	indices = []
	s = input()
	i = 0
	while i < len(s):
		if s[i] == 'o' and s[i:i + 3] == 'one':
			indices += [i + 1]
			i += 3
			continue
		elif s[i] == 't':
			if s[i:i + 5] == 'twone':
				indices += [i + 2]
				i += 5
			elif s[i:i + 3] == 'two':
				indices += [i + 1]
				i += 3
			else:
				i += 1
			continue
		i += 1
	print(len(indices))
	for i in indices:
		print(i + 1, end=' ')
	print()


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)


def make_liked(s):
	i = 0
	remove = []
	while i < len(s) - 2:
		if i < len(s) - 4 and s[i] == 't' and (s[i + 1] == 'w') and (s[i + 2] == 'o') and (s[i + 3] == 'n') and (s[i + 4] == 'e'):
			remove.append(i + 3)
			i += 4
			continue
		if s[i] == 'o' and s[i + 1] == 'n' and (s[i + 2] == 'e'):
			remove.append(i + 2)
		elif s[i] == 't' and s[i + 1] == 'w' and (s[i + 2] == 'o'):
			remove.append(i + 2)
		i += 1
	print(len(remove))
	print(*remove)
t = int(input())
for i in range(t):
	s = input()
	make_liked(s)


t = int(input())
for i in range(t):
	s = str(input())
	arr = []
	s += '111'
	j = 0
	while j <= len(s) - 2:
		q = s[j:j + 3]
		p = s[j + 2:j + 5]
		if q == 'one':
			arr.append(j + 2)
			j += 3
		elif q == 'two':
			if p == 'one':
				arr.append(j + 3)
				j += 5
			else:
				arr.append(j + 2)
				j += 3
		else:
			j += 1
	print(len(arr))
	for j in range(len(arr)):
		print(arr[j], end=' ')
	print()


for test in range(int(input())):
	b = input()
	a = []
	c = []
	for lol in range(len(b)):
		a.append(b[lol])
	for i in range(len(a) - 1, 3, -1):
		if a[i - 4] == 't' and a[i - 3] == 'w' and (a[i - 2] == 'o') and (a[i - 1] == 'n') and (a[i] == 'e'):
			a[i - 2] = 'X'
			c.append(i - 1)
	for j in range(len(a) - 1, 1, -1):
		if a[j - 2] == 'o' and a[j - 1] == 'n' and (a[j] == 'e'):
			a[j - 1] = 'X'
			c.append(j)
	for k in range(len(a) - 1, 1, -1):
		if a[k - 2] == 't' and a[k - 1] == 'w' and (a[k] == 'o'):
			a[k - 1] = 'X'
			c.append(k)
	print(len(c))
	for l in range(len(c)):
		print(c[l], end=' ')
	print()


import sys

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

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

def oint():
	return int(input())
t = oint()
one = list('one')
two = list('two')
twone = list('twone')
for _ in range(t):
	s = list(input())
	l = len(s)
	cnt = 0
	p = []
	for i in range(l - 2):
		if s[i:i + 3] == one:
			cnt += 1
			p.append(i + 2)
		elif s[i:i + 3] == two:
			if i + 4 < l:
				if s[i:i + 5] == twone:
					s[i + 2] = 'x'
					p.append(i + 1 + 2)
				else:
					p.append(i + 2)
				cnt += 1
			else:
				cnt += 1
				p.append(i + 2)
	print(cnt)
	print(*p)


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)


import math
y = int(input())
while y > 0:
	y -= 1
	s = input()
	i = 0
	ans = 0
	l = []
	while i < len(s):
		if i + 5 <= len(s) and s[i:i + 5] == 'twone':
			l.append(i + 2)
			ans += 1
			i += 5
		elif i + 3 <= len(s) and s[i:i + 3] == 'two':
			l.append(i + 1)
			ans += 1
			i += 3
		elif i + 3 <= len(s) and s[i:i + 3] == 'one':
			l.append(i + 1)
			ans += 1
			i += 3
		else:
			i += 1
	print(ans)
	for j in l:
		print(j + 1, end=' ')
	print()


for _ in range(int(input())):
	s = input().replace('twone', 'tw_ne').replace('one', 'o_e').replace('two', 't_o')
	A = {i for (i, ch) in enumerate(s, 1) if ch == '_'}
	print(len(A))
	print(*A)


n = int(input())
for i in range(n):
	z = input() + '  '
	x = len(z)
	a = []
	q = 0
	w = 0
	while q < x - 2:
		if z[q:q + 3] == 'one':
			a.append(q + 2)
			q += 2
			w += 1
		elif z[q:q + 3] == 'two':
			if z[q + 2:q + 5] == 'one':
				a.append(q + 3)
			else:
				a.append(q + 2)
			q += 2
			w += 1
		q += 1
	print(w)
	for i in range(w):
		print(a[i], end=' ')
	print()


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


import sys
input = sys.stdin.readline
inf = 100000000000000000
mod = 998244353
for CASES in range(int(input())):
	S = input().strip()
	if len(S) < 3:
		print(0)
		print()
		continue
	A = [S[0], S[1]]
	ANS = []
	for i in range(2, len(S)):
		if S[i] == 'e' and A[-1] == 'n' and (A[-2] == 'o'):
			ANS.append(i)
			A.pop()
			A.append(S[i])
		elif S[i] == 'o' and A[-1] == 'w' and (A[-2] == 't'):
			if i + 2 < len(S) and S[i + 1] == 'n' and (S[i + 2] == 'e'):
				ANS.append(i + 1)
			else:
				ANS.append(i)
				A.pop()
				A.append(S[i])
		else:
			A.append(S[i])
	print(len(ANS))
	print(*ANS)


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

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

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

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

def sin():
	return input()

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

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

def main():
	t = inin()
	for _ in range(t):
		s = sin()
		n = len(s)
		i = 0
		ans = []
		while i < n - 2:
			if i < n - 4 and s[i] == 't' and (s[i + 1] == 'w') and (s[i + 2] == 'o') and (s[i + 3] == 'n') and (s[i + 4] == 'e'):
				ans.append(i + 3)
				i += 4
			elif s[i] == 'o' and s[i + 1] == 'n' and (s[i + 2] == 'e'):
				ans.append(i + 2)
				i = i + 2
			elif s[i] == 't' and s[i + 1] == 'w' and (s[i + 2] == 'o'):
				ans.append(i + 2)
				i = i + 2
			i += 1
		print(len(ans))
		print(*ans)
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

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

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

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

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

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

class IOWrapper(IOBase):

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

class ostream:

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

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


for _ in range(int(input())):
	s = input()
	n = len(s)
	ct = 0
	co = 0
	two = set()
	one = set()
	for i in range(n - 2):
		if s[i] == 'o' and s[i + 1] == 'n' and (s[i + 2] == 'e'):
			if i - 1 >= 0 and i - 2 >= 0 and (s[i - 2] == 't') and (s[i - 1] == 'w'):
				one.add(i + 1)
			else:
				one.add(i + 2)
		elif s[i] == 't' and s[i + 1] == 'w' and (s[i + 2] == 'o'):
			if i + 3 < n and i + 4 < n and (s[i + 3] == 'n') and (s[i + 4] == 'e'):
				two.add(i + 3)
			else:
				two.add(i + 2)
	k = one | two
	print(len(k))
	k = sorted(list(k))
	print(*k)


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


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)


for t in range(int(input())):
	s = input()
	l = set()
	n = len(s)
	for i in range(n - 2):
		if s[i:i + 3] == 'one':
			l.add(i + 2)
		if s[i:i + 3] == 'two':
			l.add(i + 2)
	for i in range(n - 4):
		if s[i:i + 5] == 'twone':
			l.remove(i + 4)
			l.remove(i + 2)
			l.add(i + 3)
	print(len(l))
	print(' '.join(map(str, l)))


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)


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


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


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)


import sys, os, io

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

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

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

def ws(s):
	sys.stdout.write(s + '\n')

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

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools, itertools, operator, bisect
from collections import deque, defaultdict, OrderedDict
import collections

def main():
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	for _ in range(ri()):
		s = rs()
		s = 'zz' + s + 'zz'
		ans = []
		r = 0
		for i in range(2, len(s) - 2):
			if s[i] == 'o':
				if s[i - 2] + s[i - 1] == 'tw' and s[i + 1] + s[i + 2] == 'ne':
					ans.append(i + 1 - 2)
				if s[i - 2] + s[i - 1] == 'tw' and s[i + 1] + s[i + 2] != 'ne':
					ans.append(i - 2)
				if s[i - 2] + s[i - 1] != 'tw' and s[i + 1] + s[i + 2] == 'ne':
					ans.append(i + 2 - 2)
		print(len(ans))
		print(*ans)
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			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, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			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()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

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

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


t = int(input())
while t:
	s = input()
	ls = []
	i = 2
	while i < len(s):
		if s[i - 2] + s[i - 1] + s[i] == 'one':
			ls.append(i - 1 + 1)
		elif s[i - 2] + s[i - 1] + s[i] == 'two':
			if i < len(s) - 2:
				if s[i + 1] + s[i + 2] == 'ne':
					ls.append(i + 1)
					i += 2
				else:
					ls.append(i - 1 + 1)
			else:
				ls.append(i - 1 + 1)
		i += 1
	ls = list(set(ls))
	print(len(ls))
	print(*ls)
	t -= 1


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)


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 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 re
t = int(input())
while t:
	text = input()
	s1 = set()
	s2 = set()
	for m in re.finditer('one', text):
		s1.add((m.start(), m.end()))
	for m in re.finditer('two', text):
		s2.add((m.start(), m.end()))
	soln = []
	for i in s1:
		if (i[0] - 2, i[0] + 1) in s2:
			s2.remove((i[0] - 2, i[0] + 1))
			soln.append(i[0] + 1)
		else:
			soln.append(i[1] - 1)
	for i in s2:
		soln.append(i[1] - 1)
	print(len(soln))
	for i in soln:
		print(i, end=' ')
	print()
	t -= 1


t = int(input())
for _ in range(t):
	index = []
	s = input()
	for i in range(len(s) - 2):
		if s[i] + s[i + 1] + s[i + 2] == 'one' or s[i] + s[i + 1] + s[i + 2] == 'two':
			index.append([i + 2, 1])
	for i in range(len(index)):
		try:
			if index[i][0] + 2 == index[i + 1][0] and index[i][1] == 1:
				index[i][0] = index[i][0] + 1
				index[i + 1][1] = 0
		except:
			continue
	count = 0
	for i in range(len(index)):
		if index[i][1] == 1:
			count += 1
	print(count)
	for i in range(len(index)):
		if index[i][1] == 1:
			print(index[i][0], end=' ')
			count += 1


a = int(input())
for x in range(a):
	b = input()
	c = len(b)
	d = list(b)
	k = 0
	h = []
	if c == 1 or c == 2:
		print(0)
		print()
	elif c == 3:
		if d[0] == 'o':
			if d[1] == 'n':
				if d[2] == 'e':
					k += 1
					d[0] = '@'
					h.append(1)
		elif d[2] == 'o':
			if d[1] == 'w':
				if d[0] == 't':
					k += 1
					d[2] = '@'
					h.append(3)
		print(k)
		print(*h)
	else:
		for y in range(c):
			if d[y] == 'o':
				if y == 0 or y == 1:
					if d[y + 1] == 'n':
						if d[y + 2] == 'e':
							k += 1
							d[y + 1] = '@'
							h.append(y + 2)
				elif y == c - 2 or y == c - 1:
					if d[y - 1] == 'w':
						if d[y - 2] == 't':
							k += 1
							d[y - 1] = '@'
							h.append(y)
				elif (d[y + 1] == 'n' and d[y + 2] == 'e') and (d[y - 1] == 'w' and d[y - 2] == 't'):
					k += 1
					d[y] = '@'
					h.append(y + 1)
				elif d[y + 1] == 'n' and d[y + 2] == 'e':
					k += 1
					d[y + 1] == '@'
					h.append(y + 2)
				elif d[y - 1] == 'w' and d[y - 2] == 't':
					k += 1
					d[y - 1] == '@'
					h.append(y)
		print(k)
		print(*h)


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


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


import sys
ip = lambda : sys.stdin.readline().rstrip()
for _ in range(int(ip())):
	s = ip()
	n = len(s)
	ans = []
	i = 0
	prev = -1
	while i < n:
		if s[i] == 'o':
			ct = [[], [], []]
			j = i
			while j < n and s[j] == 'o':
				j += 1
			ct[0] = [j - i, i]
			i = j
			while j < n and s[j] == 'n':
				j += 1
			ct[1] = [j - i, i]
			i = j
			while j < n and s[j] == 'e':
				j += 1
			ct[2] = [j - i, i]
			i = j
			if ct[0][0] and ct[1][0] == 1 and ct[2][0]:
				mn = min(ct, key=lambda x: x[0])
				if prev != -1:
					if prev == ct[0]:
						ans += list(range(prev[1], prev[1] + prev[0]))
						prev = -1
						continue
					else:
						ans += list(range(prev[1], prev[1] + prev[0]))
						prev = -1
				ans += list(range(mn[1], mn[1] + mn[0]))
		elif s[i] == 't':
			ct = [[], [], []]
			j = i
			while j < n and s[j] == 't':
				j += 1
			ct[0] = [j - i, i]
			i = j
			while j < n and s[j] == 'w':
				j += 1
			ct[1] = [j - i, i]
			i = j
			while j < n and s[j] == 'o':
				j += 1
			ct[2] = [j - i, i]
			i = j
			if ct[2][0] >= 1:
				i = ct[2][1]
			if prev != -1:
				ans += list(range(prev[1], prev[1] + prev[0]))
				prev = -1
			if ct[0][0] and ct[1][0] == 1 and ct[2][0]:
				mn = min(ct, key=lambda x: x[0])
				if mn[0] == ct[2][0]:
					mn = ct[2]
				prev = mn
		else:
			i += 1
	if prev != -1:
		ans += list(range(prev[1], prev[1] + prev[0]))
	print(len(ans))
	print(*[i + 1 for i in ans])


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


import heapq
import math
from collections import *
from functools import reduce, cmp_to_key
import sys
input = sys.stdin.readline
M = mod = 10 ** 9 + 7

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

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip('\n')]

def st():
	return input().rstrip('\n')

def val():
	return int(input())
for _ in range(val()):
	s = list(st())
	ans = []
	i = 2
	for i in range(5, len(s) + 1):
		if s[i - 5:i] == ['t', 'w', 'o', 'n', 'e']:
			ans.append(i - 2)
			s[i - 3] = '5'
	for i in range(len(s) - 2):
		if s[i:i + 3] == ['t', 'w', 'o']:
			ans.append(i + 2)
			s[i + 1] == '3'
	for i in range(2, len(s)):
		if s[i - 2:i + 1] == ['o', 'n', 'e']:
			ans.append(i)
			s[i - 1] = '2'
	print(len(ans))
	print(*ans)


t = int(input())
for i in range(0, t):
	count = 0
	s = []
	ignoreOne = False
	emptyS = True
	line = input()
	for f in range(0, len(line)):
		if line[f] == 't':
			if line[f:f + 5] == 'twone':
				s.append(str(f + 3))
				count = count + 1
				ignoreOne = True
			elif line[f:f + 3] == 'two':
				s.append(str(f + 2))
				count = count + 1
		if line[f] == 'o':
			if line[f:f + 3] == 'one':
				if ignoreOne == True:
					ignoreOne = False
				else:
					count = count + 1
					s.append(str(f + 2))
	print(count)
	print(' '.join(s))


import re
t = int(input())
for i in range(t):
	s = input()
	one = [i.start() for i in re.finditer('one', s)]
	two = [i.start() for i in re.finditer('two', s)]
	set_one = set()
	set_two = set()
	for j in one:
		set_one.add(j)
	for j in two:
		set_two.add(j)
	set_ans = set()
	ctr = 0
	for j in one:
		if j - 2 in set_two:
			set_two.remove(j - 2)
			set_ans.add(j)
			ctr += 1
			set_one.remove(j)
		else:
			set_ans.add(j + 1)
			ctr += 1
			set_one.remove(j)
	for j in two:
		if j in set_two:
			set_ans.add(j + 1)
			ctr += 1
	final = list(set_ans)
	ff = []
	for k in final:
		ff.append(str(k + 1) + ' ')
	print(ctr)
	print(''.join(ff))


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


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)


import sys
input = sys.stdin.readline
t = int(input())
for testcaess in range(t):
	S = input().strip() + 'zzzzzzzz'
	LEN = len(S)
	ANS = [0] * LEN
	for i in range(LEN):
		if S[i:i + 3] == 'two':
			if S[i + 2:i + 5] == 'one':
				ANS[i + 2] = 1
			else:
				ANS[i + 1] = 1
	for i in range(LEN):
		if S[i:i + 3] == 'one':
			if ANS[i] == 1:
				continue
			else:
				ANS[i + 1] = 1
	A = []
	for i in range(LEN):
		if ANS[i] == 1:
			A.append(i + 1)
	print(len(A))
	print(*A)


t = int(input())
for _ in range(t):
	ind = []
	s = list(input())
	l = len(s)
	for i in range(2, l):
		if i + 2 < l:
			if s[i - 2] == 't' and s[i - 1] == 'w' and (s[i] == 'o') and (s[i + 1] == 'n') and (s[i + 2] == 'e'):
				ind.append(i + 1)
				s[i] = ''
			if s[i - 2] == 'o' and s[i - 1] == 'n' and (s[i] == 'e'):
				ind.append(i)
				s[i - 1] = ''
			elif s[i - 2] == 't' and s[i - 1] == 'w' and (s[i] == 'o'):
				ind.append(i)
				s[i - 1] = ''
		elif s[i - 2] == 'o' and s[i - 1] == 'n' and (s[i] == 'e'):
			ind.append(i)
			s[i - 1] = ''
		elif s[i - 2] == 't' and s[i - 1] == 'w' and (s[i] == 'o'):
			ind.append(i)
			s[i - 1] = ''
	print(len(ind))
	print(*ind)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	S = input()
	N = len(S)
	if N <= 2:
		print(0)
		continue
	ans = [0] * N
	for i in range(N - 2):
		if S[i] == 'o' and S[i + 1] == 'n' and (S[i + 2] == 'e'):
			ans[i + 1] = 1
		if S[i] == 't' and S[i + 1] == 'w' and (S[i + 2] == 'o'):
			ans[i + 1] = 1
	for i in range(N - 4):
		if S[i] == 't' and S[i + 1] == 'w' and (S[i + 2] == 'o') and (S[i + 3] == 'n') and (S[i + 4] == 'e'):
			ans[i + 1] = 0
			ans[i + 3] = 0
			ans[i + 2] = 1
	print(sum(ans))
	a = []
	for i in range(N):
		if ans[i]:
			a.append(i + 1)
	print(*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)


import sys
sin = sys.stdin
t = int(sin.readline())
for i in range(t):
	s = sin.readline()
	idx = set()
	twones = 0
	j = 0
	while j < len(s) - 3:
		if j < len(s) - 4 and s[j:j + 5] == 'twone':
			idx.add(str(j + 3))
			j += 5
		elif s[j:j + 3] == 'one' or s[j:j + 3] == 'two':
			idx.add(str(j + 2))
			j += 3
		else:
			j += 1
	print(len(idx))
	print(' '.join(idx))


q = int(input())
for _ in range(q):
	s = input()
	n = len(s)
	dp = [0 for i in range(n)]
	for i in range(4, n):
		if s[i - 4] + s[i - 3] + s[i - 2] + s[i - 1] + s[i] == 'twone':
			dp[i - 4] = 1
			dp[i - 2] = 2
			dp[i] = 1
	for i in range(2, n):
		if s[i - 2] + s[i - 1] + s[i] == 'one' and dp[i] != 1:
			dp[i] = 1
			dp[i - 2] = 1
			dp[i - 1] = 2
	for i in range(2, n):
		if s[i - 2] + s[i - 1] + s[i] == 'two' and dp[i] != 2:
			dp[i] = 1
			dp[i - 2] = 1
			dp[i - 1] = 2
	ans = []
	res = 0
	for i in range(n):
		if dp[i] == 2:
			res += 1
			ans.append(i + 1)
	print(res)
	for i in range(res):
		print(ans[i], end=' ')


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase

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

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

def main():
	T = I()
	for _ in range(T):
		l = list(input())
		(s1, s2, s3) = ('one', 'two', 'twone')
		(i, n) = (0, len(l))
		ans_path = []
		while i < n:
			if i + 4 < n:
				t = ''.join(l[i:i + 5])
				if t == s3:
					ans_path.append(i + 2)
					i += 5
				else:
					t = ''.join(l[i:i + 3])
					if t == s1 or t == s2:
						ans_path.append(i + 1)
						i += 3
					else:
						i += 1
			elif i + 2 < n:
				t = ''.join(l[i:i + 3])
				if t == s1 or t == s2:
					ans_path.append(i + 1)
					i += 3
				else:
					i += 1
			else:
				break
		print(len(ans_path))
		for x in ans_path:
			print(x + 1, end=' ')
		print()
BUFSIZE = 8192
P = 1000000007

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


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


import sys
readline = sys.stdin.readline
ns = lambda : readline().rstrip()
ni = lambda : int(readline().rstrip())
nm = lambda : map(int, readline().split())
nl = lambda : list(map(int, readline().split()))
for _ in range(ni()):
	s = ns()
	ind = []
	i = 0
	while i < len(s) - 2:
		if s[i] == 'o':
			if s[i + 1] == 'n' and s[i + 2] == 'e':
				ind.append(i + 1)
				i += 2
		elif s[i] == 't':
			if i < len(s) - 4 and s[i + 1] == 'w' and (s[i + 2] == 'o') and (s[i + 3] == 'n') and (s[i + 4] == 'e'):
				ind.append(i + 2)
				i += 4
			elif s[i + 1] == 'w' and s[i + 2] == 'o':
				ind.append(i + 1)
				i += 2
		i += 1
	print(len(ind))
	for i in ind:
		print(i + 1, end=' ')
	print()


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


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


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


def solution(s):
	ret = set()
	for i in range(len(s) - 2):
		if s[i:i + 3] == 'one':
			try:
				if s[i - 2:i + 1] == 'two':
					ret.add(i + 1)
					continue
			except:
				pass
			ret.add(i + 2)
		if s[i:i + 3] == 'two':
			try:
				if s[i + 2:i + 5] == 'one':
					ret.add(i + 3)
					continue
			except:
				pass
			ret.add(i + 2)
	return ret
t = int(input())
for i in range(t):
	res = solution(input())
	print(len(res))
	print(' '.join(list(map(str, res))))


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


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


from os import path
import sys, time
mod = int(1000000000.0 + 7)
from math import ceil, floor, gcd, log, log2, factorial, sqrt
from collections import defaultdict, Counter, OrderedDict, deque
from itertools import combinations, permutations
from string import ascii_lowercase, ascii_uppercase
from bisect import *
from functools import reduce
from operator import mul
maxx = float('inf')
I = lambda : int(sys.stdin.buffer.readline())
lint = lambda : [int(x) for x in sys.stdin.buffer.readline().split()]
S = lambda : sys.stdin.readline().strip('\n')
grid = lambda r: [lint() for i in range(r)]
localsys = 0
start_time = time.time()
nCr = lambda n, r: reduce(mul, range(n - r + 1, n + 1), 1) // factorial(r)

def ceill(n, x):
	return (n + x - 1) // x
T = 1

def solve():
	s = S() + '-1' * 2
	(ans, n, i) = ([], len(s), 0)
	while i < n:
		x = s[i:i + 3]
		if x == 'one':
			ans.append(i + 2)
			i += 1
		elif x == 'two':
			if s[i + 3] == 'n' and s[i + 4] == 'e':
				ans.append(i + 3)
				i += 3
			else:
				ans.append(i + 2)
				i += 1
		i += 1
	print(len(ans), ' '.join(map(str, ans)), sep='\n')

def run():
	if path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
run()
T = I() if T else 1
for _ in range(T):
	solve()
if localsys:
	print('\n\nTime Elased :', time.time() - start_time, 'seconds')


t = int(input())
for _ in range(t):
	s = input()
	if len(s) < 3:
		print(0)
		continue
	ans = []
	for i in range(len(s)):
		if i < 2:
			if s[i:i + 3] == 'one':
				ans.append(i + 1)
		elif i + 2 < len(s) and s[i - 2:i + 3] == 'twone':
			ans.append(i)
		elif s[i - 2:i + 1] == 'two':
			ans.append(i - 1)
		elif i + 2 < len(s) and s[i:i + 3] == 'one':
			ans.append(i + 1)
	ans.sort()
	print(len(ans))
	for j in ans:
		print(j + 1, end=' ')
	print(end='\n')


class state:

	def __init__(self, states, key, keys):
		self.stringe = []
		self.cur = []
		self.rem = []
		self.action = None
		self.states = None
		self.children_keys = keys
		self.children = {}
		self.key = None
		self.cur_string = []

class states:

	def __init__(self):
		self.states = {}
		self.current_state = None
		self.total = 0

	def assing(self, stringe, cur, rem):
		self.total = 0
		self.current_state = self.states.get('o1')
		for state in states.states.values():
			state.states = self
			state.cur = cur
			state.rem = rem
			state.stringe = stringe
states = states()
o1 = state(states, 'o1', ['n1', 'w1'])

def o1_action(state):
	stringe = state.stringe[0]
	cur = state.cur[0]
	states = state.states
	letter = stringe[cur]
	if letter == 'o':
		states.current_state = state.children[0]
		o1.cur[0] = o1.cur[0] + 1
	elif letter == 't':
		states.current_state = state.children[1]
		state.cur[0] = state.cur[0] + 1
	else:
		state.cur[0] = state.cur[0] + 1
o1.action = o1_action
states.states.update({'o1': o1})
n1 = state(states, 'n1', ['w1', 'o1', 'e1'])

def n1_action(state):
	stringe = state.stringe[0]
	cur = state.cur[0]
	states = state.states
	letter = stringe[cur]
	if letter == 'n':
		states.current_state = state.children[0]
		state.cur[0] = state.cur[0] + 1
	elif letter == 'o':
		state.cur[0] = state.cur[0] + 1
	elif letter == 't':
		states.current_state = state.children[1]
		state.cur[0] = state.cur[0] + 1
	else:
		states.current_state = state.children[2]
		state.cur[0] = state.cur[0] + 1
n1.action = n1_action
states.states.update({'n1': n1})
e1 = state(states, 'e1', ['o1', 'n1', 'w1'])

def e1_action(state):
	stringe = state.stringe[0]
	cur = state.cur[0]
	states = state.states
	letter = stringe[cur]
	if letter == 'e':
		state.rem[states.total] = str(cur)
		states.total = states.total + 1
		states.current_state = state.children[0]
		state.cur[0] = state.cur[0] + 1
	elif letter == 'o':
		states.current_state = state.children[1]
		state.cur[0] = state.cur[0] + 1
	elif letter == 't':
		states.current_state = state.children[2]
		state.cur[0] = state.cur[0] + 1
	else:
		states.current_state = state.children[0]
		state.cur[0] = state.cur[0] + 1
e1.action = e1_action
states.states.update({'e1': e1})
w1 = state(states, 'w1', ['o2', 'o1', 'w1', 'n1'])

def w1_action(state):
	stringe = state.stringe[0]
	cur = state.cur[0]
	states = state.states
	letter = stringe[cur]
	if letter == 'w':
		states.current_state = state.children[0]
		state.cur[0] = state.cur[0] + 1
	elif letter == 't':
		states.current_state = state.children[1]
		state.cur[0] = state.cur[0] + 1
	elif letter == 'o':
		states.current_state = state.children[2]
		state.cur[0] = state.cur[0] + 1
	else:
		states.current_state = state.children[3]
		state.cur[0] = state.cur[0] + 1
w1.action = w1_action
states.states.update({'w1': w1})
o2 = state(states, 'o2', ['n2', 'o1', 'w1'])

def o2_action(state):
	stringe = state.stringe[0]
	cur = state.cur[0]
	states = state.states
	letter = stringe[cur]
	if letter == 'o':
		if cur + 1 == len(stringe):
			state.rem[states.total] = str(cur)
			states.total = states.total + 1
			state.cur[0] = state.cur[0] + 1
		else:
			states.current_state = state.children[0]
			state.cur[0] = state.cur[0] + 1
	elif letter == 't':
		states.current_state = state.children[1]
		state.cur[0] = state.cur[0] + 1
	else:
		states.current_state = state.children[2]
		state.cur[0] = state.cur[0] + 1
o2.action = o2_action
states.states.update({'o2': o2})
n2 = state(states, 'n2', ['e2', 'n1', 'w1', 'o1'])

def n2_action(state):
	stringe = state.stringe[0]
	cur = state.cur[0]
	states = state.states
	letter = stringe[cur]
	if letter == 'n':
		if cur + 1 == len(stringe):
			state.rem[states.total] = str(cur)
			states.total = states.total + 1
			state.cur[0] = state.cur[0] + 1
		else:
			states.current_state = state.children[0]
			state.cur[0] = state.cur[0] + 1
	elif letter == 'o':
		state.rem[states.total] = str(cur - 1)
		states.total = states.total + 1
		states.current_state = state.children[1]
		state.cur[0] = state.cur[0] + 1
	elif letter == 't':
		state.rem[states.total] = str(cur - 1)
		states.total = states.total + 1
		states.current_state = state.children[2]
		state.cur[0] = state.cur[0] + 1
	else:
		state.rem[states.total] = str(cur - 1)
		states.total = states.total + 1
		states.current_state = state.children[3]
		state.cur[0] = state.cur[0] + 1
n2.action = n2_action
states.states.update({'n2': n2})
e2 = state(states, 'e2', ['n1', 'w1', 'o1'])

def e2_action(state):
	stringe = state.stringe[0]
	cur = state.cur[0]
	states = state.states
	letter = stringe[cur]
	if letter == 'e':
		state.rem[states.total] = str(cur - 1)
		states.total = states.total + 1
		states.current_state = state.children[0]
		state.cur[0] = state.cur[0] + 1
	elif letter == 'o':
		state.rem[states.total] = str(cur - 2)
		states.total = states.total + 1
		states.current_state = state.children[1]
		state.cur[0] = state.cur[0] + 1
	elif letter == 't':
		state.rem[states.total] = str(cur - 2)
		states.total = states.total + 1
		states.current_state = state.children[2]
		state.cur[0] = state.cur[0] + 1
	else:
		state.rem[states.total] = str(cur - 2)
		states.total = states.total + 1
		states.current_state = state.children[3]
		state.cur[0] = state.cur[0] + 1
e2.action = e2_action
states.states.update({'e2': e2})
o1.children = [n1, w1]
n1.children = [e1, w1, o1]
e1.children = [o1, n1, w1]
w1.children = [o2, w1, n1, o1]
o2.children = [n2, w1, o1]
n2.children = [e2, n1, w1, o1]
e2.children = [o1, n1, w1, o1]
N = int(input())
k = 0
while k < N:
	stringe = [input()]
	cur = [0]
	rem = [''] * int(1500000 / N)
	states.assing(stringe, cur, rem)
	n = len(stringe[0])
	while cur[0] < n:
		state = states.current_state
		state.action(state)
	print(states.total)
	if states.total > 0:
		print(' '.join(state.rem[0:states.total]))
	k = k + 1


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)


from sys import stdin, stdout
input = stdin.readline
t = int(input())
for _ in range(t):
	s = input()[:-1]
	n = len(s)
	ans = []
	i = 1
	while 1:
		i += 1
		if i >= n:
			break
		if s[i] == 'o' and s[i - 1] == 'w' and (s[i - 2] == 't') and (i + 1 < n) and (s[i + 1] == 'n') and (i + 2 < n) and (s[i + 2] == 'e'):
			ans.append(i + 1)
			i = i + 3
		elif s[i] == 'o' and s[i - 1] == 'w' and (s[i - 2] == 't'):
			ans.append(i)
			i += 1
		elif s[i] == 'e' and s[i - 1] == 'n' and (s[i - 2] == 'o'):
			ans.append(i)
			i += 1
	print(len(ans))
	print(*ans)