$,=$\=$/; $n=<>; @s=<>=~/./g; @t=<>=~/./g; @a=map{ ($s0,$s1)=@s[$_,$_-$n]; ($t0,$t1)=@t[$_,$_-$n]; $t0==$s0&&$t1==$s1?(): $t0==($s0^$s1)&&$t1==$s0?($_,$_+1): $t0==$s1&&$t1==($s0^$s1)?($_+$n,($_+$n+1)%@s): exit!print-1; }0..$n-1; print~~@a,@a;