{ a[$1]=a[$1]<$3?a[$1]?a[$1]:$3:$3 b[$1 OFS $3]=$0 } END{ for(j in a){ print b[j OFS a[j]] } }