#!/usr/bin/python

import cPickle
import sys
import string

cfile = sys.argv[1]
ufile = open(cfile, 'r')
x = cPickle.load(ufile)
ufile.close()

fname = cfile+'.xyz'
f = open(fname, 'w')
for i in range(len(x)):
    for j in range(len(x[0])):
        f.write(string.join(map(str, x[i][j]))+'\n')
    f.write('\n')
f.close()
