input_lines1 = input().split()
input_lines2 = input().split()
n = int(input_lines1[0])
x = int(input_lines1[1])
ans = []
for i in range(len(input_lines2)):
    a = int(input_lines2[i])
    if a != x:
        ans.append(a)
print(*ans)

ad931ed245f5a79b8890643534daa4962f255778
<mask token>

<mask token>
for i in range(len(input_lines2)):
    a = int(input_lines2[i])
    if a != x:
        ans.append(a)
print(*ans)

input_lines1 = input().split()
input_lines2 = input().split()
n = int(input_lines1[0])
x = int(input_lines1[1])
ans = []
for i in range(len(input_lines2)):
    a = int(input_lines2[i])
    if a != x:
        ans.append(a)
print(*ans)
