#include <bits/stdc++.h>
using namespace std;
long long fx[4] = {1, -1, 0, 0};
long long fy[4] = {0, 0, 1, -1};
int main() {
  {
    long long n;
    cin >> n;
    long long visi[n + 2];
    memset(visi, 0, sizeof visi);
    for (long long i = 1; i <= n; i++) {
      for (long long j = 1; j <= n; j++) {
        long long x;
        cin >> x;
        if (x == 1) visi[i] = 1;
        if (x == 2) visi[j] = 1;
        if (x == 3) visi[i] = 1, visi[j] = 1;
      }
    }
    long long ans = 0;
    for (long long i = 1; i <= n; i++) {
      if (!visi[i]) ans++;
    }
    if (!ans) return cout << 0 << "\n", 0;
    cout << ans << "\n";
    for (long long i = 1; i <= n; i++) {
      if (!visi[i]) cout << i << " ";
    }
    cout << "\n";
  }
  return 0;
}
