Task: Text to Code
Input (English): select the row whose entered service record of all rows is 3rd minimum . the locomotive record of this row is c503 .
Output (English): eq { hop { nth_argmin { all_rows ; entered service ; 3 } ; locomotive } ; c503 }