#include<bits/stdc++.h>
using namespace std;
const int maxn=1e6+100;
int read()
{
	int ans=0;bool f=0;char ch=getchar();
	while(ch<'0' or ch>'9'){if(ch='-')f=1;ch=getchar();}
	while(ch>='0' and ch<='9'){ans=(ans<<1)+(ans<<3)+(ch^48);ch=getchar();}
	return f?~ans+1:ans;
}
int n,l[maxn],r[maxn];
char s[maxn];
void chuli(int a[])
{
	for(int i=n;i>=1;--i)
	a[i-1]+=a[i]/2,a[i]%=2;
}
bool cmp()
{
	for(int i=0;i<=n;++i)
	if(l[i]<r[i])
	return 1;
	else if(l[i]>r[i])return 0;
	return 1;
}
int main()
{
	n=read();
	scanf("%s",s+1);
	for(int i=1;i<=n;++i)
	l[i]=s[i]-'0';
	scanf("%s",s+1);
	for(int i=1;i<=n;++i)
	r[i]=s[i]-'0';
	if(l[1]!=r[1])
	{
		for(int i=1;i<=n;++i)
		printf("1");
		return 0;
	}
	if(r[n]==0)
	{
		l[n-1]+=1;
		chuli(l);
		if(cmp())
		r[n]++;
	}
	for(int i=1;i<=n;++i)
		printf("%d",r[i]);
	return 0;
}
