def FindRange(nums,lower,upper):
    def getRanges(lower,upper):
        if lower == upper:
            return "{}".format(lower)
        else:
            return "{}-{}".format(lower,upper)

    ranges = []
    pre = lower -1
    for i in range(len(nums)-1):
        if i ==len(nums):
            cur = upper+1
        else:
            cur = nums[i]
            if cur - pre >=2:
                ranges.append(getRange(pre+1,cur-1))
            pre = cur
    return ranges