import sys input = sys.stdin.readline T=int(input()) for tests in range(T): N=int(input()) S=list(map(int,input().split())) X=[] for s in S: if X and X[-1]==s: continue else: X.append(s) if len(X)==len(set(X)): ANS=" ".join(map(str,X)) else: ANS="IMPOSSIBLE" print("Case #"+str(tests+1)+": "+str(ANS))