#!/usr/bin/env python2

import sys
myFile = open(sys.argv[1],"r")
myFile2 = open("output.txt","w")
nl = ''
ciphertext = myFile.read()

freqDict = {
        "A" :"t",
        "O" :"h",
        "U" :"d",
        "B" :"e",
        "V" :"a",
        "M" :"n",
        "X" :"o",
        "P" :"i",
        "N" :"g",
        "F" :"r",
        "W" :"s",
        "T" :"u",
        "I" :"m",
        "Q" :"f",
        "S" :"l",
        "L" :"b",
        "R" :"w",
        "H" :"y",
        "Z" :"c",
        "Y" :"k",
        "G" :"v",
        "K" :"j",
        "D" :"q",
        "C" :"p"
        }

for letter in ciphertext:
    if letter in freqDict:
       letter = freqDict[letter]
    myFile2.write(letter)
myFile.close()
