#include<bits/stdc++.h> #include<cstdio> #include<cmath> #include<cstring> #include<cstdlib> #include<algorithm> #include<queue> #include<deque> #include<list> #include<set> #include<vector> #include<iostream> #define ll long long #define re register #define inf 0x7f7f7f7f #define inl inline #define sqr(x) (x*x) //#define eps 1e-8 #define debug printf("debug "); //#pragma comment(linker, "/STACK:1024000000,1024000000") //#pragma GCC optimize (2) //#pragma G++ optimize (2) using namespace std; //const ll mod; const double Pi=acos(-1.0); const ll MAXN=2e6+10; inl ll read() { re ll x = 0; re int f = 1; char ch = getchar(); while(ch<'0'||ch>'9') { if(ch== '-' ) f = -1; ch = getchar(); } while(ch>='0'&&ch<='9') {x=(x<<1)+(x<<3)+(ch^48);ch=getchar();} return x * f; } inl char readc() { char ch=getchar(); while(('z'<ch||ch<'a')&&('Z'<ch||ch<'A')) ch=getchar(); return ch; } inl void write(re ll x){ if(x>=10)write(x/10); putchar(x%10+'0'); } inl void writeln(re ll x){ if(x<0) {x=-x;putchar('-');} write(x); puts(""); } inl ll gcd(re ll x,re ll y){while(y^=x^=y^=x%=y);return x;} inl ll Lcm(re ll a,re ll b) {return a/gcd(a,b)*b;} inl void FR() { freopen(".in","r",stdin); freopen(".out","w",stdout); } inl void FC() { fclose(stdin); fclose(stdout); } struct cmplex{ double x,y; cmplex (double xx=0,double yy=0) {x=xx;y=yy;} cmplex operator + (const cmplex &ch) const {return cmplex(x+ch.x,y+ch.y);} cmplex operator - (const cmplex &ch) const {return cmplex(x-ch.x,y-ch.y);} cmplex operator * (const cmplex &ch) const {return cmplex(x*ch.x-y*ch.y,x*ch.y+y*ch.x);} }a[MAXN],b[MAXN]; ll n,ss[MAXN],l,r[MAXN],limit=1; inl void fft(cmplex *a,ll type) { for(re ll i=0;i<limit;i++) {if(i<r[i]) swap(a[i],a[r[i]]);}//要迭代序列 for(re ll mid=1;mid<limit;mid<<=1) { cmplex Wn(cos(Pi/mid),type*sin(Pi/mid));//单位根 for(re ll R=mid<<1,j=0;j<limit;j+=R) {//R区间长,枚举到j cmplex w(1,0);//幂 for(re ll k=0;k<mid;k++,w=w*Wn) {//左半部分 cmplex x=a[j+k],y=w*a[j+mid+k]; a[j+k]=x+y;a[j+mid+k]=x-y; } } } } char ssa[MAXN],ssb[MAXN]; int main() { // FR(); n=read();n--; scanf("%s",ssa);scanf("%s",ssb); for(re ll i=0;i<=n;i++) a[i].x=ssa[n-i]-'0'; for(re ll i=0;i<=n;i++) b[i].x=ssb[n-i]-'0'; while(limit<=n+n) limit<<=1,l++; for(re ll i=0;i<limit;i++) {r[i]=(r[i>>1]>>1)|((i&1)<<(l-1));} fft(a,1);fft(b,1); for(re ll i=0;i<=limit;i++) a[i]=a[i]*b[i]; fft(a,-1); ll top=(n<<1); for(re ll i=0;i<=top;i++) { ss[i]+=a[i].x/limit+0.5; if(ss[i]>=10) { ss[i+1]+=ss[i]/10,ss[i]%=10; if(i==top) top++; } } while(!ss[top]&&top>=1) top--; for(re ll i=top;~i;i--) write(ss[i]); putchar(' '); // FC(); return 0; }