Program NhatNgu;
Uses crt;
Var A: array[1..10000] of longint;
n,i,x,dl,db,j,tg,dem: longint;
Begin
Clrscr;
Write('Nhap n, x: '); Readln(n,x);
dl:=0; db:=0;
For i:=1 to n do
Begin
Write('A[',i,'] = '); Readln(A[i]);
If A[i]=x then inc(dem);
If A[i]<=x then inc(db)
Else inc(dl);
End;
For i:=1 to n-1 do
For j:=i+1 to n do
If A[i]>A[j] then
Begin
tg:=A[i];
A[i]:=A[j];
A[j]:=tg;
End;
For i:=1 to n do Write(A[i],' ');
Writeln;
Writeln('Xuat hien ',dem,' lan');
Writeln('Co ',db,' phan tu be hon hoac bang ',x);
Writeln('Co ',dl,' phan tu lon hon ',x);
Readln
End.