#データ入力

data = eval(input())

data = data.split(" ")



n_large = int(data[0])

t_large = int(data[1])



data = eval(input())

data = data.split(" ")

ts = []

for d in data:

    ts.append(int(d))



#計算

ts.sort()



total = ts[0]

for i in range(1, len(ts)):

    buf = ts[i] - ts[i - 1]

    if buf > t_large:

        total += t_large

    else:

        total += buf



total += t_large



print(total)
data = eval(input())

data = data.split(" ")



n_large = int(data[0])

t_large = int(data[1])



data = eval(input())

data = data.split(" ")

ts = []

for d in data:

	ts.append(int(d))



max = ts[n_large - 1] + t_large

decrease = 0

for i in range(0, n_large - 1):

	a = ts[i + 1] - ts[i]

	if a > t_large:

		b = a - t_large

		decrease += b

print((max - decrease))
# データ入力
data = eval(input())
data = data.split(" ")
n_large = int(data[0])
t_large = int(data[1])
data = eval(input())
data = data.split(" ")
ts = []
for d in data:
    ts.append(int(d))
# 計算
ts.sort()
total = ts[0]
for i in range(1, len(ts)):
    buf = ts[i] - ts[i - 1]
    if buf > t_large:
        total += t_large
    else:
        total += buf
total += t_large
print(total)

data = eval(input())
data = data.split(" ")
n_large = int(data[0])
t_large = int(data[1])
data = eval(input())
data = data.split(" ")
ts = []
for d in data:
    ts.append(int(d))
max = ts[n_large - 1] + t_large
decrease = 0
for i in range(0, n_large - 1):
    a = ts[i + 1] - ts[i]
    if a > t_large:
        b = a - t_large
        decrease += b
print((max - decrease))

-# データ入力 -# 計算 -ts.sort() -total = ts[0] -for i in range(1, len(ts)): -    buf = ts[i] - ts[i - 1] -    if buf > t_large: -        total += t_large -    else: -        total += buf -total += t_large -print(total) +max = ts[n_large - 1] + t_large +decrease = 0 +for i in range(0, n_large - 1): +    a = ts[i + 1] - ts[i] +    if a > t_large: +        b = a - t_large +        decrease += b +print((max - decrease))