public void solve() throws IOException {
    int n = nextInt();
    List<Integer> cars = new ArrayList<Integer>();
    for (int x = 0; x < n; x++) {
      boolean flipped = false;
      for (int y = 0; y < n; y++) {
        int status = nextInt();
        if (status == 1 || status == 3) {
          flipped = true;
        }
      }
      if (!flipped) {
        cars.add(x + 1);
      }
    }
    System.out.println(cars.size());
    for (int car : cars) {
      System.out.print(car + " ");
    }
  }