/*
* 解题思路:
* 题意不难理解、主要是控制好就行、下面几种注意点
* 1、例如99*99这种,最后还有高位进位
* 2、例如00000001*1,只输出一个1,前面0不输出
* 3、例如0000*101,只输出一个0
* 4、数组大小控制好,否则出现RE错
*/
#include <stdio.h>
#include <string.h>
#define A 500
int main( )
{
int x,y;
int i,j;
int in,tmp,flag;
int len1,len2,len;
char s1[ A ] , s2[ A ],ss[ A ],s[ A ];
while( ~scanf("%s%s",s1,s2) )
{
len1 = strlen( s1 );
len2 = strlen( s2 );
if( len1 > len2 )
{
strcpy( s , s1 );
strcpy( s1,s2 );
strcpy( s2 , s );
tmp = len1;
len1 = len2;
len2 = tmp;
}
memset( ss , '0' , sizeof( ss ) );
for( i=len2-1;i>=0;i-- )
{
in = 0;
memset( s , '0', sizeof( s ) );
for( j=len1-1;j>=0;j-- )
{
x = s1[ j ] - '0';
y = s2[ i ] - '0';
if( ( x*y+in) >= 10 )
{
s[ i+j ] = ( char )(( (x*y+in)%10 )+'0');
in = (x*y+in)/10;
}
else if( (x*y+in )<=9 && (x*y+in ) >=0 )
{
s[ i+j ] =(char) (x*y+in +'0');
in = 0;
}
}
if( in != 0 && i!=0 )
s[ i-1 ] = in+'0';
flag = 0;
for( j=i+len2-1;j>=0;j-- )
{
if( ss[ j ]-'0' + s[ j ] -'0' + flag >=10 )
{
ss[ j ] = (ss[ j ]-'0' + s[ j ] - '0' + flag )%10+'0';
flag = 1;
}
else
{
ss[ j ] += s[ j ] -'0'+ flag;
flag = 0;
}
}
if( i == 0 && in+flag )
printf("%d",in+flag);
}
ss[ len1+len2-1 ] = '\0';
len = strlen( ss );
for(i=0;i<len;i++)
if( !flag && ss[ i ] == '0' ) continue;
else
{
printf("%c",ss[ i ]);
flag = 1;
}
if( !flag ) printf("0");
puts("");
}
return 0;
}