from __future__ import division, print_function
# import threading
# threading.stack_size(2**27)
# import sys
# sys.setrecursionlimit(10**7)
from sys import stdin, stdout
import bisect            #c++ upperbound
import math
import heapq
def modinv(n,p):
    return pow(n,p-2,p)
def cin():
    return map(int,sin().split())
def ain():                           #takes array as input
    return list(map(int,sin().split()))
def sin():
    return input()
def inin():
    return int(input())
import math
def Divisors(n) :
    l = []
    for i in range(1, int(math.sqrt(n) + 1)) :
        if (n % i == 0) :
            if (n // i == i) :
                l.append(i)
            else :
                l.append(i)
                l.append(n//i)
    return l
def primeFactors(n):
    d={}
    while n % 2 == 0:
        if 2 not in d:
            d[2]=1
        else:
            d[2]+=1
        n = n // 2
    for i in range(3,int(math.sqrt(n))+1,2):
        while n % i== 0:
            if i not in d:
                d[i]=1
            else:
                d[i]+=1
            n = n // i
    if n > 2:
        d[n]=1
    return d
q=[]
def dfs(n,d,v,c):
    global q
    v[n]=1
    x=d[n]
    q.append(n)
    j=c
    for i in x:
        if i not in v:
            f=dfs(i,d,v,c+1)
            j=max(j,f)
            # print(f)
    return j
"""*******************************************************"""
def main():
    n=inin()
    s=sin()
    ss=sin()
    a=[]
    b=[]
    c=[]
    d=[]
    j=k=l=m=0
    for i in range(n):
        if(s[i]=="1" and ss[i]=="0"):
            a.append(i)
            j+=1
        if(s[i]=="0" and ss[i]=="1"):
            b.append(i)
            k+=1
        if(s[i]=="1" and ss[i]=="1"):
            c.append(i)
            l+=1
        if(s[i]=="0" and ss[i]=="0"):
            d.append(i)
            m+=1
    # print(a,b,c,d)
    ans=0
    for p in range(j+1):
        for q in range(l+1):
            r=p+2*q-l
            x=k-r
            # print(p,q,r)
            if(x<0 or r<0):
                continue
            if(x+p+q<=n//2 and x+p+q+m>=n//2):
                ans=1
                m=n//2-x-p-q
                break
        if(ans==1):
            break
    if(ans==0):
        print(-1)
    else:
        # print(p,q,x,m)
        for i in range(p):
            print(a[i]+1,end=" ")
        for i in range(q):
            print(c[i]+1,end=" ")
        for i in range(x):
            print(b[i]+1,end=" ")
        for i in range(m):
            print(d[i]+1,end=" ")

######## Python 2 and 3 footer by Pajenegod and c1729

# Note because cf runs old PyPy3 version which doesn't have the sped up
# unicode strings, PyPy3 strings will many times be slower than pypy2.
# There is a way to get around this by using binary strings in PyPy3
# but its syntax is different which makes it kind of a mess to use.

# So on cf, use PyPy2 for best string performance.

py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip
    range = xrange

import os, sys
from io import IOBase, BytesIO

BUFSIZE = 8192
class FastIO(BytesIO):
    newlines = 0

    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0,2), super(FastIO, self).write(s))[0])
        return s

    def read(self):
        while self._fill(): pass
        return super(FastIO,self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill(); self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s:self.buffer.write(s.encode('ascii'))
            self.read = lambda:self.buffer.read().decode('ascii')
            self.readline = lambda:self.buffer.readline().decode('ascii')

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip('\r\n')

# Cout implemented in Python
import sys
class ostream:
    def __lshift__(self,a):
        sys.stdout.write(str(a))
        return self
cout = ostream()
endl = '\n'

# Read all remaining integers in stdin, type is given by optional argument, this is fast
def readnumbers(zero = 0):
    conv = ord if py2 else lambda x:x
    A = []; numb = zero; sign = 1; i = 0; s = sys.stdin.buffer.read()
    try:
        while True:
            if s[i] >= b'R' [0]:
                numb = 10 * numb + conv(s[i]) - 48
            elif s[i] == b'-' [0]: sign = -1
            elif s[i] != b'\r' [0]:
                A.append(sign*numb)
                numb = zero; sign = 1
            i += 1
    except:pass
    if s and s[-1] >= b'R' [0]:
        A.append(sign*numb)
    return A

# threading.Thread(target=main).start()
if __name__== "__main__":
  main()


#import resource
import sys
#resource.setrlimit(resource.RLIMIT_STACK, [0x100000000, resource.RLIM_INFINITY])
#threading.Thread(target=main).start()
#import threading
#threading.stack_size(2**26)
sys.setrecursionlimit(10**6)
#mod=(10**9)+7
#fact=[1]
#for i in range(1,1001):
#    fact.append((fact[-1]*i)%mod)
#ifact=[0]*1001
#ifact[1000]=pow(fact[1000],mod-2,mod)
#for i in range(1000,0,-1):
#    ifact[i-1]=(i*ifact[i])%mod
from sys import stdin, stdout
from bisect import bisect_left as bl
from bisect import bisect_right as br
import itertools
import math
import heapq
from random import randint as rn
from Queue import Queue as Q
def modinv(n,p):
    return pow(n,p-2,p)
def ncr(n,r,p):
    t=((fact[n])*((ifact[r]*ifact[n-r])%p))%p
    return t
def ain():
    return map(int,sin().split())
def sin():
    return stdin.readline().strip()
def GCD(x, y):
   while(y):
       x, y = y, x % y
   return x
"""**************************************************************************"""
n=input()
c=sin()
a=sin()
d={("0","0"): [],("0","1"): [],("1","0"): [],("1","1"): []}
for i in range(n):
    d[(c[i],a[i])].append(i)
x=len(d[("1","0")])
y=len(d[("0","1")])
r1=len(d[("0","0")])
r2=len(d[("1","1")])
p=0
for i in range(x+1):
    for j in range(y+1):
        s1=i+(y-j)
        c1=i
        f1=0
        f2=0
        s2=j+(x-i)
        c2=j
        g1=i
        g2=y-j
        v1=r1
        v2=r2
        if(c1>=c2 and v2>=(c1-c2)):
            s2+=(c1-c2)
            v2-=(c1-c2)
            c2+=(c1-c2)
            if(v2%2==0):
                s1+=v2/2
                s2+=v2/2
                f1+=v2/2
                if(s1>=s2 and v1>=(s1-s2)):
                    v1-=(s1-s2)
                    s2+=(s1-s2)
                    if(v1%2==0):
                        f2+=v1/2
                        p=1
                        break
                elif(s2>=s1 and v1>=(s2-s1)):
                    v1-=(s2-s1)
                    f2+=(s2-s1)
                    s1+=(s2-s1)
                    if(v1%2==0):
                        f2+=v1/2
                        p=1
                        break
        elif(c2>=c1 and v2>=(c2-c1)):
            v2-=(c2-c1)
            s1+=(c2-c1)
            f1+=(c2-c1)
            c1+=(c2-c1)
            if(v2%2==0):
                s1+=v2/2
                s2+=v2/2
                f1+=v2/2
                if(s1>=s2 and v1>=(s1-s2)):
                    v1-=(s1-s2)
                    s2+=(s1-s2)
                    if(v1%2==0):
                        f2+=v1/2
                        p=1
                        break
                elif(s2>=s1 and v1>=(s2-s1)):
                    v1-=(s2-s1)
                    f2+=(s2-s1)
                    s1+=(s2-s1)
                    if(v1%2==0):
                        f2+=v1/2
                        p=1
                        break
    if(p==1):
        break
w=[]
if(p==1):
    for i in range(g1):
        w.append(str(d[("1","0")][i]+1))
    for i in range(g2):
        w.append(str(d[("0","1")][i]+1))
    for i in range(f1):
        w.append(str(d[("1","1")][i]+1))
    for i in range(f2):
        w.append(str(d[("0","0")][i]+1))
    stdout.write(" ".join(w))
    stdout.write("\n")
else:
    print -1


n = int(raw_input())
l1 = list(raw_input())
l2 = list(raw_input())

def next_index(arr1, arr2, start, end, v1, v2):
    for i in range(start, end):
        if arr1[i] == v1 and arr2[i] == v2:
            return i
    return -1

first_half = 0
second_half = 0
location = [i for i in range(1, n+1)]

for i in range(n):
    if i < n / 2:
        if l1[i] == "1":
            first_half += 1
    else:
        if l2[i] == "1":
            second_half += 1

diff = abs(first_half - second_half)
diffs_first = [[["0", "1"], ["0", "0"]], [["1", "0"], ["0", "0"]], [["1", "1"], ["0", "1"]], [["1", "1"], ["1", "0"]]]
diffs_second = [[["0", "0"], ["0", "1"]], [["0", "0"], ["1", "0"]], [["0", "1"], ["1", "1"]], [["1", "0"], ["1", "1"]]]

first_pointer = 0
second_pointer = n / 2
x0, x1, y0, y1 = [1, 1, 0, 0] if first_half > second_half else [0, 0, 1, 1]

while diff > 1:
    i1 = next_index(l1, l2, first_pointer, n/2, x0, x1)
    if i1 == -1: break
    first_pointer = i1 + 1
    i2 = next_index(l1, l2, second_pointer, n, y0, y1)
    if i2 == -1: break
    second_pointer = i2 + 1
    diff -= 2
    location[i1], location[i2] = location[i2], location[i1]

diffs = diffs_first if first_half > second_half else diffs_second
for switch in diffs:
    first_pointer = 0
    second_pointer = n / 2
    while diff > 0:
        i1 = next_index(l1, l2, first_pointer, n/2, switch[0][0], switch[0][1])
        if i1 == -1: break
        first_pointer = i1 + 1
        i2 = next_index(l1, l2, second_pointer, n, switch[1][0], switch[1][1])
        if i2 == -1: break
        second_pointer = i2 + 1
        diff -= 1
        location[i1], location[i2] = location[i2], location[i1]

first_pointer = 0
second_pointer = n / 2
is_minus = False
while diff == 1:
    i1 = next_index(l1, l2, first_pointer, n/2, x0, x1)
    if i1 == -1: break
    first_pointer = i1 + 1
    i2 = next_index(l1, l2, second_pointer, n, y0, y1)
    if i2 == -1: break
    second_pointer = i2 + 1
    diff -= 2
    location[i1], location[i2] = location[i2], location[i1]
    is_minus = True

diff *= -1
if is_minus:
    diffs = diffs_first if first_half < second_half else diffs_second
    for switch in diffs:
        first_pointer = 0
        second_pointer = n / 2
        while diff > 0:
            i1 = next_index(l1, l2, first_pointer, n/2, switch[0][0], switch[0][1])
            if i1 == -1: break
            first_pointer = i1 + 1
            i2 = next_index(l1, l2, second_pointer, n, switch[1][0], switch[1][1])
            if i2 == -1: break
            second_pointer = i2 + 1
            diff -= 1
            location[i1], location[i2] = location[i2], location[i1]

if diff != 0:
    print -1
else:
    print " ".join(map(str, location[:n/2]))


n = int(raw_input())
l1 = list(raw_input())
l2 = list(raw_input())

def switch_half(arr):
    return arr[n/2:] + arr[:n/2]

def next_index(arr1, arr2, start, end, v1, v2):
    for i in range(start, end):
        if arr1[i] == v1 and arr2[i] == v2:
            return i
    return -1

first_half = 0
second_half = 0
location = [i for i in range(1, n+1)]

for i in range(n):
    if i < n / 2:
        if l1[i] == "1":
            first_half += 1
    else:
        if l2[i] == "1":
            second_half += 1

diff = abs(first_half - second_half)
diffs_first = [[["0", "1"], ["0", "0"]], [["1", "0"], ["0", "0"]], [["1", "1"], ["0", "1"]], [["1", "1"], ["1", "0"]]]
diffs_second = [[["0", "0"], ["0", "1"]], [["0", "0"], ["1", "0"]], [["0", "1"], ["1", "1"]], [["1", "0"], ["1", "1"]]]

first_pointer = 0
second_pointer = n / 2

while diff > 1:
    if first_half > second_half:
        i1 = next_index(l1, l2, first_pointer, n/2, 1, 1)
        if i1 == -1: break
        first_pointer = i1
        i2 = next_index(l1, l2, second_pointer, n, 0, 0)
        if i2 == -1: break
        second_pointer = i2
    else:
        i1 = next_index(l1, l2, first_pointer, n/2, 0, 0)
        if i1 == -1: break
        first_pointer = i1
        i2 = next_index(l1, l2, second_pointer, n, 1, 1)
        if i2 == -1: break
        second_pointer = i2

    diff -= 2
    location[i1], location[i2] = location[i2], location[i1]

diffs = diffs_first if first_half > second_half else diffs_second
for switch in diffs:
    first_pointer = 0
    second_pointer = n / 2
    while diff > 0:
        i1 = next_index(l1, l2, first_pointer, n/2, switch[0][0], switch[0][1])
        if i1 == -1: break
        first_pointer = i1
        i2 = next_index(l1, l2, second_pointer, n, switch[1][0], switch[1][1])
        if i2 == -1: break
        second_pointer = i2
        diff -= 1
        location[i1], location[i2] = location[i2], location[i1]

if diff > 0:
    print -1
if diff == 0:
    print " ".join(map(str, location[:n/2]))


n = int(raw_input())
l1 = list(raw_input())
l2 = list(raw_input())

def next_index(arr1, arr2, start, end, v1, v2):
    for i in range(start, end):
        if arr1[i] == v1 and arr2[i] == v2:
            return i
    return -1

first_half = 0
second_half = 0
location = [i for i in range(1, n+1)]

for i in range(n):
    if i < n / 2:
        if l1[i] == "1":
            first_half += 1
    else:
        if l2[i] == "1":
            second_half += 1

diff = abs(first_half - second_half)
diffs_first = [[["0", "1"], ["0", "0"]], [["1", "0"], ["0", "0"]], [["1", "1"], ["0", "1"]], [["1", "1"], ["1", "0"]]]
diffs_second = [[["0", "0"], ["0", "1"]], [["0", "0"], ["1", "0"]], [["0", "1"], ["1", "1"]], [["1", "0"], ["1", "1"]]]

first_pointer = 0
second_pointer = n / 2
x0, x1, y0, y1 = ["1", "1", "0", "0"] if first_half > second_half else ["0", "0", "1", "1"]

while diff > 1:
    i1 = next_index(l1, l2, first_pointer, n/2, x0, x1)
    if i1 == -1: break
    first_pointer = i1 + 1
    i2 = next_index(l1, l2, second_pointer, n, y0, y1)
    if i2 == -1: break
    second_pointer = i2 + 1
    diff -= 2
    location[i1], location[i2] = location[i2], location[i1]
    l1[i1], l1[i2] = l1[i2], l1[i1]
    l2[i1], l2[i2] = l2[i2], l2[i1]

diffs = diffs_first if first_half > second_half else diffs_second
for i in range(n):
    any_diff = False
    for switch in diffs:
        first_pointer = 0
        second_pointer = n / 2
        while diff > 0:
            i1 = next_index(l1, l2, first_pointer, n/2, switch[0][0], switch[0][1])
            if i1 == -1:
                break
            first_pointer = i1 + 1
            i2 = next_index(l1, l2, second_pointer, n, switch[1][0], switch[1][1])
            if i2 == -1:
                break
            any_diff = True
            second_pointer = i2 + 1
            diff -= 1
            location[i1], location[i2] = location[i2], location[i1]
            l1[i1], l1[i2] = l1[i2], l1[i1]
            l2[i1], l2[i2] = l2[i2], l2[i1]
    if not any_diff:
        break

first_pointer = 0
second_pointer = n / 2
is_minus = False
while diff == 1:
    i1 = next_index(l1, l2, first_pointer, n/2, x0, x1)
    if i1 == -1: break
    first_pointer = i1 + 1
    i2 = next_index(l1, l2, second_pointer, n, y0, y1)
    if i2 == -1: break
    second_pointer = i2 + 1
    diff = 1
    location[i1], location[i2] = location[i2], location[i1]
    l1[i1], l1[i2] = l1[i2], l1[i1]
    l2[i1], l2[i2] = l2[i2], l2[i1]
    is_minus = True

if is_minus:
    diffs = diffs_first if first_half < second_half else diffs_second
    for switch in diffs:
        first_pointer = 0
        second_pointer = n / 2
        while diff > 0:
            i1 = next_index(l1, l2, first_pointer, n/2, switch[0][0], switch[0][1])
            if i1 == -1: break
            first_pointer = i1 + 1
            i2 = next_index(l1, l2, second_pointer, n, switch[1][0], switch[1][1])
            if i2 == -1: break
            second_pointer = i2 + 1
            diff -= 1
            location[i1], location[i2] = location[i2], location[i1]
            l1[i1], l1[i2] = l1[i2], l1[i1]
            l2[i1], l2[i2] = l2[i2], l2[i1]

if diff != 0:
    print -1
else:
    print " ".join(map(str, location[:n/2]))


n = int(raw_input())
l1 = list(raw_input())
l2 = list(raw_input())

def next_index(arr1, arr2, start, end, v1, v2):
    for i in range(start, end):
        if arr1[i] == v1 and arr2[i] == v2:
            return i
    return -1

first_half = 0
second_half = 0
location = [i for i in range(1, n+1)]

for i in range(n):
    if i < n / 2:
        if l1[i] == "1":
            first_half += 1
    else:
        if l2[i] == "1":
            second_half += 1

diff = abs(first_half - second_half)
diffs_first = [[["0", "1"], ["0", "0"]], [["1", "0"], ["0", "0"]], [["1", "1"], ["0", "1"]], [["1", "1"], ["1", "0"]]]
diffs_second = [[["0", "0"], ["0", "1"]], [["0", "0"], ["1", "0"]], [["0", "1"], ["1", "1"]], [["1", "0"], ["1", "1"]]]

first_pointer = 0
second_pointer = n / 2
x0, x1, y0, y1 = ["1", "1", "0", "0"] if first_half > second_half else ["0", "0", "1", "1"]

while diff > 1:
    i1 = next_index(l1, l2, first_pointer, n/2, x0, x1)
    if i1 == -1: break
    first_pointer = i1 + 1
    i2 = next_index(l1, l2, second_pointer, n, y0, y1)
    if i2 == -1: break
    second_pointer = i2 + 1
    diff -= 2
    location[i1], location[i2] = location[i2], location[i1]

diffs = diffs_first if first_half > second_half else diffs_second
for i in range(n):
    any_diff = False
    for switch in diffs:
        first_pointer = 0
        second_pointer = n / 2
        while diff > 0:
            i1 = next_index(l1, l2, first_pointer, n/2, switch[0][0], switch[0][1])
            if i1 == -1: break
            first_pointer = i1 + 1
            i2 = next_index(l1, l2, second_pointer, n, switch[1][0], switch[1][1])
            if i2 == -1: break
            any_diff = True
            second_pointer = i2 + 1
            diff -= 1
            location[i1], location[i2] = location[i2], location[i1]
    if not any_diff: break

if diff != 0:
    print -1
else:
    print " ".join(map(str, location[:n/2]))


n = int(raw_input())
l1 = list(raw_input())
l2 = list(raw_input())

def switch_half(arr):
    return arr[n/2:] + arr[:n/2]

def next_index(arr1, arr2, start, end, v1, v2):
    for i in range(start, end):
        if arr1[i] == v1 and arr2[i] == v2:
            return i
    return -1

first_half = 0
second_half = 0
location = [i for i in range(1, n+1)]

for i in range(n):
    if i < n / 2:
        if l1[i] == "1":
            first_half += 1
    else:
        if l2[i] == "1":
            second_half += 1

diff = abs(first_half - second_half)
if second_half > first_half:
    l1 = switch_half(l1)
    l2 = switch_half(l2)
    location = switch_half(location)

diffs = [[["0", "1"], ["0", "0"]], [["1", "0"], ["0", "0"]], [["1", "1"], ["0", "1"]], [["1", "1"], ["1", "0"]]]

first_pointer = 0
second_pointer = n / 2

while diff > 1:
    i1 = next_index(l1, l2, first_pointer, n/2, 1, 1)
    if i1 == -1: break
    first_pointer = i1
    i2 = next_index(l1, l2, second_pointer, n, 0, 0)
    if i2 == -1: break
    second_pointer = i2
    diff -= 2
    location[i1], location[i2] = location[i2], location[i1]

for switch in diffs:
    first_pointer = 0
    second_pointer = n / 2
    while diff > 0:
        i1 = next_index(l1, l2, first_pointer, n/2, switch[0][0], switch[0][1])
        if i1 == -1: break
        first_pointer = i1
        i2 = next_index(l1, l2, second_pointer, n, switch[1][0], switch[1][1])
        if i2 == -1: break
        second_pointer = i2
        diff -= 1
        location[i1], location[i2] = location[i2], location[i1]

if diff > 0:
    print -1
if diff == 0:
    print " ".join(map(str, location[:n/2]))


n = int(raw_input())
l1 = list(raw_input())
l2 = list(raw_input())

def next_index(arr1, arr2, start, end, v1, v2):
    for i in range(start, end):
        if arr1[i] == v1 and arr2[i] == v2:
            return i
    return -1

first_half = 0
second_half = 0
location = [i for i in range(1, n+1)]

for i in range(n):
    if i < n / 2:
        if l1[i] == "1":
            first_half += 1
    else:
        if l2[i] == "1":
            second_half += 1

diff = abs(first_half - second_half)
diffs_first = [[["0", "1"], ["0", "0"]], [["1", "0"], ["0", "0"]], [["1", "1"], ["0", "1"]], [["1", "1"], ["1", "0"]]]
diffs_second = [[["0", "0"], ["0", "1"]], [["0", "0"], ["1", "0"]], [["0", "1"], ["1", "1"]], [["1", "0"], ["1", "1"]]]

first_pointer = 0
second_pointer = n / 2
x0, x1, y0, y1 = ["1", "1", "0", "0"] if first_half > second_half else ["0", "0", "1", "1"]

while diff > 1:
    i1 = next_index(l1, l2, first_pointer, n/2, x0, x1)
    if i1 == -1: break
    first_pointer = i1 + 1
    i2 = next_index(l1, l2, second_pointer, n, y0, y1)
    if i2 == -1: break
    second_pointer = i2 + 1
    diff -= 2
    location[i1], location[i2] = location[i2], location[i1]

diffs = diffs_first if first_half > second_half else diffs_second
for i in range(n):
    any_diff = False
    for switch in diffs:
        first_pointer = 0
        second_pointer = n / 2
        while diff > 0:
            i1 = next_index(l1, l2, first_pointer, n/2, switch[0][0], switch[0][1])
            if i1 == -1:
                break
            first_pointer = i1 + 1
            i2 = next_index(l1, l2, second_pointer, n, switch[1][0], switch[1][1])
            if i2 == -1:
                break
            any_diff = True
            second_pointer = i2 + 1
            diff -= 1
            location[i1], location[i2] = location[i2], location[i1]
    if not any_diff:
        break

first_pointer = 0
second_pointer = n / 2
is_minus = False
while diff == 1:
    i1 = next_index(l1, l2, first_pointer, n/2, x0, x1)
    if i1 == -1: break
    first_pointer = i1 + 1
    i2 = next_index(l1, l2, second_pointer, n, y0, y1)
    if i2 == -1: break
    second_pointer = i2 + 1
    diff = 1
    location[i1], location[i2] = location[i2], location[i1]
    is_minus = True

if is_minus:
    diffs = diffs_first if first_half < second_half else diffs_second
    for switch in diffs:
        first_pointer = 0
        second_pointer = n / 2
        while diff > 0:
            i1 = next_index(l1, l2, first_pointer, n/2, switch[0][0], switch[0][1])
            if i1 == -1: break
            first_pointer = i1 + 1
            i2 = next_index(l1, l2, second_pointer, n, switch[1][0], switch[1][1])
            if i2 == -1: break
            second_pointer = i2 + 1
            diff -= 1
            location[i1], location[i2] = location[i2], location[i1]

if diff != 0:
    print -1
else:
    print " ".join(map(str, location[:n/2]))


n = int(raw_input())
l1 = list(raw_input())
l2 = list(raw_input())

def next_index(arr1, arr2, start, end, v1, v2):
    for i in range(start, end):
        if arr1[i] == v1 and arr2[i] == v2:
            return i
    return -1

first_half = 0
second_half = 0
location = [i for i in range(1, n+1)]

for i in range(n):
    if i < n / 2:
        if l1[i] == "1":
            first_half += 1
    else:
        if l2[i] == "1":
            second_half += 1

diff = abs(first_half - second_half)
diffs_first = [[["0", "1"], ["0", "0"]], [["1", "0"], ["0", "0"]], [["1", "1"], ["0", "1"]], [["1", "1"], ["1", "0"]]]
diffs_second = [[["0", "0"], ["0", "1"]], [["0", "0"], ["1", "0"]], [["0", "1"], ["1", "1"]], [["1", "0"], ["1", "1"]]]

first_pointer = 0
second_pointer = n / 2
x0, x1, y0, y1 = [1, 1, 0, 0] if first_half > second_half else [0, 0, 1, 1]

while diff > 1:
    i1 = next_index(l1, l2, first_pointer, n/2, x0, x1)
    if i1 == -1: break
    first_pointer = i1 + 1
    i2 = next_index(l1, l2, second_pointer, n, y0, y1)
    if i2 == -1: break
    second_pointer = i2 + 1
    diff -= 2
    location[i1], location[i2] = location[i2], location[i1]

diffs = diffs_first if first_half > second_half else diffs_second
for i in range(n):
    any_diff = False
    for switch in diffs:
        first_pointer = 0
        second_pointer = n / 2
        while diff > 0:
            i1 = next_index(l1, l2, first_pointer, n/2, switch[0][0], switch[0][1])
            if i1 == -1: break
            first_pointer = i1 + 1
            i2 = next_index(l1, l2, second_pointer, n, switch[1][0], switch[1][1])
            if i2 == -1: break
            any_diff = True
            second_pointer = i2 + 1
            diff -= 1
            location[i1], location[i2] = location[i2], location[i1]
    if not any_diff: break

if diff != 0:
    print -1
else:
    print " ".join(map(str, location[:n/2]))


n = int(raw_input())
l1 = list(raw_input())
l2 = list(raw_input())

def next_index(arr1, arr2, start, end, v1, v2):
    for i in range(start, end):
        if arr1[i] == v1 and arr2[i] == v2:
            return i
    return -1

first_half = 0
second_half = 0
location = [i for i in range(1, n+1)]

for i in range(n):
    if i < n / 2:
        if l1[i] == "1":
            first_half += 1
    else:
        if l2[i] == "1":
            second_half += 1

diff = abs(first_half - second_half)
diffs_first = [[["0", "1"], ["0", "0"]], [["1", "0"], ["0", "0"]], [["1", "1"], ["0", "1"]], [["1", "1"], ["1", "0"]]]
diffs_second = [[["0", "0"], ["0", "1"]], [["0", "0"], ["1", "0"]], [["0", "1"], ["1", "1"]], [["1", "0"], ["1", "1"]]]

first_pointer = 0
second_pointer = n / 2

while diff > 1:
    x0, x1, y0, y1 = [1, 1, 0, 0] if first_half > second_half else [0, 0, 1, 1]
    i1 = next_index(l1, l2, first_pointer, n/2, x0, x1)
    if i1 == -1: break
    first_pointer = i1 + 1
    i2 = next_index(l1, l2, second_pointer, n, y0, y1)
    if i2 == -1: break
    second_pointer = i2 + 1
    diff -= 2
    location[i1], location[i2] = location[i2], location[i1]

diffs = diffs_first if first_half > second_half else diffs_second
for switch in diffs:
    first_pointer = 0
    second_pointer = n / 2
    while diff > 0:
        i1 = next_index(l1, l2, first_pointer, n/2, switch[0][0], switch[0][1])
        if i1 == -1: break
        first_pointer = i1 + 1
        i2 = next_index(l1, l2, second_pointer, n, switch[1][0], switch[1][1])
        if i2 == -1: break
        second_pointer = i2 + 1
        diff -= 1
        location[i1], location[i2] = location[i2], location[i1]

if diff > 0:
    print -1
if diff == 0:
    print " ".join(map(str, location[:n/2]))


rr = raw_input
n = int(rr())
A = map(int, rr())
B = map(int, rr())

def solve(N, A, B):
    count = [0] * 4
    for i in xrange(N):
        count[2 * A[i] + B[i]] += 1
    na, nb, nc, nd = count
    for c in xrange(nc + 1):
        for b in xrange(nb + 1):
            d = nb-b+nd-c
            if d & 1: continue
            d >>= 1
            a = N / 2 -b-c-d
            if a < 0: continue
            # answer a,b,c,d
            ans = []
            ansct = [a,b,c,d]
            for i in xrange(N):
                code = 2 * A[i] + B[i]
                if ansct[code]:
                    ansct[code] -= 1
                    ans.append(i + 1)
            return ans
    return

ans = solve(n, A, B)
if ans is None:
    print -1
else:
    print " ".join(map(str, ans))


rr = raw_input
n = int(rr())
A = map(int, rr())
B = map(int, rr())

def solve(N, A, B):
    count = [0] * 4
    for i in xrange(N):
        count[2 * A[i] + B[i]] += 1
    na, nb, nc, nd = count
    for c in xrange(nc + 1):
        for b in xrange(nb + 1):
            d = nb-b+nd-c
            if d & 1: continue
            d >>= 1
            a = N / 2 -b-c-d
            if not(0<=a<=na): continue
            if not(0<=d<=nd): continue
            # answer a,b,c,d
            #print("!", a,b,c,d)
            ans = []
            ansct = [a,b,c,d]
            for i in xrange(N):
                code = 2 * A[i] + B[i]
                if ansct[code]:
                    ansct[code] -= 1
                    ans.append(i + 1)
            return ans
    return

ans = solve(n, A, B)
if ans is None:
    print -1
else:
    print " ".join(map(str, ans))


rr = raw_input
n = int(rr())
A = map(int, rr())
B = map(int, rr())

def solve(N, A, B):
    if sum(A) + sum(B) < N: return
    ans = []
    both = []
    for i in range(N):
        if A[i] == B[i] == 0:
            return
        if A[i] != B[i]:
            a += A[i]
            b += B[i]
            if A[i]:
                ans.append(i)
        else:
            both.append(i)

    for i in both:
        if len(ans) < N / 2:
            ans.append(i)
    if len(ans) < N/2:
        return
    return ans

ans = solve(n, A, B)
if ans is None:
    print -1
else:
    print " ".join(map(str, ans))


rr = raw_input
n = int(rr())
A = map(int, rr())
B = map(int, rr())

def solve(N, A, B):
    count = [0] * 4
    for i in xrange(N):
        count[2 * A[i] + B[i]] += 1
    na, nb, nc, nd = count
    for c in xrange(nc + 1):
        for b in xrange(nb + 1):
            d = nb-b+nd-c
            if d & 1: continue
            d >>= 1
            a = N / 2 -b-c-d
            if not(0<=a<=na): continue
            if not(0<=d<=nd): continue
            # answer a,b,c,d
            print("!", a,b,c,d)
            ans = []
            ansct = [a,b,c,d]
            for i in xrange(N):
                code = 2 * A[i] + B[i]
                if ansct[code]:
                    ansct[code] -= 1
                    ans.append(i + 1)
            return ans
    return

ans = solve(n, A, B)
if ans is None:
    print -1
else:
    print " ".join(map(str, ans))


n = input()
c = raw_input().strip()
a = raw_input().strip()

sz = n // 2

t = [[], [], [], []]

for i in xrange(n):
    if c[i] == '0' and a[i] == '0': t[0].append(i)
    elif c[i] == '0' and a[i] == '1': t[1].append(i)
    elif c[i] == '1' and a[i] == '0': t[2].append(i)
    else: t[3].append(i)

t0, t1, t2, t3 = len(t[0]), len(t[1]), len(t[2]), len(t[3])

lhs = t1 + t3

flag = 0
for a in xrange(t1 + 1):
    for b in xrange(t2 + 1):
        diff = lhs - a - b
        if diff & 1: continue
        c = diff // 2

        if c <= t3 and c >= 0:
            if a + b + c <= sz:
                x = sz - (a + b + c)
                if x <= t0:
                    flag = 1
                    tup = [x, a, b, c]
                    break

    if flag == 1: break

if flag == 0: print -1
else:
    out = []
    for i in xrange(x):
        out.append(str(t[0][i] + 1))
    for i in xrange(a):
        out.append(str(t[1][i] + 1))
    for i in xrange(b):
        out.append(str(t[2][i] + 1))
    for i in xrange(c):
        out.append(str(t[3][i] + 1))

    print ' '.join(out)


n=int(input())
aa=input()
bb=input()
s=[0]*n
t=[0]*n
ans=[0]*(n)
for i in range(n):
	s[i]=aa[i]
	t[i]=bb[i]
	ans[i]=i+1

k=n//2
cs,at=0,0
for i in range(n//2):
	if s[i]=='1':
		cs+=1
	if t[k+i]=='1':
		at+=1
if cs == at:
	for i in range(n//2):
		print(i+1,end=" ")
	print()
	exit()
else:
	for i in range(k):
		for j in range(k,n,1):
			ncs=cs
			nat=at
			if s[i]=='1':
				ncs-=1
			if t[j]=='1':
				nat-=1
			if s[j]=='1':
				ncs+=1
			if t[i]=='1':
				nat+=1
			if abs(ncs-nat)<abs(cs-at):
				s[i],s[j]=s[j],s[i]
				t[i],t[j]=t[j],t[i]
				ans[i],ans[j]=ans[j],ans[i]
				cs=ncs
				at=nat
		if cs==at:
			break
if cs == at:
	print(*ans[:n//2])
else:
	print("-1")


from sys import stdin, stdout

n = int(stdin.readline())
a = [int(x) for x in stdin.readline().strip()]
c = [int(x) for x in stdin.readline().strip()]
ind = [[],[],[],[]]

for i in range(len(a)):
  ind[2*a[i]+c[i]].append(i+1)

cnt = []
r = []

for i in range(n//2 + 1): #numbers in set 1 with first bit set
  for j in range(i+1): # number of 10 in first set
    if j > len(ind[2]):
      continue;
    if i-j > len(ind[3]):
      continue;
    cnt = [len(x) for x in ind]
    cnt[2] -= j
    cnt[3] += - i + j
    cnt1soll = i - cnt[3]
    cnt0soll = n//2 - i - cnt[2]
    if cnt1soll >= 0 and cnt1soll <= cnt[1] and cnt0soll >= 0 and cnt0soll <= cnt[0]:
      #print(cnt)
      #print('i: ', i, ', j: ', j)
      for x in range(j):
        r.append(ind[2][x])
      for x in range(i-j):
        r.append(ind[3][x])
      for x in range(cnt[1]-cnt1soll):
        r.append(ind[1][x])
      for x in range(cnt[0]-cnt0soll):
        r.append(ind[0][x])
      break;
  else:
    continue;
  break;
else:
  r = [-1]

r = [str(x) for x in r]
r.append('\n')
stdout.write(" ".join(r))


from sys import stdin, stdout

n = int(stdin.readline())
a = [int(x) for x in stdin.readline().strip()]
c = [int(x) for x in stdin.readline().strip()]
ind = [[],[],[],[]]

for i in range(len(a)):
  ind[2*a[i]+c[i]].append(i+1)

cnt = []
r = []

for i in range(n//2 + 1): #numbers in set 1 with first bit set
  for j in range(i+1): # number of 10 in first set
    if j > len(ind[2]):
      continue;
    if i-j > len(ind[3]):
      continue;
    cnt = [len(x) for x in ind]
    cnt[2] -= j
    cnt[3] += - i + j
    cnt1soll = i - cnt[3]
    cnt0soll = n//2 - i - cnt[2]
    if cnt1soll >= 0 and cnt1soll <= cnt[1] and cnt0soll >= 0 and cnt0soll <= cnt[0]:
      #print(cnt)
      #print('i: ', i, ', j: ', j)
      for x in range(j):
        r.append(ind[2][x])
      for x in range(i-j):
        r.append(ind[3][x])
      for x in range(cnt[1]-cnt1soll):
        r.append(ind[1][x])
      for x in range(cnt[0]-cnt0soll):
        r.append(ind[0][x])
      break;
  else:
    continue;
  break;
else:
  r = [-1]

for x in r:
  print(x, end=' ')
print('')
#  stdout.write(x, end=' ')
#stdout.write('')


from sys import stdin, stdout

n = int(stdin.readline())
a = [int(x) for x in stdin.readline().strip()]
c = [int(x) for x in stdin.readline().strip()]
ind = [[],[],[],[]]

for i in range(len(a)):
  ind[2*a[i]+c[i]].append(i+1)

cnt = []
r = []

for i in range(n//2 + 1): #numbers in set 1 with first bit set
  for j in range(i+1): # number of 10 in first set
    if j > len(ind[2]):
      continue;
    if i-j > len(ind[3]):
      continue;
    cnt = [len(x) for x in ind]
    cnt[2] -= j
    cnt[3] += - i + j
    cnt1soll = i - cnt[3]
    cnt0soll = n//2 - i - cnt[2]
    if cnt1soll >= 0 and cnt1soll <= cnt[1] and cnt0soll >= 0 and cnt0soll <= cnt[0]:
      #print(cnt)
      #print('i: ', i, ', j: ', j)
      for x in range(j):
        r.append(ind[2][x])
        print('...')
      for x in range(i-j):
        r.append(ind[3][x])
      for x in range(cnt[1]-cnt1soll):
        r.append(ind[1][x])
      for x in range(len(ind[0])-cnt0soll):
        r.append(ind[0][x])
      break;
  else:
    continue;
  break;
else:
  #print('.')
  r = [-1]

for x in r:
  print(x, end=' ')
print('')
#  stdout.write(x, end=' ')
#stdout.write('')


n = int(input())
c = input()
a = input()
zer = []
ones = []
clown = []
acrob = []
for i in range(n):
    if int(c[i]) == int(a[i]) == 0:
        zer.append(i + 1)
    elif int(c[i]) == int(a[i]):
        ones.append(i + 1)
    elif c[i] == '1':
        clown.append(i + 1)
    else:
        acrob.append(i + 1)
O = len(ones)
A = len(acrob)
C = len(clown)
Z = len(zer)
if C > n // 2 or A > n // 2:
    print(-1)
elif len(ones) % 2 == 0:
    O1 = O // 2
    for i in range(O1):
        print(ones[i], end=' ')
    for i in acrob:
        print(i, end=' ')
    for i in range(n // 2 - O1 - len(acrob)):
        print(zer[i], end=' ')
else:
    O1 = O // 2 + 1
    for i in range(O1):
        print(ones[i], end=' ')
    for i in acrob[1:]:
        print(i, end=' ')
    for i in range(n // 2 - O1 - max(0, len(acrob) - 1)):
        print(zer[i], end=' ')


n = int(input())
c = input()
a = input()
zer = []
ones = []
clown = []
acrob = []
for i in range(n):
    if int(c[i]) == int(a[i]) == 0:
        zer.append(i + 1)
    elif int(c[i]) == int(a[i]):
        ones.append(i + 1)
    elif c[i] == '1':
        clown.append(i + 1)
    else:
        acrob.append(i + 1)
O = len(ones)
A = len(acrob)
C = len(clown)
Z = len(zer)
if C > n // 2 or A > n // 2:
    print(-1)
elif len(ones) % 2 == 0:
    O1 = O // 2
    for i in range(O1):
        print(ones[i], end=' ')
    for i in acrob:
        print(i, end=' ')
    for i in range(n // 2 - O1 - len(acrob)):
        print(zer[i], end=' ')
else:
    O1 = O // 2 + 1
    for i in range(O1):
        print(ones[i], end=' ')
    for i in acrob[1:]:
        print(i, end=' ')
    for i in range(n // 2 - O1 - len(acrob) + 1):
        print(zer[i], end=' ')


n = int(input())
s = input()
t = input()
A = []
B = []
C = []
D = []
a, b, c, d = 0, 0, 0, 0
for i in range(n):
    f = s[i] + t[i]
    if f == '00':
        d += 1
        D.append(i + 1)
    elif f == '01':
        a += 1
        A.append(i + 1)
    elif f == '11':
        c += 1
        C.append(i + 1)
    else:
        b += 1
        B.append(i + 1)
for x1 in range(a + 1):
    for x2 in range(b + 1):
        if (a + c - x1 - x2) % 2 == 0:
            x3 = (a + c - x1 - x2) // 2
            x4 = n // 2 - x1 - x2 - x3
            if 0 <= x3 <= c and 0 <= x4 <= d:
                ans = []
                for i in range(x1):
                    ans.append(A[i])
                for i in range(x2):
                    ans.append(B[i])
                for i in range(x3):
                    ans.append(C[i])
                for i in range(x4):
                    ans.append(D[i])
                print(' '.join(list(map(str, ans))))
                exit(0)
print(-1)


x=int(input())
s1=input()
s2=input()
a=[]
b=[]
c=[]
d=[]
for i in range(len(s1)):
    if(s1[i]=='0' and s2[i]=='0'):
        a.append(i+1)
    elif(s1[i]=='1' and s2[i]=='0'):
        b.append(i+1)
    elif(s1[i]=='0' and s2[i]=='1'):
        c.append(i+1)
    else:
        d.append(i+1)
flag=1
for i in range(len(a)+1):
    for j in range(len(b)+1):
        if(flag==0):
            continue;
        a1=i
        a2=len(a)-i
        b1=j
        b2=len(b)-j
        c1=a2+b2-a1
        if(c1<0):
            continue;
        c2=len(c)-c1
        p=c2-b1 #d1-d2
        q=len(d) #d1+d2
        if((p+q)%2!=0):
            continue;
        if(((p+q)//2)>=0):
            d1=(p+q)//2
            d2=q-d1
        if(min(a1,a2,b1,b2,c1,c2,d1,d2)<0):
            continue;
        else:
            flag=0

if(flag==1):
    print(-1)
else:

    ans=[]
    for i in range(a1):
        ans.append(a[i])
    for i in range(b1):
        ans.append(b[i])
    for i in range(c1):
        ans.append(c[i])
    for i in range(d1):
        ans.append(d[i])
    print(*ans)


x=int(input())
s1=input()
s2=input()
a=[]
b=[]
c=[]
d=[]
for i in range(len(s1)):
    if(s1[i]=='0' and s2[i]=='0'):
        a.append(i+1)
    elif(s1[i]=='1' and s2[i]=='0'):
        b.append(i+1)
    elif(s1[i]=='0' and s2[i]=='1'):
        c.append(i+1)
    else:
        d.append(i+1)
flag=1

for i in range(len(a)+1):
    for j in range(len(b)+1):
        if(flag==0):
            continue;
        a1=i
        a2=len(a)-i
        b1=j
        b2=len(b)-j
        c1=a2+b2-a1
        if(c1<0):
            continue;
        c2=len(c)-c1
        p=c2-b1 #d1-d2
        q=len(d) #d1+d2
        if((p+q)%2!=0):
            continue;
        if(((p+q)//2)>=0):
            d1=(p+q)//2
            d2=q-d1
        else:
            continue;
        if(min(a1,a2,b1,b2,c1,c2,d1,d2)<0):
            continue;
        else:
            flag=0

if(flag==1):
    print(-1)
else:

    ans=[]
    for i in range(a1):
        ans.append(a[i])
    for i in range(b1):
        ans.append(b[i])
    for i in range(c1):
        ans.append(c[i])
    for i in range(d1):
        ans.append(d[i])
    print(*ans)


n = int(input())

s1 = input()

s2 = input()

count1 = 0
count2 = 0
count3 = 0
count4 = 0

l1 = []
l2 = []
l3 = []
l4 = []

for i in range(n):
    if s1[i] == '1' and s2[i] == '0':
        count1+=1
        l1.append(i+1)
    if s1[i] == '0' and s2[i] == '1':
        count2+=1
        l2.append(i+1)
    if s1[i] == '0' and s2[i] == '0':
        count3+=1
        l3.append(i+1)
    if s1[i] == '1' and s2[i] == '1':
        count4+=1
        l4.append(i+1)

if len(l1)<=len(l2):

    ka = []
    z = (len(l4) + len(l2) - len(l1))
    while z%2!=0:

        h = l2.pop(0)
        z = (len(l4) + len(l2) - len(l1))
        ka.append(h)

    z = z//2
    if len(l4)>=z:
        for i in range(z):
            l1.append(l4[i])
    for i in ka:
        l1.append(i)
    for i in l4:
        if i not in l1:
            l2.append(i)

elif len(l2)<len(l1):

    ka = []
    z = (len(l4) + len(l1) - len(l2))
    while z%2!=0:

        h = l1.pop(0)
        z = (len(l4) + len(l1) - len(l2))
        ka.append(h)
    z = z//2

    if len(l4)>=z:
        for i in range(z):
            l2.append(l4[i])
    for i in ka:
        l2.append(i)
    for i in l4:
        if i not in l2:
            l1.append(i)

if len(l1)>len(l2):
    for i in l3:
        l2.append(i)

    while len(l1)!=len(l2) and l2!=[]:
        z = l2.pop()
        if z not in l3:
          if len(l1)!=len(l2):
            print(-1)
            exit()
          else:
              print(*l1)
              break
        else:
            l1.append(z)
    if len(l1)!=len(l2):
        print(-1)
        exit()
    print(*l1)

elif len(l2)>len(l1):
    for i in l3:
        l1.append(i)

    while len(l1)!=len(l2) and l1!=[]:
        z = l1.pop()
        if z not in l3:
            if len(l1)!=len(l2):
                print(-1)
                exit()
            else:
                print(*l1)
                exit()
        else:
            l2.append(z)
    if len(l1)!=len(l2):
        print(-1)
        exit()
    print(*l1)
else:
    if len(l3)%2!=0:
        print(-1)

    else:
        for i in range(len(l3)):
            if i%2 == 0:
                l1.append(l3[i])
            else:
                l2.append(l3[i])
    print(*l1)


n = int(input())

s1 = input()

s2 = input()

count1 = 0
count2 = 0
count3 = 0
count4 = 0

l1 = []
l2 = []
l3 = []
l4 = []

for i in range(n):
    if s1[i] == '1' and s2[i] == '0':
        count1+=1
        l1.append(i+1)
    if s1[i] == '0' and s2[i] == '1':
        count2+=1
        l2.append(i+1)
    if s1[i] == '0' and s2[i] == '0':
        count3+=1
        l3.append(i+1)
    if s1[i] == '1' and s2[i] == '1':
        count4+=1
        l4.append(i+1)

if len(l1)<=len(l2):

    ka = []
    z = (len(l4) + len(l2) - len(l1))
    while z%2!=0:

        h = l2.pop(0)
        z = (len(l4) + len(l2) - len(l1))
        ka.append(h)

    z = z//2
    if len(l4)>=z:
        for i in range(z):
            l1.append(l4[i])
    for i in ka:
        l1.append(i)
    for i in l4:
        if i not in l1:
            l2.append(i)

elif len(l2)<len(l1):

    ka = []
    z = (len(l4) + len(l1) - len(l2))
    while z%2!=0:

        h = l1.pop(0)
        z = (len(l4) + len(l1) - len(l2))
        ka.append(h)
    z = z//2

    if len(l4)>=z:
        for i in range(z):
            l2.append(l4[i])
    for i in ka:
        l2.append(i)
    for i in l4:
        if i not in l2:
            l1.append(i)

if len(l1)>len(l2):
    for i in l3:
        l2.append(i)

    while len(l1)!=len(l2) and l2!=[]:
        z = l2.pop(0)
        if z!='0':
          if len(l1)!=len(l2):
            print(-1)
            exit()
          else:
              print(*l1)
              break
        else:
            l1.append(z)
    if len(l1)!=len(l2):
        print(-1)
        exit()
    print(*l1)

elif len(l2)>len(l1):
    for i in l3:
        l1.append(i)

    while len(l1)!=len(l2) and l1!=[]:
        z = l1.pop(0)
        if z!='0':
            if len(l1)!=len(l2):
                print(-1)
                exit()
            else:
                print(*l1)
                exit()
        else:
            l2.append(z)
    if len(l1)!=len(l2):
        print(-1)
        exit()
    print(*l1)
else:
    if len(l3)%2!=0:
        print(-1)

    else:
        for i in range(len(l3)):
            if i%2 == 0:
                l1.append(l3[i])
            else:
                l2.append(l3[i])
    print(*l1)


n = int(input())

s1 = input()

s2 = input()

count1 = 0
count2 = 0
count3 = 0
count4 = 0

l1 = set()
l2 = set()
l3 = set()
l4 = set()

for i in range(n):
    if s1[i] == '1' and s2[i] == '0':
        count1+=1
        l1.add(i+1)
    if s1[i] == '0' and s2[i] == '1':
        count2+=1
        l2.add(i+1)
    if s1[i] == '0' and s2[i] == '0':
        count3+=1
        l3.add(i+1)
    if s1[i] == '1' and s2[i] == '1':
        count4+=1
        l4.add(i+1)
ka = {}
a,b,c,d = -1,-1,-1,-1

for i in range(count3+1):
    for j in range(count4+1):
        if j-i == count4+count2 - n//2:
            ka[(i+j)] = (i,j)

for i in range(count1+1):
    flag = 1
    for j in range(count2+1):
        if n//2 - (i+j) in ka:
            x,y = ka[n//2 - (i+j)]
            flag = 0
            a,b,c,d = i,j,x,y
            break
    if not flag:
        break

if a!=-1 and b!=-1 and c!=-1 and d!=-1:
    ans = []
    l1 =  list(l1)
    l2 =  list(l2)
    l3 =  list(l3)
    l4 =  list(l4)
    for i in range(a):
        ans.append(l1[i])
    for i in range(b):
        ans.append(l2[i])
    for i in range(c):
        ans.append(l3[i])
    for i in range(d):
        ans.append(l4[i])

    print(*ans)

else:
    print(-1)


n = int(input())

s1 = input()

s2 = input()

count1 = 0
count2 = 0
count3 = 0
count4 = 0

l1 = []
l2 = []
l3 = []
l4 = []

for i in range(n):
    if s1[i] == '1' and s2[i] == '0':
        count1+=1
        l1.append(i+1)
    if s1[i] == '0' and s2[i] == '1':
        count2+=1
        l2.append(i+1)
    if s1[i] == '0' and s2[i] == '0':
        count3+=1
        l3.append(i+1)
    if s1[i] == '1' and s2[i] == '1':
        count4+=1
        l4.append(i+1)

if len(l1)<=len(l2):

    ka = []
    z = (len(l4) + len(l2) - len(l1))//2
    while z%2!=0:
        z = (len(l4) + len(l2) - len(l1))//2
        h = l2.pop(0)
        ka.append(h)

    if len(l4)>=z:
        for i in range(z):
            l1.append(l4[i])
    for i in ka:
        l1.append(i)
    for i in l4:
        if i not in l1:
            l2.append(i)

elif len(l2)<len(l1):

    ka = []
    z = (len(l4) + len(l1) - len(l2))//2
    while z%2!=0:
        z = (len(l4) + len(l1) - len(l2))//2
        h = l1.pop(0)
        ka.append(h)

    if len(l4)>=z:
        for i in range(z):
            l2.append(l4[i])
    for i in ka:
        l2.append(i)
    for i in l4:
        if i not in l2:
            l1.append(i)

if len(l1)>len(l2):
    for i in l3:
        l2.append(i)

    while len(l1)!=len(l2):
        z = l2.pop(0)
        if z!='0':
          if len(l1)!=len(l2):
            print(-1)
            exit()
          else:
              print(*l1)
              break
        else:
            l1.append(z)
    if len(l1)!=len(l2):
        print(-1)
        exit()
    print(*l1)

elif len(l2)>len(l1):
    for i in l3:
        l1.append(i)

    while len(l1)!=len(l2):
        z = l1.pop(0)
        if z!='0':
            if len(l1)!=len(l2):
                print(-1)
                exit()
            else:
                print(*l1)
                exit()
        else:
            l2.append(z)
    if len(l1)!=len(l2):
        print(-1)
        exit()
    print(*l1)
else:
    if len(l3)%2!=0:
        print(-1)

    else:
        for i in range(len(l3)):
            if i%2 == 0:
                l1.append(l3[i])
            else:
                l2.append(l3[i])
    print(*l1)


n = int(input())

s1 = input()

s2 = input()

count1 = 0
count2 = 0
count3 = 0
count4 = 0

l1 = []
l2 = []
l3 = []
l4 = []

for i in range(n):
    if s1[i] == '1' and s2[i] == '0':
        count1+=1
        l1.append(i+1)
    if s1[i] == '0' and s2[i] == '1':
        count2+=1
        l2.append(i+1)
    if s1[i] == '0' and s2[i] == '0':
        count3+=1
        l3.append(i+1)
    if s1[i] == '1' and s2[i] == '1':
        count4+=1
        l4.append(i+1)

if len(l1)<=len(l2):

    ka = []
    z = (len(l4) + len(l2) - len(l1))
    while z%2!=0:

        h = l2.pop(0)
        z = (len(l4) + len(l2) - len(l1))
        ka.append(h)

    z = z//2
    if len(l4)>=z:
        for i in range(z):
            l1.append(l4[i])
    for i in ka:
        l1.append(i)
    for i in l4:
        if i not in l1:
            l2.append(i)

elif len(l2)<len(l1):

    ka = []
    z = (len(l4) + len(l1) - len(l2))
    while z%2!=0:

        h = l1.pop(0)
        z = (len(l4) + len(l1) - len(l2))
        ka.append(h)
    z = z//2

    if len(l4)>=z:
        for i in range(z):
            l2.append(l4[i])
    for i in ka:
        l2.append(i)
    for i in l4:
        if i not in l2:
            l1.append(i)

if len(l1)>len(l2):
    for i in l3:
        l2.append(i)

    while len(l1)!=len(l2) and l2!=[]:
        z = l2.pop()
        if z!='0':
          if len(l1)!=len(l2):
            print(-1)
            exit()
          else:
              print(*l1)
              break
        else:
            l1.append(z)
    if len(l1)!=len(l2):
        print(-1)
        exit()
    print(*l1)

elif len(l2)>len(l1):
    for i in l3:
        l1.append(i)

    while len(l1)!=len(l2) and l1!=[]:
        z = l1.pop()
        if z!='0':
            if len(l1)!=len(l2):
                print(-1)
                exit()
            else:
                print(*l1)
                exit()
        else:
            l2.append(z)
    if len(l1)!=len(l2):
        print(-1)
        exit()
    print(*l1)
else:
    if len(l3)%2!=0:
        print(-1)

    else:
        for i in range(len(l3)):
            if i%2 == 0:
                l1.append(l3[i])
            else:
                l2.append(l3[i])
    print(*l1)


n = int(input())

s1 = input()

s2 = input()

count1 = 0
count2 = 0
count3 = 0
count4 = 0

l1 = []
l2 = []
l3 = []
l4 = []

for i in range(n):
    if s1[i] == '1' and s2[i] == '0':
        count1+=1
        l1.append(i+1)
    if s1[i] == '0' and s2[i] == '1':
        count2+=1
        l2.append(i+1)
    if s1[i] == '0' and s2[i] == '0':
        count3+=1
        l3.append(i+1)
    if s1[i] == '1' and s2[i] == '1':
        count4+=1
        l4.append(i+1)
if len(l1) == len(l2) and  (len(l4)+len(l3))%2 == 0 and len(l4)%2 == 0 and len(l3)%2 == 0:

        for i in range(len(l3)):
            if i%2 == 0:
                l1.append(l3[i])
            else:
                l2.append(l3[i])
        for i in range(len(l4)):
            if i%2 == 0:
                l1.append(l4[i])
            else:
                l2.append(l4[i])
        print(*l1)

        exit()

if len(l1)<len(l2):

    ka = []
    z = (len(l4) + len(l2) - len(l1))
    while z%2!=0:

        h = l2.pop(0)
        z = (len(l4) + len(l2) - len(l1))
        ka.append(h)

    z = z//2
    if len(l4)>=z:
        for i in range(z):
            l1.append(l4[i])
    for i in ka:
        l1.append(i)
    for i in l4:
        if i not in l1:
            l2.append(i)

elif len(l2)<=len(l1):

    ka = []
    z = (len(l4) + len(l1) - len(l2))
    while z%2!=0:

        h = l1.pop(0)
        z = (len(l4) + len(l1) - len(l2))
        ka.append(h)
    z = z//2

    if len(l4)>=z:
        for i in range(z):
            l2.append(l4[i])
    for i in ka:
        l2.append(i)
    for i in l4:
        if i not in l2:
            l1.append(i)

if len(l1)>len(l2):
    for i in l3:
        l2.append(i)

    while len(l1)!=len(l2) and l2!=[]:
        z = l2.pop()
        if z not in l3:
          if len(l1)!=len(l2):
            print(-1)
            exit()

        else:
            l1.append(z)
    if len(l1)!=len(l2):
        print(-1)
        exit()
    print(*l1)

elif len(l2)>len(l1):
    for i in l3:
        l1.append(i)

    while len(l1)!=len(l2) and l1!=[]:
        z = l1.pop()
        if z not in l3:
            if len(l1)!=len(l2):
                print(-1)
                exit()

        else:
            l2.append(z)
    if len(l1)!=len(l2):
        print(-1)
        exit()
    print(*l1)
else:
    if len(l3)%2!=0:
        print(-1)

    else:
        for i in range(len(l3)):
            if i%2 == 0:
                l1.append(l3[i])
            else:
                l2.append(l3[i])
    print(*l1)


n = int(input())

s1 = input()

s2 = input()

count1 = 0
count2 = 0
count3 = 0
count4 = 0

l1 = []
l2 = []
l3 = []
l4 = []

for i in range(n):
    if s1[i] == '1' and s2[i] == '0':
        count1+=1
        l1.append(i+1)
    if s1[i] == '0' and s2[i] == '1':
        count2+=1
        l2.append(i+1)
    if s1[i] == '0' and s2[i] == '0':
        count3+=1
        l3.append(i+1)
    if s1[i] == '1' and s2[i] == '1':
        count4+=1
        l4.append(i+1)

if len(l1)<=len(l2):

    ka = []
    z = (len(l4) + len(l2) - len(l1))
    while z%2!=0:

        h = l2.pop(0)
        z = (len(l4) + len(l2) - len(l1))
        ka.append(h)

    z = z//2
    if len(l4)>=z:
        for i in range(z):
            l1.append(l4[i])
    for i in ka:
        l1.append(i)
    for i in l4:
        if i not in l1:
            l2.append(i)

elif len(l2)<len(l1):

    ka = []
    z = (len(l4) + len(l1) - len(l2))
    while z%2!=0:

        h = l1.pop(0)
        z = (len(l4) + len(l1) - len(l2))
        ka.append(h)
    z = z//2

    if len(l4)>=z:
        for i in range(z):
            l2.append(l4[i])
    for i in ka:
        l2.append(i)
    for i in l4:
        if i not in l2:
            l1.append(i)

if len(l1)>len(l2):
    for i in l3:
        l2.append(i)

    while len(l1)!=len(l2) and l2!=[]:
        z = l2.pop()
        if z not in l3:
          if len(l1)!=len(l2):
            print(-1)
            exit()

        else:
            l1.append(z)
    if len(l1)!=len(l2):
        print(-1)
        exit()
    print(*l1)

elif len(l2)>len(l1):
    for i in l3:
        l1.append(i)

    while len(l1)!=len(l2) and l1!=[]:
        z = l1.pop()
        if z not in l3:
            if len(l1)!=len(l2):
                print(-1)
                exit()

        else:
            l2.append(z)
    if len(l1)!=len(l2):
        print(-1)
        exit()
    print(*l1)
else:
    if len(l3)%2!=0:
        print(-1)

    else:
        for i in range(len(l3)):
            if i%2 == 0:
                l1.append(l3[i])
            else:
                l2.append(l3[i])
    print(*l1)


n = int(input())

s1 = input()

s2 = input()

count1 = 0
count2 = 0
count3 = 0
count4 = 0

l1 = []
l2 = []
l3 = []
l4 = []

for i in range(n):
    if s1[i] == '1' and s2[i] == '0':
        count1+=1
        l1.append(i+1)
    if s1[i] == '0' and s2[i] == '1':
        count2+=1
        l2.append(i+1)
    if s1[i] == '0' and s2[i] == '0':
        count3+=1
        l3.append(i+1)
    if s1[i] == '1' and s2[i] == '1':
        count4+=1
        l4.append(i+1)

if len(l1)<=len(l2):

    ka = []
    z = (len(l4) + len(l2) - len(l1))
    while z%2!=0:

        h = l2.pop(0)
        z = (len(l4) + len(l2) - len(l1))
        ka.append(h)

    z = z//2
    if len(l4)>=z:
        for i in range(z):
            l1.append(l4[i])
    for i in ka:
        l1.append(i)
    for i in l4:
        if i not in l1:
            l2.append(i)

elif len(l2)<len(l1):

    ka = []
    z = (len(l4) + len(l1) - len(l2))
    while z%2!=0:

        h = l1.pop(0)
        z = (len(l4) + len(l1) - len(l2))
        ka.append(h)
    z = z//2

    if len(l4)>=z:
        for i in range(z):
            l2.append(l4[i])
    for i in ka:
        l2.append(i)
    for i in l4:
        if i not in l2:
            l1.append(i)

if len(l1)>len(l2):
    for i in l3:
        l2.append(i)

    while len(l1)!=len(l2):
        z = l2.pop(0)
        if z!='0':
          if len(l1)!=len(l2):
            print(-1)
            exit()
          else:
              print(*l1)
              break
        else:
            l1.append(z)
    if len(l1)!=len(l2):
        print(-1)
        exit()
    print(*l1)

elif len(l2)>len(l1):
    for i in l3:
        l1.append(i)

    while len(l1)!=len(l2):
        z = l1.pop(0)
        if z!='0':
            if len(l1)!=len(l2):
                print(-1)
                exit()
            else:
                print(*l1)
                exit()
        else:
            l2.append(z)
    if len(l1)!=len(l2):
        print(-1)
        exit()
    print(*l1)
else:
    if len(l3)%2!=0:
        print(-1)

    else:
        for i in range(len(l3)):
            if i%2 == 0:
                l1.append(l3[i])
            else:
                l2.append(l3[i])
    print(*l1)


cnt=[0]*4
ans=[0]*4
n=int(input())
c=[int(i) for i in input()]
an=[int(i) for i in input()]
for i in range(n):
    cnt[(c[i]&1)<<1|(an[i]&1)]+=1
fl=1
for d in range(cnt[3]+1):
    a=(n>>1) + d - cnt[1] - cnt[3]
    if a>=0 and a<=cnt[0]:
        bc=cnt[1]+cnt[3]-2*d
        if bc>=0 and bc<=cnt[1]+cnt[2]:
            ans[0]=a
            ans[3]=d
            ans[1]=min(bc,cnt[1])
            ans[2]=bc-ans[1]
            fl=0
if fl==1:
    exit(print(-1))
else:
    for i in range(n):
        tmp=(c[i]&1)<<1|(an[i]&1)
        if ans[tmp]:
            print(i+1,end=' ')
            ans[tmp]-=1


from sys import stdin, stdout

#T = int(input())

#s = input()
N = int(input())

#N,K = [int(x) for x in stdin.readline().split()]
#arr = [int(x) for x in stdin.readline().split()]

clown = input()
acro = input()

clown = list(clown)
acro = list(acro)

k1 = 0
k2 = 0
k3 = 0
k4 = 0

for i in range(N):
    if clown[i]=='0' and acro[i]=='0':
        k1 += 1
    if clown[i]=='0' and acro[i]=='1':
        k2 += 1
    if clown[i]=='1' and acro[i]=='0':
        k3 += 1
    if clown[i]=='1' and acro[i]=='1':
        k4 += 1

a = 0
b = 0
c = 0
d = 0

target = k1 + k3 - k2 - k4

if target%2==1:
    print(-1)
    quit()

if target<0:
    a = 0
    d = -target//2
else:
    a = target//2
    d = 0

valid = 0
for i in range(10000):
    if a<=k1 and d<=k4:
        #print(a,d)
        # b+c = N//2 - a - d, find combination of b+c
        b = N//2 - a - d
        c = 0
        while b>=0 and c>=0:
            if b<=k2 and c<=k3:
                # valid !!!
                #print(a,b,c,d)
                for j in range(N):
                    if clown[j]=='0' and acro[j]=='0' and a>0:
                        print(j+1,end=' ')
                        a -= 1
                    if clown[j]=='0' and acro[j]=='1' and b>0:
                        print(j+1,end=' ')
                        b -= 1
                    if clown[j]=='1' and acro[j]=='0' and c>0:
                        print(j+1,end=' ')
                        c -= 1
                    if clown[j]=='1' and acro[j]=='1' and d>0:
                        print(j+1,end=' ')
                        d -= 1
                quit()
            b -= 1
            c += 1

    else:
        break

    a += 1
    d += 1

print(-1)


from collections import *
from math import *
n = int(input())
s = input()
t = input()
d = dict()
d["00"],d["01"],d["10"],d["11"] = 0,0,0,0
for i in range(n):
	x = s[i]+t[i]
	d[x] += 1
na = d["00"]
nb = d["01"]
nc = d["10"]
nd = d["11"]
for i in range(nb+1):
	for j in range(nc+1):
		b,c = i,j
		if (nb+nd-b-c)%2 == 1: continue
		d = (nb+nd-b-c)//2
		if(d < 0 or d > nd): continue
		a = (n//2)-b-c-d
		if(a < 0 or a > na): continue
		else:
			ans = []
			for i in range(n):
				x = s[i]+t[i]
				if(x == "00" and a != 0):
					ans.append(i+1)
					a -= 1
				if(x == "01" and b != 0):
					ans.append(i+1)
					b -= 1
				if(x == "10" and c != 0):
					ans.append(i+1)
					c -= 1
				if(x == "11" and d != 0):
					ans.append(i+1)
					d -= 1
			print(*ans)
			exit(0)
print(-1)


n=int(input())
a=input()
b=input()
init=sum(int(c) for c in a)
mp=[[] for i in range(3)]
for i in range(n):
    c=int(b[i])+int(a[i])
    mp[c]+=[i+1]
need=n//2
for i in range(len(mp[1])+1):
    for j in range(len(mp[2])+1):
        if i+2*j==init and i+j<=need and i+j+len(mp[0])>=need:
            print(*(mp[0][:need-i-j]+mp[1][:i]+mp[2][:j]))
            exit()
print(-1)


n=int(input())
a=input()
b=input()
init=-sum(int(c) for c in a)
mp={-1: [], 0: [], 1: []}
for i in range(n):
    c=int(b[i])-int(a[i])
    mp[c]+=[i+1]
need=n//2
ans=[]
while init<0:
    if not mp[1]:
        print(-1)
        exit()
    ans+=[mp[1].pop()]
    need-=1
    init+=1
while init>0:
    if not mp[-1]:
        print(-1)
        exit()
    ans+=[mp[-1].pop()]
    need-=1
    init-=1
if need<0:
    print(-1)
    exit()
if need%2>0:
    if not mp[0]:
        print(-1)
        exit()
    ans+=[mp[0].pop()]
    need-=1
o=min(len(mp[-1]), len(mp[1]))
while need>0 and o>0:
    ans+=[mp[-1].pop(), mp[1].pop()]
    need-=2
    o-=1
if len(mp[0])<need:
    print(-1)
    exit()
while need>0:
    ans+=[mp[0].pop()]
    need-=1
print(*ans)


n=int(input())
a=input()
b=input()
init=sum(int(c) for c in b)
mp=[[] for i in range(3)]
for i in range(n):
    c=int(a[i])+int(b[i])
    mp[c]+=[i+1]
need=n//2
for i in range(len(mp[1])+1):
    for j in range(len(mp[2])+1):
        if i+2*j==init and i+j<=need and i+j+len(mp[0])>=need:
            print(*(mp[0][:need-i-j]+mp[1][:i]+mp[2][:j]))
            exit()
print(-1)


n=int(input())
a=input()
b=input()
init=sum(int(c) for c in b)-sum(int(c) for c in a)
mp={-1: [], 0: [], 1: []}
for i in range(n):
    c=int(b[i])-int(a[i])
    mp[c]+=[i+1]
need=n//2
ans=[]
if need%2>0:
    if not mp[0]:
        print(-1)
        exit()
    ans+=[mp[0].pop()]
o=min(len(mp[-1]), len(mp[1]))
while need>0 and o>0:
    ans+=[mp[-1].pop(), mp[1].pop()]
    need-=2
    o-=1
if len(mp[0])<need:
    print(-1)
    exit()
while need>0:
    ans+=[mp[0].pop()]
    need-=1
print(*ans)


n=int(input())
a=input()
b=input()
init=sum(int(c) for c in b)-sum(int(c) for c in a)
mp={-1: [], 0: [], 1: []}
for i in range(n):
    c=int(b[i])-int(a[i])
    mp[c]+=[i+1]
need=n//2
ans=[]
if need%2>0:
    if not mp[0]:
        print(-1)
        exit()
    ans+=[mp[0].pop()]
o=min(len(mp[-1]), len(mp[1]))
while need>0:
    ans+=[mp[-1].pop(), mp[1].pop()]
    need-=2
if len(mp[0])<need:
    print(-1)
    exit()
while need>0:
    ans+=[mp[0].pop()]
    need-=1
print(*ans)


n=int(input())
a=input()
b=input()
init=sum(int(c) for c in b)-sum(int(c) for c in a)
mp={-1: [], 0: [], 1: []}
for i in range(n):
    c=int(b[i])-int(a[i])
    mp[c]+=[i+1]
need=n//2
ans=[]
while init<0:
    if not mp[1]:
        print(-1)
        exit()
    ans+=[mp[1].pop()]
    need-=1
while init>0:
    if not mp[-1]:
        print(-1)
        exit()
    ans+=[mp[-1].pop()]
    need-=1
if need<0:
    print(-1)
    exit()
if need%2>0:
    if not mp[0]:
        print(-1)
        exit()
    ans+=[mp[0].pop()]
o=min(len(mp[-1]), len(mp[1]))
while need>0 and o>0:
    ans+=[mp[-1].pop(), mp[1].pop()]
    need-=2
    o-=1
if len(mp[0])<need:
    print(-1)
    exit()
while need>0:
    ans+=[mp[0].pop()]
    need-=1
print(*ans)


import sys
n = int(input())
cc = input()
aa = input()
na, nb, nc, nd = 0, 0, 0, 0
for i in range(len(aa)):
	if cc[i] == '0' and aa[i] == '0':
		na += 1
	if cc[i] == '0' and aa[i] == '1':
		nb += 1
	if cc[i] == '1' and aa[i] == '0':
		nc += 1
	if cc[i] == '1' and aa[i] == '1':
		nd += 1
ans = []
f = False
for c in range(nc + 1):
	for d in range(nd + 1):
		xx = (n // 2) - (c + d)
		b = (nb + nd) - (2 * d + c)
		a = xx - b
		if a >= 0 and b >= 0 and a <= na and b <= nb:
			ans.append([a, b, c, d])
			f = True
			break
	if f:
		break
if len(ans) == 0:
	print(-1)
	sys.exit(0)
for i in range(len(ans)):
	a = ans[i][0]
	b = ans[i][1]
	c = ans[i][2]
	d = ans[i][3]
	temp = []
	for j in range(len(aa)):
		if a > 0:
			if cc[j] == '0' and aa[j] == '0':
				a -= 1
				temp.append(j)
		if b > 0:
			if cc[j] == '0' and aa[j] == '1':
				b -= 1
				temp.append(j)
		if c > 0:
			if cc[j] == '1' and aa[j] == '0':
				c -= 1
				temp.append(j)
		if d > 0:
			if cc[j] == '1' and aa[j] == '1':
				d -= 1
				temp.append(j)
	if a == 0 and b == 0 and c == 0 and d == 0:
		for ii in temp:
			print(ii + 1,end = " ")
		print()
		sys.exit(0)


from math import *
import math

n = int(input())
c = [int(i) for i in input()]
a = [int(i) for i in input()]

x = 0
y = 0
z = 0
for i in range(n):
    if c[i] and a[i]:
        x += 1
    elif a[i]:
        z += 1
    elif c[i]:
        y += 1
e = n - x - y - z

ha = False

y2 = 0
z2 = 0
d2 = 0

for y1 in range(0, y + 1):
    for z1 in range(0, z + 1):
        d = (x - y1 + z1) / 2
        if d >= 0 and d <= x:
            if int(d) == d:
                if ((y1 + d + z - z1) <= n / 2) and ((z1 + x - d + y - y1) <= n/2):
                    if (e + y1 + d + z - z1 >= n // 2) and (e + z1 + x - d + y - y1 >= n // 2):
                        ha = True
                        z2 = z1
                        y2 = y1
                        d2 = d
                        break
    if ha:
        break

if ha:
    cnt = n//2 - y2 - d2
    cnt1 = y2
    cnt2 = z2
    want = z - z2
    i = 0
    #print(x, y, z)
    #print(d2, y2, z2, cnt)
    while i < n:
        if c[i] and a[i]:
            if d2 > 0:
                d2 -= 1
                print(i + 1, end=' ')
        elif c[i]:
            if cnt1 > 0:
                cnt1 -= 1
                print(i + 1, end=' ')
        elif a[i]:
            if cnt2 > 0:
                cnt2 -= 1
            elif cnt > 0:
                cnt -= 1
                want -= 1
                print(i + 1, end=' ')
        else:
            if cnt > 0 and want < cnt:
                print(i + 1, end=' ')
                cnt -= 1
        i += 1

else:
    print(-1)


from math import *
import math

n = int(input())
c = [int(i) for i in input()]
a = [int(i) for i in input()]

x = 0
y = 0
z = 0
for i in range(n):
    if c[i] and a[i]:
        x += 1
    elif a[i]:
        z += 1
    elif c[i]:
        y += 1
e = n - x - y - z

ha = False

y2 = 0
z2 = 0
d2 = 0

for y1 in range(0, y + 1):
    for z1 in range(0, z + 1):
        d = (x - y1 + z1) / 2
        if x >= d >= 0:
            if int(d) == d:
                if y1 + d <= n / 2 and z1 + x - d <= n/2:
                    if e + y1 + d >= n // 2 and e + z1 + x - d >= n // 2:
                        ha = True
                        z2 = z1
                        y2 = y1
                        d2 = d
                        break
    if ha:
        break

if ha:
    cnt = n//2 - y2 - d2
    cnt1 = y2
    cnt2 = z2
    i = 0
    while i < n:
        if c[i] and a[i]:
            if d2 > 0:
                d2 -= 1
                print(i + 1, end=' ')
        elif c[i]:
            if cnt1 > 0:
                cnt1 -= 1
                print(i + 1, end=' ')
        elif a[i]:
            if cnt2 > 0:
                cnt2 -= 1
            elif cnt > 0:
                cnt -= 1
                print(i + 1, end=' ')
        else:
            if cnt > 0:
                print(i + 1, end=' ')
                cnt -= 1
        i += 1

else:
    print(-1)


from math import *
import math

n = int(input())
c = [int(i) for i in input()]
a = [int(i) for i in input()]

x = 0
y = 0
z = 0
for i in range(n):
    if c[i] and a[i]:
        x += 1
    elif a[i]:
        z += 1
    elif c[i]:
        y += 1
e = n - x - y - z

ha = False

y2 = 0
z2 = 0
d2 = 0

for y1 in range(0, y + 1):
    for z1 in range(0, z + 1):
        d = (x - y1 + z1) / 2
        if x >= d >= 0:
            if int(d) == d:
                if y1 + d <= n / 2 and z1 + x - d <= n/2:
                    if e + y1 + d >= n // 2:
                        ha = True
                        z2 = z1
                        y2 = y1
                        d2 = d
                        break
    if ha:
        break

if ha:
    cnt = n//2 - y2 - d2
    cnt1 = y2
    cnt2 = z2
    i = 0
    while i < n:
        if c[i] and a[i]:
            if d2 > 0:
                d2 -= 1
                print(i + 1, end=' ')
        elif c[i]:
            if cnt1 > 0:
                cnt1 -= 1
                print(i + 1, end=' ')
        elif a[i]:
            if cnt2 > 0:
                cnt2 -= 1
            elif cnt > 0:
                cnt -= 1
                print(i + 1, end=' ')
        else:
            if cnt > 0:
                print(i + 1, end=' ')
                cnt -= 1
        i += 1

else:
    print(-1)


#Code by Sounak, IIESTS
#------------------------------warmup----------------------------

import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
from collections import defaultdict
from itertools import permutations

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

#-------------------game starts now-----------------------------------------------------
n=int(input())
d={v:[] for v in [(0,0),(0,1),(1,0),(1,1)]}
for j,x,y in zip(range(n),map(int,input()),map(int,input())):d[x,y]+=[j+1]
x=n//2
y=len(d[0,1])+len(d[1,1])
x+=x-y
c=min(x,y,len(d[0,1])+len(d[1,0]))
if c%2 != y%2: c -= 1
b=(y-c)//2
a=(x-c)//2
if a<=len(d[0,0]) and 0<=c and b<=len(d[1,1]):
 print(*(d[0,0][:a]+(d[0,1]+d[1,0])[:c]+d[1,1][:b]))
else:
 print(-1)


#include <bits/stdc++.h>

using namespace std;
#define md 1000000007
#define itn int
#define pb push_back
#define mp make_pair
#define ull unsigned long long
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define all(x) x.begin(),x.end()
#define x first
#define lb lower_bound
#define ub upper_bound
#define y second
#define sz(x) (int)x.size()
#define inf 1e9
#define endl '\n'
#define cuot cout
#define dbs long double
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
#define trace(v) for(auto it=v.begin();it!=v.end();it++)cerr<<*it<<" ";cerr<<endl;
#define linf 1e18
#define reset(x) memset(x,0,sizeof(x))
#define rep(i,a,b) for(int i=a;i<b;i++)
#define eps 1e-12
#define randomize srand(chrono::steady_clock::now().time_since_epoch().count());

void fastio(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}

ll n;
string a,b;
void solve(){
	cin>>n;
	cin>>a;cin>>b;
	vector<ll> res;
	rep(i,1,n){
		if(a[i]=='1' and a[i-1]=='0'){
			res.pb(i);
		}
		else if(a[i]=='0' and a[i-1]=='1')
			res.pb(i);
	}
	if(a[n-1]=='1')res.pb(n);
	if(b[n-1]=='1')res.pb(n);
	for(int i=n-2;i>=0;i--){
		if(b[i+1]=='1' and b[i]=='0')
			res.pb(i+1);
		else if(b[i+1]=='0' and b[i]=='1')
			res.pb(i+1);
	}
	cout<<res.size()<<" ";
	for(auto x:res)cout<<x<<" ";
	cout<<endl;
}

int main(){
	fastio();

	int t;
	t=1;
	cin>>t;
	for(int i=1;i<=t;i++){
		// cout<<"Case #"<<i<<": ";
		solve();
	}
	return 0;
}


n = int(input())
c_s = input()
a_s = input()
clowns = []
acrobats = []
both = []
none = []
for i in range(n):
    if a_s[i] == '1' and c_s[i] == '1':
        both.append(i+1)
    elif a_s[i]=='1':
        acrobats.append(i+1)
    elif c_s[i]=='1':
        clowns.append(i+1)
    else:
        none.append(i+1)
nc = len(clowns)
nb = len(acrobats)
nd = len(both)
na = len(none)
# c+b+2d = nb + nd
found = False
for b in range(0,nb+1):
    for c in range( 0, nc+1 ):
        d = (nb + nd - c - b)
        if d%2 == 1: continue
        d = d//2
        a = n//2 - d - c - b
        if d < 0 or d > nd or a > na or a < 0: continue
        found = True
        break
    if found: break

if not found:
    print(-1)
else:
    ans = []
    for i in range(a):
        ans.append( none[i] )
    for i in range(b):
        ans.append( acrobats[i] )
    for i in range(c):
        ans.append( clowns[i] )
    for i in range(d):
        ans.append( both[i] )
    print(*ans)


n = int(input())
c_s = input()
a_s = input()
clowns = []
acrobats = []
both = []
none = []
for i in range(n):
    if a_s[i] == '1' and c_s[i] == '1':
        both.append(i+1)
    elif a_s[i]=='1':
        acrobats.append(i+1)
    elif c_s[i]=='1':
        clowns.append(i+1)
    else:
        none.append(i+1)
nc = len(clowns)
nb = len(acrobats)
nd = len(both)
na = len(none)
# c+b+2d = nb + nd
found = False
for b in range(0,nb+1):
    for c in range( 0, nc+1 ):
        d = (nb + nd - c - b)
        if d%2 == 1: continue
        d = d//2
        a = n//2 - d - c - b
        if d > nd or a > na or a < 0: continue
        found = True
        break
    if found: break

if not found:
    print(-1)
else:
    ans = []
    for i in range(a):
        ans.append( none[i] )
    for i in range(b):
        ans.append( acrobats[i] )
    for i in range(c):
        ans.append( clowns[i] )
    for i in range(d):
        ans.append( both[i] )
    print(*ans)


n = int(input())
c = input()
a = input()
clowns = []
acrobats = []
both = []
none = []
for i in range(n):
    if a[i] == '1' and c[i] == '1':
        both.append(i+1)
    elif a[i]=='1':
        acrobats.append(i+1)
    elif c[i]=='1':
        clowns.append(i+1)
    else:
        none.append(i+1)
nc = len(clowns)
nb = len(acrobats)
nd = len(both)
na = len(none)
# c+b+2d = nb + nd
found = False
for b in range(1,nb+1):
    for c in range( 1, nc+1 ):
        d = (nb + nd - c - b)
        if d%2 == 1: continue
        d = d//2
        a = n//2 - d - c - b
        if d > nd or a > na or a < 0: continue
        found = True
        break
    if found: break

if not found:
    print(-1)
else:
    ans = []
    for i in range(a):
        ans.append( none[i] )
    for i in range(b):
        ans.append( acrobats[i] )
    for i in range(c):
        ans.append( clowns[i] )
    for i in range(d):
        ans.append( both[i] )
    print(*ans)


n = int(input())
c = input()
a = input()
clowns = []
acrobats = []
both = []
none = []
for i in range(n):
    if a[i] == '1' and c[i] == '1':
        both.append(i+1)
    elif a[i]=='1':
        acrobats.append(i+1)
    elif c[i]=='1':
        clowns.append(i+1)
    else:
        none.append(i+1)
ccnt = len(clowns)
acnt = len(acrobats)
bcnt = len(both)
ncnt = len(none)
if ccnt > acnt+bcnt or acnt > ccnt+bcnt:
    print(-1)
else:
    if ccnt < acnt:
        diff = acnt - ccnt
        remain = bcnt - diff
        print( *(clowns+both[:diff] + (both[diff:]+none)[:(remain+ncnt)//2] ) )
    else:
        diff = ccnt - acnt
        remain = bcnt - diff
        print( *(acrobats+both[:diff] + (both[diff:]+none)[:(remain+ncnt)//2] ) )


# map(int, input().split())
# list(map(int, input().split()))
# for _ in range(int(input())):

n = int(input())
c = list(map(int, list(input())))
a = list(map(int, list(input())))

p = [0,0,0,0]
# 00,10,01,11
ind = [[],[],[],[]]

for i in range(n):
    if c[i] and a[i]:
        p[3] += 1
        ind[3].append(i)
    elif c[i]:
        p[1] += 1
        ind[1].append(i)
    elif a[i]:
        p[2] += 1
        ind[2].append(i)
    else:
        p[0] += 1
        ind[0].append(i)

first = [0,p[1],0,0]
second = [0,0,p[2],0]

def trans(i, n):
    first[i] += n
    second[i] -= n

if p[2] > p[1]:
    d = p[2] - p[1]
    first[2] += d
    second[2] -= d
else:
    d = p[1] - p[2]
    first[1] -= d
    second[1] += d

d = p[3]
while d>0:
    if first[1]+first[3] > second[2]+second[3]:
        second[3] += 1
        d -= 1
    else:
        first[3] += 1
        d -= 1

dif = first[1]+first[3] - (second[2]+second[3])

if dif > 0:
    if first[2] > 0:
        trans(2,-1)
    elif first[1] > 0:
        trans(1,-1)
    else:
        print(-1)
        quit()
elif dif < 0:
    if second[1] > 0:
        trans(1,1)
    elif second[2] > 0:
        trans(2,2)
    else:
        print(-1)
        quit()

d = p[0]
while d>0:
    if sum(first) > sum(second):
        second[0] += 1
        d -= 1
    else:
        first[0] += 1
        d -= 1

while sum(first) > sum(second):
    if first[1]>0 and first[2]>0 and second[3]>0:
        trans(1,-1)
        trans(2,-1)
        trans(3,1)
    else:
        print(-1)
        quit()

while sum(first) < sum(second):
    if second[1]>0 and second[2]>0 and first[3]>0:
        trans(1,1)
        trans(2,1)
        trans(3,-1)
    else:
        print(-1)
        quit()

ans = []
for i in range(4):
    for j in range(first[i]):
        ans.append(ind[i][j])

print(' '.join([str(x+1) for x in ans]))


# map(int, input().split())
# list(map(int, input().split()))
# for _ in range(int(input())):

n = int(input())
c = list(map(int, list(input())))
a = list(map(int, list(input())))

p = [0,0,0,0]
# 00,10,01,11
ind = [[],[],[],[]]

for i in range(n):
    if c[i] and a[i]:
        p[3] += 1
        ind[3].append(i)
    elif c[i]:
        p[1] += 1
        ind[1].append(i)
    elif a[i]:
        p[2] += 1
        ind[2].append(i)
    else:
        p[0] += 1
        ind[0].append(i)

first = [0,p[1],0,0]
second = [0,0,p[2],0]

def trans(i, n):
    first[i] += n
    second[i] -= n

if p[2] > p[1]:
    d = p[2] - p[1]
    first[2] += d
    second[2] -= d
else:
    d = p[1] - p[2]
    first[1] -= d
    second[1] += d

d = p[3]
while d>0:
    if first[1]+first[3] > second[2]+second[3]:
        second[3] += 1
        d -= 1
    else:
        first[3] += 1
        d -= 1

dif = first[1]+first[3] - (second[2]+second[3])

if dif > 0:
    if first[2] > 0:
        trans(2,-1)
    elif first[1] > 0:
        trans(1,-1)
    elif first[3] > 0 and second[1] > 0:
        trans(3,-1)
        trans(1,1)
    else:
        print(-1)
        quit()
elif dif < 0:
    if second[1] > 0:
        trans(1,1)
    elif second[2] > 0:
        trans(2,2)
    elif second[3] > 0 and first[2] > 0:
        trans(3,1)
        trans(2,-1)
    else:
        print(-1)
        quit()

d = p[0]
while d>0:
    if sum(first) > sum(second):
        second[0] += 1
        d -= 1
    else:
        first[0] += 1
        d -= 1

while sum(first) > sum(second):
    if first[1]>0 and first[2]>0 and second[3]>0:
        trans(1,-1)
        trans(2,-1)
        trans(3,1)
    elif first[2]>1 and second[3] > 0:
        trans(2,-1)
        trans(2,-1)
        trans(3,1)
    else:
        print(-1)
        quit()

while sum(first) < sum(second):
    if second[1]>0 and second[2]>0 and first[3]>0:
        trans(1,1)
        trans(2,1)
        trans(3,-1)
    elif second[1]>1 and first[3] > 0:
        trans(1,1)
        trans(1,1)
        trans(3,-1)
    else:
        print(-1)
        quit()

ans = []
for i in range(4):
    for j in range(first[i]):
        ans.append(ind[i][j])

print(' '.join([str(x+1) for x in ans]))


# map(int, input().split())
# list(map(int, input().split()))
# for _ in range(int(input())):

n = int(input())
c = list(map(int, list(input())))
a = list(map(int, list(input())))

p = [0,0,0,0]
# 00,10,01,11
ind = [[],[],[],[]]

for i in range(n):
    if c[i] and a[i]:
        p[3] += 1
        ind[3].append(i)
    elif c[i]:
        p[1] += 1
        ind[1].append(i)
    elif a[i]:
        p[2] += 1
        ind[2].append(i)
    else:
        p[0] += 1
        ind[0].append(i)

first = [0,p[1],0,0]
second = [0,0,p[2],0]

if p[2] > p[1]:
    d = p[2] - p[1]
    first[2] += d
    second[2] -= d
else:
    d = p[1] - p[2]
    first[1] -= d
    second[1] += d

d = p[3]
while d>0:
    if first[1]+first[3] > second[2]+second[3]:
        second[3] += 1
        d -= 1
    else:
        first[3] += 1
        d -= 1

dif = first[1]+first[3] - (second[2]+second[3])
if d > 0:


from collections import *
from math import *
n = int(input())
s = input()
t = input()
d = dict()
d["00"],d["01"],d["10"],d["11"] = 0,0,0,0
for i in range(n):
	x = s[i]+t[i]
	d[x] += 1
na = d["00"]
nb = d["01"]
nc = d["10"]
nd = d["11"]
for i in range(nb+1):
	for j in range(nc+1):
		b,c = i,j
		if (nb+nd-b-c)%2 == 1: continue
		d = (nb+nd-b-c)//2
		if(d < 0 or d > nd): continue
		a = (n//2)-b-c-d
		if(a < 0 or a > na): continue
		else:
			ans = []
			for i in range(n):
				x = s[i]+t[i]
				if(x == "00" and a != 0):
					ans.append(i+1)
					a -= 1
				if(x == "01" and b != 0):
					ans.append(i+1)
					b -= 1
				if(x == "10" and c != 0):
					ans.append(i+1)
					c -= 1
				if(x == "11" and d != 0):
					ans.append(i+1)
					d -= 1
			print(*ans)
			exit(0)
print(-1)


n = int(input())

c = input()
a = input()

counta = 0
for x in a:
    x = int(x)
    if x == 1:
        counta += 1

c0 = 0
c1 = 0
c2 = 0
for x, y in zip(c, a):
    x, y = int(x), int(y)
    if x == 1 and y == 1:
        c2 += 1
    elif x == 1 or y == 1:
        c1 += 1
    else:
        c0 += 1

p = 0
q = 0
r = 0
for k in range(c0+1):
    for l in range(c1+1):
        m = n//2 - k - l
        if m < 0:
            break
        elif c2 < m:
            continue
        if l + m * 2 == counta:
            p, q, r = k, l, m
            break

if p == 0 and q == 0 and r == 0:
    print(-1)
    exit()

ans = []
for i in range(n):
    if a[i] == "0" and c[i] == "0" and p > 0:
        ans.append(i+1)
        p -= 1
    elif a[i] == "1" and c[i] == "1" and r > 0:
        ans.append(i+1)
        r -= 1
    elif ((a[i] == "1" and c[i] == "0") or (a[i] == "0" and c[i] == "1")) and q > 0:
        ans.append(i+1)
        q -= 1

print(*ans)


from operator import itemgetter

class CodeforcesTask1138BSolution:
    def __init__(self):
        self.result = ''
        self.artist_count = 0
        self.clowns = []
        self.acrobats = []

    def read_input(self):
        self.artist_count = int(input())
        self.clowns = [int(x) for x in input()]
        self.acrobats = [int(x) for x in input()]

    def process_task(self):
        pure_clowns = 0
        pure_acrobats = 0
        pure_useless = 0
        pure_both = 0
        for x in range(self.artist_count):
            if self.acrobats[x]:
                if self.clowns[x]:
                    pure_both += 1
                else:
                    pure_acrobats += 1
            else:
                if self.clowns[x]:
                    pure_clowns += 1
                else:
                    pure_useless += 1
        #print(pure_useless, pure_acrobats, pure_clowns, pure_both)
        eq = self.artist_count // 2 - pure_acrobats - pure_both
        a_d = []
        possible_a = [x for x in range(pure_useless + 1)]
        for pos_a in possible_a:
            d = pos_a - eq
            if d <= pure_both:
                a_d.append((pos_a, d))
        #print(a_d, eq)
        possb = [x for x in range(pure_acrobats + 1)]
        possc = [x for x in range(pure_clowns + 1)]
        solutions = []
        for para in a_d:
            eq2 = pure_acrobats + pure_both - 2 * para[1]
            for b in possb:
                c = eq2 - b
                if c in possc:
                    solutions.append([para[0], b, c, para[1]])
                    break
            if solutions:
                break
        if not solutions:
            self.result = "-1"
        else:
            squad = []
            for x in range(self.artist_count):
                if self.acrobats[x]:
                    if self.clowns[x]:
                        if solutions[0][3]:
                            solutions[0][3] -= 1
                            squad.append(x)
                    else:
                        if solutions[0][1]:
                            solutions[0][1] -= 1
                            squad.append(x)
                else:
                    if self.clowns[x]:
                        if solutions[0][2]:
                            solutions[0][2] -= 1
                            squad.append(x)
                    else:
                        if solutions[0][0]:
                            solutions[0][0] -= 1
                            squad.append(x)
            self.result = " ".join([str(x+1) for x in squad])
        #print(solutions)

    def get_result(self):
        return self.result

if __name__ == "__main__":
    Solution = CodeforcesTask1138BSolution()
    Solution.read_input()
    Solution.process_task()
    print(Solution.get_result())


from operator import itemgetter

class CodeforcesTask1138BSolution:
    def __init__(self):
        self.result = ''
        self.artist_count = 0
        self.clowns = []
        self.acrobats = []

    def read_input(self):
        self.artist_count = int(input())
        self.clowns = [int(x) for x in input()]
        self.acrobats = [int(x) for x in input()]

    def process_task(self):
        pure_clowns = 0
        pure_acrobats = 0
        pure_useless = 0
        pure_both = 0
        for x in range(self.artist_count):
            if self.acrobats[x]:
                if self.clowns[x]:
                    pure_both += 1
                else:
                    pure_acrobats += 1
            else:
                if self.clowns[x]:
                    pure_clowns += 1
                else:
                    pure_useless += 1
        #print(pure_useless, pure_acrobats, pure_clowns, pure_both)
        eq = self.artist_count // 2 - pure_acrobats - pure_both
        a_d = []
        possible_a = [x for x in range(pure_useless + 1)]
        for pos_a in possible_a:
            d = pos_a - eq
            if d <= pure_both and d >= 0:
                a_d.append((pos_a, d))
        #print(a_d, eq)
        possb = [x for x in range(pure_acrobats + 1)]
        possc = [x for x in range(pure_clowns + 1)]
        solutions = []
        for para in a_d:
            eq2 = pure_acrobats + pure_both - 2 * para[1]
            for b in possb:
                c = eq2 - b
                if c in possc:
                    solutions.append([para[0], b, c, para[1]])
                    break
            if solutions:
                break
        if not solutions:
            self.result = "-1"
        else:
            squad = []
            for x in range(self.artist_count):
                if self.acrobats[x]:
                    if self.clowns[x]:
                        if solutions[0][3]:
                            solutions[0][3] -= 1
                            squad.append(x)
                    else:
                        if solutions[0][1]:
                            solutions[0][1] -= 1
                            squad.append(x)
                else:
                    if self.clowns[x]:
                        if solutions[0][2]:
                            solutions[0][2] -= 1
                            squad.append(x)
                    else:
                        if solutions[0][0]:
                            solutions[0][0] -= 1
                            squad.append(x)
            self.result = " ".join([str(x+1) for x in squad])
        #print(solutions)

    def get_result(self):
        return self.result

if __name__ == "__main__":
    Solution = CodeforcesTask1138BSolution()
    Solution.read_input()
    Solution.process_task()
    print(Solution.get_result())


n=int(input())
cc=input()
aa=input()
na=0
nb=0
nc=0
nd=0
for i in range(len(aa)):
	if cc[i]=='0' and aa[i]=='0':
		na+=1
	if cc[i]=='0' and aa[i]=='1':
		nb+=1
	if cc[i]=='1' and aa[i]=='0':
		nc+=1
	if cc[i]=='1' and aa[i]=='1':
		nd+=1
ans=[]
f=False
for c in range(nc+1):
	for d in range(nd+1):
		xx=(n//2)-(c+d)
		b=(nb+nd)-(2*d+c)
		a=xx-b
		if a>=0 and b>=0 and a<=na and b<=nb:
			ans.append([a,b,c,d])
			f=True
			break
	if f:
		break
# print(ans)
if len(ans)==0:
	print(-1)
	exit()
# print(ans)
for i in range(len(ans)):
	a=ans[i][0]
	b=ans[i][1]
	c=ans[i][2]
	d=ans[i][3]
	temp=[]
	for j in range(len(aa)):
		if a>0:
			if cc[j]=='0' and aa[j]=='0':
				a-=1
				temp.append(j)
		if b>0:
			if cc[j]=='0' and aa[j]=='1':
				b-=1
				temp.append(j)
		if c>0:
			if cc[j]=='1' and aa[j]=='0':
				c-=1
				temp.append(j)
		if d>0:
			if cc[j]=='1' and aa[j]=='1':
				d-=1
				temp.append(j)
	if a==0 and b==0 and c==0 and d==0:
		for ii in temp:
			print(ii+1,end=" ")
		print()
		exit()


n=int(input())
cc=input()
aa=input()
na=0
nb=0
nc=0
nd=0
for i in range(len(aa)):
	if cc[i]=='0' and aa[i]=='0':
		na+=1
	if cc[i]=='0' and aa[i]=='1':
		nb+=1
	if cc[i]=='1' and aa[i]=='0':
		nc+=1
	if cc[i]=='1' and aa[i]=='1':
		nd+=1
ans=[]
for c in range(nc+1):
	for d in range(nd+1):
		xx=(n//2)-(c+d)
		b=(nb+nd)-(2*d+c)
		a=xx-b
		if a>=0 and b>=0:
			ans.append([a,b,c,d])
# print(ans)
if len(ans)==0:
	print(-1)
	exit()
for i in range(len(ans)):
	a=ans[i][0]
	b=ans[i][1]
	c=ans[i][2]
	d=ans[i][3]
	temp=[]
	for j in range(len(aa)):
		if a>0:
			if cc[j]=='0' and aa[j]=='0':
				a-=1
				temp.append(j)
		if b>0:
			if cc[j]=='0' and aa[j]=='1':
				b-=1
				temp.append(j)
		if c>0:
			if cc[j]=='1' and aa[j]=='0':
				c-=1
				temp.append(j)
		if d>0:
			if cc[j]=='1' and aa[j]=='1':
				d-=1
				temp.append(j)
	if a==0 and b==0 and c==0 and d==0:
		for ii in temp:
			print(ii+1,end=" ")
		print()
		exit()


a,b,c=0,0,0
n,s,t=int(input()),input(),input()
for i in range(n):
    if s[i]==t[i]:
        a+=1
    else if s[i]=1:
        c+=1
    else:
        b+=1
if a+c<b or a+b<c or (a+c-b)%2==1:
    print(-1)
    exit(0)
cnt=(a+c-b)/2
for i in range(n):
    if s[i]==t[i]:
        if cnt>0:
            print(i, end=" ")
            cnt-=1
    elif s[i]=1:
        print(i, end=" ")


a,b,c,d=0,0,0,0
n,s,t=int(input()),input(),input()
for i in range(n):
    if s[i]=='1' and t[i]=='1':
        d+=1
    elif s[i]==t[i]:
        a+=1
    elif s[i]=='1':
        c+=1
    else:
        b+=1
if n%2==1:
    print(-1)
    exit(0)
hi = n//2
for x in range(a+1):
    for m in range(b+1):
        y=b+d+x-hi
        n=hi-m-x-y
        if 0<=y<=d and 0<=n<=c:
            # print(x,m,n,y)
            for i in range(hi*2):
                if s[i]=='1' and t[i]=='1':
                    if y>0:
                        print(i+1,end=' ')
                        y-=1
                elif s[i]==t[i]:
                    if x>0:
                        print(i+1,end=' ')
                        x-=1
                elif s[i]=='1':
                    if n>0:
                        print(i+1,end=' ')
                        n-=1
                else:
                    if m>0:
                        print(i+1,end=' ')
                        m-=1
            exit(0)
print(-1)


a,b,c=0,0,0
n,s,t=int(input()),input(),input()
for i in range(n):
    if s[i]==t[i]:
        a+=1
    else if s[i]=1:
        c+=1
    else:
        b+=1
if a+c<b or a+b<c or (a+c-b)%2==1:
    print(-1)
    exit(0)
cnt=(a+c-b)/2
for i in range(n):
    if s[i]==t[i]:
        if cnt>0:
            print(i, end=" ")
            cnt-=1
    else if s[i]=1:
        print(i, end=" ")


a,b,c=0,0,0
n,s,t=int(input()),input(),input()
for i in range(n):
    if s[i]==t[i]:
        a+=1
    elif s[i]=='1':
        c+=1
    else:
        b+=1
if a+c<b or a+b<c or (a+c-b)%2==1:
    print(-1)
    exit(0)
cnt=(a+c-b)/2
for i in range(n):
    if s[i]==t[i]:
        if cnt>=0:
            print(i+1,end=" ")
            cnt-=1
    elif s[i]=='1':
        print(1+i,end=" ")


a,b,c=0,0,0
n,s,t=int(input()),input(),input()
for i in range(n):
    if s[i]==t[i]:
        a+=1
    elif s[i]=='1':
        c+=1
    else:
        b+=1
if a+c<b or a+b<c or (a+c-b)%2==1:
    print(-1)
    exit(0)
cnt=(a+c-b)/2
for i in range(n):
    if s[i]==t[i]:
        if cnt>0:
            print(i+1,end=" ")
            cnt-=1
    elif s[i]=='1':
        print(1+i,end=" ")


a,b,c=0,0,0
n,s,t=int(input()),input(),input()
for i in range(n):
    if s[i]==t[i]:
        a+=1
    elif s[i]=1:
        c+=1
    else:
        b+=1
if a+c<b or a+b<c or (a+c-b)%2==1:
    print(-1)
    exit(0)
cnt=(a+c-b)/2
for i in range(n):
    if s[i]==t[i]:
        if cnt>0:
            print(i, end=" ")
            cnt-=1
    elif s[i]=1:
        print(i, end=" ")


a,b,c=0,0,0
n,s,t=int(input()),input(),input()
for i in range(n):
    if s[i]==t[i]:
        a+=1
    elif s[i]=='1':
        c+=1
    else:
        b+=1
if a+c<b or a+b<c or (a+c-b)%2==1:
    print(-1)
    exit(0)
cnt=(a+c-b)/2
for i in range(n):
    if s[i]==t[i]:
        if cnt>=0:
            print(i+1,end=" ")
            cnt-=1
    elif s[i]==1:
        print(1+i,end=" ")


a,b,c=0,0,0
n,s,t=int(input()),input(),input()
for i in range(n):
    if s[i]==t[i]:
        a+=1
    elif s[i]=='1':
        c+=1
    else:
        b+=1
if a+c<b or a+b<c or (a+c-b)%2==1:
    print(-1)
    exit(0)
cnt=(a+c-b)/2
for i in range(n):
    if s[i]==t[i]:
        if cnt>0:
            print(i,end=" ")
            cnt-=1
    elif s[i]==1:
        print(i,end=" ")


a,b,c=0,0,0
n,s,t=int(input()),input(),input()
for i in range(n):
    if s[i]==t[i]:
        a+=1
    elif s[i]==1:
        c+=1
    else:
        b+=1
if a+c<b or a+b<c or (a+c-b)%2==1:
    print(-1)
    exit(0)
cnt=(a+c-b)/2
for i in range(n):
    if s[i]==t[i]:
        if cnt>0:
            print(i, end=" ")
            cnt-=1
    elif s[i]==1:
        print(i, end=" ")


def find_sol1(result,num_dict):
    ans_list = []
    #print("result",result)
    for i in range(num_dict['a']+1):
        for j in range(num_dict['d']+1):
            if i - j == result:
                ans_list.append((i,j))
    return ans_list
def find_sol2(N,num_dict,ans_list):
    for a,d in ans_list:
        for i in range(num_dict['b'] + 1):
                for j in range(num_dict['c'] + 1):
                    if i + j + a + d == N//2:
                        b = i;c = j
                        return a,b,c,d
    return -1,-1

if __name__ == '__main__':
    N = int(input().strip())
    clown = [int(i) for i in input().strip()]
    acro =  [int(i) for i in input().strip()]
    num_dict = {'a':0,'b':0,'c':0,'d':0}
    for i in range(N):
        if clown[i] == 0 and acro[i] == 0:
            num_dict['a']+=1
        elif clown[i] == 1 and acro[i] == 0:
            num_dict['b']+=1
        elif clown[i] == 0 and acro[i] == 1:
            num_dict['c']+=1
        else:
            num_dict['d']+=1
    a,b,c,d= 0,0,0,0
    result = N//2 - num_dict['c'] - num_dict['d']
    ans_list = find_sol1(result,num_dict)
    #print(a,b,c,d)
    if ans_list == []:
        print(-1)
    else:
        a,b,c,d = find_sol2(N,num_dict,ans_list)
        if a == -1:
            print(-1)
        else:
            ans = []

            for i in range(N):
                if clown[i] == 0 and acro[i] == 0:
                    if a > 0:
                        ans.append(i + 1)
                        a -= 1
                elif clown[i] == 1 and acro[i] == 0:
                    if b > 0:
                        ans.append(i + 1)
                        b -= 1
                elif clown[i] == 0 and acro[i] == 1:
                    if c > 0:
                        ans.append(i + 1)
                        c -= 1
                else:
                    if d > 0:
                        ans.append(i + 1)
                        d -= 1

            print(' '.join(str(i) for i in ans))


def find_sol1(result,num_dict):
    ans_list = []
    #print("result",result)
    for i in range(num_dict['a']+1):
        for j in range(num_dict['d']+1):
            if i - j == result:
                ans_list.append((i,j))
    return ans_list
def find_sol2(N,num_dict,ans_list):
    for a,d in ans_list:
        for i in range(num_dict['b'] + 1):
                for j in range(num_dict['c'] + 1):
                    if i + j + a + d == N//2:
                        b = i;c = j
                        return a,b,c,d
    return -1,-1,-1,-1

if __name__ == '__main__':
    N = int(input().strip())
    clown = [int(i) for i in input().strip()]
    acro =  [int(i) for i in input().strip()]
    num_dict = {'a':0,'b':0,'c':0,'d':0}
    for i in range(N):
        if clown[i] == 0 and acro[i] == 0:
            num_dict['a']+=1
        elif clown[i] == 1 and acro[i] == 0:
            num_dict['b']+=1
        elif clown[i] == 0 and acro[i] == 1:
            num_dict['c']+=1
        else:
            num_dict['d']+=1
    a,b,c,d= 0,0,0,0
    result = N//2 - num_dict['c'] - num_dict['d']
    ans_list = find_sol1(result,num_dict)
    #print(a,b,c,d)
    if ans_list == []:
        print(-1)
    else:
        a,b,c,d = find_sol2(N,num_dict,ans_list)
        if a == -1:
            print(-1)
        else:
            ans = []

            for i in range(N):
                if clown[i] == 0 and acro[i] == 0:
                    if a > 0:
                        ans.append(i + 1)
                        a -= 1
                elif clown[i] == 1 and acro[i] == 0:
                    if b > 0:
                        ans.append(i + 1)
                        b -= 1
                elif clown[i] == 0 and acro[i] == 1:
                    if c > 0:
                        ans.append(i + 1)
                        c -= 1
                else:
                    if d > 0:
                        ans.append(i + 1)
                        d -= 1

            print(' '.join(str(i) for i in ans))