#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100;
const double PI = 3.14159;
vector<string> v;
long long n, m, k, d, ans[101], c, sum, a[105][105];
set<string> st;
string s, b;
bool flag;
set<string>::iterator it;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    c = 0;
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      if (a[i][j] == 0 || a[i][j] == 2) c++;
    }
    if (c == n - 1) {
      sum++;
      d = i + 1;
      ans[d / 32] |= (1 << (d % 32));
    }
  }
  cout << sum << endl;
  for (int i = 1; i <= n; i++) {
    if (ans[i / 32] & (1 << (i % 32))) cout << i << " ";
  }
  return 0;
}
