#include <bits/stdc++.h>
int state[105];
int main() {
  int n, count = 0;
  scanf("%d", &n);
  int a[105][105], i, j;
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) scanf("%d", &a[i][j]);
  for (i = 0; i < n; i++) {
    for (j = 0; j < i; j++) {
      if (a[i][j] == 1)
        state[i] = 1;
      else if (a[i][j] == 2)
        state[j] = 1;
      else if (a[i][j] == 3) {
        state[i] = state[j] = 1;
      }
    }
  }
  for (i = 0; i < n; i++)
    if (!state[i]) count++;
  printf("%d\n", count);
  for (i = 0; i < n; i++)
    if (!state[i]) printf("%d ", i + 1);
  return 0;
}
