import sys, math, itertools, functools, collections input = sys.stdin.readline def solve(testcase): n = int(input()) a = [*map(int, input().split())] b = [(i, len(list(j))) for i, j in itertools.groupby(a)] res = 'IMPOSSIBLE' if len(set(i[0] for i in b)) == len(b): res = ' '.join(str(i[0]) for i in b) print('Case #'+str(testcase)+':', res) for testcase in range(1, int(input())+1): solve(testcase)