#!/usr/bin/python
# -*- coding: utf-8 -*-

temp_dict = {}
with open('hightemp.txt', 'r') as fr:
    for f in fr.readlines():
        cols = f.rstrip('\n').split('\t')
        temp_dict[cols[0],cols[1],cols[3]] = cols[2]

for k, v in sorted(temp_dict.items(), key=lambda x: x[1], reverse=True):
    print k[0], k[1], v, k[2]
