#include <cmath>

const int blen = 2;
const unsigned base = (int)1e2;
const int maxdep = 17;
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); }
};

#define max_mem (mlen * 2)

int mpos = 0;
comp mem[max_mem];

comp root[mlen + 1];
comp x[mlen], y[mlen], z[mlen];

int len;
num a, b, c;

void FFT( int dep, int step, int n, comp *a, comp *res )
{
  if (n == 1)
  {
    res[0] = a[0];
    return;
  }

  int n1 = n / 2;
  comp *r0 = mem + mpos; mpos += n1;
  comp *r1 = mem + mpos; mpos += n1;
  comp *a0 = res;
  comp *a1 = res + n1;
  assert(mpos < max_mem);

  forn(i, n)
    if (i & 1)
      a1[i >> 1] = a[i];
    else
      a0[i >> 1] = a[i];

  FFT(dep + 1, step * 2, n1, a0, r0);
  FFT(dep + 1, step * 2, n1, a1, r1);

  int pos = (step < 0 ? len : 0);
  forn(i, n1)
  {
    comp tmp = root[pos] * r1[i];
    res[i] = r0[i] + tmp;
    res[i + n1] = r0[i] - tmp;
    pos += step;
  }

  mpos -= n;
}

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

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

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

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

  forn(i, len)
    x[i] = comp(a[i], 0);
  FFT(0, 1, len, x, y);
  
  forn(i, len)
    x[i] = comp(b[i], 0);
  FFT(0, 1, len, x, z);

  forn(i, len)
    x[i] = y[i] * z[i];
  FFT(0, -1, len, x, y);

  forn(i, len)
    c[i] = (int)(y[i].x / len + 0.5);

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