#include <bits/stdc++.h>
using namespace std;
int a[105][105];
int b[105];
int main() {
  int n;
  memset(b, 0, sizeof(b));
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      int x;
      scanf("%d", &x);
      if (i == j) continue;
      if (x == 1) b[i] = 1;
      if (x == 2) b[j] = 1;
      if (x == 3) b[i] = 1, b[j] = 1;
    }
  }
  int cnt = 0;
  for (int i = 1; i <= n; i++)
    if (b[i]) cnt++;
  printf("%d\n", n - cnt);
  for (int i = 1; i <= n; i++)
    if (b[i] == 0) printf("%d ", i);
  return 0;
}
