#!/usr/bin/python

rows = {
  'a':  370,
  'b':  346,
  'c1': 273 + (336 - 273)/4.0 * 3.0,
  'c2': 273 + (336 - 273)/4.0 * 2.0,
  'c3': 273 + (336 - 273)/4.0 * 1.0,
  'c4': 273 + (336 - 273)/4.0 * 0.0,
  'd':  250,
  'e':  226,
  'f1': 150 + (225 - 150)/4.0 * 3.0,
  'f2': 150 + (225 - 150)/4.0 * 2.0,
  'f3': 150 + (225 - 150)/4.0 * 1.0,
  'f4': 150 + (225 - 150)/4.0 * 0.0,
  '3':  322,
  '5':  298,
  '12b':202,
  '12c':177,
  '12d':154,
  '14': 142,
  '15': 117,
}
rows['1'] = rows['b']
rows['2'] = rows['b']
rows['4'] = rows['3']
rows['6'] = rows['5']
rows['7'] = rows['c4']
rows['8'] = rows['c4']
rows['9'] = rows['d']
rows['10'] = rows['d']
rows['11'] = rows['e']
rows['12a'] = rows['e']
rows['13'] = rows['12b']
rows['16'] = rows['15']
rows['17'] = rows['15']
rows['18'] = rows['15']
rows['19'] = rows['15']
rows['20'] = rows['15']
rows['e1'] = rows['e']

columns = {
  'a':    9,
  '1':  304,
  '2':  426,
  'e1': 145,
  '16': 167,
  '17': 254,
  '18': 333,
  '19': 420,
  '20': 499,
}

for c in ('b', 'c1', 'c2', 'c3', 'c4', 'd', 'e', 'f1', 'f2', 'f3', 'f4', '15'):
    columns[c] = columns['a']
for c in ('3', '5', '7', '9', '11', '13', '14'):
    columns[c] = columns['1']
for c in ('4', '6', '8', '10', '12a', '12b', '12c', '12d'):
    columns[c] = columns['2']

for column in columns.keys():
    assert rows.has_key(column)
for row in rows.keys():
    assert columns.has_key(row)

print """%!PS-Adobe-3.0
%%BoundingBox: 
%%Pages: 1
%%EndComments
"""

print "/Helvetica findfont 15 scalefont setfont"

print "/one {"
for k in columns.keys():
    print columns[k], rows[k], "moveto", 
    print '(%s) show' % k
print "} def"

print "gsave",40,-27,"translate","one","grestore"
print "gsave",40,365,"translate","one","grestore"

print "showpage"


