#include <bits/stdc++.h>
using namespace std;
int a[105];
int main() {
  memset(a, 0, sizeof(a));
  vector<int> v;
  int n, x;
  scanf("%d", &(n));
  for (int(i) = 1; i <= (n); i++)
    for (int(j) = 1; j <= (n); j++) {
      scanf("%d", &(x));
      if (i == j) continue;
      if (x == 1) a[i] = 1;
      if (x == 2) a[j] = 1;
      if (x == 3) a[i] = 1, a[j] = 1;
    }
  for (int(i) = 1; i <= (n); i++)
    if (a[i] == 0) v.push_back(i);
  cout << v.size() << endl;
  for (int i = 0; i < (int)v.size(); i++) {
    if (i > 0) cout << " ";
    cout << v[i];
  }
  cout << endl;
  return 0;
}
