#include<iostream>
#include<iomanio>
using namespace std;
class TE{
    public:
    double tf(double c){
        return(c*9.0/5.0)+32;
    }
    double tc(double f){
        return (f-32)*5.0/9.0;
    }
};
int main(){
    double c,f;
    if(!(cin>>c>>f))return 0;
    if(c<0||f<0){
        cout<<"Inalid input"<<endl;
        
    }else{
        TE temp;
        couty<<fixed<<setprecision(2);
        cout<<temp.tf(C)<<endl;
        cout<<temp.tc<<endl;
    }
    return 0;
}