#include <iostream>
using namespace std;

int main() {

    // write your code here......
    int a = 0;
    int b = 0;
    cin>>a;
    cin>>b;

    cout<<(a+b)<<' ';
    if(a>b)
    {
        cout<<(a-b)<<' '<<(a*b)<<' '<<(a/b)<<' '<<(a%b);
    }
    else
    {
         cout<<(b-a)<<' '<<(a*b)<<' '<<(b/a)<<' '<<(b%a);
    }

    return 0;
}