import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); in.nextLine(); String s = in.nextLine(); if (s.charAt(n - 1) == '0') { System.out.print(-1); return; } List<Integer> result = new ArrayList<>(); int p1 = 0; int p2 = 0; for (int i = 0; i < n; i++) { if (s.charAt(i) == '1') { if (p1 == p2) { p1 = p2 = i + 1; result.add(i + 1); } else { result.add(i + 1); p2 = i + 1; for(int j = p1+1;j<p2;j++){ result.add(j); } p1 = i+1; } } else { p2++; } } for (int tmp : result) { System.out.print(tmp + " "); } } }