#include<bits/stdc++.h>
using namespace std;
#define N 10010
#define base 10000
struct ass
{
int c[N],len,sign;
ass(){memset(c,0,sizeof(c));len=0;sign=0;}
void zero()
{
while(c[len]==0&&len>1) len--;
if(len==1&&c[len]==0) sign=0;
}
void write(char *s)
{
int l=strlen(s),k=1;
for(int i=l-1;i>=0;i--)
{
c[len]+=(s[i]-'0')*k;
k*=10;
if(k==base){k=1;len++;}
}
}
void read()
{
char s[N]={0};
scanf("%s",s);
write(s);
}
void print()
{
if(sign)printf("-");
printf("%d",c[len]);
for(int i=len-1;i>=1;i--) printf("%04d",c[i]);
printf("\n");
}
ass operator = (int a)
{
char s[100];
sprintf(s,"%s",a);
write(s);
return *this;
}
bool operator < (const ass &a)const
{
if(len!=a.len) return len<a.len;
for(int i=len;i>=1;i--)
if(c[i]!=a.c[i]) return c[i]<a.c[i];
return 0;
}
bool operator > (const ass &a)const
{
return a<*this;
}
ass operator + (const ass &a)
{
ass r;
r.len=max(len,a.len)+1;
for(int i=1;i<=r.len;i++)
{
r.c[i]+=c[i]+a.c[i];
r.c[i + 1]+=r.c[i]/base;
r.c[i]%=base;
}
r.zero();
return r;
}
ass operator + (const int &a)
{
ass b;b=a;
return *this+b;
}
ass operator - (const ass &a)
{
ass b,c;
b=*this;
c=a;
if(c>b)
{
swap(b,c);
b.sign=1;
}
for(int i=1;i<=b.len;i++)
{
b.c[i]-=c.c[i];
if(b.c[i]<0)
{
b.c[i]+=base;
b.c[i+1]--;
}
}
b.zero();
return b;
}
ass operator - (const int &a)
{
ass b;b=a;
return *this-b;
}
ass operator * (const ass &a)
{
ass r;
r.len=a.len+len+1;
for(int i=1;i<=len;i++)
for(int j=1;j<=a.len;j++)
r.c[i+j-1]+=c[i]*a.c[i];
for(int i=1;i<=r.len;i++)
{
r.c[i+1]+=r.c[i]/base;
r.c[i]%=base;
}
r.zero();
return r;
}
ass operator * (const int &a)
{
ass b;b=a;
return *this*b;
}
ass operator / (const ass &b)
{
ass r,t,a;
a=b;
r.len=len;
for(int i=len;i>=1;i--)
{
t=t*base+c[i];
int div,ll=0,rr=base;
while(ll<=rr)
{
int mid=(ll+rr)/2;
ass k=a*mid;
if(k>t) rr=mid-1;
else
{
ll=mid+1;
div=mid;
}
}
r.c[i]=div;
t=t-a*div;
}
r.zero();
return r;
}
ass operator / (const int &a)
{
ass b;b=a;
return *this/b;
}
};
int main()
{
ass a,b;
a.read();
b.read();
ass c,d,e,f;
c=a/b;
d=a+b;
e=a-b;
f=a*b;
c.print();
d.print();
e.print();
f.print();
return 0;
}