#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
int a,b,c,d;
scanf("%d %d %d %d",&a,&b,&c,&d);
if(b-a==d-c){
printf("%d %d %d %d %d",a,b,c,d,d+(d-c));
}else if(d/c==c/b){
printf("%d %d %d %d %d",a,b,c,d,d*(d/c));
}
return 0;
}