#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  set<int> h;
  cin >> n;
  for (int i = 1; i <= n; i++) h.insert(i);
  for (int i = 1; i <= n; i++)
    for (int j = 1, x; j <= n; j++) {
      cin >> x;
      x != 0 && x != -1 ? x == 1 ? h.erase(i) : h.erase(j) : 0;
    }
  cout << h.size() << "\n";
  for (int i = 1; i <= n; i++)
    if (h.find(i) != h.end()) cout << i << " ";
  return 0;
}
