public void solve() throws IOException {
    String nextline;
    while (!(nextline = nextLine()).equals("0")) {
      List<Integer> satellites = new ArrayList<Integer>();
      for (int x = 1; x < nextline.length(); x++) {
        if (getChar(satellites, x) != nextline.charAt(x)) {
          satellites.add(x);
        }
      }
      StringBuffer buf = new StringBuffer();
      for (int x = 0; x < satellites.size(); x++) {
        if (x != 0) 
          buf.append(" ");
        buf.append(satellites.get(x));
      }
      System.out.println(buf.toString());
    }
  }