using awk's assiciative arrays... read in the file, for every record/line create/update the assiciative arrave indexed by the value of first field with the value of the record/line itself. The last update of A entry in an array will done for the LAST record for a given index [FIRST filed in a record/line].
After processing ALL the records/lines in a file ['END' block of 'awk']... iterate through the previously populated array 'a' indexed by the iterator 'i' [the first field in the original file and output the value for a given index [the original record/line] in a file.
Because the final array iteration does not guarantee the ORDER of the entries, 'sort -n' the output - the sorting is numeric and is done based on the 'FIRST' column.