# -*- coding: utf8 -*-
import urllib2
rsp = urllib2.urlopen('http://opendata.epa.gov.tw/ws/Data/AQX/?format=csv&ndctype=CSV&ndcnid=6074')
data = rsp.read()
csvdata = str(data).decode('utf8')
weather_dict = {}
for line in csvdata.splitlines()[1:76]:
word = line.split(',')
weather_dict.update(weather_dict)
weather_dict[word[0]] = [word[1],word[2],word[3],word[4], word[-1]]
for key, value in sorted(weather_dict.iteritems(),key = lambda (k,v):(int(v[1]),k),reverse = True ):
print key, ':', value[1]
input_l = raw_input('地點:').decode('utf-8')
print weather_dict[input_l][1]