#include <iostream>
using namespace std;
int main()
{int num[4];
while (cin>>num[0]>>num[1]>>num[2]>>num[3])
{
if ((num[1]-num[0]==1)&&(num[2]-num[1]==1)&&(num[3]-num[2]==1))
{
cout<<num[0]<<" "<<num[1]<<" "<<num[2]<<" "<<num[3]<<" "<<num[3]+1<<endl;
}
if ((num[2]%num[1]==0)&&(num[3]%num[2]==0))
{
cout<<num[0]<<" "<<num[1]<<" "<<num[2]<<" "<<num[3]<<" "<<(num[3]*(num[3]/num[2]));
}
}
return 0;
}