#include<bits/stdc++.h>
using namespace std;

#define ii pair < int , int >
#define ig pair < ii , ii >

#define fi first
#define se second
#define pb push_back

#define fo(i , x , n) for(int i = x ; i <= n ; ++i)
#define re(i , n) for(int i = 0 ; i < n ; ++i)
#define fod(i , x , n) for(int i = x ; i >= n ; --i)
template<class T> T getbit(T s, int i){return (s >> i) & 1;}
template<class T> T onbit(T s, int i){return s | (T(1) << i);}
template<class T> T offbit(T s, int i){return s & (~(T(1) << i));}
template<class T> T cntbit(T s){return __builtin_popcountt(s);}

template<class T> T gcd(T a, T b){T r; while (b != 0){r = a % b; a = b; b = r;} return a;}
template<class T> T lcm(T a, T b){return a / gcd(a, b) * b;}

template <typename T> T Max(T a, T b){return a > b ? a : b;}
template <typename T> T Min(T a, T b){return a < b ? a : b;}
template <typename T> T abs(T a){return a > 0 ? a : -a;}

template <typename T> ll pow(T a, T b){ll res = 1; fo(i,1,b) res = res * a; return res;}

template<class T> void read(T &x)
{
    x = 0;
    char c;
    for(c = getchar(); c < '0' || c > '9'; c = getchar());
    x = c - '0';
    for(c = getchar(); c >= '0' && c <= '9'; c = getchar())
        x = x * 10 + c - '0';
}

template<class T> void readchar(T &x)
{
    for(x = getchar(); x != 'D' && x != 'C'; x = getchar());
}

template <typename T> inline void writep(T x){ if(x>9) writep(x/10); putchar(x%10+48);}
template <typename T> inline void write(T x){ if(x<0){ putchar('-'); x=-x; } writep(x);}
template <typename T> inline void writeln(T x){ write(x); putchar('\n'); }
template <typename T> inline void writec(T x){ write(x); putchar(' ');}

#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

const int mm = 1e6 + 5;
int n , T , res;
int dx[] = {'t' , 'w' , 'o' , 'n' , 'e'};
int cnt[mm] , dp[mm];
int d1[] = {'o' , 'n' , 'e'} , d2[] = {'t' , 'w' , 'o'};
char f[mm];
ig a[mm];
vector < int > ats;
vector < ii > g;

main ()
{
fast
    cin >> T;
    while(T--)
    {
        int r = 0;
        cin >> f;
        int n = strlen(f);
        fod(i , n , 1)
            f[i] = f[i - 1];
        f[n + 1] = 0;
        int bd = 1;
        fo(i , 2 , n + 1)
            if(f[i] != f[i - 1])
                a[++r] = ig (ii(f[i - 1] , i - bd) , ii(bd, i - 1)) , bd= i;
        ats.clear();
        fo(i , 1 , r)
        {
            bool ok = true;
            if(i + 2 <= r)
            {
                bool ok = true;
                re(s , 5)
                    cnt[dx[s]] = 0;
                fo (j , 0 , 2)
                {
                    if(a[i + j].fi.fi != d1[j])
                        ok = false;
                    cnt[a[i + j].fi.fi] += a[i + j].fi.se;
                    dp[a[i + j].fi.fi] = i + j;
                }
                if(ok && cnt['o'] != 0 && cnt['n'] == 1 && cnt['e'] != 0)
                {
                        int pos = dp['n'];
                        fo (i , a[pos].se.fi , a[pos].se.se)
                            ats.pb(i);
                        a[pos].fi.se = 0;
                }
                ok = true;
                re (s , 5)
                    cnt[dx[s]] = 0;
                fo (j , 0 , 2)
                {
                    if(a[i + j].fi.fi != d2[j])
                        ok = false;
                    cnt[a[i + j].fi.fi] += a[i + j].fi.se;
                    dp[a[i + j].fi.fi] = i + j;
                }
                if(ok && cnt['t'] != 0 && cnt['o'] != 0 && cnt['w'] == 1)
                {
                    if(cnt['o'] <= cnt['w'])
                    {
                        int pos = dp['o'];
                        fo(i , a[pos].se.fi , a[pos].se.se)
                                ats.pb(i);
                        a[pos].fi.se = 0;
                    }
                    else
                    {
                        int pos = dp['w'];
                        fo(i , a[pos].se.fi , a[pos].se.se)
                                ats.pb(i);
                        a[pos].fi.se = 0;
                    }
                }
            }
        }
        cout << ats.size() << "\n";
        re(ss , ats.size())
            cout << ats[ss] << " ";
        cout << "\n";
    }
}


#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;

#define mp make_pair
#define pb push_back
#define ll long long
#define li long int
#define ST string
#define ld long double
#define st string

#define fo(i,a,b) for(ll i=a; i<=b; i++)
#define re(i,a,b) for(ll i=a; i>=b; i--)
#define fop(i,a,b) for(ll i=a; i<b; i++)
#define rep(i,a,b) for(ll i=a-1; i>=b; i--)

#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second
#define sz(x) (int)(x).size()
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()

#define N 2000000
#define M 2000
#define MOD 1000000009

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef pair<int, int> II;
typedef pair<int, II> III;
typedef pair<ll, ll> LL;
typedef pair<ll, LL> LLL;
typedef pair<ld,ld> PD;
typedef pair<LL,LL> IG;
typedef vector<int> VI;
typedef vector<VI > VVI;
typedef vector<ll> VL;
typedef vector<VL > VVL;
typedef vector<ld> VD;
typedef complex<ld> cd;

const int INF = 2147483647;
const long double PI = 3.1415926535898;
const long long oo = 9223372036854775807;

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

template<class T> T getbit(T s, int i){return (s >> i) & 1;}
template<class T> T onbit(T s, int i){return s | (T(1) << i);}
template<class T> T offbit(T s, int i){return s & (~(T(1) << i));}
template<class T> T dembit(T s){return __builtin_popcountt(s);}

template<class T> T gcd(T a, T b){T r; while (b != 0){r = a % b; a = b; b = r;} return a;}
template<class T> T lcm(T a, T b){return a / gcd(a, b) * b;}

template <typename T> T Max(T a, T b){return a > b ? a : b;}
template <typename T> T Min(T a, T b){return a < b ? a : b;}
template <typename T> T abs(T a){return a > 0 ? a : -a;}

template <typename T> ll pow(T a, T b){ll res = 1; fo(i,1,b) res = res * a; return res;}

template<class T> void read(T &x)
{
    x = 0;
    char c;
    for(c = getchar(); c < '0' || c > '9'; c = getchar());
    x = c - '0';
    for(c = getchar(); c >= '0' && c <= '9'; c = getchar())
        x = x * 10 + c - '0';
}

template<class T> void readchar(T &x)
{
    for(x = getchar(); x != 'D' && x != 'C'; x = getchar());
}

template <typename T> inline void writep(T x){ if(x>9) writep(x/10); putchar(x%10+48);}
template <typename T> inline void write(T x){ if(x<0){ putchar('-'); x=-x; } writep(x);}
template <typename T> inline void writeln(T x){ write(x); putchar('\n'); }
template <typename T> inline void writec(T x){ write(x); putchar(' ');}

int x1[] = {'o' , 'n' , 'e'};
int x2[] = {'t' , 'w' , 'o'};
int x[]={'t','w','o','n','e'};
ll n;
int dem[N],qq[N];
char f[N];
IG khu[N];
VI qqq;

main()
{
    //fast
    ll T;
    cin>>T;
    while(T--)
    {
        cin>>f;
        n=strlen(f);
        re(i,n,1)
            f[i]=f[i-1];
        f[n+1] = 0;
        int bd=1,r=0;
        fo(i,2,n+1)
            if(f[i]!=f[i - 1])
                {
                    khu[++r]=IG(II(f[i-1],i-bd),II(bd,i-1));
                    bd=i;
                }
        qqq.clear();
    fo(i,1,r)
        {
            bool check = true;
            if(i+2<=r)
            {
                bool check = true;
                fo(ii,0,4)
                    dem[x[ii]] = 0;
                fo(ppp,0,2)
                {
                    if(khu[i+ppp].first.first!=x1[ppp])
                        check=false;
                    dem[khu[i+ppp].first.first]+=khu[i+ppp].first.se;
                    qq[khu[i+ppp].first.first]=i+ppp;
                }
                if(check && dem['o'] != 0 && dem['n'] == 1 && dem['e'] != 0)
                {
                        int pn = qq['n'];
                        fo(i , khu[pn].se.first , khu[pn].se.se)
                            qqq.pb(i);
                        khu[pn].first.se = 0;
                }
                check = true;
                fo(pppp,0,4)
                    dem[x[pppp]] = 0;
                fo(j,0,2)
                {
                    if(khu[i + j].first.first != x2[j])
                        check = false;
                    dem[khu[i + j].first.first] += khu[i + j].first.se;
                    qq[khu[i + j].fi.fi] = i + j;
                }
                if(check && dem['t'] != 0 && dem['o'] != 0 && dem['w'] == 1)
                {
                    if(dem['o'] <= dem['w'])
                    {
                        int pn = qq['o'];
                        fo(i , khu[pn].se.first , khu[pn].se.se)
                                qqq.pb(i);
                        khu[pn].first.se = 0;
                    }
                    else
                    {
                        int pn = qq['w'];
                        fo(i , khu[pn].se.first , khu[pn].se.se)
                                qqq.pb(i);
                        khu[pn].first.se = 0;
                    }
                }
            }
        }
        cout<<qqq.size()<<'\n';
        if(qqq.size()!=0)
        {fo(s,0,qqq.size()-1)
            cout << qqq[s] << " ";}
        cout << '\n';
    }
}


#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;

#define mp make_pair
#define pb push_back
#define ll long long
#define li long int
#define ST string
#define ld long double
#define st string

#define fo(i,a,b) for(ll i=a; i<=b; i++)
#define re(i,a,b) for(ll i=a; i>=b; i--)
#define fop(i,a,b) for(ll i=a; i<b; i++)
#define rep(i,a,b) for(ll i=a-1; i>=b; i--)

#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second
#define sz(x) (int)(x).size()
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()

#define N 2000000
#define M 2000
#define MOD 1000000009

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef pair<int, int> II;
typedef pair<int, II> III;
typedef pair<ll, ll> LL;
typedef pair<ll, LL> LLL;
typedef pair<ld,ld> PD;
typedef pair<LL,LL> IG;
typedef vector<int> VI;
typedef vector<VI > VVI;
typedef vector<ll> VL;
typedef vector<VL > VVL;
typedef vector<ld> VD;
typedef complex<ld> cd;

const int INF = 2147483647;
const long double PI = 3.1415926535898;
const long long oo = 9223372036854775807;

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

template<class T> T getbit(T s, int i){return (s >> i) & 1;}
template<class T> T onbit(T s, int i){return s | (T(1) << i);}
template<class T> T offbit(T s, int i){return s & (~(T(1) << i));}
template<class T> T dembit(T s){return __builtin_popcountt(s);}

template<class T> T gcd(T a, T b){T r; while (b != 0){r = a % b; a = b; b = r;} return a;}
template<class T> T lcm(T a, T b){return a / gcd(a, b) * b;}

template <typename T> T Max(T a, T b){return a > b ? a : b;}
template <typename T> T Min(T a, T b){return a < b ? a : b;}
template <typename T> T abs(T a){return a > 0 ? a : -a;}

template <typename T> ll pow(T a, T b){ll res = 1; fo(i,1,b) res = res * a; return res;}

template<class T> void read(T &x)
{
    x = 0;
    char c;
    for(c = getchar(); c < '0' || c > '9'; c = getchar());
    x = c - '0';
    for(c = getchar(); c >= '0' && c <= '9'; c = getchar())
        x = x * 10 + c - '0';
}

template<class T> void readchar(T &x)
{
    for(x = getchar(); x != 'D' && x != 'C'; x = getchar());
}

template <typename T> inline void writep(T x){ if(x>9) writep(x/10); putchar(x%10+48);}
template <typename T> inline void write(T x){ if(x<0){ putchar('-'); x=-x; } writep(x);}
template <typename T> inline void writeln(T x){ write(x); putchar('\n'); }
template <typename T> inline void writec(T x){ write(x); putchar(' ');}

int x1[] = {'o' , 'n' , 'e'};
int x2[] = {'t' , 'w' , 'o'};
int x[]={'t','w','o','n','e'};
ll n;
int dem[N],qq[N];
char f[N];
IG khu[N];
VI qqq;

void sol()
{
    n=strlen(f);
        re(i,n,1)
            f[i]=f[i-1];
        f[n+1] = 0;
        int bd=1,r=0;
        fo(i,2,n+1)
            if(f[i]!=f[i - 1])
                {
                    khu[++r]=IG(II(f[i-1],i-bd),II(bd,i-1));
                    bd=i;
                }
        qqq.clear();
    fo(i,1,r)
        {
            bool check = true;
            if(i+2<=r)
            {
                bool check = true;
                fo(ii,0,4)
                    dem[x[ii]] = 0;
                fo(ppp,0,2)
                {
                    if(khu[i+ppp].first.first!=x1[ppp])
                        check=false;
                    dem[khu[i+ppp].first.first]+=khu[i+ppp].first.se;
                    qq[khu[i+ppp].first.first]=i+ppp;
                }
                if(check && dem['o'] != 0 && dem['n'] == 1 && dem['e'] != 0)
                {
                        int pn = qq['n'];
                        fo(i , khu[pn].se.first , khu[pn].se.se)
                            qqq.pb(i);
                        khu[pn].first.se = 0;
                }
                check = true;
                fo(pppp,0,4)
                    dem[x[pppp]] = 0;
                fo(j,0,2)
                {
                    if(khu[i + j].first.first != x2[j])
                        check = false;
                    dem[khu[i + j].first.first] += khu[i + j].first.se;
                    qq[khu[i + j].fi.fi] = i + j;
                }
                if(check && dem['t'] != 0 && dem['o'] != 0 && dem['w'] == 1)
                {
                    if(dem['o'] <= dem['w'])
                    {
                        int pn = qq['o'];
                        fo(i , khu[pn].se.first , khu[pn].se.se)
                                qqq.pb(i);
                        khu[pn].first.se = 0;
                    }
                    else
                    {
                        int pn = qq['w'];
                        fo(i , khu[pn].se.first , khu[pn].se.se)
                                qqq.pb(i);
                        khu[pn].first.se = 0;
                    }
                }
            }
        }
}
main()
{
    fast
    ll T;
    cin>>T;
    while(T--)
    {
        cin>>f;
        sol();
        cout<<qqq.size()<<'\n';
        fo(s,0,qqq.size()-1)
            cout << qqq[s] << " ";
        cout << '\n';
    }
}


#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;

#define mp make_pair
#define pb push_back
#define ll long long
#define li long int
#define ST string
#define ld long double
#define st string

#define fo(i,a,b) for(ll i=a; i<=b; i++)
#define re(i,a,b) for(ll i=a; i>=b; i--)
#define fop(i,a,b) for(ll i=a; i<b; i++)
#define rep(i,a,b) for(ll i=a-1; i>=b; i--)

#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second
#define sz(x) (int)(x).size()
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()

#define N 2000000
#define M 2000
#define MOD 1000000009

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef pair<int, int> II;
typedef pair<int, II> III;
typedef pair<ll, ll> LL;
typedef pair<ll, LL> LLL;
typedef pair<ld,ld> PD;
typedef pair<LL,LL> IG;
typedef vector<int> VI;
typedef vector<VI > VVI;
typedef vector<ll> VL;
typedef vector<VL > VVL;
typedef vector<ld> VD;
typedef complex<ld> cd;

const int INF = 2147483647;
const long double PI = 3.1415926535898;
const long long oo = 9223372036854775807;

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

template<class T> T getbit(T s, int i){return (s >> i) & 1;}
template<class T> T onbit(T s, int i){return s | (T(1) << i);}
template<class T> T offbit(T s, int i){return s & (~(T(1) << i));}
template<class T> T dembit(T s){return __builtin_popcountt(s);}

template<class T> T gcd(T a, T b){T r; while (b != 0){r = a % b; a = b; b = r;} return a;}
template<class T> T lcm(T a, T b){return a / gcd(a, b) * b;}

template <typename T> T Max(T a, T b){return a > b ? a : b;}
template <typename T> T Min(T a, T b){return a < b ? a : b;}
template <typename T> T abs(T a){return a > 0 ? a : -a;}

template <typename T> ll pow(T a, T b){ll res = 1; fo(i,1,b) res = res * a; return res;}

template<class T> void read(T &x)
{
    x = 0;
    char c;
    for(c = getchar(); c < '0' || c > '9'; c = getchar());
    x = c - '0';
    for(c = getchar(); c >= '0' && c <= '9'; c = getchar())
        x = x * 10 + c - '0';
}

template<class T> void readchar(T &x)
{
    for(x = getchar(); x != 'D' && x != 'C'; x = getchar());
}

template <typename T> inline void writep(T x){ if(x>9) writep(x/10); putchar(x%10+48);}
template <typename T> inline void write(T x){ if(x<0){ putchar('-'); x=-x; } writep(x);}
template <typename T> inline void writeln(T x){ write(x); putchar('\n'); }
template <typename T> inline void writec(T x){ write(x); putchar(' ');}

int n , T , res;
int dx[] = {'t' , 'w' , 'o' , 'n' , 'e'};
int dem[N] , ppp[N];
int d1[] = {'o' , 'n' , 'e'} , d2[] = {'t' , 'w' , 'o'};
char f[N];
IG a[N];
VI qq;
vector < II > g;

main()
{
    fast
    cin >> T;
    while(T--)
    {
        int r = 0;
        cin >> f;
        int n = strlen(f);
        re(i , n , 1)
            f[i] = f[i - 1];
        f[n + 1] = 0;
        int bd = 1;
        fo(i , 2 , n + 1)
            if(f[i] != f[i - 1])
                a[++r] = IG(II(f[i - 1] , i - bd) , II(bd , i - 1)) , bd = i;
        qq.clear();
        fo(i , 1 , r)
        {
            bool ok = true;
            if(i + 2 <= r)
            {
                bool ok = true;
                fo(s ,0, 4)
                    dem[dx[s]] = 0;
                fo(j , 0 , 2)
                {
                    if(a[i + j].fi.fi != d1[j])
                        ok = false;
                    dem[a[i + j].fi.fi] += a[i + j].fi.se;
                    ppp[a[i + j].fi.fi] = i + j;
                }
                if(ok && dem['o'] != 0 && dem['n'] == 1 && dem['e'] != 0)
                {
                        int pn = ppp['n'];
                        fo(i , a[pn].se.fi , a[pn].se.se)
                            qq.pb(i);
                        a[pn].fi.se = 0;
                }
                ok = true;
                fo(s ,0, 4)
                    dem[dx[s]] = 0;
                fo(j , 0 , 2)
                {
                    if(a[i + j].fi.fi != d2[j])
                        ok = false;
                    dem[a[i + j].fi.fi] += a[i + j].fi.se;
                    ppp[a[i + j].fi.fi] = i + j;
                }
                if(ok && dem['t'] != 0 && dem['o'] != 0 && dem['w'] == 1)
                {
                    if(dem['o'] <= dem['w'])
                    {
                        int pn = ppp['o'];
                        fo(i , a[pn].se.fi , a[pn].se.se)
                                qq.pb(i);
                        a[pn].fi.se = 0;
                    }
                    else
                    {
                        int pn = ppp['w'];
                        fo(i , a[pn].se.fi , a[pn].se.se)
                                qq.pb(i);
                        a[pn].fi.se = 0;
                    }
                }
            }
        }
        cout << qq.size() << '\n';
        fo(pq ,0, qq.size()-1)
            cout << qq[pq] << " ";
        cout << '\n';
    }
}


#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;

#define mp make_pair
#define pb push_back
#define ll long long
#define li long int
#define ST string
#define ld long double
#define st string

#define fo(i,a,b) for(ll i=a; i<=b; i++)
#define re(i,a,b) for(ll i=a; i>=b; i--)
#define fop(i,a,b) for(ll i=a; i<b; i++)
#define rep(i,a,b) for(ll i=a-1; i>=b; i--)

#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second
#define sz(x) (int)(x).size()
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()

#define N 2000000
#define M 2000
#define MOD 1000000009

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef pair<int, int> II;
typedef pair<int, II> III;
typedef pair<ll, ll> LL;
typedef pair<ll, LL> LLL;
typedef pair<ld,ld> PD;
typedef pair<LL,LL> IG;
typedef vector<int> VI;
typedef vector<VI > VVI;
typedef vector<ll> VL;
typedef vector<VL > VVL;
typedef vector<ld> VD;
typedef complex<ld> cd;

const int INF = 2147483647;
const long double PI = 3.1415926535898;
const long long oo = 9223372036854775807;

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

template<class T> T getbit(T s, int i){return (s >> i) & 1;}
template<class T> T onbit(T s, int i){return s | (T(1) << i);}
template<class T> T offbit(T s, int i){return s & (~(T(1) << i));}
template<class T> T dembit(T s){return __builtin_popcountt(s);}

template<class T> T gcd(T a, T b){T r; while (b != 0){r = a % b; a = b; b = r;} return a;}
template<class T> T lcm(T a, T b){return a / gcd(a, b) * b;}

template <typename T> T Max(T a, T b){return a > b ? a : b;}
template <typename T> T Min(T a, T b){return a < b ? a : b;}
template <typename T> T abs(T a){return a > 0 ? a : -a;}

template <typename T> ll pow(T a, T b){ll res = 1; fo(i,1,b) res = res * a; return res;}

template<class T> void read(T &x)
{
    x = 0;
    char c;
    for(c = getchar(); c < '0' || c > '9'; c = getchar());
    x = c - '0';
    for(c = getchar(); c >= '0' && c <= '9'; c = getchar())
        x = x * 10 + c - '0';
}

template<class T> void readchar(T &x)
{
    for(x = getchar(); x != 'D' && x != 'C'; x = getchar());
}

template <typename T> inline void writep(T x){ if(x>9) writep(x/10); putchar(x%10+48);}
template <typename T> inline void write(T x){ if(x<0){ putchar('-'); x=-x; } writep(x);}
template <typename T> inline void writeln(T x){ write(x); putchar('\n'); }
template <typename T> inline void writec(T x){ write(x); putchar(' ');}

int n , T , res;
int dx[] = {'t' , 'w' , 'o' , 'n' , 'e'};
int dem[N] , ppp[N];
int d1[] = {'o' , 'n' , 'e'} , d2[] = {'t' , 'w' , 'o'};
char f[N];
IG a[N];
VI qq;
vector < II > g;

main()
{
    fast
    cin >> T;
    while(T--)
    {
        int r = 0;
        cin >> f;
        int n = strlen(f);
        re(i , n , 1)
            f[i] = f[i - 1];
        f[n + 1] = 0;
        int bd = 1;
        fo(i , 2 , n + 1)
            if(f[i] != f[i - 1])
                a[++r] = IG(II(f[i - 1] , i - bd) , II(bd , i - 1)) , bd = i;
        qq.clear();
        fo(i , 1 , r)
        {
            bool ok = true;
            if(i + 2 <= r)
            {
                bool ok = true;
                fo(s ,0, 4)
                    dem[dx[s]] = 0;
                fo(j , 0 , 2)
                {
                    if(a[i + j].fi.fi != d1[j])
                        ok = false;
                    dem[a[i + j].fi.fi] += a[i + j].fi.se;
                    ppp[a[i + j].fi.fi] = i + j;
                }
                if(ok && dem['o'] != 0 && dem['n'] == 1 && dem['e'] != 0)
                {
                        int pn = ppp['n'];
                        fo(i , a[pn].se.fi , a[pn].se.se)
                            qq.pb(i);
                        a[pn].fi.se = 0;
                }
                ok = true;
                fo(s ,0, 4)
                    dem[dx[s]] = 0;
                fo(j , 0 , 2)
                {
                    if(a[i + j].fi.fi != d2[j])
                        ok = false;
                    dem[a[i + j].fi.fi] += a[i + j].fi.se;
                    ppp[a[i + j].fi.fi] = i + j;
                }
                if(ok && dem['t'] != 0 && dem['o'] != 0 && dem['w'] == 1)
                {
                    if(dem['o'] <= dem['w'])
                    {
                        int pn = ppp['o'];
                        fo(i , a[pn].se.fi , a[pn].se.se)
                                qq.pb(i);
                        a[pn].fi.se = 0;
                    }
                    else
                    {
                        int pn = ppp['w'];
                        fo(i , a[pn].se.fi , a[pn].se.se)
                                qq.pb(i);
                        a[pn].fi.se = 0;
                    }
                }
            }
        }
        cout << qq.size() << '\n';
        fo(qp ,0, qq.size())
            cout << qq[pq] << " ";
        cout << '\n';
    }
}


#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;

#define mp make_pair
#define pb push_back
#define ll long long
#define li long int
#define ST string
#define ld long double
#define st string

#define fo(i,a,b) for(ll i=a; i<=b; i++)
#define re(i,a,b) for(ll i=a; i>=b; i--)
#define fop(i,a,b) for(ll i=a; i<b; i++)
#define rep(i,a,b) for(ll i=a-1; i>=b; i--)

#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second
#define sz(x) (int)(x).size()
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()

#define N 2000000
#define M 2000
#define MOD 1000000009

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef pair<int, int> II;
typedef pair<int, II> III;
typedef pair<ll, ll> LL;
typedef pair<ll, LL> LLL;
typedef pair<ld,ld> PD;
typedef pair<LL,LL> IG;
typedef vector<int> VI;
typedef vector<VI > VVI;
typedef vector<ll> VL;
typedef vector<VL > VVL;
typedef vector<ld> VD;
typedef complex<ld> cd;

const int INF = 2147483647;
const long double PI = 3.1415926535898;
const long long oo = 9223372036854775807;

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

template<class T> T getbit(T s, int i){return (s >> i) & 1;}
template<class T> T onbit(T s, int i){return s | (T(1) << i);}
template<class T> T offbit(T s, int i){return s & (~(T(1) << i));}
template<class T> T dembit(T s){return __builtin_popcountt(s);}

template<class T> T gcd(T a, T b){T r; while (b != 0){r = a % b; a = b; b = r;} return a;}
template<class T> T lcm(T a, T b){return a / gcd(a, b) * b;}

template <typename T> T Max(T a, T b){return a > b ? a : b;}
template <typename T> T Min(T a, T b){return a < b ? a : b;}
template <typename T> T abs(T a){return a > 0 ? a : -a;}

template <typename T> ll pow(T a, T b){ll res = 1; fo(i,1,b) res = res * a; return res;}

template<class T> void read(T &x)
{
    x = 0;
    char c;
    for(c = getchar(); c < '0' || c > '9'; c = getchar());
    x = c - '0';
    for(c = getchar(); c >= '0' && c <= '9'; c = getchar())
        x = x * 10 + c - '0';
}

template<class T> void readchar(T &x)
{
    for(x = getchar(); x != 'D' && x != 'C'; x = getchar());
}

template <typename T> inline void writep(T x){ if(x>9) writep(x/10); putchar(x%10+48);}
template <typename T> inline void write(T x){ if(x<0){ putchar('-'); x=-x; } writep(x);}
template <typename T> inline void writeln(T x){ write(x); putchar('\n'); }
template <typename T> inline void writec(T x){ write(x); putchar(' ');}

int n , T , res;
int dx[] = {'t' , 'w' , 'o' , 'n' , 'e'};
int dem[N] , ppp[N];
int d1[] = {'o' , 'n' , 'e'} , d2[] = {'t' , 'w' , 'o'};
char f[N];
IG a[N];
VI qq;
vector < II > g;

main()
{
    fast
    cin >> T;
    while(T--)
    {
        int r = 0;
        cin >> f;
        int n = strlen(f);
        re(i , n , 1)
            f[i] = f[i - 1];
        f[n + 1] = 0;
        int bd = 1;
        fo(i , 2 , n + 1)
            if(f[i] != f[i - 1])
                a[++r] = IG(II(f[i - 1] , i - bd) , II(bd , i - 1)) , bd = i;
        qq.clear();
        fo(i , 1 , r)
        {
            bool ok = true;
            if(i + 2 <= r)
            {
                bool ok = true;
                fo(s ,0, 4)
                    dem[dx[s]] = 0;
                fo(j , 0 , 2)
                {
                    if(a[i + j].fi.fi != d1[j])
                        ok = false;
                    dem[a[i + j].fi.fi] += a[i + j].fi.se;
                    ppp[a[i + j].fi.fi] = i + j;
                }
                if(ok && dem['o'] != 0 && dem['n'] == 1 && dem['e'] != 0)
                {
                        int pn = ppp['n'];
                        fo(i , a[pn].se.fi , a[pn].se.se)
                            qq.pb(i);
                        a[pn].fi.se = 0;
                }
                ok = true;
                fo(s ,0, 4)
                    dem[dx[s]] = 0;
                fo(j , 0 , 2)
                {
                    if(a[i + j].fi.fi != d2[j])
                        ok = false;
                    dem[a[i + j].fi.fi] += a[i + j].fi.se;
                    ppp[a[i + j].fi.fi] = i + j;
                }
                if(ok && dem['t'] != 0 && dem['o'] != 0 && dem['w'] == 1)
                {
                    if(dem['o'] <= dem['w'])
                    {
                        int pn = ppp['o'];
                        fo(i , a[pn].se.fi , a[pn].se.se)
                                qq.pb(i);
                        a[pn].fi.se = 0;
                    }
                    else
                    {
                        int pn = ppp['w'];
                        fo(i , a[pn].se.fi , a[pn].se.se)
                                qq.pb(i);
                        a[pn].fi.se = 0;
                    }
                }
            }
        }
        cout << qq.size() << '\n';
        fo(pp ,0, qq.size()-1)
            cout << qq[pq] << " ";
        cout << '\n';
    }
}


#include <bits/stdc++.h>
#include <algorithm>
#define lli long long int
#define pb(a) push_back(a)
#define forr(a,n) for(lli i=a;i<n;i++)
#define all(x) x.begin(),x.end()
using namespace std;
lli power(lli x){
lli u=0;
while(x%2==0){
    u++;
    x=x/2;
}
return u;
}

lli powM(lli x,lli y,lli m)
{
    lli ans=1,r=1;
    x%=m;
    while(r>0&&r<=y)
    {
        if(r&y)
        {
            ans*=x;
            ans%=m;
        }
        r<<=1;
        x*=x;
        x%=m;
    }
    return ans;
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
int t;
cin>>t;
lli m=1e9+7;
while(t--){
  /*string s;
  cin>>s;
  lli n=s.size();
  lli x=0;
  lli y=0;
  lli z=0;
set<lli> s1;
  forr(0,n-2){
  if(s.substr(i,3)=="one"){
    x++;
    //s1.insert(i+1);
  }
  if(s.substr(i,3)=="two" ){
    y++;
    //s1.insert(i+1);
  }
  }
   forr(1,n-2){
  if(s.substr(i,3)=="one" && s[i-1]=='o' ){

    s1.insert(i+1);
  }
  else if(s.substr(i,3)=="one" && s[i-1]!='o'){
    s1.insert(i);
  }
  }
  forr(0,n-3){
  if(s.substr(i,3)=="two" && s[i+3]=='o'){

    s1.insert(i+1);
  }
  else if(s.substr(i,3)=="two"&& s[i+3]!='o'){
    s1.insert(i+2);
  }
  }
  if(s.substr(0,3)=="one"){s1.insert(0);}

   if(s.substr(n-3,3)=="two"){s1.insert(n-1);}
  forr(0,n-4){
  if(s.substr(i,5)=="twone"){
    z++;
    s1.insert(i+2);
  }
  }
  cout<<x+y-z<<"\n";
  set<lli>::iterator it;
  it=s1.begin();
  forr(0,s1.size()){
  cout<<(*it)+1<<" ";
  it++;
  }
cout<<"\n";*/
string s;
cin >> s;
vector<int> r;
for (string k: {"twone", "one", "two"}) {
    for (size_k pos = 0; (pos = s.find(k, pos)) != string::npos;) {
        s[pos + k.length() / 2] = '?';
        r.push_back(pos + k.length() / 2);
    }
}
cout << r.size() << endl;
for (auto rr: r)
    cout << rr + 1 << " ";
cout << endl;
}
     return 0;
}


#include <bits/stdc++.h>
#include <algorithm>
#define lli long long int
#define pb(a) push_back(a)
#define forr(a,n) for(lli i=a;i<n;i++)
#define all(x) x.begin(),x.end()
using namespace std;
typedef long long ll;
int t;
string s;
int a[100005];
int times,num;

int main () {
	cin>>t;
	while(t--){
		cin>>s;
		times=0;	num=0;
		forr(0,s.size()){
			if(s[i]=='o' && s[i+1]=='n'&& s[i+2]=='e'){
				times++;
				a[num++]=i+2;
				i=i+2;
			}else if(s[i]=='t' && s[i+1]=='w' && s[i+2]=='o'){
				if(s[i+3]=='n' && s[i+4]=='e'){
					times++;
					a[num++]=i+3;
					i=i+4;
				}else{
					times++;
					a[num++]=i+2;
					i=i+2;
				}
			}
		}
		cout<<times<<endl;
		for(int i=0;i<num;i++){
			cout<<a[i];
			if(i!=num-1){
				cout<<" ";
			}
		}
		cout<<endl;
	}
	return 0;

}


#include <bits/stdc++.h>
#include <algorithm>
#define lli long long int
#define pb(a) push_back(a)
#define forr(a,n) for(lli i=a;i<n;i++)
#define all(x) x.begin(),x.end()
using namespace std;
lli power(lli x){
lli u=0;
while(x%2==0){
    u++;
    x=x/2;
}
return u;
}

lli powM(lli x,lli y,lli m)
{
    lli ans=1,r=1;
    x%=m;
    while(r>0&&r<=y)
    {
        if(r&y)
        {
            ans*=x;
            ans%=m;
        }
        r<<=1;
        x*=x;
        x%=m;
    }
    return ans;
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
int t;
cin>>t;
lli m=1e9+7;
while(t--){
  /*string s;
  cin>>s;
  lli n=s.size();
  lli x=0;
  lli y=0;
  lli z=0;
set<lli> s1;
  forr(0,n-2){
  if(s.substr(i,3)=="one"){
    x++;
    //s1.insert(i+1);
  }
  if(s.substr(i,3)=="two" ){
    y++;
    //s1.insert(i+1);
  }
  }
   forr(1,n-2){
  if(s.substr(i,3)=="one" && s[i-1]=='o' ){

    s1.insert(i+1);
  }
  else if(s.substr(i,3)=="one" && s[i-1]!='o'){
    s1.insert(i);
  }
  }
  forr(0,n-3){
  if(s.substr(i,3)=="two" && s[i+3]=='o'){

    s1.insert(i+1);
  }
  else if(s.substr(i,3)=="two"&& s[i+3]!='o'){
    s1.insert(i+2);
  }
  }
  if(s.substr(0,3)=="one"){s1.insert(0);}

   if(s.substr(n-3,3)=="two"){s1.insert(n-1);}
  forr(0,n-4){
  if(s.substr(i,5)=="twone"){
    z++;
    s1.insert(i+2);
  }
  }
  cout<<x+y-z<<"\n";
  set<lli>::iterator it;
  it=s1.begin();
  forr(0,s1.size()){
  cout<<(*it)+1<<" ";
  it++;
  }
cout<<"\n";*/
string s;
cin >> s;
vector<int> r;
for (string k: {"twone", "one", "two"}) {
    for (lli i = 0; (pos = s.find(k, pos)) != string::npos;) {
        s[pos + k.length() / 2] = '?';
        r.push_back(pos + k.length() / 2);
    }
}
cout << r.size() << endl;
for (auto rr: r)
    cout << rr + 1 << " ";
cout << endl;
}
     return 0;
}


#include <bits/stdc++.h>
#include <algorithm>
#define lli long long int
#define pb(a) push_back(a)
#define forr(a,n) for(lli i=a;i<n;i++)
#define all(x) x.begin(),x.end()
using namespace std;
lli power(lli x){
lli u=0;
while(x%2==0){
    u++;
    x=x/2;
}
return u;
}

lli powM(lli x,lli y,lli m)
{
    lli ans=1,r=1;
    x%=m;
    while(r>0&&r<=y)
    {
        if(r&y)
        {
            ans*=x;
            ans%=m;
        }
        r<<=1;
        x*=x;
        x%=m;
    }
    return ans;
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
int t;
cin>>t;
lli m=1e9+7;
while(t--){
  string s;
  cin>>s;
  lli n=s.size();
  lli x=0;
  lli y=0;
  lli z=0;
set<lli> s1;
  forr(0,n-2){
  if(s.substr(i,3)=="one"){
    x++;
    //s1.insert(i+1);
  }
  if(s.substr(i,3)=="two" ){
    y++;
    //s1.insert(i+1);
  }
  }
   forr(1,n-2){
  if(s.substr(i,3)=="one" && s[i-1]=='o' ){

    s1.insert(i+1);
  }
  else if(s.substr(i,3)=="one" && s[i-1]!='o'){
    s1.insert(i);
  }
  }
  forr(0,n-3){
  if(s.substr(i,3)=="two" && s[i+3]=='o'){

    s1.insert(i+1);
  }
  else if(s.substr(i,3)=="two"&& s[i+3]!='o'){
    s1.insert(i+2);
  }
  }
  if(s.substr(0,3)=="one"){s1.insert(0);}

   if(s.substr(n-3,3)=="two"){s1.insert(n-1);}
  forr(0,n-4){
  if(s.substr(i,5)=="twone"){
    z++;
    s1.insert(i+2);
  }
  }
  cout<<x+y-z<<"\n";
  set<lli>::iterator it;
  it=s1.begin();
  forr(0,s1.size()){
  cout<<(*it)+1<<" ";
  it++;
  }
cout<<"\n";
}
     return 0;
}


#include <bits/stdc++.h>
#include <algorithm>
#define lli long long int
#define pb(a) push_back(a)
#define forr(a,n) for(lli i=a;i<n;i++)
#define all(x) x.begin(),x.end()
using namespace std;
lli power(lli x){
lli u=0;
while(x%2==0){
    u++;
    x=x/2;
}
return u;
}

lli powM(lli x,lli y,lli m)
{
    lli ans=1,r=1;
    x%=m;
    while(r>0&&r<=y)
    {
        if(r&y)
        {
            ans*=x;
            ans%=m;
        }
        r<<=1;
        x*=x;
        x%=m;
    }
    return ans;
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
int t;
cin>>t;
lli m=1e9+7;
while(t--){
  string s;
  cin>>s;
  lli n=s.size();
  lli x=0;
  lli y=0;
  lli z=0;
set<lli> s1;
  forr(0,n-4){
  if(s.substr(i,5)=="twone"){
    z++;
    s1.insert(i+2);
    s[i+2]='?';
  }
  }
  forr(0,n-2){
  if(s.substr(i,3)=="one"){
    x++;
    s1.insert(i+1);
  }
  if(s.substr(i,3)=="two" ){
    y++;
    s1.insert(i+1);
  }
  }
  cout<<x+y+z<<"\n";
  set<lli>::iterator it;
  it=s1.begin();
  forr(0,s1.size()){
  cout<<(*it)+1<<" ";
  it++;
  }
cout<<"\n";

}
     return 0;
}


#include <bits/stdc++.h>
#include <algorithm>
#define lli long long int
#define pb(a) push_back(a)
#define forr(a,n) for(lli i=a;i<n;i++)
#define all(x) x.begin(),x.end()
using namespace std;
lli power(lli x){
lli u=0;
while(x%2==0){
    u++;
    x=x/2;
}
return u;
}

lli powM(lli x,lli y,lli m)
{
    lli ans=1,r=1;
    x%=m;
    while(r>0&&r<=y)
    {
        if(r&y)
        {
            ans*=x;
            ans%=m;
        }
        r<<=1;
        x*=x;
        x%=m;
    }
    return ans;
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
int t;
cin>>t;
lli m=1e9+7;
while(t--){
  string s;
  cin>>s;
  lli n=s.size();
  lli x=0;
  lli y=0;
  lli z=0;
set<lli> s1;
  forr(0,n-2){
  if(s.substr(i,3)=="one"){
    x++;
    s1.insert(i);
  }
  if(s.substr(i,3)=="two"){
    y++;
    s1.insert(i+2);
  }
  }
  forr(0,n-4){
  if(s.substr(i,5)=="twone"){
    z++;
    s1.insert(i+2);
  }
  }
  cout<<x+y-z<<"\n";
  set<lli>::iterator it;
  it=s1.begin();
  forr(0,s1.size()){
  cout<<(*it)+1<<" ";
  it++;
  }
cout<<"\n";
}
     return 0;
}


#include <iostream>
using namespace std;
#include <map>
#include <stack>

int main(){
    long long t, n, m;
    long long a;
    string s;
    cin >> t;
    for(int i = 0; i < t; i++){
        cin >> s;
        stack<int> st;
        st.push(-1);
        int res = 0;
        int bla = s.size() - 5;
        for(int k = 0; k < bla; k++){
            if(s.substr(k, 5) == "twone"){
                st.push(k+2);
                res++;
                k += 4;
            } else if(s.substr(k, 3) == "two"){
                st.push(k+1);
                res++;
                k += 2;
            } else if(s.substr(k, 3) == "one"){
                st.push(k+1);
                res++;
                k += 2;
            }
        }
        if(s.size() >= 3 && st.top() != s.size()-3 && (s.substr(s.size()-3, 3) == "two" || s.substr(s.size()-3, 3) == "one")){
            st.push(s.size()-3);
            res++;
        }
        cout << res << endl;
        for(int k = 0; k < res; k++){
            cout << st.top() + 1 << " ";
            st.pop();
        }
        cout << endl;
    }
}


#include <iostream>
using namespace std;
#include <map>
#include <stack>

int main(){
    long long t, n, m;
    long long a;
    string s;
    cin >> t;
    for(int i = 0; i < t; i++){
        cin >> s;
        stack<int> st;
        st.push(-1);
        int res = 0;
        int bla = s.size() - 4;
        for(int k = 0; k < bla; k++){
            if(s.substr(k, 5) == "twone"){
                st.push(k+2);
                res++;
                k += 4;
            } else if(s.substr(k, 3) == "two"){
                st.push(k+1);
                res++;
                k += 2;
            } else if(s.substr(k, 3) == "one"){
                st.push(k+1);
                res++;
                k += 2;
            }
        }
        if(s.size() >= 3 && st.top() != s.size()-3 && (s.substr(s.size()-3, 3) == "two" || s.substr(s.size()-3, 3) == "one")){
            st.push(s.size()-2);
            res++;
        }
        cout << res << endl;
        for(int k = 0; k < res; k++){
            cout << st.top() + 1 << " ";
            st.pop();
        }
        cout << endl;
    }
}


#include <iostream>
using namespace std;
#include <map>
#include <stack>

int main(){
    long long t, n, m;
    long long a;
    string s;
    cin >> t;
    for(int i = 0; i < t; i++){
        cin >> s;
        stack<int> st;
        st.push(-1);
        int res = 0;
        for(int k = 0; k < s.size()-4; k++){
            if(s.substr(k, 5) == "twone"){
                st.push(k+2);
                res++;
                k += 4;
            } else if(s.substr(k, 3) == "two"){
                st.push(k);
                res++;
                k += 2;
            } else if(s.substr(k, 3) == "one"){
                st.push(k);
                res++;
                k += 2;
            }
        }
        if(st.top() != s.size()-3 && (s.substr(s.size()-3, 3) == "two" || s.substr(s.size()-3, 3) == "one")){
            st.push(s.size()-3);
            res++;
        }
        cout << res << endl;
        for(int k = 0; k < res; k++){
            cout << st.top() << " ";
            st.pop();
        }
        cout << endl;
    }
}


#include <iostream>
using namespace std;
#include <map>
#include <stack>

int main(){
    long long t, n, m;
    long long a;
    string s;
    cin >> t;
    for(int i = 0; i < t; i++){
        cin >> s;
        stack<int> st;
        st.push(-1);
        int res = 0;
        int bla = s.size() - 5;
        for(int k = 0; k < bla; k++){
            if(s.substr(k, 5) == "twone"){
                st.push(k+2);
                res++;
                k += 4;
            } else if(s.substr(k, 3) == "two"){
                st.push(k);
                res++;
                k += 2;
            } else if(s.substr(k, 3) == "one"){
                st.push(k);
                res++;
                k += 2;
            }
        }
        if(s.size() >= 3 && st.top() != s.size()-3 && (s.substr(s.size()-3, 3) == "two" || s.substr(s.size()-3, 3) == "one")){
            st.push(s.size()-3);
            res++;
        }
        cout << res << endl;
        for(int k = 0; k < res; k++){
            cout << st.top() + 1 << " ";
            st.pop();
        }
        cout << endl;
    }
}


#include <iostream>
using namespace std;
#include <map>
#include <stack>

int main(){
    long long t, n, m;
    long long a;
    string s;
    cin >> t;
    for(int i = 0; i < t; i++){
        cin >> s;
        stack<int> st;
        st.push(-1);
        int res = 0;
        int bla = s.size() - 4;
        cout << bla << endl;
        for(int k = 0; k < bla; k++){
            if(s.substr(k, 5) == "twone"){
                st.push(k+2);
                res++;
                k += 4;
            } else if(s.substr(k, 3) == "two"){
                st.push(k+1);
                res++;
                k += 2;
            } else if(s.substr(k, 3) == "one"){
                st.push(k+1);
                res++;
                k += 2;
            }
        }
        if(s.size() >= 3 && st.top() != s.size()-3 && (s.substr(s.size()-3, 3) == "two" || s.substr(s.size()-3, 3) == "one")){
            st.push(s.size()-2);
            res++;
        }
        cout << res << endl;
        for(int k = 0; k < res; k++){
            cout << st.top() + 1 << " ";
            st.pop();
        }
        cout << endl;
    }
}


#include <iostream>
using namespace std;
#include <map>
#include <stack>

int main(){
    long long t, n, m;
    long long a;
    string s;
    cin >> t;
    for(int i = 0; i < t; i++){
        cin >> s;
        stack<int> st;
        st.push(-1);
        int res = 0;
        int bla = s.size() - 4;
        for(int k = 0; k < bla; k++){
            if(s.substr(k, 5) == "twone"){
                st.push(k+2);
                res++;
                k += 4;
            } else if(s.substr(k, 3) == "two"){
                st.push(k+1);
                res++;
                k += 2;
            } else if(s.substr(k, 3) == "one"){
                st.push(k+1);
                res++;
                k += 2;
            }
        }
        if(s.size() >= 3 && st.top() != s.size()-3 && (s.substr(s.size()-3, 3) == "two" || s.substr(s.size()-3, 3) == "one")){
            st.push(s.size()-2);
            res++;
        }
        if(s.size() >= 4 && st.top() != s.size()-3 && (s.substr(s.size()-4, 3) == "two" || s.substr(s.size()-4, 3) == "one")){
            st.push(s.size()-3);
            res++;
        }
        cout << res << endl;
        for(int k = 0; k < res; k++){
            cout << st.top() + 1 << " ";
            st.pop();
        }
        cout << endl;
    }
}


#include <iostream>
using namespace std;
#include <map>
#include <stack>

int main(){
    long long t, n, m;
    long long a;
    string s;
    cin >> t;
    for(int i = 0; i < t; i++){
        cin >> s;
        stack<int> st;
        st.push(-1);
        int res = 0;
        int bla = s.size() - 4;
        for(int k = 0; k < bla; k++){
            if(k <= bla -1 && s.substr(k, 5) == "twone"){
                st.push(k+2);
                res++;
                k += 4;
            } else if(s.substr(k, 3) == "two"){
                st.push(k+1);
                res++;
                k += 2;
            } else if(s.substr(k, 3) == "one"){
                st.push(k+1);
                res++;
                k += 2;
            }
        }
        if(s.size() >= 3 && st.top() != s.size()-3 && (s.substr(s.size()-3, 3) == "two" || s.substr(s.size()-3, 3) == "one")){
            st.push(s.size()-2);
            res++;
        }
        if(s.size() >= 4 && st.top() != s.size()-4 && st.top() != s.size()-4 && (s.substr(s.size()-4, 3) == "two" || s.substr(s.size()-4, 3) == "one")){
            st.push(s.size()-3);
            res++;
        }
        cout << res << endl;
        for(int k = 0; k < res; k++){
            cout << st.top() + 1 << " ";
            st.pop();
        }
        cout << endl;
    }
}


#include <iostream>
using namespace std;
#include <map>
#include <stack>

int main(){
    long long t, n, m;
    long long a;
    string s;
    cin >> t;
    for(int i = 0; i < t; i++){
        cin >> s;
        stack<int> st;
        st.push(-1);
        int res = 0;
        for(int k = 0; k < s.size()-4; k++){
            if(s.substr(k, 5) == "twone"){
                st.push(k+2);
                res++;
                k += 4;
            } else if(s.substr(k, 3) == "two"){
                st.push(k);
                res++;
                k += 2;
            } else if(s.substr(k, 3) == "one"){
                st.push(k);
                res++;
                k += 2;
            }
        }
        if(st.top() != s.size()-3 && (s.substr(s.size()-3, 3) == "two" || s.substr(s.size()-3, 3) == "one")){
            st.push(s.size()-3);
            res++;
        }
        cout << res << endl;
        for(int k = 0; k < res; k++){
            cout << st.top() + 1 << " ";
            st.pop();
        }
        cout << endl;
    }
}


#include <iostream>
using namespace std;
#include <map>
#include <stack>

int main(){
    long long t, n, m;
    long long a;
    string s;
    cin >> t;
    for(int i = 0; i < t; i++){
        cin >> s;
        stack<int> st;
        st.push(-1);
        int res = 0;
        int bla = s.size() - 4;
        for(int k = 0; k < bla; k++){
            if(k <= bla -1 && s.substr(k, 5) == "twone"){
                st.push(k+2);
                res++;
                k += 4;
            } else if(s.substr(k, 3) == "two"){
                st.push(k+1);
                res++;
                k += 2;
            } else if(s.substr(k, 3) == "one"){
                st.push(k+1);
                res++;
                k += 2;
            }
        }
        if(s.size() >= 3 && st.top() != s.size()-3 && (s.substr(s.size()-3, 3) == "two" || s.substr(s.size()-3, 3) == "one")){
            st.push(s.size()-2);
            res++;
        }
        if(s.size() >= 4 && st.top() != s.size()-3 && (s.substr(s.size()-4, 3) == "two" || s.substr(s.size()-4, 3) == "one")){
            st.push(s.size()-3);
            res++;
        }
        cout << res << endl;
        for(int k = 0; k < res; k++){
            cout << st.top() + 1 << " ";
            st.pop();
        }
        cout << endl;
    }
}


#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define f first
#define se second

using namespace std;
int main()
{
    ll t,n,i,j,k;
    cin>>t;
    while(t--)
    {
        string s;
        cin>>s;
        vector<ll> v;
        vector<pair<char,ll> > z;
        for(i=0;i<s.size();)
        {
            char c=s[i];
            ll cnt=0;
            while(s[i]==c)
            {
                i++;
                cnt++;
            }
            z.pb(mp(c,cnt));
        }
        ll cnt=0;
        for(i=0;i<z.size()-2;i++)
        {
            if(z[i].f=='o' && z[i+1].f=='n' && z[i+2].f=='e')
            {
                if(z[i+1].se==1)
                {
                    v.pb(i+1);
                    cnt++;
                }
                i=i+2;
            }
            else if(z[i].f=='t' && z[i+1].f=='w' && z[i+2].f=='o')
            {
                if(i+4<z.size())
                {
                    if(z[i+3].f=='n' && z[i+4].f=='e')
                    {
                        ll c,d,e,fi,g;
                        c=z[i].se;d=z[i+1].se;e=z[i+2].se;fi=z[i+3].se;g=z[i+4].se;
                        if(min(c,d)+min(fi,g)<e)
                        {
                            if(c<d)
                            v.pb(i);
                            else
                            v.pb(i+1);
                            if(fi<g)
                            v.pb(i+3);
                            else
                            v.pb(i+4);
                            cnt=cnt+min(c,d)+min(fi,g);
                        }
                        else
                        {
                            v.pb(i+2);
                            cnt=cnt+z[i+2].se;
                        }
                        i=i+4;
                    }
                    else
                    {
                        if(z[i+1].se==1)
                        {
                            v.pb(i+1);
                            cnt++;
                        }
                        i=i+2;
                    }
                }
                else
                {
                    if(z[i+1].se==1)
                    {
                        v.pb(i+1);
                        cnt++;
                    }
                    i=i+2;
                }
            }
        }
        cout<<cnt<<endl;
        ll sum=1;
        j=0;

        for(i=0;i<z.size();i++)
        {
            if(j==v.size())
                break;
            if(v[j]==i)
            {
                ll pq=z[i].se;
                while(pq--)
                {
                    cout<<sum<<" ";
                    sum++;
                }
                j++;
            }
            else
            sum=sum+z[i].se;
        }
        cout<<endl;
    }
}


#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define f first
#define se second

using namespace std;
int main()
{
    ll t,n,i,j,k;
    cin>>t;
    while(t--)
    {
        string s;
        cin>>s;
        vector<ll> v;
        vector<pair<char,ll> > z;
        for(i=0;i<s.size();)
        {
            char c=s[i];
            ll cnt=0;
            while(s[i]==c)
            {
                i++;
                cnt++;
            }
            z.pb(mp(c,cnt));
        }
        ll cnt=0;
        if(z.size()<3)
        goto flag;
        for(i=0;i<z.size()-2;i++)
        {
            if(z[i].f=='o' && z[i+1].f=='n' && z[i+2].f=='e')
            {
                if(z[i+1].se==1)
                {
                    v.pb(i+1);
                    cnt++;
                }
                i=i+2;
            }
            else if(z[i].f=='t' && z[i+1].f=='w' && z[i+2].f=='o')
            {
                if((i+4)<z.size())
                {
                    if(z[i+3].f=='n' && z[i+4].f=='e')
                    {

                        ll c,d,e,fi,g;
                        c=z[i].se;d=z[i+1].se;e=z[i+2].se;fi=z[i+3].se;g=z[i+4].se;
                        if(d==1 && fi==1)
                        {
                            if(e>2)
                            {
                                v.pb(i+1);
                                v.pb(i+3);
                                cnt=cnt+2;
                            }
                            else
                            {
                                v.pb(i+2);
                                cnt=cnt++;
                            }
                        }
                        else if(d==1)
                        {
                            v.pb(i+1);
                            cnt++;
                        }
                        else if(fi==1)
                        {
                            v.pb(i+3);
                            cnt++;
                        }
                        i=i+4;
                    }
                    else
                    {
                        if(z[i+1].se==1)
                        {
                            v.pb(i+1);
                            cnt++;
                        }
                        i=i+2;
                    }
                }
                else
                {
                    if(z[i+1].se==1)
                    {
                        v.pb(i+1);
                        cnt++;
                    }
                    i=i+2;
                }
            }
        }
        flag:
        cout<<cnt<<endl;
        ll sum=1;
        j=0;

        for(i=0;i<z.size();i++)
        {
            if(j==v.size())
                break;
            if(v[j]==i)
            {
                ll pq=z[i].se;
                while(pq--)
                {
                    cout<<sum<<" ";
                    sum++;
                }
                j++;
            }
            else
            sum=sum+z[i].se;
        }
        cout<<endl;
    }
}


#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define f first
#define se second

using namespace std;
int main()
{
    ll t,n,i,j,k;
    cin>>t;
    while(t--)
    {
        string s;
        cin>>s;
        vector<ll> v;
        vector<pair<char,ll> > z;
        for(i=0;i<s.size();)
        {
            char c=s[i];
            ll cnt=0;
            while(s[i]==c)
            {
                i++;
                cnt++;
            }
            z.pb(mp(c,cnt));
        }
        ll cnt=0;
        if(z.size()<3)
        goto flag;
        for(i=0;i<z.size()-2;i++)
        {
            if(z[i].f=='o' && z[i+1].f=='n' && z[i+2].f=='e')
            {
                if(z[i+1].se==1)
                {
                    v.pb(i+1);
                    cnt++;
                }
                i=i+2;
            }
            else if(z[i].f=='t' && z[i+1].f=='w' && z[i+2].f=='o')
            {
                if((i+4)<z.size())
                {
                    if(z[i+3].f=='n' && z[i+4].f=='e')
                    {

                        ll c,d,e,fi,g;
                        c=z[i].se;d=z[i+1].se;e=z[i+2].se;fi=z[i+3].se;g=z[i+4].se;
                        if(d==1 && fi==1)
                        {
                            if(e>2)
                            {
                                v.pb(i+1);
                                v.pb(i+3);
                                cnt=cnt+2;
                            }
                            else
                            {
                                v.pb(i+2);
                                cnt++;
                            }
                        }
                        else if(d==1)
                        {
                            v.pb(i+1);
                            cnt++;
                        }
                        else if(fi==1)
                        {
                            v.pb(i+3);
                            cnt++;
                        }
                        i=i+4;
                    }
                    else
                    {
                        if(z[i+1].se==1)
                        {
                            v.pb(i+1);
                            cnt++;
                        }
                        i=i+2;
                    }
                }
                else
                {
                    if(z[i+1].se==1)
                    {
                        v.pb(i+1);
                        cnt++;
                    }
                    i=i+2;
                }
            }
        }
        flag:
        cout<<cnt<<endl;
        ll sum=1;
        j=0;

        for(i=0;i<z.size();i++)
        {
            if(j==v.size())
                break;
            if(v[j]==i)
            {
                ll pq=z[i].se;
                while(pq--)
                {
                    cout<<sum<<" ";
                    sum++;
                }
                j++;
            }
            else
            sum=sum+z[i].se;
        }
        cout<<endl;
    }
}


#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define f first
#define se second

using namespace std;
int main()
{
    ll t,n,i,j,k;
    cin>>t;
    while(t--)
    {
        string s;
        cin>>s;
        vector<ll> v;
        vector<pair<char,ll> > z;
        for(i=0;i<s.size();)
        {
            char c=s[i];
            ll cnt=0;
            while(s[i]==c)
            {
                i++;
                cnt++;
            }
            z.pb(mp(c,cnt));
        }
        ll cnt=0;
        if(z.size()<3)
        goto flag;
        for(i=0;i<z.size()-2;i++)
        {
            if(z[i].f=='o' && z[i+1].f=='n' && z[i+2].f=='e')
            {
                if(z[i+1].se==1)
                {
                    v.pb(i+1);
                    cnt++;
                }
                i=i+2;
            }
            else if(z[i].f=='t' && z[i+1].f=='w' && z[i+2].f=='o')
            {
                if((i+4)<z.size())
                {
                    if(z[i+3].f=='n' && z[i+4].f=='e')
                    {
                        ll c,d,e,fi,g;
                        c=z[i].se;d=z[i+1].se;e=z[i+2].se;fi=z[i+3].se;g=z[i+4].se;
                        if(min(c,d)+min(fi,g)<e)
                        {
                            if(c<d)
                            v.pb(i);
                            else
                            v.pb(i+1);
                            if(fi<g)
                            v.pb(i+3);
                            else
                            v.pb(i+4);
                            cnt=cnt+min(c,d)+min(fi,g);
                        }
                        else
                        {
                            v.pb(i+2);
                            cnt=cnt+z[i+2].se;
                        }
                        i=i+4;
                    }
                    else
                    {
                        if(z[i+1].se==1)
                        {
                            v.pb(i+1);
                            cnt++;
                        }
                        i=i+2;
                    }
                }
                else
                {
                    if(z[i+1].se==1)
                    {
                        v.pb(i+1);
                        cnt++;
                    }
                    i=i+2;
                }
            }
        }
        flag:
        cout<<cnt<<endl;
        ll sum=1;
        j=0;

        for(i=0;i<z.size();i++)
        {
            if(j==v.size())
                break;
            if(v[j]==i)
            {
                ll pq=z[i].se;
                while(pq--)
                {
                    cout<<sum<<" ";
                    sum++;
                }
                j++;
            }
            else
            sum=sum+z[i].se;
        }
        cout<<endl;
    }
}


#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define f first
#define se second

using namespace std;
int main()
{
    ll t,n,i,j,k;
    cin>>t;
    while(t--)
    {
        string s;
        cin>>s;
        vector<ll> v;
        vector<pair<char,ll> > z;
        for(i=0;i<s.size();)
        {
            char c=s[i];
            ll cnt=0;
            while(s[i]==c)
            {
                i++;
                cnt++;
            }
            z.pb(mp(c,cnt));
        }
        ll cnt=0;
        if(z.size()<3)
        goto flag;
        for(i=0;i<z.size()-2;i++)
        {
            if(z[i].f=='o' && z[i+1].f=='n' && z[i+2].f=='e')
            {
                if(z[i+1].se==1)
                {
                    v.pb(i+1);
                    cnt++;
                }
                i=i+2;
            }
            else if(z[i].f=='t' && z[i+1].f=='w' && z[i+2].f=='o')
            {
                if((i+4)<z.size())
                {
                    if(z[i+3].f=='n' && z[i+4].f=='e')
                    {

                        ll c,d,e,fi,g;
                        c=z[i].se;d=z[i+1].se;e=z[i+2].se;fi=z[i+3].se;g=z[i+4].se;
                        if(d==1 && fi==1)
                        {
                            if(e>1)
                            {
                                v.pb(i+1);
                                v.pb(i+3);
                                cnt=cnt+2;
                            }
                            else
                            {
                                v.pb(i+2);
                                cnt++;
                            }
                        }
                        else if(d==1)
                        {
                            v.pb(i+1);
                            cnt++;
                        }
                        else if(fi==1)
                        {
                            v.pb(i+3);
                            cnt++;
                        }
                        i=i+4;
                    }
                    else
                    {
                        if(z[i+1].se==1)
                        {
                            v.pb(i+1);
                            cnt++;
                        }
                        i=i+2;
                    }
                }
                else
                {
                    if(z[i+1].se==1)
                    {
                        v.pb(i+1);
                        cnt++;
                    }
                    i=i+2;
                }
            }
        }
        flag:
        cout<<cnt<<endl;
        ll sum=1;
        j=0;

        for(i=0;i<z.size();i++)
        {
            if(j==v.size())
                break;
            if(v[j]==i)
            {
                ll pq=z[i].se;
                while(pq--)
                {
                    cout<<sum<<" ";
                    sum++;
                }
                j++;
            }
            else
            sum=sum+z[i].se;
        }
        cout<<endl;
    }
}


#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define f first
#define se second

using namespace std;
int main()
{
    ll t,n,i,j,k;
    cin>>t;
    while(t--)
    {
        string s;
        cin>>s;
        vector<ll> v;
        vector<pair<char,ll> > z;
        for(i=0;i<s.size();)
        {
            char c=s[i];
            ll cnt=0;
            while(s[i]==c)
            {
                i++;
                cnt++;
            }
            z.pb(mp(c,cnt));
        }
        ll cnt=0;
        if(z.size()<3)
        goto flag;
        for(i=0;i<z.size()-2;i++)
        {
            if(z[i].f=='o' && z[i+1].f=='n' && z[i+2].f=='e')
            {
                if(z[i+1].se==1)
                {
                    v.pb(i+1);
                    cnt++;
                }
                i=i+2;
            }
            else if(z[i].f=='t' && z[i+1].f=='w' && z[i+2].f=='o')
            {
                if((i+4)<z.size())
                {
                    if(z[i+3].f=='n' && z[i+4].f=='e')
                    {

                        ll c,d,e,fi,g;
                        c=z[i].se;d=z[i+1].se;e=z[i+2].se;fi=z[i+3].se;g=z[i+4].se;
                        if(d==1 && fi==1){
                        if(min(c,d)+min(fi,g)<e)
                        {
                            if(c<d)
                            v.pb(i);
                            else
                            v.pb(i+1);
                            if(fi<g)
                            v.pb(i+3);
                            else
                            v.pb(i+4);
                            cnt=cnt+min(c,d)+min(fi,g);
                        }
                        else
                        {
                            v.pb(i+2);
                            cnt=cnt+z[i+2].se;
                        }
                        }
                        else if(d==1)
                        {
                            v.pb(i+1);
                        }
                        else if(fi==1)
                        {
                            v.pb(i+3);
                        }
                        i=i+4;
                    }
                    else
                    {
                        if(z[i+1].se==1)
                        {
                            v.pb(i+1);
                            cnt++;
                        }
                        i=i+2;
                    }
                }
                else
                {
                    if(z[i+1].se==1)
                    {
                        v.pb(i+1);
                        cnt++;
                    }
                    i=i+2;
                }
            }
        }
        flag:
        cout<<cnt<<endl;
        ll sum=1;
        j=0;

        for(i=0;i<z.size();i++)
        {
            if(j==v.size())
                break;
            if(v[j]==i)
            {
                ll pq=z[i].se;
                while(pq--)
                {
                    cout<<sum<<" ";
                    sum++;
                }
                j++;
            }
            else
            sum=sum+z[i].se;
        }
        cout<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;

#define int long long
#define ll long long
#define f(i,l,n) for(int i=l;i<n;i++)
#define E "\n"
#define Outerloop int q;cin>>q;while(q--)
#define Mod 1000000007
#define N 2000007
int32_t main()
{

      Outerloop{

           string s;
           cin >> s;

           set<int> ans;

           f(i,0,s.length()-2)
           {
                 string ss=s.substr(i,3);
                 if(ss=="two")
                 {
                       if(i<s.length()-4 &&  s[i+3]=='n' && s[i+4]=='e') ans.insert(i+3),i=i+4;
                       else
                       ans.insert(i+2),i+=2;
                 }
                 if(ss=="one") ans.insert(i+2).i+=2;
           }

           cout<<ans.size()<<E;

           for(auto x:ans) cout<<x<<" ";

           cout<<E;

      }
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define int long long
#define ll long long
#define f(i,l,n) for(int i=l;i<n;i++)
#define E "\n"
#define Outerloop int q;cin>>q;while(q--)
#define Mod 1000000007
#define N 2000007
int32_t main()
{

      Outerloop{

           string s;
           cin >> s;

           set<int> ans;

           f(i,0,s.length()-2)
           {
                 string ss=s.substr(i,3);
                 if(ss=="two")
                 {
                       if(i<s.length()-4 &&  s[i+3]=='n' && s[i+4]=='e') ans.insert(i+3),i=i+4;
                       else
                       ans.insert(i+2),i+=2;
                 }
                 if(ss=="one") ans.insert(i+2),i+=2;
           }

           cout<<ans.size()<<E;

           for(auto x:ans) cout<<x<<" ";

           cout<<E;

      }
	return 0;
}


    #include<bits/stdc++.h>
    using namespace std;
    #define ll long long
    #define FOR(i,l,n) for(ll i=l;i<n;i++)
    #define pb push_back

    int main(){
        int q;
        cin>>q;
        while(q--){
            string s;
            cin>>s;
            vector<int> v;
            int p=s.length();
            for(int i=0;i<p-2;i++){
                if(s[i]=='o' && s[i+1]=='n' && s[i+2]=='e'){
                    v.pb(i+1);
                    i+=2;
                }
                else if(i+4<p && s[i]=='t' && s[i+1]=='w' && s[i+2]=='o' && s[i+3]=='n' && s[i+4]=='e'){
                    v.pb(i+2);
                    i+=4;
                }

                else if(s[i]=='t' && s[i+1]=='w' && s[i+2]=='o'){
                    v.pb(i+1);
                    i+=2;
                   // cout<<i+1<<" ";
                }
            }
           // cout<<endl;
            cout<<v.size()<<endl;
            for(int i=0;i<v.size();i++)cout<<v[i]+1<<" ";
            cout<<endl;
        }
    }


#include<bits/stdc++.h>
using namespace std;

#define int long long
#define ll long long
#define f(i,l,n) for(int i=l;i<n;i++)
#define E "\n"
#define Outerloop int q;cin>>q;while(q--)
#define Mod 1000000007
#define N 2000007
int32_t main()
{

      Outerloop{

           string s;
           cin >> s;

           set<int> ans;

           f(i,0,s.length()-2)
           {
                 string ss=s.substr(i,3);
                 if(ss=="two") ans.insert(i+3);
                 if(ss=="one") ans.insert(i+1);
           }

           cout<<ans.size()<<E;

           for(auto x:ans) cout<<x<<" ";

           cout<<E;

      }
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define int long long
#define ll long long
#define f(i,l,n) for(int i=l;i<n;i++)
#define E "\n"
#define Outerloop int q;cin>>q;while(q--)
#define Mod 1000000007
#define N 2000007
int32_t main()
{

      Outerloop{

           string s;
           cin >> s;

           set<int> ans;

           f(i,0,s.length()-2)
           {
                 string ss=s.substr(i,3);
                 if(ss=="two")
                 {
                       if(i<s.length()-4 && s[i+2]=='o' && s[i+3]=='n' && s[i+4]=='e') ans.insert(i+3),i=i+5;
                       else
                       ans.insert(i+2);
                 }
                 if(ss=="one") ans.insert(i+2);
           }

           cout<<ans.size()<<E;

           for(auto x:ans) cout<<x<<" ";

           cout<<E;

      }
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define int long long
#define ll long long
#define f(i,l,n) for(int i=l;i<n;i++)
#define E "\n"
#define Outerloop int q;cin>>q;while(q--)
#define Mod 1000000007
#define N 2000007
int32_t main()
{

      Outerloop{

           string s;
           cin >> s;

           set<int> ans;

           f(i,0,s.length()-2)
           {
                 string ss=s.substr(i,3);
                 if(ss=="two")
                 {
                       if(i<s.length()-4 && s[i+2]=='o' && s[i+3]=='n' && s[i+4]=='e') ans.insert(i+3);
                       else
                       ans.insert(i+2);
                 }
                 if(ss=="one") ans.insert(i+2);
           }

           cout<<ans.size()<<E;

           for(auto x:ans) cout<<x<<" ";

           cout<<E;

      }
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define int long long
#define ll long long
#define f(i,l,n) for(int i=l;i<n;i++)
#define E "\n"
#define Outerloop int q;cin>>q;while(q--)
#define Mod 1000000007
#define N 2000007
int32_t main()
{

      Outerloop{

           string s;
           cin >> s;

           set<int> ans;

           f(i,0,s.length()-2)
           {
                 string ss=s.substr(i,3);
                 if(ss=="two")
                 {
                       if(i<s.length()-4 && s[i+2]=='o' && s[i+3]=='n' && s[i+4]=='e') ans.insert(i+3),i=i+4;
                       else
                       ans.insert(i+2);
                 }
                 if(ss=="one") ans.insert(i+2);
           }

           cout<<ans.size()<<E;

           for(auto x:ans) cout<<x<<" ";

           cout<<E;

      }
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define int long long
#define ll long long
#define f(i,l,n) for(int i=l;i<n;i++)
#define E "\n"
#define Outerloop int q;cin>>q;while(q--)
#define Mod 1000000007
#define N 2000007
int32_t main()
{

      Outerloop{

           string s;
           cin >> s;

           set<int> ans;

           f(i,0,s.length()-2)
           {
                 string ss=s.substr(i,3);
                 if(ss=="two")
                 {
                       if(s[i+3]=='o') ans.insert(i+1);
                       else
                       ans.insert(i+3);
                 }
                 if(ss=="one") ans.insert(i+1);
           }

           cout<<ans.size()<<E;

           for(auto x:ans) cout<<x<<" ";

           cout<<E;

      }
	return 0;
}


/*
	Failure is not the reason for you to stop trying
	   it is actually a reminder that you should
					KEEP GOING
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define SaveTime ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define eb emplace_back
#define fn for(int i =0 ;i <n;i++)
#define fn1 for( int i =1;i<=n;i++)
#define fm for(int j =0 ;j <m;j++)
#define fm1 for(int j =1;j<=m;j++)
#define fi first
#define se second
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
const int N = 1e6+5;
const int INF = 1e18L;
int ar[N];
int dp[N];
signed main(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	SaveTime;
	int T=1;
	cin >> T;
	while(T--){
		string s;
		cin >>s;
		int n ;
		s+="333333";
		n = s.size();

		vector<int>ans;
		fn{
			  char x= s[i];
		      bool f1= false;
		      bool f2=false;
		      bool f3= false;
		      if(x=='o')
		     {
		       if(s[i+1]=='n' && s[i+2]=='e')
		        f1= true;
		     }
		      if(x=='t')
		     {
		       if(s[i+1]=='w' && s[i+2]=='o' && s[i+3]=='n' && s[i+4]=='e')
		        f3= true;
		     }
		       if(x=='t')
		     {
		       if(s[i+1]=='w' && s[i+2]=='o' && !f3)
		        f2= true;
		     }
		     if(f3==true)
		     {
		       ans.pb(i+3);
		       i+=4;
		     }
		     else if(f1==true)
		     {
		     	ans.pb(i+2);
		       i+=2;
		     }
		      else if(f2==true)
		     {
		     	ans.pb(i+2);
		       i+=2;
		     }

		}
		cout<<ans.size()<<endl;
		for(auto i : ans)cout <<i<< " ";
			cout<<endl;

	}

	cerr << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
	return 0;
}


/*
	Failure is not the reason for you to stop trying
	   it is actually a reminder that you should
					KEEP GOING
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define SaveTime ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define eb emplace_back
#define fn for(int i =0 ;i <n;i++)
#define fn1 for( int i =1;i<=n;i++)
#define fm for(int j =0 ;j <m;j++)
#define fm1 for(int j =1;j<=m;j++)
#define fi first
#define se second
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
const int N = 1e6+5;
const int INF = 1e18L;
int ar[N];
int dp[N];
signed main(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	SaveTime;
	int T=1;
	cin >> T;
	while(T--){
		string s;
		cin >>s;
		int n = s.size();
		if(n <=2){
			cout << 0 << endl;
			cout<<endl;
		}
		vector<int>ans;
		for(int i=1;i<n-1;i++){
			if(i+3<n && s[i]=='w' && s[i-1]=='t' && s[i+1]=='o' && s[i+2]=='n' && s[i+3]=='e'){
				s[i+1]='x';
				ans.pb(i+2);
			}
			if( (s[i]=='n' && s[i-1]=='o' && s[i+1]=='e') || (s[i]=='w' && s[i-1]=='t' && s[i+1]=='o')){
				s[i]='x';
				ans.pb(i+1);
			}
		}
		cout<<ans.size()<<endl;
		// cout<<s<<endl;
		for(auto i : ans)cout <<i<< " ";
			cout<<endl;

	}

	cerr << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
	return 0;
}


/*
	Failure is not the reason for you to stop trying
	   it is actually a reminder that you should
					KEEP GOING
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define SaveTime ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define eb emplace_back
#define fn for(int i =0 ;i <n;i++)
#define fn1 for( int i =1;i<=n;i++)
#define fm for(int j =0 ;j <m;j++)
#define fm1 for(int j =1;j<=m;j++)
#define fi first
#define se second
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
const int N = 1e6+5;
const int INF = 1e18L;
int ar[N];
int dp[N];
signed main(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	SaveTime;
	int T=1;
	cin >> T;
	while(T--){
		string s;
		cin >>s;
		int n ;
		s+="33333333";
		n = s.size();

		vector<int>ans;
		fn{
			  char x= s[i];
		      bool f1= false;
		      bool f2=false;
		      bool f3= false;
		      if(x=='o')
		     {
		       if(s[i+1]=='n' && s[i+2]=='e')
		        f1= true;
		     }
		      if(x=='t')
		     {
		       if(s[i+1]=='w' && s[i+2]=='o' && s[i+3]=='n' && s[i+4]=='e')
		        f3= true;
		     }
		       if(x=='t')
		     {
		       if(s[i+1]=='w' && s[i+2]=='o' && !f3)
		        f2= true;
		     }
		     if(f3==true)
		     {
		       ans.pb(i+3);
		       i+=4;
		     }
		     else if(f1==true)
		     {
		     	ans.pb(i+2);
		       i+=2;
		     }
		      else if(f2==true)
		     {
		     	ans.pb(i+2);
		       i+=2;
		     }

		}
		cout<<ans.size()<<endl;
		for(auto i : ans)cout <<i<< " ";
			cout<<endl;

	}

	cerr << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
	return 0;
}


/*
	Failure is not the reason for you to stop trying
	   it is actually a reminder that you should
					KEEP GOING
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define SaveTime ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define eb emplace_back
#define fn for(int i =0 ;i <n;i++)
#define fn1 for( int i =1;i<=n;i++)
#define fm for(int j =0 ;j <m;j++)
#define fm1 for(int j =1;j<=m;j++)
#define fi first
#define se second
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
const int N = 1e6+5;
const int INF = 1e18L;
int ar[N];
int dp[N];
signed main(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	SaveTime;
	int T=1;
	cin >> T;
	while(T--){
		string s;
		cin >>s;
		int n ;
		s+="33333333";
		n = s.size();

		vector<int>ans;
		fn{
			  char x= s[i];
		      bool f1= false;
		      bool f2=false;
		      bool f3= false;
		      if(x=='o')
		     {
		       if(s[i+1]=='n' && s[i+2]=='e')
		        f1= true;
		     }
		      if(x=='t')
		     {
		       if(s[i+1]=='w' && s[i+2]=='o' && s[i+3]=='n' && s[i+4]=='e')
		        f3= true;
		     }
		       if(x=='t')
		     {
		       if(s[i+1]=='w' && s[i+2]=='o' && s[i+3]!='n')
		        f2= true;
		     }
		     if(f3==true)
		     {
		       ans.pb(i+2);
		       i+=4;
		     }
		     else if(f1==true)
		     {
		     	ans.pb(i+1);
		       i+=2;
		     }
		      else if(f2==true)
		     {
		     	ans.pb(i+1);
		       i+=2;
		     }

		}
		cout<<ans.size()<<endl;
		for(auto i : ans)cout <<i<< " ";
			cout<<endl;

	}

	cerr << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
	return 0;
}


/*
	Failure is not the reason for you to stop trying
	   it is actually a reminder that you should
					KEEP GOING
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define SaveTime ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define eb emplace_back
#define fn for(int i =0 ;i <n;i++)
#define fn1 for( int i =1;i<=n;i++)
#define fm for(int j =0 ;j <m;j++)
#define fm1 for(int j =1;j<=m;j++)
#define fi first
#define se second
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
const int N = 1e6+5;
const int INF = 1e18L;
int ar[N];
int dp[N];
signed main(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	SaveTime;
	int T=1;
	cin >> T;
	while(T--){
		string s;
		cin >>s;
		int n = s.size();
		if(n <=2){
			cout << 0 << endl;
			cout<<endl;
		}
		s+="333333333";
		n = s.size();

		vector<int>ans;
		fn{
			  char x= s[i];
		      bool f1= false;
		      bool f2=false;
		      bool f3= false;
		      if(x=='o')
		     {
		       if(s[i+1]=='n' && s[i+2]=='e')
		        f1= true;
		     }
		      if(x=='t')
		     {
		       if(s[i+1]=='w' && s[i+2]=='o' && s[i+3]=='n' && s[i+4]=='e')
		        f3= true;
		     }
		       if(x=='t')
		     {
		       if(s[i+1]=='w' && s[i+2]=='o' && s[i+3]!='n')
		        f2= true;
		     }
		     if(f1==true)
		     {
		     	ans.pb(i+2);
		       i+=2;
		     }
		      if(f2==true)
		     {
		     	ans.pb(i+2);
		       i+=2;
		     }
		      if(f3==true)
		     {
		       ans.pb(i+3);
		       i+=4;
		     }
		}
		cout<<ans.size()<<endl;
		// cout<<s<<endl;
		for(auto i : ans)cout <<i<< " ";
			cout<<endl;

	}

	cerr << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
	return 0;
}


/*
	Failure is not the reason for you to stop trying
	   it is actually a reminder that you should
					KEEP GOING
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define SaveTime ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define eb emplace_back
#define fn for(int i =0 ;i <n;i++)
#define fn1 for( int i =1;i<=n;i++)
#define fm for(int j =0 ;j <m;j++)
#define fm1 for(int j =1;j<=m;j++)
#define fi first
#define se second
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
const int N = 1e6+5;
const int INF = 1e18L;
int ar[N];
int dp[N];
signed main(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	SaveTime;
	int T=1;
	cin >> T;
	while(T--){
		string s;
		cin >>s;
		int n ;
		s+="33333333";
		n = s.size();

		vector<int>ans;
		fn{
			  char x= s[i];
		      bool f1= false;
		      bool f2=false;
		      bool f3= false;
		      if(x=='o')
		     {
		       if(s[i+1]=='n' && s[i+2]=='e')
		        f1= true;
		     }
		      if(x=='t')
		     {
		       if(s[i+1]=='w' && s[i+2]=='o' && s[i+3]=='n' && s[i+4]=='e')
		        f3= true;
		     }
		       if(x=='t')
		     {
		       if(s[i+1]=='w' && s[i+2]=='o' && s[i+3]!='n')
		        f2= true;
		     }
		     if(f1==true)
		     {
		     	ans.pb(i+2);
		       i+=2;
		     }
		      else if(f2==true)
		     {
		     	ans.pb(i+2);
		       i+=2;
		     }
		     else if(f3==true)
		     {
		       ans.pb(i+3);
		       i+=4;
		     }
		}
		cout<<ans.size()<<endl;
		for(auto i : ans)cout <<i<< " ";
			cout<<endl;

	}

	cerr << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
	return 0;
}


/*
	Failure is not the reason for you to stop trying
	   it is actually a reminder that you should
					KEEP GOING
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define SaveTime ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define eb emplace_back
#define fn for(int i =0 ;i <n;i++)
#define fn1 for( int i =1;i<=n;i++)
#define fm for(int j =0 ;j <m;j++)
#define fm1 for(int j =1;j<=m;j++)
#define fi first
#define se second
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
const int N = 1e6+5;
const int INF = 1e18L;
int ar[N];
int dp[N];
signed main(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	SaveTime;
	int T=1;
	cin >> T;
	while(T--){
		string s;
		cin >>s;
		int n ;
		s+="333333333";
		n = s.size();

		vector<int>ans;
		fn{
			  char x= s[i];
		      bool f1= false;
		      bool f2=false;
		      bool f3= false;
		      if(x=='o')
		     {
		       if(s[i+1]=='n' && s[i+2]=='e')
		        f1= true;
		     }
		      if(x=='t')
		     {
		       if(s[i+1]=='w' && s[i+2]=='o' && s[i+3]=='n' && s[i+4]=='e')
		        f3= true;
		     }
		       if(x=='t')
		     {
		       if(s[i+1]=='w' && s[i+2]=='o' && s[i+3]!='n')
		        f2= true;
		     }
		     if(f1==true)
		     {
		     	ans.pb(i+2);
		       i+=2;
		     }
		      if(f2==true)
		     {
		     	ans.pb(i+2);
		       i+=2;
		     }
		      if(f3==true)
		     {
		       ans.pb(i+3);
		       i+=4;
		     }
		}
		cout<<ans.size()<<endl;
		// cout<<s<<endl;
		for(auto i : ans)cout <<i<< " ";
			cout<<endl;

	}

	cerr << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define endl "\n"
#define dbg(x) cout << #x << " = " << (x) << endl;
const int MOD = 1000000007;
const int INF = 0x7fffffffffffffff;
int t;
int n, m;
const int M = 300000;
vector<int> g[M];
int v[M];
int vnum = 0;

void dfs(int x, int y) {
    v[x] = 1;
    vnum++;
    for(auto i: g[x]) if (!v[i] and i != y) {
        dfs(i, y);
    }
}

signed main(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cin >> t;
    while(t--) {
        memset(v, 0, sizeof v);
        int a, b;
        cin >> n >> m >> a >> b;
        a--; b--;
        for(int i = 0; i < m; ++i) {
            int x, y;
            cin >> x >> y; x--; y--;
            g[x].push_back(y); g[y].push_back(x);
        }
        vnum = 0;
        dfs(a, b);
        int xx = n - vnum - 1;
        vnum = 0;
        memset(v, 0, sizeof v);
        dfs(b, a);
        int yy = n- vnum- 1;
        cout << max(0ll, (xx * yy)) << endl;
        for(int i = 0; i < n; ++i) g[i].clear();
    }
}


/*
	Failure is not the reason for you to stop trying
	   it is actually a reminder that you should
					KEEP GOING
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define SaveTime ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define eb emplace_back
#define fn for(int i =0 ;i <n;i++)
#define fn1 for( int i =1;i<=n;i++)
#define fm for(int j =0 ;j <m;j++)
#define fm1 for(int j =1;j<=m;j++)
#define fi first
#define se second
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
const int N = 1e6+5;
const int INF = 1e18L;
int ar[N];
int dp[N];
signed main(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	SaveTime;
	int T=1;
	cin >> T;
	while(T--){
		string s;
		cin >>s;
		int n = s.size();
		if(n <=2){
			cout << 0 << endl;
			cout<<endl;
		}
		vector<int>ans;
		for(int i=1;i<n-1;i++){
			if(i+3<n && s[i]=='w' && s[i-1]=='t' && s[i+1]=='o' && s[i+2]=='n' && s[i+3]=='e'){
				s[i+1]=s[i];
				ans.pb(i+2);
			}
			if( (s[i]=='n' && s[i-1]=='o' && s[i+1]=='e') || (s[i]=='w' && s[i-1]=='t' && s[i+1]=='o')){
				s[i]=s[i-1];
				ans.pb(i+1);
			}
		}
		cout<<ans.size()<<endl;
		// cout<<s<<endl;
		for(auto i : ans)cout <<i<< " ";
			cout<<endl;

	}

	cerr << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
	return 0;
}


/*
	Failure is not the reason for you to stop trying
	   it is actually a reminder that you should
					KEEP GOING
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define SaveTime ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define eb emplace_back
#define fn for(int i =0 ;i <n;i++)
#define fn1 for( int i =1;i<=n;i++)
#define fm for(int j =0 ;j <m;j++)
#define fm1 for(int j =1;j<=m;j++)
#define fi first
#define se second
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
const int N = 1e6+5;
const int INF = 1e18L;
int ar[N];
int dp[N];
signed main(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	SaveTime;
	int T=1;
	cin >> T;
	while(T--){
		string s;
		cin >>s;
		int n = s.size();
		if(n <=2){
			cout << 0 << endl;
			cout<<endl;
		}
		vector<int>ans;
		for(int i=1;i<n-1;i++){
			if(i+3<n && s[i]=='w' && s[i-1]=='t' && s[i+1]=='o' && s[i+2]=='n' && s[i+3]=='e'){
				s[i+1]=s[i];
				ans.pb(i+2);
				continue;
			}
			if( (s[i]=='n' && s[i-1]=='o' && s[i+1]=='e') || (s[i]=='w' && s[i-1]=='t' && s[i+1]=='o')){
				s[i]=s[i-1];
				ans.pb(i+1);
			}
		}
		cout<<ans.size()<<endl;
		// cout<<s<<endl;
		for(auto i : ans)cout <<i<< " ";
			cout<<endl;

	}

	cerr << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
	return 0;
}


/*
	Failure is not the reason for you to stop trying
	   it is actually a reminder that you should
					KEEP GOING
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define SaveTime ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define eb emplace_back
#define fn for(int i =0 ;i <n;i++)
#define fn1 for( int i =1;i<=n;i++)
#define fm for(int j =0 ;j <m;j++)
#define fm1 for(int j =1;j<=m;j++)
#define fi first
#define se second
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
const int N = 1e6+5;
const int INF = 1e18L;
int ar[N];
int dp[N];
signed main(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	SaveTime;
	int T=1;
	cin >> T;
	while(T--){
		string s;
		cin >>s;
		int n ;
		s+="33333333";
		n = s.size();

		vector<int>ans;
		fn{
			  char x= s[i];
		      bool f1= false;
		      bool f2=false;
		      bool f3= false;
		      if(x=='o')
		     {
		       if(s[i+1]=='n' && s[i+2]=='e')
		        f1= true;
		     }
		      if(x=='t')
		     {
		       if(s[i+1]=='w' && s[i+2]=='o' && s[i+3]=='n' && s[i+4]=='e')
		        f3= true;
		     }
		       if(x=='t')
		     {
		       if(s[i+1]=='w' && s[i+2]=='o' && s[i+3]!='n')
		        f2= true;
		     }
		     if(f3==true)
		     {
		       ans.pb(i+3);
		       i+=4;
		     }
		     else if(f1==true)
		     {
		     	ans.pb(i+2);
		       i+=2;
		     }
		      else if(f2==true)
		     {
		     	ans.pb(i+2);
		       i+=2;
		     }

		}
		cout<<ans.size()<<endl;
		for(auto i : ans)cout <<i<< " ";
			cout<<endl;

	}

	cerr << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
	return 0;
}


/*
	Failure is not the reason for you to stop trying
	   it is actually a reminder that you should
					KEEP GOING
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define SaveTime ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define eb emplace_back
#define fn for(int i =0 ;i <n;i++)
#define fn1 for( int i =1;i<=n;i++)
#define fm for(int j =0 ;j <m;j++)
#define fm1 for(int j =1;j<=m;j++)
#define fi first
#define se second
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
const int N = 1e6+5;
const int INF = 1e18L;
int ar[N];
int dp[N];
signed main(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	SaveTime;
	int T=1;
	cin >> T;
	while(T--){
		string s;
		cin >>s;
		int n ;
		s+="333333";
		n = s.size();
		/*
		behenchod aaj tho isss qst ne dimaag karab kardiya
		*/
		vector<int>ans;
		fn{
			  char x= s[i];
		      bool f1= false;
		      bool f2=false;
		      bool f3= false;
		      if(x=='o')
		     {
		       if(s[i+1]=='n' && s[i+2]=='e')
		        f1= true;
		     }
		      if(x=='t')
		     {
		       if(s[i+1]=='w' && s[i+2]=='o' && s[i+3]=='n' && s[i+4]=='e')
		        f3= true;
		     }
		       if(x=='t')
		     {
		       if(s[i+1]=='w' && s[i+2]=='o' && !f3)
		        f2= true;
		     }
		     if(f3==true)
		     {
		       ans.pb(i+3);
		       i+=4;
		     }
		     else if(f1==true)
		     {
		     	ans.pb(i+2);
		       i+=2;
		     }
		      else if(f2==true)
		     {
		     	ans.pb(i+2);
		       i+=2;
		     }

		}
		cout<<ans.size()<<endl;
		for(auto i : ans)cout <<i<< " ";
			cout<<endl;

	}

	cerr << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
	return 0;
}


        #include <bits/stdc++.h>
        using namespace std;
        #define int long long
        #define fi first
        #define se second
        #define pi pair<int,int>
        #define pb push_back

        // dont forget to initialize global variables inside main() ;

        int32_t main() {

            ios::sync_with_stdio(false);
            cin.tie(0);
            cout.tie(0);
            int tt;cin>>tt;

            while( tt-- ){
                   int n;cin>>n;
                   string a,b;
                   cin>>a>>b;
                   int l=n-1;int k=0;vector<int > res;int c=0;
                   for(int i=n-1;i>=0;i--){
                        int x = (i+1)%n;
                        if( c%2==0 ){
                            if( a[x]!=b[i] ){
                                k++;
                                res.pb(i+1);
                            }
                            else{
                                k++;
                                res.pb(1);
                                c++;
                                res.pb(i+1);
                            }
                        }
                        else{
                            if( a[x]==b[i] ){
                                k++;
                                res.pb(i+1);
                            }
                            else{
                                k++;
                                res.pb(1);
                                c++;
                                res.pb(i+1);
                            }
                        }
                   }
                   cout<<k+c<<" ";
                   //cout<<res.size()<<endl;

                   for(int i=0;i<res.size();i++)
                        cout<<res[i]<<" ";
                    cout<<endl;
            }
            return 0;
        }


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define see(x) cout<< #x <<" = "<< x <<' ';
#define seen(x) cout<< #x <<" = "<< x <<'\n';
#define UWU cout<<'\n';
ll Q;
void flip(int L,int R,string &s){
    string z = s.substr(L,R-L+1);
    for(int i = 0 ; i < z.size() ; ++i){
        (z[i] == '1' ? z[i] = '0' : z[i] = '1');
    }
    int j = 0;
    reverse(z.begin(),z.end());
    for(int i = L ; i <= R ; ++i){
        s[i] = z[j];
        j++;
    }
}
void solve(){
    int n;cin>>n;
    string s,x;cin>>s>>x;
    vector<int> ve;
    int p = n - 1;
    //transform to full zero
    while(p >= 0){
        if(s[p] == '0'){
            p--;
            continue;
        }
        if(s[0] == '0'){
            for(int i = 0 ; i <= p ; ++i){
                if(s[i] == '1'){
                    ve.pb(i);
                    flip(0,i-1,s);
                    break;
                }
            }
        }else{
            for(int i = 0 ; i <= p ; ++i){
                if(s[i] == '0'){
                    ve.pb(i);
                    flip(0,i-1,s);
                    break;
                }
                if(i == p){
                    ve.pb(i+1);
                    flip(0,p,s);
                }
            }
        }
    }
//    seen(s);
    p = n - 1;
    while(p >= 0){
        if(s[p] == x[p]){
            p--;
            continue;
        }else{
            flip(0,p,s);
            ve.pb(p+1);
//            seen(s);
        }
    }
    cout<<ve.size()<<' ';
    for(auto i : ve){
        cout<<i<<' ';
    }
}
int main(){
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin>>Q;
    while(Q--){
        solve();
        cout<<'\n';
    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define see(x) cout<< #x <<" = "<< x <<' ';
#define seen(x) cout<< #x <<" = "<< x <<'\n';
#define UWU cout<<'\n';
ll Q;
void flip(int L,int R,string &s){
    string z = s.substr(L,R-L+1);
    for(int i = 0 ; i < z.size() ; ++i){
        (z[i] == '1' ? z[i] = '0' : z[i] = '1');
    }
    int j = 0;
    reverse(z.begin(),z.end());
    for(int i = L ; i <= R ; ++i){
        s[i] = z[j];
        j++;
    }
}
void trans(string &s){

}
void solve(){
    int n;cin>>n;
    string s,x;cin>>s>>x;
    vector<int> ve;
    int p = n - 1;
    //transform to full zero
    while(p >= 0){
        if(s[p] == '0'){
            p--;
            continue;
        }
        if(s[0] == '0'){
            for(int i = 0 ; i <= p ; ++i){
                if(s[i] == '1'){
                    ve.pb(i);
                    flip(0,i-1,s);
                    break;
                }
            }
        }else{
            for(int i = 0 ; i <= p ; ++i){
                if(s[i] == '0'){
                    ve.pb(i);
                    flip(0,i-1,s);
                    break;
                }
                if(i == p){
                    ve.pb(i+1);
                    flip(0,p,s);
                }
            }
        }
    }
//    seen(s);
    p = n - 1;
    while(p >= 0){
        if(s[p] == x[p]){
            p--;
            continue;
        }else{
            flip(0,p,s);
            ve.pb(p+1);
//            seen(s);
        }
    }
    cout<<ve.size()<<' ';
    for(auto i : ve){
        cout<<i<<' ';
    }
}
int main(){
//ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin>>Q;
    while(Q--){
        solve();
        cout<<'\n';
    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define see(x) cout<< #x <<" = "<< x <<' ';
#define seen(x) cout<< #x <<" = "<< x <<'\n';
#define UWU cout<<'\n';
ll Q;
void flip(int L,int R,string &s){
    string z = s.substr(L,R-L+1);
    for(int i = 0 ; i < z.size() ; ++i){
        (z[i] == '1' ? z[i] = '0' : z[i] = '1');
    }
    int j = 0;
    reverse(z.begin(),z.end());
    for(int i = L ; i <= R ; ++i){
        s[i] = z[j];
        j++;
    }
}
void solve(){
    int n;cin>>n;
    string s,x;cin>>s>>x;
    vector<int> ve;
    int p = n - 1;
    //transform to full zero
    while(p >= 0){
        if(s[p] == '0'){
            p--;
            continue;
        }
        if(s[0] == '0'){
            for(int i = 0 ; i <= p ; ++i){
                if(s[i] == '1'){
                    ve.pb(i);
                    flip(0,i-1,s);
                    break;
                }
            }
        }else{
            for(int i = 0 ; i <= p ; ++i){
                if(s[i] == '0'){
                    ve.pb(i);
                    flip(0,i-1,s);
                    break;
                }
                if(i == p){
                    ve.pb(i+1);
                    flip(0,p,s);
                }
            }
        }
    }//101 000 111 001 101
//    seen(s);
    if(x[n-1] == '1') ve.pb(n);
    for(int i = n - 2 ; i >= 0 ; --i){
        if(x[i] != x[i+1]) ve.pb(i+1);
    }
    cout<<ve.size()<<' ';
    for(auto i : ve){
        cout<<i<<' ';
    }
}
int main(){
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin>>Q;
    while(Q--){
        solve();
        cout<<'\n';
    }
}