#include using namespace std; int main(){ int N; cin >> N; string S; cin >> S; string T; cin >> T; string S2; for (int i = 0; i < N; i++){ if (S[i] == '0' && S[N + i] == '0'){ S2 += '#'; } if (S[i] == '0' && S[N + i] == '1'){ S2 += 'A'; } if (S[i] == '1' && S[N + i] == '0'){ S2 += 'B'; } if (S[i] == '1' && S[N + i] == '1'){ S2 += 'C'; } } string T2; for (int i = 0; i < N; i++){ if (T[i] == '0' && T[N + i] == '0'){ T2 += '#'; } if (T[i] == '0' && T[N + i] == '1'){ T2 += 'A'; } if (T[i] == '1' && T[N + i] == '0'){ T2 += 'B'; } if (T[i] == '1' && T[N + i] == '1'){ T2 += 'C'; } } bool ok = true; vector x; for (int i = 0; i < N; i++){ if (S2[i] != T2[i]){ if (S2[i] == '#' || T2[i] == '#'){ ok = false; } if (S2[i] == 'A' && T2[i] == 'B' || S2[i] == 'B' && T2[i] == 'C' || S2[i] == 'C' && T2[i] == 'A'){ x.push_back(i + 1); x.push_back(i); } if (S2[i] == 'A' && T2[i] == 'C' || S2[i] == 'C' && T2[i] == 'B' || S2[i] == 'B' && T2[i] == 'A'){ x.push_back(i); x.push_back(i + 1); } } } if (!ok){ cout << -1 << endl; } else { int M = x.size(); cout << M << endl; for (int i = 0; i < M; i++){ cout << x[i] << endl; } } }