import sys input=lambda:sys.stdin.readline().rstrip() N=int(input()) S=input() T=input() ans=[] for i in range(N): a=int(S[i]+S[i+N],2) b=int(T[i]+T[i+N],2) if a*b: if (b-a+3)%3==1: ans.append(i) ans.append(i+1) elif (b-a+3)%3==2: ans.append(i+N) ans.append((i+N+1)%(2*N)) elif a+b: print(-1) sys.exit() print(len(ans)) for i in ans: print(i)