from math import gcd t=int(input()) for _ in range(t): a,b,c=map(int,input().split()) a=gcd(a,b) a=gcd(a,c) print(a,a,a)