#include<iostream>
using namespace std;
int main()
{
int num, cof;
cin >> num >> cof;
if (!cof) {
cout << "0 0";
}
else {
cout << num * cof << " " << cof - 1;
}
while (cin >> num >> cof) {
cof ? cout << " " << num * cof << " " << cof - 1 : cout << "";
}
return 0;
}
08-06
08-06
08-31