#include <iostream>
using namespace std;

int main()
{
    int A , B;
    cin>>A>> B;
    if(A<13 && A>=6){
         cout<<B/2<<endl;
         cout<<"Takahashi is "<<A<<" years old, and the cost of the Ferris wheel is the half of "<<B<<" yen, that is, "<<B/2<<" yen."<<endl;
    }
    if(A<6){
        cout<<0<<endl;
        cout<<"Takahashi is "<<A<<" years old, and he can ride the Ferris wheel for free."<<endl;
    }
    if(A>=13){
        cout<<B<<endl;
        cout<<"Takahashi is "<<A<<" years old now, and the cost of the Ferris wheel is "<<B<<" yen."<<endl;
    }
}
