#include <bits/stdc++.h>
using namespace std;
int debug = 0;
int n, a[110][110];
bool mark[110];
void solve() {
  cin >> n;
  for (int i = (1); i <= (n); ++i)
    for (int j = (1); j <= (n); ++j) cin >> a[i][j];
  for (int i = (1); i <= (n); ++i)
    for (int j = (i + 1); j <= (n); ++j) {
      if (a[i][j] == 1) mark[i] = true;
      if (a[i][j] == 2) mark[j] = true;
      if (a[i][j] == 3) mark[i] = mark[j] = true;
    }
  int cnt = 0;
  for (int i = (1); i <= (n); ++i)
    if (!mark[i]) cnt++;
  cout << cnt << endl;
  for (int i = (1); i <= (n); ++i)
    if (!mark[i]) cout << i << " ";
}
int main() {
  solve();
  return 0;
}
