from sys import argv

complement = {'c':'g','t':'a','g':'c','a':'t','\n':''}
filename = argv[1]
output = argv[2]
rc = ''

ins = open(filename)
ost = open(output,"w")
source = ""
for line in ins:
	line = line[:-1].lower()
	if line[0] == '>':
		if source != "":
			temp = ""
			for c in source:
				temp += complement[c]
			temp = temp[::-1]
			rc+= temp+"\n"
			source = ""
		rc += line + "_reverse_complement\n"
	else:
		source += line 

temp = ""
for c in source:
	temp += complement[c]
temp = temp[::-1]
rc+= temp+"\n"


ins.close()
ost.write(rc)
ost.close()
