#!/usr/bin/python3

def main():
	while(True):
		x=input("f for farenheit c for celcious:")
		if x=="f" or x=="c":
			break
		else:
			print("f or c")

	try:
		y=float(input("temperature:"))
		if x=="f":
			print((y - 32) * 5 / 9 ," celsius")
		else:
			print((y * 9 / 5) + 32," fahrenheit")
	except Exception as e:
		print("c or f" , e)

if __name__=="__main__":
	main()
