#include<cstdio>
using namespace std;
long long C(int u,int d) {
	long long ans=1;
	for(long long i=d,num=1; num<=u; num++,i--)
		ans=ans*i/num;
	return ans;
}
long long a,b,k;
int main() {
	scanf("%lld%lld%lld",&a,&b,&k);
	for(; a+b;) {
		if(a==0) {
			b--;
			printf("b");
			continue;
		}
		if(b==0) {
			a--;
			printf("a");
			continue;
		}
		if(k>C(a-1,a+b-1)) {
			k-=C(a-1,a+b-1);
			b--;
			printf("b");
		} else {
			a--;
			printf("a");
		}
	}
	return 0;
}
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long
#define P pair<int,ll>
#define MOD 1000000007

using namespace std;

int n, c1,c2, p, res;
vector<int> v1, v2;
string s, t;

int main(){
    cin >> n >> s >> t;
    rep(i, n)if(s[i]=='0'){v1.push_back(i);}
    rep(i, n)if(t[i]=='0'){v2.push_back(i);}
    if(v1.size() != v2.size()){
        cout << -1 << endl;
        return 0;
    }
    rep(i,v1.size()){
        if(v1[i] != v2[i])res++;
    }

    cout << res << endl;
}