#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define pre(i,a,b) for(int i=a;i>=b;i--)
#define N 1000005
using namespace std;
char s[N],t[N];int n;
int main(){
	scanf("%d",&n);
	scanf("%s%s",s+1,t+1);
	if(s[1]!=t[1]){rep(i,1,n)putchar('1');putchar('\n');return 0;}
	bool flag=true;
	rep(i,1,n)flag&=s[i]==t[i];
	if(flag){puts(t+1);return 0;}
	s[n]++;pre(i,n,1)if(s[i]-'0'>1)s[i]-=2,s[i-1]++;
	flag=true;
	rep(i,1,n)flag&=s[i]==t[i];
	if(flag){puts(t+1);return 0;}
	if(t[n]=='1'){puts(t+1);return 0;}
	t[n]++;puts(t+1);
	return 0;
} 