#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, a[109][109], v[109] = {0};
  cin >> n;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      cin >> a[i][j];
      if (a[i][j] == 0) {
        if (v[i] != -1) v[i] = 1;
        if (v[j] != -1) v[j] = 1;
      } else if (a[i][j] == 1) {
        v[i] = -1;
        if (v[j] != -1) v[j] = 1;
      } else if (a[i][j] == 2) {
        v[j] = -1;
        if (v[i] != -1) v[i] = 1;
      } else if (a[i][j] == 3) {
        v[j] = -1;
        v[i] = -1;
      }
    }
  }
  if (n == 1 && a[0][0] == -1) {
    cout << "1" << endl << "1";
    return 0;
  }
  int c = 0;
  for (i = 0; i < 109; i++) {
    if (v[i] == 1) c++;
  }
  cout << c << endl;
  for (i = 0; i < 109; i++) {
    if (v[i] == 1) cout << i + 1 << " ";
  }
}
