#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
using namespace std;
const int g_kMaxs = 1001;
char g_a[g_kMaxs], g_b[g_kMaxs];
void StrRes(char* str) {
int len = strlen(str);
int i = 0, j = len - 1;
while (i < j) {
char c = str[i];
str[i] = str[j];
str[j] = c;
++i;
--j;
}
}
int* Mul(char* lhs, char* rhs) {
if (NULL == lhs || NULL == rhs) { // 为空则出错,其他的需要假设保证输入没有问题
fprintf(stderr, "Nul: Invalid arguments");
exit(1);
}
int lhsLen = (int)strlen(lhs);
int rhsLen = (int)strlen(rhs);
int* ret = new int[lhsLen + rhsLen + 1];
// 两个数相乘之积的位数不会超过两个数的位数之和,
// 而申请多一位是把积的长度绝对值放在ret[0]中,并用ret[0]的正负代表积的正负
memset(ret, 0, sizeof(int)*(lhsLen + rhsLen + 1));
if ((isdigit(lhs[0]) && isdigit(rhs[0])) || (lhs[0] == '-' && rhs[0] == '-')) {
ret[0] = 1;
} else ret[0] = -1;
if (lhs[0] == '-') --lhsLen;
if (rhs[0] == '-') --rhsLen;
StrRes(lhs); //把输入的数字串反转
StrRes(rhs);
for (int i = 0; i < lhsLen; i++) {
for (int j = 0; j < rhsLen; j++) {
ret[i + j + 1] += ((lhs[i] - '0') * (rhs[j] - '0')) % 10;
ret[i + j + 2] += ((lhs[i] - '0') * (rhs[j] - '0')) / 10;
}
}
StrRes(lhs); //把输入的数字串反转恢复
StrRes(rhs);
if (ret[0] < 0) printf("-"); // ret[0] < 0 为负数
ret[0] = ret[0] * ((ret[lhsLen + rhsLen] > 0) ? (lhsLen + rhsLen) : (lhsLen + rhsLen - 1));
for (int i = abs(ret[0]); i >= 1; i--) printf("%d", ret[i]);
printf("\n");
return ret;
}
int main()
{
while (EOF != scanf("%s%s", g_a, g_b)) {
Mul(g_a, g_b);
}
return 0;
}