#include <bits/stdc++.h>

int main() {
	int n;
    std::string a, b, diff;
    std::cin >> n;
    std::cin >> a >> b;

    diff = std::string(n, '0');

    if(a[0] != b[0]) {
        for(int i = 0; i < n; ++i)
            std::cout << '1';
    } else if(b[n - 1] == '1') {
        std::cout << b;
    } else {
        int t = 0;
        for(int i = n - 1; i >= 0; --i) {
            t = b[i] - '0' + 1 - (a[i] - '0') + t;
            diff[i] = t % 2 + '0';
            t /= 2;
        }

        int i = n - 1;
        while(i >= 0 && diff[i] == '1') {
            diff[i] = '0' + '1' - diff[i];
            --i;
        }
        if(i >= 0) diff[i]++;
   
        for(int i = 0; i < n - 1; ++i)
            if(diff[i] == '1')
                b[n - 1] = '1';
        std::cout << b;
    }

    return 0;
}