import sys input = sys.stdin.readline from collections import deque from bisect import bisect_left, bisect_right import itertools #from math import * for t in range(1, int(input())+1): m, r, n = map(int, input().split()) arr = list(map(int, input().split())) ans = 0 c = 0 pind = -1 ans = 0 while c < m: tg = c+r ind = bisect_right(arr, tg) ind -= 1 if ind == pind: ans = "IMPOSSIBLE" break pind = ind ans += 1 c = arr[ind]+r print("Case #{}: {}".format(t, ans))