//Pham Huu Canh
//C. Marina and Vasya
//Algorithm:
//Complexity:
//AC:

#include <iostream>
#include <fstream>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>

#define max64 9223372036854775807LL
#define max32 2147483647
#define maxty 1001001001
#define max16 32767
#define EPS 1e-8
#define ll long long
#define ull unsigned long long
#define pb push_back
#define mp make_pair
#define PQ priority_queue
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
#define timmax(x, y)    ((x) > (y) ? (x) : (y))
#define timmin(x, y)    ((x) < (y) ? (x) : (y))
#define fori(i, n)      for((i) = 0; (i) < (n); (i)++)
#define ford(i, n)      for((i) = (n-1); (i) >= 0; (i)--)
#define fore(i, v)		for(typeof(v.begin()) i = v.begin(); i != v.end(); i++)
#define repi(i, a, b)   for((i) = (a); (i) <= (b); (i)++)
#define repd(i, a, b)   for((i) = (a); (i) >= (b); (i)--)
#define all(tmpv)      tmpv.begin(), tmpv.end()

#define fii "c.inp"
#define foo "c.out"
#define MOD 1000000007
#define inf 1000111000111000111LL

using namespace std;

typedef pair<int, int> II;
typedef vector<int> VI;
#define nmax 100005

char s[nmax], t[nmax], res[nmax];

void input()
{
	int i, j, k, n;
	int cnt, x;

	scanf("%d %d %s %s", &n, &k, &s, &t);

	cnt = 0;
	fori(i, n)	cnt += s[i] != t[i];
	strcpy(res, s);

	if (cnt <= k){
		k -= cnt;
		for (i = 0; i < n && cnt; i++)	if (s[i] != t[i]){
			repi(j, 'a', 'z')	if (j != s[i] && j != t[i]){
				cnt--;
				res[i] = j;
				break;
			}
		}

		for (i = 0; i < n && k; i++)	if (s[i] == t[i]){
			repi(j, 'a', 'z')	if (j != s[i]){
				k--;
				res[i] = j;
				break;
			}
		}
		printf("%s",res);
	}
	else if (cnt > 2 * k)	printf("-1");
	else{
		x = cnt/2;
		for (i = 0; i < n && x; i++)	if (s[i] != t[i]){
			res[i] = s[i];
			x--;
		}

		x = cnt/2;
		for (; i < n && x; i++)	if (s[i] != t[i]){
			res[i] = t[i];
			x--;
		}

		k -= cnt/2;
		if (cnt & 1){
			k--;
			cnt = 1;
			for (; i < n && cnt; i++)	if (s[i] != t[i]){
				repi(j, 'a', 'z')	if (j != s[i] && j != t[i]){
					res[i] = j;
					cnt--;
					break;
				}
			}
		}

		for (i = 0; i < n && k; i++)	if (s[i] == t[i]){
			repi(j, 'a', 'z')	if (s[i] != j){
				res[i] = j;
				k--;
				break;
			}
		}

		printf("%s", res);
	}
}

int main()
{
    #ifndef ONLINE_JUDGE
    	freopen(fii,"r",stdin);
    	freopen(foo,"w",stdout);
    #endif

    input();

    return 0;
}


//Pham Huu Canh
//C. Marina and Vasya
//Algorithm:
//Complexity:
//AC:

#include <iostream>
#include <fstream>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>

#define max64 9223372036854775807LL
#define max32 2147483647
#define maxty 1001001001
#define max16 32767
#define EPS 1e-8
#define ll long long
#define ull unsigned long long
#define pb push_back
#define mp make_pair
#define PQ priority_queue
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
#define timmax(x, y)    ((x) > (y) ? (x) : (y))
#define timmin(x, y)    ((x) < (y) ? (x) : (y))
#define fori(i, n)      for((i) = 0; (i) < (n); (i)++)
#define ford(i, n)      for((i) = (n-1); (i) >= 0; (i)--)
#define fore(i, v)      for(typeof(v.begin()) i = v.begin(); i != v.end(); i++)
#define repi(i, a, b)   for((i) = (a); (i) <= (b); (i)++)
#define repd(i, a, b)   for((i) = (a); (i) >= (b); (i)--)
#define all(tmpv)      tmpv.begin(), tmpv.end()

#define fii "c.inp"
#define foo "c.out"
#define MOD 1000000007
#define inf 1000111000111000111LL

using namespace std;

typedef pair<int, int> II;
typedef vector<int> VI;
#define nmax 100005

char s[nmax], t[nmax], res[nmax];

void input()
{
    int i, j, k, n;
    int cnt, x;

    scanf("%d %d %s %s", &n, &k, &s, &t);

    cnt = 0;
    fori(i, n)  cnt += s[i] != t[i];
    strcpy(res, s);

    if (cnt <= k){
        k -= cnt;
        for (i = 0; i < n && cnt; i++)  if (s[i] != t[i]){
            repi(j, 'a', 'z')   if (j != s[i] && j != t[i]){
                cnt--;
                res[i] = j;
                break;
            }
        }

        for (i = 0; i < n && k; i++)    if (s[i] == t[i]){
            repi(j, 'a', 'z')   if (j != s[i]){
                k--;
                res[i] = j;
                break;
            }
        }
        printf("%s",res);
    }
    else if (cnt > 2 * k)   printf("-1");
    else{
        x = cnt/2;
        for (i = 0; i < n && x; i++)    if (s[i] != t[i]){
            res[i] = t[i];
            x--;
        }

        k -= cnt/2;
        cnt %= 2;

        if (cnt && k){
            for (; i < n && cnt; i++)   if (s[i] != t[i]){
                repi(j, 'a', 'z')   if (j != s[i] && j != t[i]){
                    res[i] = j;
                    cnt--;
                    k--;
                    break;
                }
            }
        }

        for (i = 0; i < n && k; i++)    if (s[i] == t[i]){
            repi(j, 'a', 'z')   if (s[i] != j){
                res[i] = j;
                k--;
                break;
            }
        }

        printf("%s", res);
    }
}

int main()
{
    #ifndef ONLINE_JUDGE
        freopen(fii,"r",stdin);
        freopen(foo,"w",stdout);
    #endif

    input();

    return 0;
}


//Pham Huu Canh
//C. Marina and Vasya
//Algorithm:
//Complexity:
//AC:

#include <iostream>
#include <fstream>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>

#define max64 9223372036854775807LL
#define max32 2147483647
#define maxty 1001001001
#define max16 32767
#define EPS 1e-8
#define ll long long
#define ull unsigned long long
#define pb push_back
#define mp make_pair
#define PQ priority_queue
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
#define timmax(x, y)    ((x) > (y) ? (x) : (y))
#define timmin(x, y)    ((x) < (y) ? (x) : (y))
#define fori(i, n)      for((i) = 0; (i) < (n); (i)++)
#define ford(i, n)      for((i) = (n-1); (i) >= 0; (i)--)
#define fore(i, v)      for(typeof(v.begin()) i = v.begin(); i != v.end(); i++)
#define repi(i, a, b)   for((i) = (a); (i) <= (b); (i)++)
#define repd(i, a, b)   for((i) = (a); (i) >= (b); (i)--)
#define all(tmpv)      tmpv.begin(), tmpv.end()

#define fii "c.inp"
#define foo "c.out"
#define MOD 1000000007
#define inf 1000111000111000111LL

using namespace std;

typedef pair<int, int> II;
typedef vector<int> VI;
#define nmax 100005

char s[nmax], t[nmax], res[nmax];

void input()
{
    int i, j, k, n, cnt;

    scanf("%d %d", &n, &k);
    scanf("%s %s", &s, &t);

    cnt = 0;
    fori(i, n)  if (s[i] != t[i])   cnt++;

    if (cnt > k){
        if (cnt != 2 * k)   printf("-1");
        else{
            fori(i, n)  if (s[i] != t[i]){
                s[i] = t[i];
                k--;
                if (k == 0) break;
            }
            printf("%s", s);
        }
    }
    else
    {
        k -= cnt;
        strcpy(res, s);

        for (i = 0; i < n && cnt; i++)  if (s[i] != t[i]){
            repi(j, 'a', 'z')   if (j != s[i] && j != t[i]){
                res[i] = j;
                cnt--;
                break;
            }
        }

        for (i = 0; i < n && k; i++)    if (s[i] == t[i]){
            repi(j, 'a', 'z')   if (j != s[i]){
                res[i] = j;
                k--;
                break;
            }
        }

        if (k)  printf("-1");
        else    printf("%s", res);
    }
}

int main()
{
    #ifndef ONLINE_JUDGE
        freopen(fii,"r",stdin);
        freopen(foo,"w",stdout);
    #endif

    input();

    return 0;
}


//Pham Huu Canh
//C. Marina and Vasya
//Algorithm:
//Complexity:
//AC:

#include <iostream>
#include <fstream>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>

#define max64 9223372036854775807LL
#define max32 2147483647
#define maxty 1001001001
#define max16 32767
#define EPS 1e-8
#define ll long long
#define ull unsigned long long
#define pb push_back
#define mp make_pair
#define PQ priority_queue
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
#define timmax(x, y)    ((x) > (y) ? (x) : (y))
#define timmin(x, y)    ((x) < (y) ? (x) : (y))
#define fori(i, n)      for((i) = 0; (i) < (n); (i)++)
#define ford(i, n)      for((i) = (n-1); (i) >= 0; (i)--)
#define fore(i, v)      for(typeof(v.begin()) i = v.begin(); i != v.end(); i++)
#define repi(i, a, b)   for((i) = (a); (i) <= (b); (i)++)
#define repd(i, a, b)   for((i) = (a); (i) >= (b); (i)--)
#define all(tmpv)      tmpv.begin(), tmpv.end()

#define fii "c.inp"
#define foo "c.out"
#define MOD 1000000007
#define inf 1000111000111000111LL

using namespace std;

typedef pair<int, int> II;
typedef vector<int> VI;
#define nmax 100005

char s[nmax], t[nmax], res[nmax];

void input()
{
    int i, j, k, n, cnt;

    scanf("%d %d", &n, &k);
    scanf("%s %s", &s, &t);

    cnt = 0;
    fori(i, n)  if (s[i] != t[i])   cnt++;

    if (cnt > k){
        if (k == 0 || cnt != k * 2) printf("-1");
        else{
            fori(i, n)  if (s[i] != t[i]){
                s[i] = t[i];
                k--;
                if (k == 0) break;
            }
            printf("%s", s);
        }
    }
    else
    {
        k -= cnt;
        strcpy(res, s);

        for (i = 0; i < n && cnt; i++)  if (s[i] != t[i]){
            repi(j, 'a', 'z')   if (j != s[i] && j != t[i]){
                res[i] = j;
                cnt--;
                break;
            }
        }

        if (k){
            fori(i, n)  if (s[i] == t[i])
            {
                repi(j, 'a', 'z')   if (j != s[i])
                {
                    res[i] = j;
                    k--;
                    break;
                }
                if (k == 0) break;
            }
        }

        if (k)  printf("-1");
        else    printf("%s", res);
    }
}

int main()
{
    #ifndef ONLINE_JUDGE
        freopen(fii,"r",stdin);
        freopen(foo,"w",stdout);
    #endif

    input();

    return 0;
}


//Pham Huu Canh
//C. Marina and Vasya
//Algorithm:
//Complexity:
//AC:

#include <iostream>
#include <fstream>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>

#define max64 9223372036854775807LL
#define max32 2147483647
#define maxty 1001001001
#define max16 32767
#define EPS 1e-8
#define ll long long
#define ull unsigned long long
#define pb push_back
#define mp make_pair
#define PQ priority_queue
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
#define timmax(x, y)    ((x) > (y) ? (x) : (y))
#define timmin(x, y)    ((x) < (y) ? (x) : (y))
#define fori(i, n)      for((i) = 0; (i) < (n); (i)++)
#define ford(i, n)      for((i) = (n-1); (i) >= 0; (i)--)
#define fore(i, v)      for(typeof(v.begin()) i = v.begin(); i != v.end(); i++)
#define repi(i, a, b)   for((i) = (a); (i) <= (b); (i)++)
#define repd(i, a, b)   for((i) = (a); (i) >= (b); (i)--)
#define all(tmpv)      tmpv.begin(), tmpv.end()

#define fii "c.inp"
#define foo "c.out"
#define MOD 1000000007
#define inf 1000111000111000111LL

using namespace std;

typedef pair<int, int> II;
typedef vector<int> VI;
#define nmax 100005

char s[nmax], t[nmax], res[nmax];

void input()
{
    int i, j, k, n;
    int cnt, x;

    scanf("%d %d %s %s", &n, &k, &s, &t);

    cnt = 0;
    fori(i, n)  cnt += s[i] != t[i];
    strcpy(res, s);

    if (cnt <= k){
        k -= cnt;
        for (i = 0; i < n && cnt; i++)  if (s[i] != t[i]){
            repi(j, 'a', 'z')   if (j != s[i] && j != t[i]){
                cnt--;
                res[i] = j;
                break;
            }
        }

        for (i = 0; i < n && k; i++)    if (s[i] == t[i]){
            repi(j, 'a', 'z')   if (j != s[i]){
                k--;
                res[i] = j;
                break;
            }
        }
        printf("%s",res);
    }
    else if (cnt > 2 * k)   printf("-1");
    else{
        x = cnt - k;
        for (i = 0; i < n && x; i++)    if (s[i] != t[i]){
            res[i] = t[i];
            x--;
        }

        k -= cnt - k;
        for (; i < n && k; i++) if (s[i] != t[i]){
            repi(j, 'a', 'z')   if (j != s[i] && j != t[i]){
                res[i] = j;
                k--;
                break;
            }
        }

        printf("%s", res);
    }
}

int main()
{
    #ifndef ONLINE_JUDGE
        freopen(fii,"r",stdin);
        freopen(foo,"w",stdout);
    #endif

    input();

    return 0;
}


//Pham Huu Canh
//C. Marina and Vasya
//Algorithm:
//Complexity:
//AC:

#include <iostream>
#include <fstream>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>

#define max64 9223372036854775807LL
#define max32 2147483647
#define maxty 1001001001
#define max16 32767
#define EPS 1e-8
#define ll long long
#define ull unsigned long long
#define pb push_back
#define mp make_pair
#define PQ priority_queue
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
#define timmax(x, y)    ((x) > (y) ? (x) : (y))
#define timmin(x, y)    ((x) < (y) ? (x) : (y))
#define fori(i, n)      for((i) = 0; (i) < (n); (i)++)
#define ford(i, n)      for((i) = (n-1); (i) >= 0; (i)--)
#define fore(i, v)      for(typeof(v.begin()) i = v.begin(); i != v.end(); i++)
#define repi(i, a, b)   for((i) = (a); (i) <= (b); (i)++)
#define repd(i, a, b)   for((i) = (a); (i) >= (b); (i)--)
#define all(tmpv)      tmpv.begin(), tmpv.end()

#define fii "c.inp"
#define foo "c.out"
#define MOD 1000000007
#define inf 1000111000111000111LL

using namespace std;

typedef pair<int, int> II;
typedef vector<int> VI;
#define nmax 100005

char s[nmax], t[nmax], res[nmax];

void input()
{
    int i, j, k, n, cnt;

    scanf("%d %d", &n, &k);
    scanf("%s %s", &s, &t);

    if (k == 0){
        if (strcmp(s, t))   printf("-1");
        else                printf("%s", s);
    }
    else{
        cnt = 0;
        fori(i, n)  if (s[i] != t[i])   cnt++;

        if (cnt > k)    printf("-1");
        else{
            k -= cnt;
            fori(i, n)  res[i] = s[i];
            res[n] = 0;

            if (cnt){
                fori(i, n)  if (s[i] != t[i]){
                    repi(j, 'a', 'z')   if (j != s[i] && j != t[i]){
                        res[i] = j, cnt--;
                        break;
                    }
                    if (cnt == 0)   break;
                }
            }

            if (k){
                fori(i, n)  if (s[i] == t[i]){
                    repi(j, 'a', 'z')   if (j != s[i]){
                        res[i] = j, k--;
                        break;
                    }
                    if (k == 0) break;
                }
            }

            if (k)  printf("-1");
            else    printf("%s", res);
        }
    }
}

int main()
{
    #ifndef ONLINE_JUDGE
        freopen(fii,"r",stdin);
        freopen(foo,"w",stdout);
    #endif

    input();

    return 0;
}


//Pham Huu Canh
//C. Marina and Vasya
//Algorithm:
//Complexity:
//AC:

#include <iostream>
#include <fstream>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>

#define max64 9223372036854775807LL
#define max32 2147483647
#define maxty 1001001001
#define max16 32767
#define EPS 1e-8
#define ll long long
#define ull unsigned long long
#define pb push_back
#define mp make_pair
#define PQ priority_queue
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
#define timmax(x, y)    ((x) > (y) ? (x) : (y))
#define timmin(x, y)    ((x) < (y) ? (x) : (y))
#define fori(i, n)      for((i) = 0; (i) < (n); (i)++)
#define ford(i, n)      for((i) = (n-1); (i) >= 0; (i)--)
#define fore(i, v)      for(typeof(v.begin()) i = v.begin(); i != v.end(); i++)
#define repi(i, a, b)   for((i) = (a); (i) <= (b); (i)++)
#define repd(i, a, b)   for((i) = (a); (i) >= (b); (i)--)
#define all(tmpv)      tmpv.begin(), tmpv.end()

#define fii "c.inp"
#define foo "c.out"
#define MOD 1000000007
#define inf 1000111000111000111LL

using namespace std;

typedef pair<int, int> II;
typedef vector<int> VI;
#define nmax 100005

char s[nmax], t[nmax], res[nmax];

void input()
{
    int i, j, k, n;
    int cnt, x;

    scanf("%d %d %s %s", &n, &k, &s, &t);

    cnt = 0;
    fori(i, n)  cnt += s[i] != t[i];
    strcpy(res, s);

    if (cnt <= k){
        k -= cnt;
        for (i = 0; i < n && cnt; i++)  if (s[i] != t[i]){
            repi(j, 'a', 'z')   if (j != s[i] && j != t[i]){
                cnt--;
                res[i] = j;
                break;
            }
        }

        for (i = 0; i < n && k; i++)    if (s[i] == t[i]){
            repi(j, 'a', 'z')   if (j != s[i]){
                k--;
                res[i] = j;
                break;
            }
        }
        printf("%s",res);
    }
    else if (cnt > 2 * k)   printf("-1");
    else{
        x = cnt/2;
        for (i = 0; i < n && x; i++)    if (s[i] != t[i]){
            res[i] = s[i];
            x--;
        }

        x = cnt/2;
        for (; i < n && x; i++) if (s[i] != t[i]){
            res[i] = t[i];
            x--;
        }

        k -= cnt/2;
        cnt &= 1;

        if (cnt && k){
            for (; i < n && cnt; i++)   if (s[i] != t[i]){
                repi(j, 'a', 'z')   if (j != s[i] && j != t[i]){
                    res[i] = j;
                    cnt--;
                    k--;
                    break;
                }
            }
        }

        for (i = 0; i < n && k; i++)    if (s[i] == t[i]){
            repi(j, 'a', 'z')   if (s[i] != j){
                res[i] = j;
                k--;
                break;
            }
        }

        printf("%s", res);
    }
}

int main()
{
    #ifndef ONLINE_JUDGE
        freopen(fii,"r",stdin);
        freopen(foo,"w",stdout);
    #endif

    input();

    return 0;
}


#include<iostream>
#include<cstdio>
using namespace std;

int same[100005];
int diff[100005];
int scount=0;
int dcount=0;
char a[100005];
char b[100005];
char ans[100005];

int main()
{
    int n,m,t;
    scanf("%d%d",&n,&t);
    scanf("%s%s",a,b);
    for(int i=0;i<n;i++)
    {
        if(a[i]==b[i])
            same[scount++]=i;
        else
            diff[dcount++]=i;

        for(int j=0;j<26;j++)
        {
            if(a[i]!=j+'a' && b[i]!=j+'a')
            {
                ans[i]=j+'a';
                break;
            }
        }
    }
    m=n;
    for(int i=0;i<scount && m>t;i++)
    {
        ans[same[i]]=a[same[i]];
        m--;
    }

    for(int i=0;i+1<dcount && m>t;i+=2)
    {
        ans[diff[i]]=a[diff[i]];
        ans[diff[i+1]]=b[diff[i+1]];
        m--;
    }
    if(m==t)
    printf("%s", ans);
    else
    printf("-1");

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
map<char,int>m;
int n;
bool cmp(char a,char b)
{
    return a<b;
}
void collect_common_portion(char a[],char b[],char c[])
{
    int j,k=0;
    for(int i=0;i<n;i++)
    {
        for(j=0;j<n;j++)
        {
            if(a[i]==b[j])
            {
                c[k++]=a[i];
                a[i]=b[j]='.';
                break;
            }
        }
    }
}

int main()
{
    int t;
    cin>>n>>t;
    char s1[n+1],s2[n+1],s3[n+1];
    cin>>s1>>s2;
    for(int i=0;i<n;i++)
    {
        m[s1[i]]++;
        m[s2[i]]++;
    }
    sort(s1,s1+n,cmp);
    sort(s2,s2+n,cmp);
    collect_common_portion(s1,s2,s3);
    //cout<<s1<<endl<<s2<<endl<<s3;
    int length=strlen(s3),T=n-t-length;  //      cout<<"length="<<length<<endl;
    int k=0;                    //               cout<<endl<<"T="<<T<<endl;
    for(int i=0;i<n;i++)
    {
        if(k==T)
        break;
        if(s1[i]!='.')
        {
            s3[length++]=s1[i];
            s3[length]='\0';
            k++;
        }
    }             //                     cout<<"ist step s3="<<s3<<endl;
    k=0;
    for(int i=0;i<n;i++)
    {
        if(k==T)
        break;
        if(s2[i]!='.')
        {
            s3[length++]=s2[i];
            s3[length]='\0';
            k++;
        }
    }           //        cout<<"2nd step s3="<<s3<<endl;
                    //     return 0;
    if(n==strlen(s3))
    {
        cout<<s3;
        return 0;
    }
    int left=n-strlen(s3);
    k=0;    //    cout<<"left="<<left<<endl;
    for(char c='a';c<='z';c++)
    {
        if(k==left)
        break;
        if(m[c]==0)
        {
            s3[length++]=c;
            s3[length]='\0';
            k++;
        }
    }
    if(strlen(s3)==n)
    cout<<s3;
    else
    cout<<-1;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
map<char,int>m;
int n;
bool cmp(char a,char b)
{
    return a<b;
}
void collect_common_portion(char a[],char b[],char c[])
{
    int j,k=0;
    for(int i=0;i<n;i++)
    {
        for(j=0;j<n;j++)
        {
            if(a[i]==b[j])
            {
                c[k++]=a[i];
                a[i]=b[j]='.';
                break;
            }
        }
    }
}

int main()
{
    int t;
    cin>>n>>t;
    char s1[n+1],s2[n+1],s3[n+1];
    cin>>s1>>s2;
    for(int i=0;i<n;i++)
    {
        m[s1[i]]++;
        m[s2[i]]++;
    }
    sort(s1,s1+n,cmp);
    sort(s2,s2+n,cmp);
    collect_common_portion(s1,s2,s3);
                                            cout<<s1<<endl<<s2<<endl<<s3;
    int length=strlen(s3),T=n-t-length;        cout<<"length="<<length<<endl;
    int k=0;                                   cout<<endl<<"T="<<T<<endl;
    for(int i=0;i<n;i++)
    {
        if(k==T)
        break;
        if(s1[i]!='.')
        {
            s3[length++]=s1[i];
            s3[length]='\0';
            k++;
        }
    }                                  cout<<"ist step s3="<<s3<<endl;
    k=0;
    for(int i=0;i<n;i++)
    {
        if(k==T)
        break;
        if(s2[i]!='.')
        {
            s3[length++]=s2[i];
            s3[length]='\0';
            k++;
        }
    }                   cout<<"2nd step s3="<<s3<<endl;
                    //     return 0;
    if(n==strlen(s3))
    {
        cout<<s3;
        return 0;
    }
    int left=n-strlen(s3);
    k=0;        cout<<"left="<<left<<endl;
    for(char c='a';c<='z';c++)
    {
        if(k==left)
        break;
        if(m[c]==0)
        {
            s3[length++]=c;
            s3[length]='\0';
            k++;
        }
    }
    if(strlen(s3)==n)
    cout<<s3;
    else
    cout<<-1;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
map<char,int>m;
int n;
bool cmp(char a,char b)
{
    return a<b;
}
void collect_common_portion(char a[],char b[],char c[])
{
    int j,k=0;
    for(int i=0;i<n;i++)
    {
        for(j=0;j<n;j++)
        {
            if(a[i]==b[j])
            {
                c[k++]=a[i];
                a[i]=b[j]='.';
                break;
            }
        }
    }
    c[k]='\0';
}

int main()
{
    int t;
    cin>>n>>t;
    char s1[n+1],s2[n+1],s3[n+1];
    cin>>s1>>s2;
    for(int i=0;i<n;i++)
    {
        m[s1[i]]++;
        m[s2[i]]++;
    }
    sort(s1,s1+n,cmp);
    sort(s2,s2+n,cmp);
    collect_common_portion(s1,s2,s3);
 //                                           cout<<s1<<endl<<s2<<endl<<s3;
    int length=strlen(s3),T=n-t-length;  //      cout<<"length="<<length<<endl;
    int k=0;                               //    cout<<endl<<"T="<<T<<endl;
    for(int i=0;i<n;i++)
    {
        if(k==T)
        break;
        if(s1[i]!='.')
        {
            s3[length++]=s1[i];
            s3[length]='\0';
            k++;
        }
    }                                 // cout<<"ist step s3="<<s3<<endl;
    k=0;
    for(int i=0;i<n;i++)
    {
        if(k==T)
        break;
        if(s2[i]!='.')
        {
            s3[length++]=s2[i];
            s3[length]='\0';
            k++;
        }
    }              //     cout<<"2nd step s3="<<s3<<endl;
                    //     return 0;
    if(n==strlen(s3))
    {
        cout<<s3;
        return 0;
    }
    int left=n-strlen(s3);
    k=0;                              //   cout<<"left="<<left<<endl;
    for(char c='a';c<='z';c++)
    {
        if(k==left)
        break;
        if(m[c]==0)
        {
            s3[length++]=c;
            s3[length]='\0';
            k++;
        }
    }
    if(strlen(s3)==n)
    cout<<s3;
    else
    cout<<-1;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
map<char,int>m;
int n;
bool cmp(char a,char b)
{
    return a<b;
}
void collect_common_portion(char a[],char b[],char c[])
{
    int j,k=0;
    for(int i=0;i<n;i++)
    {
        for(j=0;j<n;j++)
        {
            if(a[i]==b[j])
            {
                c[k++]=a[i];
                a[i]=b[j]='.';
                break;
            }
        }
    }
}

int main()
{
    int t;
    cin>>n>>t;
    char s1[n+1],s2[n+1],s3[n+1];
    cin>>s1>>s2;
    for(int i=0;i<n;i++)
    {
        m[s1[i]]++;
        m[s2[i]]++;
    }
    sort(s1,s1+n,cmp);
    sort(s2,s2+n,cmp);
    collect_common_portion(s1,s2,s3);
    //cout<<s1<<endl<<s2<<endl<<s3;
    int length=strlen(s3),T=n-t-length;  //      cout<<"length="<<length<<endl;
    int k=0;                    //               cout<<endl<<"T="<<T<<endl;
    for(int i=0;i<n;i++)
    {
        if(k==T)
        break;
        if(s1[i]!='.')
        {
            s3[length++]=s1[i];
            s3[length]='\0';
            k++;
        }
    }             //                     cout<<"ist step s3="<<s3<<endl;
    k=0;
    for(int i=0;i<n;i++)
    {
        if(k==T)
        break;
        if(s2[i]!='.')
        {
            s3[length++]=s2[i];
            s3[length]='\0';
            k++;
        }
    }           //        cout<<"2nd step s3="<<s3<<endl;
                    //     return 0;
    if(n==strlen(s3))
    {
        cout<<s3;
        return 0;
    }
    int left=n-strlen(s3);
    k=0;    //    cout<<"left="<<left<<endl;
    for(char c='a';c<='z';c++)
    {
        if(k==left)
        break;
        if(m[c]==0)
        {
            s3[length++]=c;
            s3[length]='\0';
            k++;
        }
    }
    if(strlen(s3)==n)
    cout<<s3;
    else
    cout<<"sadek"<<-1;
    return 0;
}


#include <bits/stdc++.h>
#define CON 1000000007

using namespace std;

int main(){
   ios_base::sync_with_stdio(false);
   cin.tie(NULL), cout.tie(NULL);
   int n , t , cnt = 0;
   cin >> n >> t;
   string s1 , s2;
   cin >> s1 >> s2;
   string s3 = "";
   for(int i = 0; i < n; i ++){
    cnt += (s1[i] == s2[i]);
   }
   if(cnt < (n-t)){
    cout << -1 << endl;
    return 0;
   }
   cnt = n-t;
   for(int i = 0; i < n; i ++){
    if(s1[i] == s2[i]){
        if(cnt){
            cnt--;
            s3 += s1[i];
        } else if(s1[i] == 'a'){
            s3 += "b";
        } else
            s3 += "a";
    } else {
        if(s1[i] != 'a' && s2[i] != 'a')
            s3 += "a";
        else if(s1[i] != 'b' && s2[i] != 'b')
            s3 += "b";
        else
            s3 += "c";
    }
   }
   cout << s3;
}


#include <bits/stdc++.h>
#define CON 1000000007

using namespace std;

int main(){
   ios_base::sync_with_stdio(false);
   cin.tie(NULL), cout.tie(NULL);
   int n , t , cnt1 = 0 , cnt2 = 0 , cnt = 0;
   cin >> n >> t;
   string s1 , s2;
   cin >> s1 >> s2;
   string s3 = "";
   for(int i = 0; i < n; i ++)
    cnt += (s1[i] != s2[i]);
   if(t < cnt && cnt % 2 == 1){
    cout << -1;
    return 0;
   }
   for(int i = 0; i < n; i ++){
    if(s1[i] == s2[i]){
        if(max(cnt1 , cnt2) < t){
            cnt1 ++;
            cnt2 ++;
            if(s1[i] == 'a'){
                s3 += "b";
            } else
                s3 += "a";
        } else
            s3 += s1[i];
    }
    else {
        if(cnt1 <= cnt2){
            if(cnt/2 >= t){
                s3 += s2[i];
                cnt1++;
            } else {
                cnt1++;
                cnt2++;
                if(s1[i] != 'a' && s2[i] != 'a')
                    s3 += "a";
                else if(s1[i] != 'b' && s2[i] != 'b')
                    s3 += "b";
                else
                    s3 += "c";
            }
        } else {
            s3 += s1[i];
            cnt2 ++;
        }
    }
   }
   cout << s3;
}


#include <bits/stdc++.h>
#define CON 1000000007

using namespace std;

int main(){
   ios_base::sync_with_stdio(false);
   cin.tie(NULL), cout.tie(NULL);
   int n , t , cnt1 = 0 , cnt2 = 0 , cnt = 0;
   cin >> n >> t;
   string s1 , s2;
   cin >> s1 >> s2;
   string s3 = "";
   for(int i = 0; i < n; i ++)
    cnt += (s1[i] != s2[i]);
   for(int i = 0; i < n; i ++){
    if(s1[i] == s2[i]){
        if(max(cnt1 , cnt2) < t){
            cnt1 ++;
            cnt2 ++;
            if(s1[i] == 'a'){
                s3 += "b";
            } else
                s3 += "a";
        } else
            s3 += s1[i];
    }
    else {
        if(cnt1 <= cnt2){
            if(cnt/2 + cnt%2 >= t){
                s3 += s2[i];
                cnt1++;
            } else {
                cnt1++;
                cnt2++;
                if(s1[i] != 'a' && s2[i] != 'a')
                    s3 += "a";
                else if(s1[i] != 'b' && s2[i] != 'b')
                    s3 += "b";
                else
                    s3 += "c";
            }
        } else {
            s3 += s1[i];
            cnt2 ++;
        }
    }
   }
   if(cnt1 != cnt2 || cnt1 != t){
    cout << -1 << endl;
    return 0;
   }
   cout << s3;
}


#include <bits/stdc++.h>
#define CON 1000000007

using namespace std;

int main(){
   ios_base::sync_with_stdio(false);
   cin.tie(NULL), cout.tie(NULL);
   int n , t , cnt1 = 0 , cnt2 = 0 , cnt = 0;
   cin >> n >> t;
   string s1 , s2;
   cin >> s1 >> s2;
   string s3 = s1;
   for(int i = 0; i < n; i ++) cnt += s1[i] != s2[i];
   int tmp = t , foo = 0;
   for(int i = 0; i < n; i ++){
    if(s1[i] == s2[i]){
        if(tmp > cnt){
            tmp --;
            foo++;
            if(s1[i] != 'a' && s2[i] != 'a')
                s3[i] = 'a';
            else if(s1[i] != 'b' && s2[i] != 'b')
                s3[i] = 'b';
            else
                s3[i] = 'c';
        }
    }
   }
   int T = t-foo;
   for(int i = 0; i < n; i ++){
    if(s1[i] != s2[i]){
        if(tmp < cnt){
            tmp++;
            s3[i] = s2[i];
        }
        else if(T > 0){
            if(s1[i] != 'a' && s2[i] != 'a')
                s3[i] = 'a';
            else if(s1[i] != 'b' && s2[i] != 'b')
                s3[i] = 'b';
            else
                s3[i] = 'c';
        } else if(T < 0){
            s3[i] = s1[i];
        }
    }
   }
   for(int i = 0; i < n; i ++){
    cnt1 += s1[i] != s3[i];
    cnt2 += s2[i] != s3[i];
   }
   if(cnt1 != cnt2 || (cnt1 < t)){
    cout << -1 << endl;
    return 0;
   }
   cout << s3;
}


#include <bits/stdc++.h>
#define CON 1000000007

using namespace std;

int main(){
   ios_base::sync_with_stdio(false);
   cin.tie(NULL), cout.tie(NULL);
   int n , t , cnt1 = 0 , cnt2 = 0 , cnt = 0;
   cin >> n >> t;
   string s1 , s2;
   cin >> s1 >> s2;
   string s3 = "";
   for(int i = 0; i < n; i ++)
    cnt += (s1[i] != s2[i]);
     int tmp = t-cnt;
   for(int i = 0; i < n; i ++){
    if(s1[i] == s2[i]){
        if(max(cnt1 , cnt2) < t && tmp){
            cnt1 ++;
            cnt2 ++;
            tmp --;
            if(s1[i] == 'a'){
                s3 += "b";
            } else
                s3 += "a";
        } else
            s3 += s1[i];
    }
    else {
        if(cnt1 <= cnt2){
            if(cnt/2 + cnt%2 >= t){
                s3 += s2[i];
                cnt1++;
            } else {
                cnt1++;
                cnt2++;
                if(s1[i] != 'a' && s2[i] != 'a')
                    s3 += "a";
                else if(s1[i] != 'b' && s2[i] != 'b')
                    s3 += "b";
                else
                    s3 += "c";
            }
        } else {
            s3 += s1[i];
            cnt2 ++;
        }
    }
   }
   if(cnt1 != cnt2 || cnt1 != t){
    cout << -1 << endl;
    return 0;
   }
   cout << s3;
}


#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define ll long long
#define pll pair<ll,ll>
#define all(v) v.begin(),v.end()
#define pil pair<int,ll>
#define pli pair<ll,int>
#define itr iterator
#define mod 1000000007LL
#define ll long long
char func(char a,char b)
{
    for(int i=0; i<26; i++)
    {
        char ch='a'+i;
        if(ch!=a&&ch!=b)
            return ch;
    }
}
int main()
{
    int n,i,j,com=0,t,k;
    string a,b;
    cin>>n>>k>>a>>b;
    t=k;
    if(t==0)
    {
        if(a==b)
            cout<<a<<endl;
        else
            cout<<-1<<endl;
        return 0;
    }
    if(t==n)
    {
        string h=a;
        for(i=0; i<n; i++)
            h[i]=func(a[i],b[i]);
        cout<<h<<endl;
        return 0;
    }
    for(i=0; i<n; i++)
        if(a[i]==b[i])
            com++;
    int c=com;
    string h=a;
    if(n-k<=com)
    {
        com=com-(n-k);
        if(com>0)
        for(i=0; i<n; i++)
        {
            if(a[i]==b[i])
            {
                h[i]=func(a[i],b[i]);
                com--;
            }
            if(com==0)
                break;
        }
        //cout<<i<<h<<endl;
        for(i=0;i<n;i++)
            if(a[i]!=b[i])
                h[i]=func(a[i],b[i]);
        cout<<h<<endl;
    }
    else
    {
        int need=n-k-c;
        if(2*need>(n-c))
        {
            printf("-1\n");
            return 0;
        }
        int y=need;
        if(y>0)
        for(i=0;i<n;i++)
        {
            if(a[i]!=b[i])
                h[i]=b[i],y--;
            if(y==0)
                break;
        }
        else
            i=-1;
        y=need;
        if(y>0)
        for(i=i+1;i<n;i++)
        {
            if(a[i]!=b[i])
                h[i]=a[i],y--;
            if(y==0)
                break;
        }
        for(i=i+1;i<n;i++)
            if(a[i]!=b[i])
                h[i]=func(a[i],b[i]);
        cout<<h<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define ll long long
#define pll pair<ll,ll>
#define all(v) v.begin(),v.end()
#define pil pair<int,ll>
#define pli pair<ll,int>
#define itr iterator
#define mod 1000000007LL
char func(char a,char b)
{
    for(int i=0;i<26;i++)
        if(a!='a'+i&&b!='a'+i)
            return ('a'+i);
}
//#define ll long long
//ll modulo(ll a,ll b,ll c)
//{
//    ll x=1LL,y=a; // long long is taken to avoid overflow of intermediate results
//    while(b > 0LL)
//    {
//        if(b%2LL == 1LL)
//        {
//            x=(x*y)%c;
//        }
//        y = (y*y)%c; // squaring the base
//        b /= 2LL;
//    }
//    return x%c;
//}

//ll a[100011];
int main()
{
    int n,i,j,k,l,c=0;
    cin>>n>>k;
    string a,b;
    cin>>a>>b;
    for(i=0;i<n;i++)
        if(a[i]!=b[i])
            c++;
    if(c>k)
    {
        printf("-1\n");
        return 0;
    }
    string h=a;
    for(i=0;i<n;i++)
        if(a[i]!=b[i])
            h[i]=func(a[i],b[i]);
    k-=c;
    if(k>0)
    for(i=0;i<n;i++)
    {
        if(a[i]==b[i])
            h[i]=func(a[i],b[i]),k--;
        if(k==0)
            break;
    }
    cout<<h<<endl;
//    int i,n;
//    a[0]=1;
//    a[1]=4;
//    for(i=2;i<=100000;i++)
//        a[i]=(((5*a[i-1]-5*a[i-2])%mod)+mod)%mod;
//    scanf("%d",&n);
//    ll ans=(((a[n]*(a[n]+1))%mod)*(a[n]+2LL))%mod;
//    ans=ans*modulo(6LL,mod-2,mod);
//    ans=ans%mod;
//    printf("%lld\n",ans);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define ll long long
#define pll pair<ll,ll>
#define all(v) v.begin(),v.end()
#define pil pair<int,ll>
#define pli pair<ll,int>
#define itr iterator
#define mod 1000000007LL
#define ll long long
char func(char a,char b)
{
    for(int i=0; i<26; i++)
    {
        char ch='a'+i;
        if(ch!='a'&&ch!='b')
            return ch;
    }
}
int main()
{
    int n,i,j,com=0,t,k;
    string a,b;
    cin>>n>>k>>a>>b;
    t=k;
    if(t==0)
    {
        if(a==b)
            cout<<a<<endl;
        else
            cout<<-1<<endl;
        return 0;
    }
    if(t==n)
    {
        string h=a;
        for(i=0; i<n; i++)
            h[i]=func(a[i],b[i]);
        cout<<h<<endl;
        return 0;
    }
    for(i=0; i<n; i++)
        if(a[i]==b[i])
            com++;
    int c=com;
    string h=a;
    if(n-k<=com)
    {
        com=com-(n-k);
        if(com>0)
        for(i=0; i<n; i++)
        {
            if(a[i]==b[i])
            {
                h[i]=func(a[i],b[i]);
                com--;
            }
            if(com==0)
                break;
        }
        for(i=0;i<n;i++)
            if(a[i]!=b[i])
                h[i]=func(a[i],b[i]);
        cout<<h<<endl;
    }
    else
    {
        int need=n-k-c;
        if(2*need>(n-c))
        {
            printf("-1\n");
            return 0;
        }
        int y=need;
        if(y>0)
        for(i=0;i<n;i++)
        {
            if(a[i]!=b[i])
                h[i]=b[i],y--;
            if(y==0)
                break;
        }
        else
            i=-1;
        y=need;
        if(y>0)
        for(i=i+1;i<n;i++)
        {
            if(a[i]!=b[i])
                h[i]=a[i],y--;
            if(y==0)
                break;
        }
        for(i=i+1;i<n;i++)
            if(a[i]!=b[i])
                h[i]=func(a[i],b[i]);
        cout<<h<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define ll long long
#define pll pair<ll,ll>
#define all(v) v.begin(),v.end()
#define pil pair<int,ll>
#define pli pair<ll,int>
#define itr iterator
char func(char a,char b)
{
    char ch;
    if(a!='a')
        ch='a';
    else if(b!='b')
        ch='b';
    else
        ch='c';
    return ch;
}
int main()
{
    int n,i,j,k,l,c=0;
    cin>>n>>k;
    string a,b;
    cin>>a>>b;
    for(i=0;i<n;i++)
        if(a[i]!=b[i])
            c++;
    if(c>k)
    {
        printf("-1\n");
        return 0;
    }
    string h=a;
    for(i=0;i<n;i++)
        if(a[i]!=b[i])
            h[i]=func(a[i],b[i]);
    k-=c;
    for(i=0;i<n;i++)
    {
        if(a[i]==b[i])
            h[i]=func(a[i],b[i]),k--;
        if(k==0)
            break;
    }
    cout<<h<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define ll long long
#define pll pair<ll,ll>
#define all(v) v.begin(),v.end()
#define pil pair<int,ll>
#define pli pair<ll,int>
#define itr iterator
#define mod 1000000007LL
#define ll long long
char func(char a,char b)
{
    for(int i=0; i<26; i++)
    {
        char ch='a'+i;
        if(ch!='a'&&ch!='b')
            return ch;
    }
}
int main()
{
    int n,i,j,com=0,t,k;
    string a,b;
    cin>>n>>k>>a>>b;
    t=k;
    if(t==0)
    {
        if(a==b)
            cout<<a<<endl;
        else
            cout<<-1<<endl;
        return 0;
    }
    if(t==n)
    {
        string h=a;
        for(i=0; i<n; i++)
            h[i]=func(a[i],b[i]);
        cout<<h<<endl;
        return 0;
    }
    for(i=0; i<n; i++)
        if(a[i]==b[i])
            com++;
    int c=com;
    string h=a;
    if(n-k<=com)
    {
        com=com-(n-k);
        for(i=0; i<n; i++)
        {
            if(a[i]==b[i])
            {
                h[i]=func(a[i],b[i]);
                com--;
            }
            if(com==0)
                break;
        }
        for(i=0;i<n;i++)
            if(a[i]!=b[i])
                h[i]=func(a[i],b[i]);
        cout<<h<<endl;
    }
    else
    {
        int need=n-k-c;
        if(2*need>(n-c))
        {
            printf("-1\n");
            return 0;
        }
        int y=need;
        if(y>0)
        for(i=0;i<n;i++)
        {
            if(a[i]!=b[i])
                h[i]=b[i],y--;
            if(y==0)
                break;
        }
        else
            i=-1;
        y=need;
        if(y>0)
        for(i=i+1;i<n;i++)
        {
            if(a[i]!=b[i])
                h[i]=a[i],y--;
            if(y==0)
                break;
        }
        for(i=i+1;i<n;i++)
            if(a[i]!=b[i])
                h[i]=func(a[i],b[i]);
        cout<<h<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define ll long long
#define pll pair<ll,ll>
#define all(v) v.begin(),v.end()
#define pil pair<int,ll>
#define pli pair<ll,int>
#define itr iterator
#define mod 1000000007LL
#define ll long long
char func(char a,char b)
{
    for(int i=0; i<26; i++)
    {
        char ch='a'+i;
        if(ch!='a'&&ch!='b')
            return ch;
    }
}
int main()
{
    int n,i,j,com=0,t,k;
    string a,b;
    cin>>n>>k>>a>>b;
    t=k;
    if(t==0)
    {
        if(a==b)
            cout<<a<<endl;
        else
            cout<<-1<<endl;
        return 0;
    }
    if(t==n)
    {
        string h=a;
        for(i=0; i<n; i++)
            h[i]=func(a[i],b[i]);
        cout<<h<<endl;
        return 0;
    }
    for(i=0; i<n; i++)
        if(a[i]==b[i])
            com++;
    int c=com;
    string h=a;
    if(n-k<=com)
    {
        com=com-(n-k);
        for(i=0; i<n; i++)
        {
            if(a[i]==b[i])
            {
                h[i]=func(a[i],b[i]);
                com--;
            }
            if(com==0)
                break;
        }
        for(i=0;i<n;i++)
            if(a[i]!=b[i])
                h[i]=func(a[i],b[i]);
        cout<<h<<endl;
    }
    else
    {
        int need=n-k-c;
        if(2*need>(n-c))
        {
            printf("-1\n");
            return 0;
        }
        int y=need;
        if(y>0)
        for(i=0;i<n;i++)
        {
            if(a[i]!=b[i])
                h[i]=b[i],y--;
            if(y==0)
                break;
        }
        y=need;
        if(y>0)
        for(i=i+1;i<n;i++)
        {
            if(a[i]!=b[i])
                h[i]=a[i],y--;
            if(y==0)
                break;
        }
        for(i=i+1;i<n;i++)
            if(a[i]!=b[i])
                h[i]=func(a[i],b[i]);
        cout<<h<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define ll long long
#define pll pair<ll,ll>
#define all(v) v.begin(),v.end()
#define pil pair<int,ll>
#define pli pair<ll,int>
#define itr iterator
#define mod 1000000007LL
char func(char a,char b)
{
    for(int i=0; i<26; i++)
        if(a!='a'+i&&b!='a'+i)
            return ('a'+i);
}
//#define ll long long
//ll modulo(ll a,ll b,ll c)
//{
//    ll x=1LL,y=a; // long long is taken to avoid overflow of intermediate results
//    while(b > 0LL)
//    {
//        if(b%2LL == 1LL)
//        {
//            x=(x*y)%c;
//        }
//        y = (y*y)%c; // squaring the base
//        b /= 2LL;
//    }
//    return x%c;
//}

//ll a[100011];
int main()
{
    int n,i,j,k,l,t=k,c=0;
    cin>>n>>k;
    t=k;
    string a,b;
    cin>>a>>b;
    if(t==0)
    {
        if(a!=b)
            printf("-1\n");
        else
            cout<<a<<endl;
        return 0;
    }
    if(n==1)
    {
        if(a!=b)
            printf("%c",func(a[0],b[0]));
        else
            printf("-1\n");
        return 0;
    }
    if(k==n)
    {
        string h=a;
        for(i=0;i<n;i++)
            h[i]=func(a[i],b[i]);
        cout<<h<<endl;
        return 0;
    }
    for(i=0; i<n; i++)
        if(a[i]==b[i])
            c++;
    string h=a;
    int sm=n-k-c;
    if(n-c<(2*sm))
    {
        printf("-1\n");
        return 0;
    }
    c=0;
    sm=2*sm;
    //cout<<h<<" "<<sm<<endl;
    if(sm>0)
    {
        for(i=0; i<n; i++)
            if(a[i]!=b[i])
            {
                if(c%2==1)
                    h[i]=b[i];
                sm--;
                if(sm==0)
                    break;
                c++;
            }
    }
    else
        i=-1;
    //cout<<a<<" "<<b<<" "<<i<<endl;
    for(i=i+1; i<n; i++)
        if(a[i]!=b[i])
            h[i]=func(a[i],b[i]);
    cout<<h<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define ll long long
#define pll pair<ll,ll>
#define all(v) v.begin(),v.end()
#define pil pair<int,ll>
#define pli pair<ll,int>
#define itr iterator
#define mod 1000000007LL
char func(char a,char b)
{
    for(int i=0; i<26; i++)
        if(a!='a'+i&&b!='a'+i)
            return ('a'+i);
}
//#define ll long long
//ll modulo(ll a,ll b,ll c)
//{
//    ll x=1LL,y=a; // long long is taken to avoid overflow of intermediate results
//    while(b > 0LL)
//    {
//        if(b%2LL == 1LL)
//        {
//            x=(x*y)%c;
//        }
//        y = (y*y)%c; // squaring the base
//        b /= 2LL;
//    }
//    return x%c;
//}

//ll a[100011];
int main()
{
    int n,i,j,k,l,t=k,c=0;
    cin>>n>>k;
    string a,b;
    cin>>a>>b;
    if(t==0)
    {
        if(a!=b)
            printf("-1\n");
        else
            cout<<a<<endl;
        return 0;
    }
    for(i=0; i<n; i++)
        if(a[i]==b[i])
            c++;
    string h=a;
    int sm=n-k-c;
    if(n-c<(2*sm))
    {
        printf("-1\n");
        return 0;
    }
    c=0;
    sm=2*sm;
    //cout<<h<<" "<<sm<<endl;
    if(sm>0)
    {
        for(i=0; i<n; i++)
            if(a[i]!=b[i])
            {
                if(c%2==1)
                    h[i]=b[i];
                sm--;
                if(sm==0)
                    break;
                c++;
            }
    }
    else
        i=-1;
    //cout<<a<<" "<<b<<" "<<i<<endl;
    for(i=i+1; i<n; i++)
        if(a[i]!=b[i])
            h[i]=func(a[i],b[i]);
    cout<<h<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define ll long long
#define pll pair<ll,ll>
#define all(v) v.begin(),v.end()
#define pil pair<int,ll>
#define pli pair<ll,int>
#define itr iterator
char func(char a,char b)
{
    char ch;
    if(a!='a')
        ch='a';
    else if(b!='b')
        ch='b';
    else
        ch='c';
    return ch;
}
int main()
{
    int n,i,j,k,l,c=0;
    cin>>n>>k;
    string a,b;
    cin>>a>>b;
    for(i=0;i<n;i++)
        if(a[i]!=b[i])
            c++;
    if(c>k)
    {
        printf("-1\n");
        return 0;
    }
    string h=a;
    for(i=0;i<n;i++)
        if(a[i]!=b[i])
            h[i]=func(a[i],b[i]);
    k-=c;
    if(k>0)
    for(i=0;i<n;i++)
    {
        if(a[i]==b[i])
            h[i]=func(a[i],b[i]),k--;
        if(k==0)
            break;
    }
    cout<<h<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define ll int
#define lll long long int
#define s(a) scanf("%d",&a)

#define slll(a) scanf("%lld",&a)
#define fr(i,n) for(i=0;i<n;i++)
#define fra(i,a,n) for(i=a;i<n;i++)
//#define N 100010
#define MAX 500100
#define inf INT_MAX
#define MOD 1000000007
/*#define gc getchar_unlocked

void scanint(int &x)
{
    register int c = gc();
    x = 0;
    for(;(c<48 || c>57);c = gc());
    for(;c>47 && c<58;c = gc()) {x = (x<<1) + (x<<3) + c - 48;}
}*/

ll gcd(ll a,ll b)
{
   if(b==0)
   return a;
   return gcd(b,a%b);
}
struct node
{
  ll x;

};
bool cmp(node a,node b)
{
  return a.x<b.x;
}
lll poww(lll a, lll b)
{

  lll x = 1, y = a;
    while(b > 0) {
        if(b%2 == 1) {
            x=(x*y);
            if(x>MOD) x%=MOD;
        }
        y = (y*y);
        if(y>MOD) y%=MOD;
        b /= 2;
    }
    return x;
}
/*bool prime[10000010];

void primer()
{
    memset(prime,1,sizeof(prime));
   prime[1]=0;

   for(i=2;i*i<=10000000;i++)
   {
     //cout<<i;
      if(prime[i])
      {
         for(j=i*i;j<=10000000;j+=i)
         {
            prime[j]=0;
            //cout<<"j"<<j;
         }
      }
   }
}*/
int main()
{
    ll n,t,i,j,count=0;
    s(n); s(t);
    char a[n+2],b[n+2],c[n+2];

    scanf("%s",a);
    scanf("%s",b);

    fr(i,n)
    {
       if(a[i]!=b[i])
       count++;
    }

    if(t<count)
    {cout<<"-1";
    return 0;
    }
    fr(i,n)
    {
      c[i]=a[i];
    }
    fr(i,n)
    {
       if(t && a[i]!=b[i])
       {
          fra(j,97,123)
          {
             char x = j;

             if(a[i]!=x && b[i]!=x)
             {
                c[i]=x;
                break;
             }
          }
          t--;
       }

    }
    fr(i,n)
    {
       if(t && a[i]==b[i])
       {
          fra(j,97,123)
          {
             char x = j;

             if(a[i]!=x && b[i]!=x)
             {
                c[i]=x;
                break;
             }
          }
          t--;
       }
    }
    c[n]='\0';
    cout<<c;
   return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define ll int
#define lll long long int
#define s(a) scanf("%d",&a)

#define slll(a) scanf("%lld",&a)
#define fr(i,n) for(i=0;i<n;i++)
#define fra(i,a,n) for(i=a;i<n;i++)
//#define N 100010
#define MAX 500100
#define inf INT_MAX
#define MOD 1000000007
/*#define gc getchar_unlocked

void scanint(int &x)
{
    register int c = gc();
    x = 0;
    for(;(c<48 || c>57);c = gc());
    for(;c>47 && c<58;c = gc()) {x = (x<<1) + (x<<3) + c - 48;}
}*/

ll gcd(ll a,ll b)
{
   if(b==0)
   return a;
   return gcd(b,a%b);
}
struct node
{
  ll x;

};
bool cmp(node a,node b)
{
  return a.x<b.x;
}
lll poww(lll a, lll b)
{

  lll x = 1, y = a;
    while(b > 0) {
        if(b%2 == 1) {
            x=(x*y);
            if(x>MOD) x%=MOD;
        }
        y = (y*y);
        if(y>MOD) y%=MOD;
        b /= 2;
    }
    return x;
}
/*bool prime[10000010];

void primer()
{
    memset(prime,1,sizeof(prime));
   prime[1]=0;

   for(i=2;i*i<=10000000;i++)
   {
     //cout<<i;
      if(prime[i])
      {
         for(j=i*i;j<=10000000;j+=i)
         {
            prime[j]=0;
            //cout<<"j"<<j;
         }
      }
   }
}*/
int main()
{

    ll n,t,i,j,count=0;
    s(n); s(t);
    char a[n+2],b[n+2],c[n+2];

    scanf("%s",a);
    scanf("%s",b);

    fr(i,n)
    {
       if(a[i]!=b[i])
       count++;
    }
     fr(i,n)
    {
      c[i]=a[i];
    }
    if(t<count && t==0)
    cout<<"-1";

    else if(t<count && (count-t)<=t)
    {
       //cout<<"part1";
       ll fir = t-count+t;
       fr(i,n)
       {
          if(fir)
          {
          if(a[i]!=b[i])
          {
             c[i]=b[i];
             fir--;
          }
          }
          else
          break;
       }
       fir = count-t;ll k;
       fra(j,i,n)
       {
           if(a[j]!=b[j] && fir)
           {
              fra(k,97,123)
             {
             char x = k;

             if(a[j]!=x && b[j]!=x)
             {
                c[j]=x;
                break;
             }
             }
             fir--;
           }
       }
       c[n]='\0';
       cout<<c;

    }
    else if(t<count && (count-t)>t)
    {cout<<"-1";}
    else
    {
    fr(i,n)
    {
       if(t && a[i]!=b[i])
       {
          fra(j,97,123)
          {
             char x = j;

             if(a[i]!=x && b[i]!=x)
             {
                c[i]=x;
                break;
             }
          }
          t--;
       }

    }
    fr(i,n)
    {
       if(t && a[i]==b[i])
       {
          fra(j,97,123)
          {
             char x = j;

             if(a[i]!=x && b[i]!=x)
             {
                c[i]=x;
                break;
             }
          }
          t--;
       }
    }
    c[n]='\0';
    cout<<c;
   }
   return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define ll int
#define lll long long int
#define s(a) scanf("%d",&a)

#define slll(a) scanf("%lld",&a)
#define fr(i,n) for(i=0;i<n;i++)
#define fra(i,a,n) for(i=a;i<n;i++)
//#define N 100010
#define MAX 500100
#define inf INT_MAX
#define MOD 1000000007
/*#define gc getchar_unlocked

void scanint(int &x)
{
    register int c = gc();
    x = 0;
    for(;(c<48 || c>57);c = gc());
    for(;c>47 && c<58;c = gc()) {x = (x<<1) + (x<<3) + c - 48;}
}*/

ll gcd(ll a,ll b)
{
   if(b==0)
   return a;
   return gcd(b,a%b);
}
struct node
{
  ll x;

};
bool cmp(node a,node b)
{
  return a.x<b.x;
}
lll poww(lll a, lll b)
{

  lll x = 1, y = a;
    while(b > 0) {
        if(b%2 == 1) {
            x=(x*y);
            if(x>MOD) x%=MOD;
        }
        y = (y*y);
        if(y>MOD) y%=MOD;
        b /= 2;
    }
    return x;
}
/*bool prime[10000010];

void primer()
{
    memset(prime,1,sizeof(prime));
   prime[1]=0;

   for(i=2;i*i<=10000000;i++)
   {
     //cout<<i;
      if(prime[i])
      {
         for(j=i*i;j<=10000000;j+=i)
         {
            prime[j]=0;
            //cout<<"j"<<j;
         }
      }
   }
}*/
int main()
{

   ll n,t,i,j,k,diff,x;
   s(n); s(t);
   char a[n+2],b[n+2],c[n+2];
   scanf("%s",a);
   scanf("%s",b);
   diff=0;
   fr(i,n)
   {
      if(a[i]!=b[i])
      diff++;
   }
   fr(i,n)
       c[i]=a[i];

   if(diff<t)
   {

       fr(i,n)
       {
          if(a[i]!=b[i] && t)
          {
             fra(j,97,123)
             {
               char x = j;
               if(a[i]!=x && b[i]!=x)
               {
                 c[i]=x;
                 break;
               }
             }
             t--;
          }
       }
       fr(i,n)
       {
          if(a[i]==b[i] && t)
          {
             fra(j,97,123)
             {
               char x = j;
               if(a[i]!=x)
               {
                 c[i]=x;
                 break;
               }
             }
             t--;
          }
       }
       c[n]='\0';
       cout<<c;
   }
   else if(diff==t)
   {
       fr(i,n)
       {
          if(a[i]!=b[i] && t)
          {
             fra(j,97,123)
             {
               char x = j;
               if(a[i]!=x && b[i]!=x)
               {
                 c[i]=x;
                 break;
               }
             }
             t--;
          }
       }
       c[n]='\0';
       cout<<c;
   }
   else
   {
       if((diff-t)<=t)
       {
           x = 2*t-diff;
           fr(i,n)
           {
              if(x==0)
              break;
              if(a[i]!=b[i])
              {
                 fra(j,97,123)
                 {
                              char x = j;
                              if(a[i]!=x && b[i]!=x)
                              {
                              c[i]=x;
                              break;
                              }
                  }
                  x--;
              }
           }
           x = diff-t;
           fra(j,i,n)
           {
              if(x==0)
              break;
              if(a[j]!=b[j])
              {
                 c[j]=b[j];
                  x--;
              }
           }
           c[n]='\0';
           cout<<c;
       }
       else
       cout<<"-1";
   }
   return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define ll int
#define lll long long int
#define s(a) scanf("%d",&a)

#define slll(a) scanf("%lld",&a)
#define fr(i,n) for(i=0;i<n;i++)
#define fra(i,a,n) for(i=a;i<n;i++)
//#define N 100010
#define MAX 500100
#define inf INT_MAX
#define MOD 1000000007
/*#define gc getchar_unlocked

void scanint(int &x)
{
    register int c = gc();
    x = 0;
    for(;(c<48 || c>57);c = gc());
    for(;c>47 && c<58;c = gc()) {x = (x<<1) + (x<<3) + c - 48;}
}*/

ll gcd(ll a,ll b)
{
   if(b==0)
   return a;
   return gcd(b,a%b);
}
struct node
{
  ll x;

};
bool cmp(node a,node b)
{
  return a.x<b.x;
}
lll poww(lll a, lll b)
{

  lll x = 1, y = a;
    while(b > 0) {
        if(b%2 == 1) {
            x=(x*y);
            if(x>MOD) x%=MOD;
        }
        y = (y*y);
        if(y>MOD) y%=MOD;
        b /= 2;
    }
    return x;
}
/*bool prime[10000010];

void primer()
{
    memset(prime,1,sizeof(prime));
   prime[1]=0;

   for(i=2;i*i<=10000000;i++)
   {
     //cout<<i;
      if(prime[i])
      {
         for(j=i*i;j<=10000000;j+=i)
         {
            prime[j]=0;
            //cout<<"j"<<j;
         }
      }
   }
}*/
int main()
{

   ll n,t,i,j,k,diff,x;
   s(n); s(t);
   char a[n+2],b[n+2],c[n+2];
   scanf("%s",a);
   scanf("%s",b);
   diff=0;
   fr(i,n)
   {
      if(a[i]!=b[i])
      diff++;
   }
   fr(i,n)
       c[i]=a[i];

   if(diff<t)
   {

       fr(i,n)
       {
          if(a[i]!=b[i] && t)
          {
             fra(j,97,123)
             {
               char x = j;
               if(a[i]!=x && b[i]!=x)
               {
                 c[i]=x;
                 break;
               }
             }
             t--;
          }
       }
       fr(i,n)
       {
          if(a[i]==b[i] && t)
          {
             fra(j,97,123)
             {
               char x = j;
               if(a[i]!=x)
               {
                 c[i]=x;
                 break;
               }
             }
             t--;
          }
       }
       c[n]='\0';
       cout<<c;
   }
   else if(diff==t)
   {
       fr(i,n)
       {
          if(a[i]!=b[i] && t)
          {
             fra(j,97,123)
             {
               char x = j;
               if(a[i]!=x && b[i]!=x)
               {
                 c[i]=x;
                 break;
               }
             }
             t--;
          }
       }
       c[n]='\0';
       cout<<c;
   }
   else
   {
       if((diff-t)<t)
       {
           x = 2*t-diff;
           fr(i,n)
           {
              if(x==0)
              break;
              if(a[i]!=b[i])
              {
                 fra(j,97,123)
                 {
                              char x = j;
                              if(a[i]!=x && b[i]!=x)
                              {
                              c[i]=x;
                              break;
                              }
                  }
                  x--;
              }
           }
           x = diff-t;
           fra(j,i,n)
           {
              if(x==0)
              break;
              if(a[i]!=b[i])
              {
                 c[i]=b[i];
                  x--;
              }
           }
           c[n]='\0';
           cout<<c;
       }
       else
       cout<<"-1";
   }
   return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define ll int
#define lll long long int
#define s(a) scanf("%d",&a)

#define slll(a) scanf("%lld",&a)
#define fr(i,n) for(i=0;i<n;i++)
#define fra(i,a,n) for(i=a;i<n;i++)
//#define N 100010
#define MAX 500100
#define inf INT_MAX
#define MOD 1000000007
/*#define gc getchar_unlocked

void scanint(int &x)
{
    register int c = gc();
    x = 0;
    for(;(c<48 || c>57);c = gc());
    for(;c>47 && c<58;c = gc()) {x = (x<<1) + (x<<3) + c - 48;}
}*/

ll gcd(ll a,ll b)
{
   if(b==0)
   return a;
   return gcd(b,a%b);
}
struct node
{
  ll x;

};
bool cmp(node a,node b)
{
  return a.x<b.x;
}
lll poww(lll a, lll b)
{

  lll x = 1, y = a;
    while(b > 0) {
        if(b%2 == 1) {
            x=(x*y);
            if(x>MOD) x%=MOD;
        }
        y = (y*y);
        if(y>MOD) y%=MOD;
        b /= 2;
    }
    return x;
}
/*bool prime[10000010];

void primer()
{
    memset(prime,1,sizeof(prime));
   prime[1]=0;

   for(i=2;i*i<=10000000;i++)
   {
     //cout<<i;
      if(prime[i])
      {
         for(j=i*i;j<=10000000;j+=i)
         {
            prime[j]=0;
            //cout<<"j"<<j;
         }
      }
   }
}*/
int main()
{
    ll n,t,i,j,count=0;
    s(n); s(t);
    char a[n+2],b[n+2],c[n+2];

    scanf("%s",a);
    scanf("%s",b);

    fr(i,n)
    {
       if(a[i]!=b[i])
       count++;
    }

    if(t<count)
    {cout<<"-1";
    return 0;
    }

    fr(i,n)
    {
       if(t && a[i]!=b[i])
       {
          fra(j,97,123)
          {
             char x = j;

             if(a[i]!=x && b[i]!=x)
             {
                c[i]=x;
                break;
             }
          }
       }
       else
       {
          c[i]=a[i];
       }
    }
    c[n]='\0';
    cout<<c;
   return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define ll int
#define lll long long int
#define s(a) scanf("%d",&a)

#define slll(a) scanf("%lld",&a)
#define fr(i,n) for(i=0;i<n;i++)
#define fra(i,a,n) for(i=a;i<n;i++)
//#define N 100010
#define MAX 500100
#define inf INT_MAX
#define MOD 1000000007
/*#define gc getchar_unlocked

void scanint(int &x)
{
    register int c = gc();
    x = 0;
    for(;(c<48 || c>57);c = gc());
    for(;c>47 && c<58;c = gc()) {x = (x<<1) + (x<<3) + c - 48;}
}*/

ll gcd(ll a,ll b)
{
   if(b==0)
   return a;
   return gcd(b,a%b);
}
struct node
{
  ll x;

};
bool cmp(node a,node b)
{
  return a.x<b.x;
}
lll poww(lll a, lll b)
{

  lll x = 1, y = a;
    while(b > 0) {
        if(b%2 == 1) {
            x=(x*y);
            if(x>MOD) x%=MOD;
        }
        y = (y*y);
        if(y>MOD) y%=MOD;
        b /= 2;
    }
    return x;
}
/*bool prime[10000010];

void primer()
{
    memset(prime,1,sizeof(prime));
   prime[1]=0;

   for(i=2;i*i<=10000000;i++)
   {
     //cout<<i;
      if(prime[i])
      {
         for(j=i*i;j<=10000000;j+=i)
         {
            prime[j]=0;
            //cout<<"j"<<j;
         }
      }
   }
}*/
int main()
{

   ll n,t,i,j,k,diff,x;
   s(n); s(t);
   char a[n+2],b[n+2],c[n+2];
   scanf("%s",a);
   scanf("%s",b);
   diff=0;
   fr(i,n)
   {
      if(a[i]!=b[i])
      diff++;
   }
   fr(i,n)
       c[i]=a[i];

   if(diff<t)
   {

       fr(i,n)
       {
          if(a[i]!=b[i] && t)
          {
             fra(j,97,123)
             {
               char x = j;
               if(a[i]!=x && b[i]!=x)
               {
                 c[i]=x;
                 break;
               }
             }
             t--;
          }
       }
       fr(i,n)
       {
          if(a[i]==b[i] && t)
          {
             fra(j,97,123)
             {
               char x = j;
               if(a[i]!=x)
               {
                 c[i]=x;
                 break;
               }
             }
             t--;
          }
       }
       c[n]='\0';
       cout<<c;
   }
   else if(diff==t)
   {
       fr(i,n)
       {
          if(a[i]!=b[i] && t)
          {
             fra(j,97,123)
             {
               char x = j;
               if(a[i]!=x && b[i]!=x)
               {
                 c[i]=x;
                 break;
               }
             }
             t--;
          }
       }
       c[n]='\0';
       cout<<c;
   }
   else
   {
       if((diff-t)<t)
       {
           x = 2*t-diff;
           fr(i,n)
           {
              if(x==0)
              break;
              if(a[i]!=b[i])
              {
                 fra(j,97,123)
                 {
                              char x = j;
                              if(a[i]!=x && b[i]!=x)
                              {
                              c[i]=x;
                              break;
                              }
                  }
                  x--;
              }
           }
           x = diff-t;
           fra(j,i,n)
           {
              if(x==0)
              break;
              if(a[j]!=b[j])
              {
                 c[j]=b[j];
                  x--;
              }
           }
           c[n]='\0';
           cout<<c;
       }
       else
       cout<<"-1";
   }
   return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define ll int
#define lll long long int
#define s(a) scanf("%d",&a)

#define slll(a) scanf("%lld",&a)
#define fr(i,n) for(i=0;i<n;i++)
#define fra(i,a,n) for(i=a;i<n;i++)
//#define N 100010
#define MAX 500100
#define inf INT_MAX
#define MOD 1000000007
/*#define gc getchar_unlocked

void scanint(int &x)
{
    register int c = gc();
    x = 0;
    for(;(c<48 || c>57);c = gc());
    for(;c>47 && c<58;c = gc()) {x = (x<<1) + (x<<3) + c - 48;}
}*/

ll gcd(ll a,ll b)
{
   if(b==0)
   return a;
   return gcd(b,a%b);
}
struct node
{
  ll x;

};
bool cmp(node a,node b)
{
  return a.x<b.x;
}
lll poww(lll a, lll b)
{

  lll x = 1, y = a;
    while(b > 0) {
        if(b%2 == 1) {
            x=(x*y);
            if(x>MOD) x%=MOD;
        }
        y = (y*y);
        if(y>MOD) y%=MOD;
        b /= 2;
    }
    return x;
}
/*bool prime[10000010];

void primer()
{
    memset(prime,1,sizeof(prime));
   prime[1]=0;

   for(i=2;i*i<=10000000;i++)
   {
     //cout<<i;
      if(prime[i])
      {
         for(j=i*i;j<=10000000;j+=i)
         {
            prime[j]=0;
            //cout<<"j"<<j;
         }
      }
   }
}*/
int main()
{

    ll n,t,i,j,count=0;
    s(n); s(t);
    char a[n+2],b[n+2],c[n+2];

    scanf("%s",a);
    scanf("%s",b);

    fr(i,n)
    {
       if(a[i]!=b[i])
       count++;
    }
     fr(i,n)
    {
      c[i]=a[i];
    }
    if(t<count && t==0)
    cout<<"-1";

    else if(t<count)
    {
       //cout<<"part1";
       ll fir = t-count+t;
       fr(i,n)
       {
          if(fir)
          {
          if(a[i]!=b[i])
          {
             c[i]=b[i];
             fir--;
          }
          }
          else
          break;
       }
       fir = count-t;ll k;
       fra(j,i,n)
       {
           if(a[j]!=b[j] && fir)
           {
              fra(k,97,123)
             {
             char x = k;

             if(a[j]!=x && b[j]!=x)
             {
                c[j]=x;
                break;
             }
             }
             fir--;
           }
       }
       c[n]='\0';
       cout<<c;

    }
    else
    {
    fr(i,n)
    {
       if(t && a[i]!=b[i])
       {
          fra(j,97,123)
          {
             char x = j;

             if(a[i]!=x && b[i]!=x)
             {
                c[i]=x;
                break;
             }
          }
          t--;
       }

    }
    fr(i,n)
    {
       if(t && a[i]==b[i])
       {
          fra(j,97,123)
          {
             char x = j;

             if(a[i]!=x && b[i]!=x)
             {
                c[i]=x;
                break;
             }
          }
          t--;
       }
    }
    c[n]='\0';
    cout<<c;
   }
   return 0;
}


#include <iostream>
#include <string.h>
#include <stdlib.h>
using namespace std;
int main(){
    int n,t,i,count;
    char str1[100001],str2[100001];
    cin>>n>>t;
    int f[n];
    cin>>str1>>str2;
    if(t>n)
    cout<<"-1";
//  else if(t==n){
//      if(strcmp(str1,str2)==0)
//      cout<<str1;
//      else
//      cout<<"-1";
//  }
    else{
        int match_count = 0;
        for(i=0;i<n;i++){
            f[i] = 0;
        }
        for(i=0;i<n;i++){
            if(str1[i] == str2[i]){
                f[i] = 1;
                match_count++;
            }
        }
        count = 0;
        char ch;
        for(i=0;i<n;i++){
            if(match_count < n-t)
            {
                cout<<"-1";
                break;
            }
            else{
                if(f[i] == 0){
                    if(abs(str1[i] - str2[i]) == 1 && (str1[i]=='a' || str2[i] == 'a')){
                         ch = 'c';
                    }
                    else if(abs(str1[i] - str2[i]) == 1 && (str1[i]=='z' || str2[i] == 'z')){
                        ch = 'x';
                    }
                    else if(abs(str1[i] - str2[i]) == 1 && str1[i] < str2[i]){
                        ch = str1[i]-1;
                    }
                    else if(abs(str1[i] - str2[i]) == 1 && str2[i] < str1[i]){
                        ch = str2[i]-1;
                    }
                    else{
                      ch=(str1[i]+str2[i])/2;
                    }
                    cout<<ch;
                }
                else if(count < n-t && f[i] == 1){
                    cout<<str1[i];
                    count++;
                }
                else if(count >= n-t && f[i] == 1){
                    if(str1[i]-1 >= 'a'){
                        ch = str1[i] - 1;
                        cout<<ch;
                    }
                    else
                    cout<<"z";
                }
            }
        }
    }
    return 0;
}


//#define _CRT_DISABLE_PERFCRIT_LOCKS
# include <algorithm>
# include <iostream>
# include <hash_set>
# include <hash_map>
# include <string.h>
# include <iterator>
# include <utility>
# include <cstring>
# include <sstream>
# include <iomanip>
# include <string>
# include <cstdio>
# include <vector>
# include <deque>
# include <queue>
# include <stack>
# include <cmath>
# include <list>
# include <map>
# include <set>
//#pragma comment (linker, "/STACK:17000000")
#define MP make_pair
#define all(v) v.begin(),v.end()
#define sym(i) i%2==0?'/':'\\'
using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int > P;
typedef double db;

const db eps=1e-9, inf=1e9, pi=acos(-1.0);

int s, l, k, x;
vector<int > ans;
int main(){
    cin>>s>>l;
    for(int i=l; i>=1; i--){
        x=i; k=1;
        while(!(x&1)){
            x>>=1;
            k*=2;
        }
        if(s-k>=0){
            s-=k;
            ans.push_back(i);
        }
    }
    if(s) cout<<-1;
    else{
        cout<<ans.size()<<endl;
        for(int i=0; i<ans.size(); i++)
            cout<<ans[i]<<' ';
    }

}
/*

*/


#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <sstream>
#include <vector>
#include <regex>
#include <iterator>

#define LLI long long int
#define LD long double
#define FORi(x,y) for(int i = x; i<y; i++)
#define FORi2(x,y) for(int i2 = x; i2<y; i2++)
#define FORi3(x,y) for(int i3 = x; i3<y; i3++)
#define FORi4(x,y) for(int i4 = x; i4<y; i4++)
using namespace std;

int lowbit(int x)
{
    int ans = 1;
    int temp = x;
    while(temp % 2 == 0)
    {
        temp /= 2;
        ans *= 2;
    }
    return ans;
}

void main()
{
    stringstream tempcout;
    int sum, limit;
    cin>>sum>>limit;
    int coll = 0, cur = limit;
    while(cur > 0 && coll != sum)
    {
        int lwb = lowbit(cur);
        if(coll+lwb <= sum)
        {
            coll+=lwb;
            tempcout<<cur<<' ';
        }
        cur--;
    }
    if(coll != sum) cout<<-1; else cout<<tempcout.str();
}


#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <sstream>
#include <vector>
#include <regex>
#include <iterator>

#define LLI long long int
#define LD long double
#define FORi(x,y) for(int i = x; i<y; i++)
#define FORi2(x,y) for(int i2 = x; i2<y; i2++)
#define FORi3(x,y) for(int i3 = x; i3<y; i3++)
#define FORi4(x,y) for(int i4 = x; i4<y; i4++)
using namespace std;

int lowbit(int x)
{
    int ans = 1;
    int temp = x;
    while(temp % 2 == 0)
    {
        temp /= 2;
        ans *= 2;
    }
    return ans;
}

void main()
{
    stringstream tempcout;
    int sum, limit;
    cin>>sum>>limit;
    int coll = 0, cur = limit, n = 0;
    while(cur > 0 && coll != sum)
    {
        int lwb = lowbit(cur);
        if(coll+lwb <= sum)
        {
            coll+=lwb;
            n++;
            tempcout<<cur<<' ';
        }
        cur--;
    }
    if(coll != sum) cout<<-1; else cout<<n<<'\n'<<tempcout.str();
}


#include<iostream>
#include<vector>
#include<cmath>
using namespace std;
int main(){
    int sum,limit;
    cin>>sum>>limit;
    vector<int>ans;
    vector<vector<int>>v(32);
    int last=0;
    int total=0;
    for(int i=1; i<=limit;i++){
        for(int j=0; j<32;j++){
            if((i>>j)&1){
                v[j].push_back(i);
                if(j>last) last=j;
                break;
            }
        }
    }
    int sim=sum;
    int counter=0;
    while(sim){
        counter++;
        sim>>=1;
    }
    if(counter-1 <=last && v[counter-1].front()<=limit){
        for(int i=0; i<counter; i++){
            if((sum>>i)&1){
                ans.push_back(v[i].back());
            }
        }
        total=sum;
    }
    else{
        bool cont=true;
        for(int i=0; i<=last && cont; i++){
            while(!v[i].empty()){
            total+=pow(2.0,double(i));
            if(!(total>sum)){
                    ans.push_back(v[i].back());
                    v[i].pop_back();
            }
            else{
                cont=false;
                break;
            }
        }
    }
 }
    if(total==sum){
    cout<<ans.size()<<endl;
    for(int i=0; i<ans.size();i++) cout<<ans[i]<<" ";
    }
    else{
        cout<<-1<<endl;
    }
return 0;
}


#include<iostream>
#include<vector>
#include<cmath>

using namespace std;

vector<int>ans;
vector<vector<int>>v(32);
int last=0;
int total=0;

bool work(int x){
    int value = pow(2.0,double(x));
    int mytotal=0;
    while(mytotal<value){
        if(last<0) break;
        while( !v[last].empty() && mytotal<value ){
            mytotal += pow(2.0,double(last));
            ans.push_back(v[last].back());
            v[last].pop_back();
        }
        if(v[last].empty()) last--;
    }
    total+=mytotal;
    if(mytotal==value) return true;
    else return false;
}
int main(){
    int sum,limit;
    cin>>sum>>limit;
    for(int i=1; i<=limit;i++){
        for(int j=0; j<32;j++){
            if((i>>j)&1){
                v[j].push_back(i);
                if(j>last) last=j;
                break;
            }
        }
    }

    int x=0;
    int sm=sum;
    while(sm){
        if((sum>>x)&1){
            if(x<=last && !v[x].empty()){
                total+=pow(2.0,double(x));
                ans.push_back(v[x].back());
                v[x].pop_back();
                if(v[last].empty())last--;
            }else{
                bool b=work(x);
                if(! b){
                    break;
                }
            }
        }
        x++;
        sm=sm>>1;
    }
    if(total!=sum)
        printf("%d\n",-1);
    else{
        printf("%d\n",ans.size());
        for(int i=0; i<ans.size(); i++)cout<<ans[i]<<" ";
    }
return 0;
}


#include<iostream>
#include<vector>
#include<cmath>

using namespace std;

vector<int>ans;
vector<vector<int>>v(32);
int last=0;
int total=0;

void add(int def){
    if(last<0) return;
    while(!v[last].empty() && def!=0 ){
        total+=pow(2.0,last);
        ans.push_back(v[last].back());
        v[last].pop_back();
        def--;
    }
    if(v[last].empty())last--;
    if(def!=0){
        add(pow(2.0,double(def)));
    }
}
int main(){
    int sum,limit;
    cin>>sum>>limit;
    for(int i=1; i<=limit;i++){
        for(int j=0; j<32;j++){
            if((i>>j)&1){
                v[j].push_back(i);
                if(j>last) last=j;
                break;
            }
        }
    }

    int x=0;
    int sm=sum;
    while(sm){
        if((sum>>x)&1){
            if(x<=last && !v[x].empty()){
                total+=pow(2.0,double(x));
                ans.push_back(v[x].back());
                v[x].pop_back();
                if(v[last].empty())last--;
            }else{
                int dif;
                if(last<0) dif=pow(2.0,double(x-0));
                else dif=pow(2.0,double(x-last));
                add(dif);
            }
        }
        x++;
        sm=sm>>1;
    }
    if(total!=sum)
        printf("%d\n",-1);
    else{
        printf("%d\n",ans.size());
        for(int i=0; i<ans.size(); i++)cout<<ans[i]<<" ";
    }
return 0;
}


#include<iostream>
#include<vector>
#include<cmath>

using namespace std;

vector<int>ans;
vector<vector<int>>v(32);
int last=0;
int total=0;

void work(int asd){
    int j=0;
    int sent=pow(2.0,double(asd));
    int counter;
    int mytotal=0;
    int pow_of_asd = pow(2.0,double(asd));
    for(int z=0; z<asd && mytotal<pow_of_asd; z++){
        int temp=v[z].size();
        bool che=false;
        while(temp){
            che=true;
            if( ((v[z].size()>>j)&1) && pow(2.0,double(j))<=sent) counter=j;
            temp=temp>>1;
            j++;
        }
        if(che){
        int tem=pow(2.0,double(counter));
        for(int a=0 ; a<tem ; a++){
            ans.push_back(v[z].back());
            v[z].pop_back();
        }
        sent=sent-pow(2.0,double(counter));
        mytotal+=( pow(2.0,double(counter)) * pow(2.0,double (z)) );
        counter=0;
        j=0;
        }
    }
    total+=mytotal;
}
int main(){
    int sum,limit;
    cin>>sum>>limit;
    for(int i=1; i<=limit;i++){
        for(int j=0; j<32;j++){
            if((i>>j)&1){
                v[j].push_back(i);
                if(j>last) last=j;
                break;
            }
        }
    }
    int x=0;
    int sm=sum;
    while(sm){
        if((sum>>x)&1){
            if(x<=last && !v[x].empty()){
                total+=pow(2.0,double(x));
                ans.push_back(v[x].back());
                v[x].pop_back();
                if(v[last].empty())last--;
            }else{
                work(x);
            }
        }
        x++;
        sm=sm>>1;
    }
    if(total!=sum)
        printf("%d\n",-1);
    else{
        printf("%d\n",ans.size());
        for(int i=0; i<ans.size(); i++)cout<<ans[i]<<" ";
    }
return 0;
}


#include<iostream>
#include<vector>
#include<cmath>

using namespace std;

vector<int>ans;
vector<vector<int>>v(32);
int last=0;
int total=0;

bool work(int x){
    int value = pow(2.0,double(x));
    int mytotal=0;
    while(mytotal<value){
        if(last<0) break;
        while( !v[last].empty() && mytotal<value ){
            mytotal += pow(2.0,double(last));
            ans.push_back(v[last].back());
            v[last].pop_back();
        }
        if(v[last].empty()) last--;
    }
    total+=mytotal;
    if(mytotal==value) return true;
    else return false;
}
int main(){
    int sum,limit;
    cin>>sum>>limit;
    for(int i=1; i<=limit;i++){
        for(int j=0; j<32;j++){
            if((i>>j)&1){
                v[j].push_back(i);
                if(j>last) last=j;
                break;
            }
        }
    }

    int x=0;
    int sm=sum;
    while(sm){
        if((sum>>x)&1){
            if(x<=last && !v[x].empty()){
                total+=pow(2.0,double(x));
                ans.push_back(v[x].back());
                v[x].pop_back();
                if(v[last].empty())last--;
            }else{
                bool b=work(x);
                if(! b){
                    break;
                }
            }
        }
        x++;
        sm=sm>>1;
    }
    if(total!=sum)
        printf("%d\n",-1);
    else{
        printf("%d\n",ans.size());
        for(int j=0; j<ans.size(); j++)cout<<ans[j]<<" ";
    }
return 0;
}


#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <iostream>
#include <cmath>
#include <iomanip>
#include <string>
#include <cstring>
#include <cstdio>
#include <math.h>
#include <algorithm>
#include <stdio.h>
#include <climits>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <sstream>
#include <map>
#include <ctime>
#include <cstdlib>
#include <list>
#include <bitset>
#include <functional>
#include <numeric>
#include <utility>

using namespace std;

typedef unsigned long long ull;
typedef long long ll;

int dx[] = { 1, 0, -1, 0 };
int dy[] = { 0, 1, 0, -1 };

// start + (end - start) / 2;

int power(int b, int p){
	if (p == 0)return 1;
	int sq = power(b, p / 2);
	sq *= sq;
	if (p % 2 == 1)sq *= b;
	return sq;
}

int binary(long long n){
	string sum2;
	long long m = 0;
	while (n != 0){
		if (n % 2 != 0)
			return power(2, m);
		n /= 2;
		m++;
	}
}
vector<int>vec, v, v2;
int sm = 0, sum, limit;
bool f = 0;
void Find(int idx){
	if (sm == sum){
		v = v2;
		f = 1;
		return;
	}
	else if (sm > sum){
		return;
	}
	for (int i = idx + 1; i < vec.size(); i++){
		sm += vec[i];
		v2.push_back(i);
		Find(i);
		v2.pop_back();
		sm -= vec[i];
	}
}
int main(){
	cin >> sum >> limit;
	vec.push_back(0);
	for (int i = 1; i <= limit; i++)
		vec.push_back(binary(i));
	Find(0);
	if (f){
		cout << v.size() << "\n";
		for (int i = 0; i < v.size(); i++){
			cout << v[i];
			if (i < v.size() - 1)
				cout << " ";
		}
	}
	else
		cout << "-1\n";
}


#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <iostream>
#include <cmath>
#include <iomanip>
#include <string>
#include <cstring>
#include <cstdio>
#include <math.h>
#include <algorithm>
#include <stdio.h>
#include <climits>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <sstream>
#include <map>
#include <ctime>
#include <cstdlib>
#include <list>
#include <bitset>
#include <functional>
#include <numeric>
#include <utility>

using namespace std;

typedef unsigned long long ull;
typedef long long ll;

int dx[] = { 1, 0, -1, 0 };
int dy[] = { 0, 1, 0, -1 };

// start + (end - start) / 2;

int power(int b, int p){
	if (p == 0)return 1;
	int sq = power(b, p / 2);
	sq *= sq;
	if (p % 2 == 1)sq *= b;
	return sq;
}

int binary(long long n){
	string sum2;
	long long m = 0;
	while (n != 0){
		if (n % 2 != 0)
			return power(2, m);
		n /= 2;
		m++;
	}
}
vector<int>vec, v, v2;
int sm = 0, sum, limit;
bool f = 0;
int main(){
	cin >> sum >> limit;
	for (int i = limit; i >= 1; i--){
		int k = binary(i);
		if (k <= sum){
			sum -= k;
			v.push_back(i);
		}
	}
	if (sum){
		cout << "-1\n";
		return 0;
	}
	cout << v.size() << "\n";
	for (int i = 0; i < v.size(); i++){
		cout << v[i];
		if (i < v.size() - 1)
			cout << " ";
	}
	cout << "\n";
}


#include<iostream>
#include<cstring>
#include<string>
#include<sstream>
#include<fstream>
#include <vector>
#include<algorithm>
#include<cmath>
#include <iomanip>      // std::setprecision
#include<map>
#include<queue>

using namespace std;
typedef pair<int ,int>ii;
typedef vector<ii>vii;
typedef vector<int>vi;

 int sum,limit,s;
 int visited[100000]={0};
  int c[100000]={0};
    int b[100000]={0};
  vector<int>r;
 int bit( int y)
 {  if(b[y]!=0)return b[y];
	 int counter=y&-y;

	 b[y]=counter;
	 return counter;
 }
 bool rf=false;
void dfs(int u,int s)

{
	for(int i=limit;i>=1;i--)
	{      if(s+bit(i)<=sum)
	    {
			r.push_back(i);
			s+=b[i];
			if(s==sum)
			{rf=true;break;}
	   }

			    //visited[i]=0;
	 }

 }
//	visited[u]=0;
	//r.pop_back();

int main()
{

		 cin>>sum>>limit;
		 s=0;//g=sum;
		  dfs(0,0);
		 int s=r.size();
	if(s==0 ||!rf)cout<<-1<<endl;
		 else
		 {
			 cout<<s<<endl;

	for(int i=0;i<s;i++)
		 {
			 cout<<r[i];
			 if(i<=s-2)cout<<" ";
		 }
	cout<<endl;
		 }

 // system("pause");
	return 0;
}


#include<iostream>
#include<cstring>
#include<string>
#include<sstream>
#include<fstream>
#include <vector>
#include<algorithm>
#include<cmath>
#include <iomanip>      // std::setprecision
#include<map>
#include<queue>

using namespace std;
typedef pair<int ,int>ii;
typedef vector<ii>vii;
typedef vector<int>vi;

 int sum,limit,s;
 int visited[100000]={0};
  int c[100000]={0};
    int b[100000]={0};
  vector<int>r;
 int bit( int y)
 {  if(b[y]!=0)return b[y];
	 int counter=y&-y;

	 b[y]=counter;
	 return counter;
 }
 bool rf=false;
void dfs(int u,int s)

{
	for(int i=limit;i>=1;i--)
	{      if(s+bit(i)<=sum)
	    {
			r.push_back(i);
			s+=b[i];
			if(s==sum)break;
	   }

			    //visited[i]=0;
	 }
 }
//	visited[u]=0;
	//r.pop_back();

int main()
{

		 cin>>sum>>limit;
		 s=0;//g=sum;
		  dfs(0,0);
		 int s=r.size();
	if(s==0 )cout<<-1<<endl;
		 else
		 {
			 cout<<s<<endl;

	for(int i=0;i<s;i++)
		 {
			 cout<<r[i];
			 if(i<=s-2)cout<<" ";
		 }
	cout<<endl;
		 }

 // system("pause");
	return 0;
}


#include<iostream>
#include<cstring>
#include<string>
#include<sstream>
#include<fstream>
#include <vector>
#include<algorithm>
#include<cmath>
#include <iomanip>      // std::setprecision
#include<map>
#include<queue>

using namespace std;
typedef pair<int ,int>ii;
typedef vector<ii>vii;
typedef vector<int>vi;

 int sum,limit,s;
 int visited[100000]={0};
  int c[100000]={0};
    int b[100000]={0};
  vector<int>r;
 int bit( int y)
 {  if(b[y]!=0)return b[y];
	 int counter=y&-y;

	 b[y]=counter;
	 return counter;
 }
 bool rf=false;
void dfs(int u,int s)

{
	for(int i=limit;i>=1;i--)
	{      if(s+bit(i)<=sum)
	    {
			r.push_back(i);
			s+=b[i];
			if(s==sum)break;
	   }

			    //visited[i]=0;
	 }
 }
//	visited[u]=0;
	//r.pop_back();

int main()
{

		 cin>>sum>>limit;
		 s=0;//g=sum;
		  dfs(0,0);
		 int s=r.size();
	if(s==0 )cout<<-1<<endl;
		 else
		 {
			 cout<<s<<endl;

	for(int i=0;i<s;i++)
		 {
			 cout<<r[i];
			 if(i<=s-2)cout<<" ";
		 }
	cout<<endl;
		 }

  system("pause");
	return 0;
}


#include<iostream>
#include<cstring>
#include<string>
#include<sstream>
#include<fstream>
#include <vector>
#include<algorithm>
#include<cmath>
#include <iomanip>      // std::setprecision
#include<map>
#include<queue>

using namespace std;
typedef pair<int ,int>ii;
typedef vector<ii>vii;
typedef vector<int>vi;

 int sum,limit,s;
 int visited[100002]={0};
  int c[100002]={0};
    int b[100002]={0};
  vector<int>r;
 int bit( int y)
 {  if(b[y]!=0)return b[y];
	 int counter=y&-y;

	 b[y]=counter;
	 return counter;
 }
 bool rf=false;
void dfs(int u,int s)

{
	for(int i=limit;i>=1;i--)
	{      if(s+bit(i)<=sum)
	    {
			r.push_back(i);
			s+=b[i];
			if(s==sum)
			{rf=true;break;}
	   }

			    //visited[i]=0;
	 }

 }
//	visited[u]=0;
	//r.pop_back();

int main()
{

		 cin>>sum>>limit;
		 s=0;//g=sum;
		  dfs(0,0);
		 int s=r.size();
	if(s==0 ||!rf)cout<<-1<<endl;
		 else
		 {
			 cout<<s<<endl;

	for(int i=0;i<s;i++)
		 {
			 cout<<r[i];
			 if(i<=s-2)cout<<" ";
		 }
	cout<<endl;
		 }

 // system("pause");
	return 0;
}


#include<iostream>
#include<cstring>
#include<string>
#include<sstream>
#include<fstream>
#include <vector>
#include<algorithm>
#include<cmath>
#include <iomanip>      // std::setprecision
#include<map>
#include<queue>

using namespace std;
typedef pair<int ,int>ii;
typedef vector<ii>vii;
typedef vector<int>vi;

 int sum,limit,s;
 int visited[100000]={0};
  int c[100000]={0};
  vector<int>r;
 int bit( int y)
 {
	 int counter=1;
	 while(y%2==0)
	 {
		 counter=counter<<1;
		 y=y>>1;
	 }
	 return counter;
 }
 bool rf=false;
void dfs(int u,int s)

{
	visited[u]=1;

	for(int i=1;i<=limit;i++)
	{     if(rf)return;
		if(!visited[i])
		{ if( (bit(i)+s)==sum){r.push_back(i);rf=true;;}
				else if( (bit(i)+s)<sum)
				{
		         visited[i]=1;
			      r.push_back(i);
			     dfs(i,bit(i)+s);
				 if(!rf)
				 {
					 visited[i]=0;
					 r.pop_back();
				 }
		      }

			    //visited[i]=0;
	 }
	}
//	visited[u]=0;
	//r.pop_back();

}

int main()
{

		 cin>>sum>>limit;
		 s=0;//g=sum;
		  dfs(0,0);
		 if(rf==0)
	cout<<-1<<endl;
		 else
		 { int s=r.size();
			 cout<<s<<endl;

	for(int i=0;i<s;i++)
		 {
			 cout<<r[i];
			 if(i<=s-2)cout<<" ";
		 }
	cout<<endl;
		 }

 // system("pause");
	return 0;
}


#include<iostream>
#include<vector>
#include<cmath>
using namespace std;
vector< int> value;
int total=0;
void operate(int r)
{ int p = r;
    int pos = 0;
    if(r%2==1)
       { value[p]=1;total++; }
    else
    {    while(r%2!=1)
             {pos++;r/=2;}
      value[p] = pow(2.0,pos);
      total+= pow (2.0, pos);
    }

}
vector<int>done;

int main()
{
     int counter =0;
    int sum,limit;
    cin>>sum>>limit;
    value.resize(limit+1);

    for(int i = 1 ;i<=limit ; i++)
        operate(i);
    int m = -1;
     if (total<sum)
       cout<<m<<endl;
    else
    {
       for (int i =limit; i>0; i--)
        if (value [i]<=sum && sum!=0)
          {
            done.push_back(i);
            sum-=value[i];
            counter++;
          }
         cout<<counter<<endl;
     }

     for(int i = 0 ;i < done.size() ; i++)
     {
         cout<<done[i];
         if(i==done.size()-1)
             cout<<endl;
         else cout<<" ";
     }

    //system("pause");
    return 0;
}


#include <iostream>
#include <fstream>
#include <cmath>
#include<algorithm>
#include<vector>

using namespace std;

#define fi(i, a, b) for(int i = a; i < b; i++)

  int rn, r[100001];
  vector< vector<int> > a(100005);
int main()
{
#if defined(DEBUG) || defined(_DEBUG)
  ifstream cin("input.txt");
  ofstream cout("output.txt");
#endif
 // fi(i,0,20) { vector<int> kkk; a[i].push_back(kkk);}
  int s,m;
  cin>>s>>m;
  fi(i,1,m+1){
	  int j;
	  for(j = 1; (i|j) != i; j*=2);
	  a[j].push_back(i);

  }

  for(int i = 100000; i >= 1; i--){

	  for(int j = 0; j < a[i].size(); j++){
		  if(s >= i){
			  s-=i;
			  r[rn++] = a[i][j];
		  }
	  }
  }

  cout<<rn<<endl;
  fi(i,0,rn) cout <<r[i] <<" ";
}


#include <iostream>
#include <fstream>
#include <cmath>
#include<algorithm>
#include<vector>

using namespace std;

#define fi(i, a, b) for(int i = a; i < b; i++)

  int rn, r[100001];
  vector< vector<int> > a(100005);
int main()
{
#if defined(DEBUG) || defined(_DEBUG)
  ifstream cin("input.txt");
  ofstream cout("output.txt");
#endif
 // fi(i,0,20) { vector<int> kkk; a[i].push_back(kkk);}
  int s,m;
  cin>>s>>m;
  fi(i,1,m+1){
	  int j;
	  for(j = 1; (i|j) != i; j*=2);
	  a[j].push_back(i);

  }

  for(int i = 100000; i >= 1; i--){

	  for(int j = 0; j < a[i].size(); j++){
		  if(s >= i){
			  s-=i;
			  r[rn++] = a[i][j];
		  }
	  }
  }

  if(s!=0) cout<<-1;
  else{
  cout<<rn<<endl;
  fi(i,0,rn) cout <<r[i] <<" ";}
}


#include<iostream>
#include<cstdio>
using namespace std;
int num[100010];
int lowbit(int x){
    return x&(-x);
}
int main(){
    int n, m;
    scanf("%d%d", &n, &m);
    int counts = 0, l;
    for (int i = m; i >= 1 && n; i--){
        l = lowbit(i);
        if (l <= n)
            n -= l, num[++counts] = i;
    }
    if (n)
        printf("-1\n");
    else{
        printf("%d\n", counts);
        for (int i = 1; i <= counts; i++){
            printf("%d ", num[i]);
        }
        printf("\n");
    }
}


#include<iostream>
#include<cstdio>
using namespace std;
int num[100010];
int lowbit(int x){
    return x&(-x);
}
int main(){
    int n, m;
    scanf("%d%d", &n, &m);
    int counts=0,l;
    for (int i = m; i >= 1&&n; i--){
        l = lowbit(i);
        if (l <= n)
            n -= l, num[++counts]=i;
    }
    if (!counts)
        printf("-1\n");
    else{
        for (int i = 1; i <= counts; i++){
            printf("%d ", num[i]);
        }
        printf("\n");
    }
}


#include<iostream>
#include<cstdio>
using namespace std;
int num[100010];
int lowbit(int x){
    return x&(-x);
}
int main(){
    int n, m;
    scanf("%d%d", &n, &m);
    int counts=0,l;
    for (int i = m; i >= 1&&n; i--){
        l = lowbit(i);
        if (l <= n)
            n -= l, num[++counts]=i;
    }
    if (!counts)
        printf("-1\n");
    else{
        printf("%d\n", counts);
        for (int i = 1; i <= counts; i++){
            printf("%d ", num[i]);
        }
        printf("\n");
    }
}


#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;

int value[100100];

int main()
{
    int sum, lim;
    for (int i = 1; i <= 100000; i++)
    {
        if (i % 2 == 1)
            value[i] = 1;
        else
        {
            int j = 1;
            while (!(i&(1 << j))) j++;
            value[i] = pow(2.0, j);
        }
    }
    while (cin >> sum >> lim)
    {
        int choose[100100];
        int s;
        int j = 0;
        for (int i = lim/2*2; i >= 1; i-=2)
        {
            if (sum > value[i])
            {
                choose[j++] = i;
                sum -= value[i];
            }
            if (!sum)
                break;
        }

        int k = 1;
        while (sum&&k <= lim)
        {
            choose[j++] = k;
            sum--;
            k += 2;
        }

        if (sum)
            cout << -1;
        else
        {
            cout << j << endl;
            for (int i = 0; i < j; i++)
                cout << choose[i] << " ";
        }
        cout << endl;

    }
}


#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;

int value[10010];

int main()
{
    int sum, lim;
    for (int i = 1; i <= 10000; i++)
    {
        if (i % 2 == 1)
            value[i] = 1;
        else
        {
            int j = 1;
            while (!(i&(1 << j))) j++;
            value[i] = pow(2.0, j);
        }
    }
    while (cin >> sum >> lim)
    {
        int choose[10010];
        int s;
        int j = 0;
        for (int i = lim/2*2; i >= 1; i-=2)
        {
            if (sum > value[i])
            {
                choose[j++] = i;
                sum -= value[i];
            }
            if (!sum)
                break;
        }

        int k = 1;
        while (sum&&k <= lim)
        {
            choose[j++] = k;
            sum--;
            k += 2;
        }

        if (sum)
            cout << -1;
        else
        {
            cout << j << endl;
            for (int i = 0; i < j; i++)
                cout << choose[i] << " ";
        }
        cout << endl;

    }
}


#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;

int value[10010];

int main()
{
	int sum, lim;
	for (int i = 1; i <= 10000; i++)
	{
		if (i % 2 == 1)
			value[i] = 1;
		else
			value[i] = i / 2 ;
	}

	while (cin >> sum >> lim)
	{
		int choose[10010];
		int s;
		int j = 0;
		for (int i = lim/2*2; i >= 1; i-=2)
		{
			if (sum > value[i])
			{
				choose[j++] = i;
				sum -= pow(2.0,value[i]);
			}
			if (!sum)
				break;
		}

		int k = 1;
		while (sum&&k <= lim)
		{
			choose[j++] = k;
			sum--;
			k += 2;
		}

		if (sum)
			cout << -1;
		else
		{
			cout << j << endl;
			for (int i = 0; i < j; i++)
				cout << choose[i] << " ";
		}
		cout << endl;

	}
}


#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;

int value[10010];

int main()
{
    int sum, lim;
    for (int i = 1; i <= 10000; i++)
    {
        if (i % 2 == 1)
            value[i] = 1;
        else
        {
            int j = 1;
            while (!(i&(1 << j))) j++;
            value[i] = pow(2.0, j);
        }
    }
    while (cin >> sum >> lim)
    {
        int choose[10010];
        int s;
        int j = 0;
        for (int i = 2; i <lim/2*2; i+=2)
        {
            if (sum > value[i])
            {
                choose[j++] = i;
                sum -= value[i];
            }
            if (!sum)
                break;
        }

        int k = 1;
        while (sum&&k <= lim)
        {
            choose[j++] = k;
            sum--;
            k += 2;
        }

        if (sum)
            cout << -1;
        else
        {
            cout << j << endl;
            for (int i = 0; i < j; i++)
                cout << choose[i] << " ";
        }
        cout << endl;

    }
}


#pragma warning(disable:4996)

#include <iostream>
#include <string>
#include <map>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <set>
#include <vector>

using namespace std;

typedef long long int i64;
typedef vector<int> vint;
typedef vector<i64> vi64;
typedef pair<int, int> pint;

const i64 inf = 1000000000000000000LL;

#define forn(i, n) for(int i = 0; i < (n); ++i)

int get(int a)
{
    for (int i = 1; i <= a; i <<= 1)
    {
        if (i & a)
            return i;
    }
}

int main()
{
    srand(13);
    ios_base::sync_with_stdio(false);

#ifdef FILE_INPUT
    freopen("file.in", "r", stdin);
    freopen("file.out", "w", stdout);
#endif

    int sum, limit;
    cin >> sum >> limit;
    vint ans;
    while (sum > 0 && limit != 0)
    {
        if (sum >= limit)
        {
            sum -= get(limit);
            ans.push_back(limit);
        }
        --limit;
    }
    if (sum == 0)
    {
        cout << ans.size() << "\n";
        forn(i, ans.size())
        {
            cout << ans[i] << " ";
        }
    }
    else
    {
        cout << -1;
    }
    return 0;
}


#pragma warning(disable:4996)

#include <iostream>
#include <string>
#include <map>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <set>
#include <vector>

using namespace std;

typedef long long int i64;
typedef vector<int> vint;
typedef vector<i64> vi64;
typedef pair<int, int> pint;

const i64 inf = 1000000000000000000LL;

#define forn(i, n) for(int i = 0; i < (n); ++i)

int get(int a)
{
    for (int i = 1; i <= a; i <<= 1)
    {
        if (i & a)
            return i;
    }
}

int main()
{
    srand(13);
    ios_base::sync_with_stdio(false);

#ifdef FILE_INPUT
    freopen("file.in", "r", stdin);
    freopen("file.out", "w", stdout);
#else
    freopen("javacert.in", "r", stdin);
    freopen("javacert.out", "w", stdout);
#endif

    int sum, limit;
    cin >> sum >> limit;
    vint ans;
    while (sum > 0 && limit != 0)
    {
        if (sum >= limit)
        {
            sum -= get(limit);
            ans.push_back(limit);
        }
        --limit;
    }
    if (sum == 0)
    {
        cout << ans.size() << "\n";
        forn(i, ans.size())
        {
            cout << ans[i] << " ";
        }
    }
    else
    {
        cout << -1;
    }
    return 0;
}


#include <iostream>
#include <cstdio>
using namespace std;

int main() {
    int sum, lim, low_bit, n=0, a[100005];
    scanf("%d%d", &sum, &lim);
    for(int i=lim; i>=1; i--) {
        low_bit = i & -i;
        if(sum>=low_bit) a[n]=i, n++, sum-=low_bit;
        if(sum==0) break;
    }
    if(sum>0) printf("-1");
    else {
        printf("%d\n", n);
        while(n--) printf("%d ", a[n]);
    }
    return 0;
}