n, k = map(int, input().split())
arr = list(map(int, input().split()))
for i in range(n - 2):
if i != 0 and arr[i] == arr[i - 1]:
continue
target = k - arr[i]
second, third = i + 1, n - 1
while second < third:
if (second != i + 1 and arr[second] == arr[second - 1]):
second += 1
continue
if arr[second] == arr[i] or arr[second] == arr[third]:
second += 1
continue
su = arr[second] + arr[third]
if su == target:
print(arr[i], arr[second], arr[third])
second += 1
elif su > target:
third -= 1
else:
second += 1