python
n = int(input())res = []mi = 0ma = 100for i in range(n): arr = [input().split()] res.extend(arr) if int(res[i][2]) < ma: mi_index = i ma = int(res[i][2]) if int(res[i][2]) > mi: ma_index = i mi = int(res[i][2])print("{} {}".format(res[ma_index][0],res[ma_index][1]))print("{} {}".format(res[mi_index][0],res[mi_index][1]))
C++
#include