#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ppi = pair<int, int>;
using ppl = pair<ll, ll>;
int v[100];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  cin >> N;
  for (long long i = 0; i < (int)N; ++i) {
    for (long long j = 0; j < (int)N; ++j) {
      int x;
      cin >> x;
      if (i < j) {
        if (x == 3)
          v[i] = v[j] = 1;
        else if (x == 2)
          v[j] = 1;
        else if (x == 1)
          v[i] = 1;
      }
    }
  }
  int ans = 0;
  for (long long i = 0; i < (int)N; ++i)
    if (!v[i]) ++ans;
  cout << ans << '\n';
  for (long long i = 0; i < (int)N; ++i)
    if (!v[i]) cout << i + 1 << ' ';
  return 0;
}
