#include <bits/stdc++.h>
using namespace std;
const int N = 123;
const int INF = 1e9 + 123;
const int MOD = 1e9 + 7;
const double EPS = 1e-9;
int n;
bool bal[N];
vector<int> ans;
int main() {
  ios_base ::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      int x;
      cin >> x;
      if (x == 1) bal[i] = 1;
      if (x == 2) bal[j] = 1;
      if (x == 3) {
        bal[i] = 1;
        bal[j] = 1;
      }
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (bal[i] == 0) {
      ans.push_back(i);
    }
  }
  cout << (int)ans.size() << '\n';
  for (int i = 0; i < (int)ans.size(); ++i) cout << ans[i] << ' ';
  return 0;
}
