func_code_string: #include <bits/stdc++.h>   template <class T>   void read(T &x) {     x = 0;     int f = 0;     char ch = getchar();     while (ch <  0  || ch >  9 ) f |= (ch ==  - ), ch = getchar();     while (ch <=  9  && ch >=  0 )       x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();     x = f ? -x : x;     return;   }   const int maxn = 5007;   char c[maxn], a[maxn];   int t[2][2];   int main() {     int n;     read(n);     scanf( %s , c + 1);     scanf( %s , a + 1);     int len = n / 2;     for (int i = 1; i <= n; i++)       if (c[i] ==  1  && a[i] ==  1 )         t[1][1]++;       else if (c[i] ==  1  && a[i] ==  0 )         t[1][0]++;       else if (c[i] ==  0  && a[i] ==  1 )         t[0][1]++;       else         t[0][0]++;     for (int i = 0; i <= len; i++)       for (int j = 0; j <= i; j++) {         if (j > t[1][1]) continue;         int k = i - j;         if (k > t[1][0]) continue;         int re11 = t[1][1] - j;         if (re11 > i) continue;         int gal = i - re11;         if (t[0][1] >= gal) {           int x = j, y = k, z = t[0][1] - gal;           int res = len - i - z;           if (res < 0 || res > t[0][0]) continue;           for (int q = 1; q <= n; q++) {             if (c[q] ==  1  && a[q] ==  1  && x > 0) {               printf( %d  , q);               x--;             }             if (c[q] ==  1  && a[q] ==  0  && y > 0) {               printf( %d  , q);               y--;             }             if (c[q] ==  0  && a[q] ==  1  && z > 0) {               printf( %d  , q);               z--;             }             if (c[q] ==  0  && a[q] ==  0  && res > 0) {               printf( %d  , q);               res--;             }           }           return 0;         }       }     printf( -1 n );     return 0;   }   