#31758: python解題思路


10730094@ms2.hssh.tp.edu.tw (給開司一份薯片)


while True:
    try:
        times = int(input())
        while times > 0 :
            a1,a2,a3,a4 = map(int,input().split())
            if(a2 / a1 == a3 / a2):
                for i in range(5): # 0 ,1 ,2 ,3 ,4
                    print(int(a1*pow((a2/a1),i)), end= " ")
                       
            else:
                for j in range(5): #0, 1, 2, 3, 4
                    print(int(a1 + j*(a2-a1)),end= " ")          
            times-=1
            print("")
    except EOFError:
        break