removing duplicates based on key

HI I am having a file like this

1234
12345678
1234567890123
4321
43215678
432156789028433435

I want to get ouput as

1234567890123
432156789028433435

based on key position 1-4

I am using ksh can anyone give me an idea

Thanks
pukars

This gives the last occurrence only of the key field:

awk '{ arr[substr($0,1,4)]=$0} END {for (i in arr ){print arr}}' inputfile