#include<iostream>
#include<bits/stdc++.h>
using namespace std;
void addonetol(string& l, int n)
{
    int rem = 1;
    for(int i = n-1; i >= 0; i--)
    {
        int temp = l[i] - '0' + rem;
        if(temp == 2)
        {
            l[i] = '0';
            rem = 1;
        }
        else
        {
            l[i] = temp + '0';
            rem = 0;
        }
    }
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n;
    string l,r;
    cin >> n >> l >> r;
    if(l[0] != r[0])
    {
        for(auto v: l)
            cout << '1';
    }
    else if(l == r)
    {
        cout << r;
    }
    else
    {
        if(r[n-1] == '1')
            cout << r;
        else
        {
            addonetol(l, n);
            if(l == r )
            {
                cout << r;
            }
            else
            {
                addonetol(r, n);
                cout << r;
            }

        }
    }
    cout << '\n';
    return 0;
}