#include <bits/stdc++.h>
bool a[105];
int main() {
  int n;
  int tmp;
  scanf("%d", &n);
  int ans = n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      scanf("%d", &tmp);
      if (tmp == -1) continue;
      if (tmp == 0) {
        continue;
      } else if (tmp == 1) {
        if (a[i] == false) {
          a[i] = true;
          ans--;
        }
      } else if (tmp == 2) {
        if (a[j] == false) {
          a[j] = true;
          ans--;
        }
      } else if (tmp == 3) {
        if (a[i] == false) {
          a[i] = true;
          ans--;
        }
        if (a[j] == false) {
          a[j] = true;
          ans--;
        }
      }
    }
  }
  printf("%d\n", ans);
  if (ans > 0) {
    int ii = 0;
    while (a[ii] == true) ii++;
    printf("%d", ii + 1);
    ii++;
    for (; ii < n; ii++) {
      if (a[ii] == false) {
        printf(" %d", ii + 1);
      }
    }
    printf("\n");
  }
  return 0;
}
