#include<stdio.h>
#include<stdlib.h>
int main(){
int a[4],i
while(scanf("%d %d %d %d",&a[0],&a[1],&a[2],&a[3])!=EOF){
a[4]=0;
for(i=0;i<2;i++){
if(a[i+1]%a[i]==0){
a[4] = (a[3]/a[2])*a[3];
printf("%d",a[4]);}
if(a[i+1]-a[i] == a[i+2]-a[i+1]){
a[4]=2*a[3]-a[2]
printf("%d",a[4]);}
}
return 0;
}
1 2 3 4會變成37...