#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N=1e5+1e4,M=1e3+1e2;
const ll Maxn=0x3ffffff,Minm=-0x3ffffff;
ll t,ans;
string s;
signed main()
{
cin>>t;
while(t--)
{
cin>>s;
for(ll i=0;i<s.size();i++)
if(s[i]>='0'&&s[i]<='9')cout<<i+1<<" ";
cout<<"\n";
}
}