#include <iostream>
using namespace std;

int main() {
    int a;
    cin>>a;
    string str;
    cin>>str;
    if(str[a-1]=='0'){
        cout <<-1;return 0;
    }
    int j=0;
    for(int i=1;i<=a;i++)
    {
        if(str[i-1]=='1')
        {
            int temp=i;
            while(i>j)
            cout <<i--<<' ';
            j=temp;
        }  
    }
}
// 64 位输出请用 printf("%lld")