#include <stdio.h>
int main()
{
        int n,m;
        int k,r;
        scanf("%d %d",&n,&m);
        r=(1.0/2.0)*(m-2*n);
        k=(1.0/2.0)*(4*n-m);
        printf("%d %d",k,r);
        return 0;
}