#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n][n];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
    }
  }
  vector<bool> b(n + 1, true);
  b[0] = false;
  int counter = 0;
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n; j++) {
      if (a[i][j] == 1) {
        b[i + 1] = false;
      }
      if (a[i][j] == 2) {
        b[j + 1] = false;
      } else if (a[i][j] == 3) {
        b[i + 1] = false;
        b[j + 1] = false;
      }
    }
  }
  counter = count(b.begin(), b.end(), 1);
  cout << counter << endl;
  for (int i = 1; i < n + 1; i++) {
    if (b[i] == true) {
      cout << i << " ";
    }
  }
  return 0;
}
