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

#define REP(i,n) for(ll i=0;i<(ll)n;i++)
#define dump(x)  cerr << "Line " << __LINE__ << ": " <<  #x << " = " << (x) << "\n";
#define spa << " " <<
#define fi first
#define se second
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()

using ld = long double;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<ld, ld>;

template<typename T> using V = vector<T>;
template<typename T> using P = pair<T, T>;
template<typename T> vector<T> make_vec(size_t n, T a) { return vector<T>(n, a); }
template<typename... Ts> auto make_vec(size_t n, Ts... ts) { return vector<decltype(make_vec(ts...))>(n, make_vec(ts...)); }
template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){os << "(" << v.first << ", " << v.second << ")"; return os;}
template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { for (auto &e : v) os << e << ' '; return os; }
template<class T> ostream& operator<<(ostream& os, const vector<vector<T>> &v){ for(auto &e : v){os << e << "\n";} return os;}
struct fast_ios { fast_ios(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;

template <class T> void UNIQUE(vector<T> &x) {sort(ALL(x));x.erase(unique(ALL(x)), x.end());}
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
void fail() { cout << -1 << '\n'; exit(0); }
inline int popcount(const int x) { return __builtin_popcount(x); }
inline int popcount(const ll x) { return __builtin_popcountll(x); }
template<typename T> void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cerr<<v[i][0];for(ll j=1;j<w;j++)cerr spa v[i][j];cerr<<"\n";}};
template<typename T> void debug(vector<T>&v,ll n){if(n!=0)cerr<<v[0];
for(ll i=1;i<n;i++)cerr spa v[i];
cerr<<"\n";};

const ll INF = (1ll<<62);
// const ld EPS   = 1e-10;
// const ld PI    = acos(-1.0);
const ll mod = (int)1e9 + 7;
//const ll mod = 998244353;

int main(){

    ll N;
    string S, T;
    cin >> N >> S >> T;

    ll cntS=0, cntT=0;
    REP(i, N) cntS += (S[i] == '1');
    REP(i, N) cntT += (T[i] == '1');

    if(cntS != cntT){
        cout << -1 << endl;
        return 0;
    }

    V<ll> posS, posT;
    REP(i, N) if(S[i] == '0') posS.push_back(i);
    REP(i, N) if(T[i] == '0') posT.push_back(i);

    ll sz = posS.size();

    ll res = 0;
    REP(i, sz){
        if(posS[i] != posT[i]) res++;
    }

    cout << res << endl;

    return 0;
}
// Author:  param3435
#include <bits/stdc++.h>
#pragma GCC optimize ("-O2")
using namespace std;

#define LL                       long long
#define LD                       long double
#define divisor                  1000000007
#define INFP                     LLONG_MAX
#define INFN                     LLONG_MIN
#define pb                       push_back
#define pf                       push_front
#define pob                      pop_back
#define pof                      pop_front
#define mp                       make_pair
#define pLL                      pair<LL, LL>
#define loop(i,a,b)              for(LL i = a; i < b; i++)
#define loopd(i,a,b)             for(LL i = a; i > b; i--)
#define numberOfOnes(n)          __builtin_popcountll(n)
#define parity(n)                __builtin_parityll(n)                                  // = 1  when numberOfOnes(n) is odd
#define leadingZeros(n)          __builtin_clzll(n)
#define trailingZeros(n)         __builtin_ctzll(n)
#define gcd(first, second)       __gcd(first, second)
#define debug(x)                 cout << #x << " = " << x << '\n'
#define all(x)                   (x).begin(), (x).end()
#define sz(x)                    (LL)(x).size()
#define sum(x)                   (accumulate((x).begin(), (x).end(), 0LL))
#define minE(x)                  (*min_element((x).begin(), (x).end()))
#define maxE(x)                  (*max_element((x).begin(), (x).end()))
#define minI(x)                  ( min_element((x).begin(), (x).end()) - (x).begin())
#define maxI(x)                  ( max_element((x).begin(), (x).end()) - (x).begin())
#define lB(x, y)                 ( lower_bound((x).begin(), (x).end(), (y)) - (x).begin())
#define uB(x, y)                 ( upper_bound((x).begin(), (x).end(), (y)) - (x).begin())
#define FastIO                   ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

template<typename T>             istream& operator>>(istream& is,  vector<T> &v) {for (auto& i : v) is >> i;        return is;}
template<typename T>             ostream& operator<<(ostream& os,  vector<T>  v) {for (auto& i : v) os << i << ' '; return os;}
template<typename T, typename U> istream& operator>>(istream& is, pair<T, U> &p) {is >> p.first >> p.second;        return is;}
template<typename T, typename U> ostream& operator<<(ostream& os, pair<T, U>  p) {os << p.first << ' ' << p.second; return os;}

void solve() {
	LL A, B, C;
	cin >> A >> B >> C;
	if (A == B || (abs(A) == abs(B) && C % 2 == 0)) {
		cout << '=';
	}
	else if (C % 2 == 0) {
		cout << ((pow(A, 2) > pow(B, 2)) ?  '>' : '<');
	}
	else
		cout << ((A > B) ?  '>' : '<');
	return;
}

int main() {

	FastIO;
	LL T = 1;
	// cin >> T;
	loop(i, 0, T - 1) {
		solve();
		cout << '\n';
	}
	solve();
	return 0;
}