#include <stdio.h> int main() { int c, b, a[5]; scanf("%d", &b); while (b > 0) { for (c = 0; c <= 3; c++) scanf("%d", &a[c]); if (a[3] / a[2] == a[2] / a[1] && a[2] / a[1] == a[1] / a[0]) a[4] = a[3] * a[2] / a[1]; else a[4] = a[3] + a[2] - a[1]; for (c = 0; c <= 4; c++) printf("%d ", a[c]); printf("\n"); b--; } }