#include <bits/stdc++.h>
using namespace std;
int main() {
    int m;
    cin>>m;
    while (m--) { 
        string str;
        cin>>str;
        vector<int> a;
        for(int i=0;i<str.size();i++)
        {
            if(str[i]>='0'&&str[i]<='9') a.push_back(i+1);
        }
        for(int i=0;i<a.size();i++) cout<<a[i]<<" ";
        cout<<endl;   
    }
}