#!/usr/bin/python3
#Askisi 4

def main():
	x=None
	temp=None
	try:
		while True:
			x=input("Give temperature: ")
			if len(x.split()[1]) > 1:
				break
			print("Give a right temperature")
	except Exception as e:
		print(f"Exception:{e}")
		exit(1)
	temp=float(x.split()[0])
	if x.split()[1]=="oF":
		print(f"The temperature in Celsiu is {fah_to_cel(temp)} oC")
	else:
		print(f"The temperature in Fahrenheit is {cel_to_fah(temp)}  oF")

def cel_to_fah(temp):
	return temp*9/5+32

def fah_to_cel(temp):
	return (temp-32)*5/9

if __name__=="__main__":
	main()
