#include <bits/stdc++.h>
using namespace std;
vector<bool> prime(100000 + 1, 1);
void SieveOfEratosthenes(int n) {
  prime[0] = 0;
  prime[1] = 0;
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
}
long long unsigned int countDivisors(long long unsigned int n) {
  long long unsigned int cnt = 0;
  for (long long unsigned int i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i)
        ++cnt;
      else
        cnt += 2;
    }
  }
  return cnt;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n;
  cin >> n;
  vector<vector<int> > arr(n, vector<int>(n));
  for (int i1 = 0; i1 < n; i1++) {
    for (int j1 = 0; j1 < n; j1++) {
      cin >> arr[i1][j1];
    }
  }
  vector<bool> a(n, 1);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (arr[i][j] == 1) {
        a[i] = 0;
      } else if (arr[i][j] == 2) {
        a[j] = 0;
      } else if (arr[i][j] == 3) {
        a[i] = 0;
        a[j] = 0;
      }
    }
  }
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (a[i]) cnt++;
  }
  cout << cnt << endl;
  for (int i = 0; i < (int)a.size(); i++) {
    if (a[i]) cout << 1 + i << " ";
  }
  if (cnt > 0) cout << endl;
  return 0;
}
