#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
    string a,b;
    double c,d,e;
    cin<<a;
    getline(cin,b);
    cin>>c;
    if(!a.empty() && a.back() == '\r') a.pop_back();
    if(!b.empty() && b.back() == '\r') b.pop_back();
    
    if(c>0)
    {
    if(b=="manager")
    {
        cout<<a;
        d=(c*25)/100;
        e=c+d;
        cout<<fixed<<setprecision(2)<<" "<<e<<endl;
    }
    else if(b=="developer")
    {
        cout<<a;
        d=(c*15)/100;
        e=c+d;
        cout<<fixed<<setprecision(2)<<" "<<e<<endl;
    }
    else
    {
        cout<<"Invalid input";
    }
    }
    else
    {
        cout<<"Invalid input";
    }
}