import java.util.Scanner;publicclassMain{static double exp=2.718281828;publicstaticvoidmain(String[] args){
Scanner sc=newScanner(System.in);while(true){//初始化三个变量
double temp=0;
double dewpoint=0;
double humidex=0;
int flag=0;//标记是哪两个的组合
int flag2=0;//如果是E标记为1,退出for(int i =0; i <2; i++){
String s=sc.next();if(s.equals("E")){
flag2=1;break;}elseif(s.equals("T")){
temp=sc.nextDouble();
flag+=1;}elseif(s.equals("D")){
dewpoint=sc.nextDouble();
flag+=2;}elseif(s.equals("H")){
humidex=sc.nextDouble();
flag+=3;}}if(flag2==1){break;}if(flag==3){//1+2=3 T D
humidex=temp+0.5555*((6.11*Math.pow(exp,5417.7530*((1/273.16)-1/(dewpoint+273.16))))-10.0);}elseif(flag==4){//1+3=4 T H
dewpoint=1/(1/273.16-Math.log(((humidex-temp)/0.5555+10)/6.11)/5417.7530)-273.16;}else{//2+3=5 D H
temp=humidex-0.5555*((6.11*Math.pow(exp,5417.7530*((1/273.16)-1/(dewpoint+273.16))))-10.0);}
System.out.println("T "+String.format("%.1f", temp)+" D "+String.format("%.1f", dewpoint)+" H "+String.format("%.1f", humidex));}}}