alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' t = int(input()) for u in range(t): n = int(input()) s = [int(i) for i in input().split()] cols = {} current = -1 ans = [] for col in s: if not col == current: if col in cols: ans = ['IMPOSSIBLE'] break else: ans.append(str(col)) cols[col] = 'hello' current = col ans = ' '.join(ans) print('Case #' + str(u+1) + ':', ans)