Hello I have to sort and match two colums and don't know how; please show me how to write such formula. Thanks in advance!!

This is what I have, match & sort column B to column A in a uqiue and non repeating way:
A-- B
11 11
22 22
33 33
33 33
33 66
44 88
55 99
66
66
77
88

After sorting & matching I would like to have something like this in column C (matched) and column D (not matched):
A--B--C--D
11 11 11 99
22 22 22
33 33 33
33 33 33
33 66
44 88
55 99
66 ---66
66
77
88 ---88

*please ignore that dash, they are just there to put the numbers in the correct column on this forum page.