n = int(input()) s = list(map(int, input())) t = list(map(int, input())) ans = [] for i in range(n): if s[i] | s[i+n] != t[i] | t[i+n]: print(-1) exit() if (s[i], s[i+n]) == (t[i], t[i+n]): continue if (s[i] ^ s[i+n], s[i]) == (t[i], t[i+n]): ans.append(i) ans.append(i + 1) else: ans.append(i + n) ans.append((i + 1 + n) % (2 * n)) print(len(ans)) print(*ans, sep='\n')