#include <bits/stdc++.h>
using namespace std;
int myGCD(int a, int b) {
  if (b == 0)
    return a;
  else
    return myGCD(b, a % b);
}
int myPOW(int a, int b) {
  int val;
  if (b == 0) return 1;
  if (b == 1) return a;
  val = myPOW(a, b / 2);
  val = val * val;
  return (b % 2) ? val * a : val;
}
void printArray(vector<int> arr) {
  for (int i = 0; i < arr.size(); i++) {
    cout << arr[i] << " ";
  }
  cout << endl;
}
int max(int a, int b) { return (a > b) ? a : b; }
int main() {
  int n, a[100][100], i, j, b[100];
  cin >> n;
  for (i = 0; i < n; i++) b[i] = 0;
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) cin >> a[i][j];
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++)
      if (a[i][j] == 1 || a[i][j] == 3) {
        b[i] = -1;
        break;
      }
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++)
      if (a[j][i] == 2 || a[j][i] == 3) {
        b[i] = -1;
        break;
      }
  int sum = 0;
  for (i = 0; i < n; i++)
    if (b[i] != -1) sum++;
  cout << sum;
  int flag = 0;
  for (i = 0; i < n; i++)
    if (b[i] != -1) {
      if (flag == 0) cout << "\n";
      cout << i + 1 << " ";
      flag = 1;
    }
  cout << "\n";
  return 0;
}
