49 atcoder#ABC191B. [ABC191B] Remove It

[ABC191B] Remove It

Score : 200200 points

Problem Statement

Given are an integer sequence AA of length NN, and an integer XX. Remove all elements that are equal to XX from AA, and arrange the remaining elements without changing the order to obtain the sequence AA'. Print AA'.

Constraints

  • 1N1051 \le N \le 10^5
  • 1X1091 \le X \le 10^9
  • 1Ai1091 \le A_i \le 10^9
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN XX

A1A_1 A2A_2 A3A_3 \dots ANA_N

Output

Print the elements of AA' in order, with space in between.

5 5
3 5 6 5 4
3 6 4

Removing 55s from [3,5,6,5,4][3, 5, 6, 5, 4] results in [3,6,4][3, 6, 4].

3 3
3 3 3

AA' can be a sequence with zero elements, in which case we should just print an empty line.