#include <cmath>

const int blen = 2;
const unsigned base = (int)1e2;
const int maxdep = 16;
const int mlen = 1 << maxdep;

#include "..\\base.cpp"

typedef long double dbl;

struct comp
{
  dbl x, y;

  comp() { }
  comp( dbl a ) : x(cos(a)), y(sin(a)) { }
  comp( dbl _x, dbl _y ) : x(_x), y(_y) { }

  comp operator + ( const comp &p ) const { return comp(x + p.x, y + p.y); }
  comp operator - ( const comp &p ) const { return comp(x - p.x, y - p.y); }
  comp operator * ( const comp &p ) const { return comp(x * p.x - y * p.y, x * p.y + y * p.x); }

  void out() { printf("%.10lf %.10lf\n", (double)x, (double)y); }
};

int pn = 0, p[mlen];
comp root[mlen + 1];
comp x[mlen], y[mlen], tmp[mlen];

int len, dep, sign = 1;
num a, b, c;

void FFT( comp *a )
{
  comp *b = tmp, *a0 = a;
  forn(i, len)
    b[i] = a[p[i]];

  for (int n1 = 1; n1 < len; n1 *= 2)
  {
    int n = 2 * n1;
    int step = sign * (len / n);

    for (int pos = 0; pos < len; pos += n)
    {
      comp *r0 = b + pos, *r1 = r0 + n1;

      int cur = (sign == -1 ? len : 0);
      forn(j, n1)
      {
        comp t = root[cur] * r1[j];
        a[pos + j] = r0[j] + t;
        a[pos + j + n1] = r0[j] - t;
        cur += step;
      }
    }
    swap(b, a);
  }
  memcpy(a0, b, sizeof(b[0]) * len);
}

void Cor( ll *c )
{
  forn(i, mlen)
    if (c[i] >= base)
      c[i + 1] += c[i] / base, c[i] %= base; 
}

void Gen( int i, int j )
{
  if (j == dep)
  {
    p[pn++] = i;
    return;
  }
  Gen(i, j + 1);
  Gen(i | (1 << j), j + 1);
}

int main()
{
  Read(a);
  Read(b);

  int t = Len(a) + Len(b);
  assert(t <= mlen);
  len = mlen, dep = maxdep;
  while (len / 2 >= t)
    len /= 2, dep--;

  comp X(2 * M_PI / len);
  root[0] = comp(1.0, 0.0);
  forn(i, len)
    root[i + 1] = root[i] * X;

  Gen(0, 0);

  forn(i, len)
    x[i] = comp(a[i], 0);
  FFT(x);

  forn(i, len)
    y[i] = comp(b[i], 0);
  FFT(y);

  forn(i, len)
    x[i] = x[i] * y[i];
  sign = -1;
  FFT(x);
  
  forn(i, len)
    c[i] = (int)(x[i].x / len + 0.5);

  Cor(c);
  Out(c);
  return 0;
}