#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, A;
  while (cin >> n) {
    set<int> Set;
    for (int i = 1; i <= n; ++i) {
      Set.insert(i);
    }
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= n; ++j) {
        cin >> A;
        if (i > j && A != 0) {
          switch (A) {
            case 1:
              Set.erase(i);
              break;
            case 2:
              Set.erase(j);
              break;
            case 3:
              Set.erase(i), Set.erase(j);
              break;
          }
        }
      }
    }
    cout << Set.size() << endl;
    if (!Set.empty()) {
      cout << *Set.begin();
      for (auto iter = ++Set.begin(); iter != Set.end(); ++iter) {
        cout << " " << *iter;
      }
      cout << endl;
    }
  }
  return 0;
}
