#include <bits/stdc++.h>   using namespace std;   void fast() {     std::ios_base::sync_with_stdio(0);     cin.tie(NULL);     cout.tie(NULL);   }   void file() {}   int main() {     fast();     file();     int n, idx = 0;     cin >> n;     vector<vector<int>> v(n, vector<int>(n));     vector<bool> ans(n, 1);     for (int i = 0; i < n; i++) {       for (int j = 0; j < n; j++) {         cin >> v[i][j];         if (v[i][j] == 3) {           ans[i] = 0;           ans[j] = 0;         } else if (v[i][j] == 1)           ans[i] = 0;         else if (v[i][j] == 2)           ans[j] = 0;       }     }     int cnt = 0;     for (int i = 0; i < n; i++) {       if (ans[i]) cnt++;     }     cout << cnt << endl;     for (int i = 0; i < n; i++) {       if (ans[i]) cout << i + 1 <<    ;     }     return 0;   }   