#include<bits/stdc++.h>
#define lc(x) (x<<1)
#define rc(x) ((x<<1)|1)
#define x first
#define y second
#define mp make_pair
#define INF 0x7fffffff
using namespace std;
typedef long long ll;
typedef double lf;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<int, int> pii;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
const int maxn=1e6+10;
const lf eps=1e-8;
char s[2][maxn];
char tmp[3][maxn];
char ans[maxn];
int n;
inline bool leq(char* a, char *b){
	for(int i=0; i<n; i++)
		if(a[i] != b[i])
			return a[i] < b[i];
	return true;
}
inline void negetive(char *a){
	for(int i=n-1; i>=0; i--){
		if(a[i] == '1'){
			a[i] = '0';
			break;
		}
		else
			a[i] = '1';
	}
}
int main(){
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	scanf("%d", &n);
	for(int i=0; i<2; i++)
		scanf("%s", s[i]);
	if(s[0][0] != s[1][0]){
		for(int i=0; i<n; i++)
			putchar('1');
		puts("");
	}
	else if(n == 1)
		printf("%s\n", s[1]);
	else{
		for(int i=0; i<n; i++){
			tmp[0][i] = s[1][i];
			tmp[1][i] = s[1][i];
		}
		negetive(tmp[1]);
		for(int i=0; i<n; i++)
			tmp[2][i] = tmp[1][i];
		negetive(tmp[2]);
		for(int i=0; i<n; i++){
			int cnt = 0;
			for(int j=0; j<3; j++)
				if(tmp[j][i] == '1')
					++cnt;
			ans[i] = '0' + cnt%2;
		}
		//printf("%s\n%s\n%s\n%s\n", tmp[0], tmp[1], tmp[2], ans);
		if(!leq(ans, s[1]) && leq(s[0], tmp[2]))
			printf("%s\n", ans);
		else
			printf("%s\n", tmp[0]);
	}
}

