+#!/usr/bin/env python
+
+import sys
+import random
+import string
+
+
+f1 = open(sys.argv[1])
+f2 = open(sys.argv[2])
+count = int(sys.argv[3])
+
+l1 = f1.readlines()
+l2 = f2.readlines()
+
+l1 = [i.strip() for i in l1]
+l2 = [i.strip() for i in l2]
+
+d1 = {}
+d2 = {}
+
+# inicializo todo vacio
+for p in range(0, count):
+ d1[l1[p]] = []
+ d2[l2[p]] = []
+
+# agrego a los de d1 las claves de d2, mezclandola al azar
+l = d2.keys()
+for i in d1.keys():
+ random.shuffle(l)
+ d1[i] = l[:]
+
+# y lo mismo para el otro
+l = d1.keys()
+for i in d2.keys():
+ random.shuffle(l)
+ d2[i] = l[:]
+
+# imprimo
+for i in d1.keys():
+ print "%s: %s" % (i, string.join(d1[i], ','))
+print
+for i in d2.keys():
+ print "%s: %s" % (i, string.join(d2[i], ','))
+
+