#include <bits/stdc++.h>
using namespace std;
int n, ans[110], tmp[21000], num;
int p[110][110];
int main() {
  while (cin >> n) {
    set<int> q;
    q.clear();
    num = 0;
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++) {
        scanf("%d", &p[i][j]);
        if (p[i][j] == -1) {
          q.insert(i);
          q.insert(j);
        } else if (p[i][j] == 0) {
          q.insert(i);
          q.insert(j);
        } else if (p[i][j] == 1) {
          tmp[num++] = i;
          q.insert(j);
        } else if (p[i][j] == 2) {
          tmp[num++] = j;
          q.insert(i);
        } else if (p[i][j] == 3) {
          tmp[num++] = i;
          tmp[num++] = j;
        }
      }
    for (int i = 0; i < num; i++) q.erase(tmp[i]);
    set<int>::iterator it;
    cout << q.size() << endl;
    for (it = q.begin(); it != q.end(); it++) cout << *it << " ";
    cout << endl;
  }
  return 0;
}
