import sys

fn = 'gg'
f = open (fn, 'r')
name, gen = [], []
for line in f:
  n,g = line.split(' ', 1)
  name.append(n)
  gen.append(g[:-3])
f.close()
n = len(name)
for i in xrange(0,n-2):
  for j in xrange(i+1,n-1):
    for k in xrange(j+1,n):
      f = open ('med/'+str(i)+'-'+str(j)+'-'+str(k)+'.txt', 'w')
      print >> f, '>'+name[i]
      print >> f, 'C:', gen[i]
      print >> f, '>'+name[j]
      print >> f, 'C:', gen[j]
      print >> f, '>'+name[k]
      print >> f, 'C:', gen[k]
      f.close()

