The last two letters of the words make up the ordinal number
first - last two letters are 'st' so put after 1 = 1st
second - last two letters are 'nd' put after 2 = 2nd
third - last two letters are 'rd' so put after 3 = 3rd
fourth - last two letters are 'th' so put after 4 = 4th