awk '{print NR, $0}' | sort -k 2,2nr | awk '{print ($1==1?"A":$1==2?"B":"C")}'