Solution if order matters, using only sort and uniq
<INPUT_FILE sort -k 1,1 -k 2nr,2 | uniq -w4
-k: sort by key (in this case column, pairs with -t)
-n: sort as a number
-r: reverse order
(optional) -t: in case you want to change the key separator (default: space)
-w: choose the first N characters
In your problem, we need to first sort the first column and then the second one. So there is a -k 1,1 followed by -k 2,2.
But, the second key (ONLY) must be sorted as a number and in the reverse order.
Thus, it should be -k 2nr,2.
Note that if the -n or -r sort parameters are outside -k parameter, they are applied to the whole input instead of specific keys.
Lastly, me must find the unique lines, but matching only the first 4 chars. Thus, uniq -w 4