from countryList import countryList

f=open( 'worldmap.gif', 'rb' )
output = f.read(13)
for i in range(1 << ( (ord(output[10]) & 7) +1 )):
    r,g,b = [ord(c) for c in f.read(3)]
    if r==255-g and b==238:
        growth = countryList[r][1]
        if growth!=None:
            r = int(30*max(0,growth+2))+64
            g = b = 92
        else:
            r = g = g = 64
    output += chr(r)+chr(g)+chr(b)

print output + f.read()
