Task: Text to Code
Input (English): select the row whose agg record of all rows is 2nd maximum . the team 2 record of this row is defence force .
Output (English): eq { hop { nth_argmax { all_rows ; agg ; 2 } ; team 2 } ; defence force }