#include <bits/stdc++.h>
#define rep(i, n) for (ll i=0; i<n; ++i)
#define all(obj) (obj).begin(),(obj).end()
using namespace std;
typedef long long ll;
long long GCD(long long x, long long y) { return y ? GCD(y, x%y) : x; }

int main(){
    
    int N;
    string S;
    string T;
    cin >> N >> S >> T ;

    int n1 = count(all(S),'0');
    int n0 = count(all(T),'0');

    int szc=0, tzc=0;

    if (n1!=n0)
        cout << "-1" <<endl;
    else{
        vector<int> sv (n0);
        vector<int> tv (n0);
        rep(i,N){
            if (S[i]=='0'){
                sv[szc]=i;
                szc++;
            }
            if (T[i]=='0'){
                tv[tzc]=i;
                tzc++;
            }
        }
        int ans = 0;
        
        rep(i,n0){
            //cout << sv[i]<<" " <<tv[i]<<endl;
            if (sv[i]!=tv[i])
                ans++;
        }
        cout <<ans <<endl;

    }
    return 0;
}

#include <bits/stdc++.h>
#define ll long long int
#define all(x) x.begin(),x.end()
#define pii pair<int,int>
#define io ios_base::sync_with_stdio(false); cin.tie(NULL);
#define N 200005
using namespace std;
void great(){
    cout<<">";
}
void same(){
    cout<<"=";
}
void small(){
    cout<<"<";
}
int main()
{
    ll a,b,c;
    cin>>a>>b>>c;
    if(a>0 && b>0){
        if(a>b) great();
        else if(a<b) small();
        else same();
    }
    else if(a==0){
        if(b==0) same();
        else if(b<0){
            if(c&1) great();
            else small();
        }
        else small();
    }
    else if(b==0){
        if(a<0){
            if(c&1) small();
            else great();
        }
        else great();
    }
    else if(a>0){
        if(c&1) great();
        else{
            if(a>abs(b)) great();
            else if(a==abs(b)) same();
            else small();
        }
    }
    else{
        if(b>0){
            if(c&1) small();
            else{
                if(abs(a)>b) great();
                else if(abs(a)==b) same();
                else small();
            }
        }
        else{
            if(c%2==0){
                a=abs(a);
                b=abs(b);
            }
            if(a>b) great();
            else if(a==b) same();
            else small();
        }
    }
    return 0;
}
