#include <iostream>
using namespace std;
int main()
{
int a, b, c, d, e, f;
while (cin >> a >> b >> c >> d)
{
if (b-a==c-b)
{
e=b-a;
cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<d + e<<endl;
}
else if (b/a==c/b)
{
f=b/a;
cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<d*f<<endl;
}
}
return 0;
}