T = int(input()) for _ in range(T): v,x = map(int,input().split()) mod = v*x+1 a = [pow(i,v,mod) for i in range(1,x+1)] a.sort() print(*a)