#include <bits/stdc++.h>
using namespace std;
int matrix[110][110];
int ans[110];
void INIT() {
  memset(matrix, 0, sizeof(matrix));
  memset(ans, 0, sizeof(ans));
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  while (cin >> n) {
    INIT();
    int sum = 0;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        cin >> matrix[i][j];
      }
    }
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (matrix[i][j] == -1) {
          break;
        } else if (matrix[i][j] == 1) {
          ans[i] = 1;
        } else if (matrix[i][j] == 2) {
          ans[j] = 1;
        } else if (matrix[i][j] == 3) {
          ans[i] = ans[j] = 1;
        }
      }
    }
    for (int i = 0; i < n; i++) {
      if (!ans[i]) {
        sum++;
      }
    }
    cout << sum << endl;
    for (int i = 0; i < n; i++) {
      if (!ans[i]) {
        if (i != n - 1) {
          cout << i + 1 << " ";
        } else {
          cout << i + 1 << endl;
        }
      }
    }
  }
  return 0;
}
