#55555: ans


yp11451032@yphs.tp.edu.tw (811-23吳嘉恩)


#include<bits/stdc++.h>
using namespace std;
int main(){
    int n, m, k;
    cin >> n >> m >> k;
    int t=0;
    bool ate=false;
    while(1){
        int cost=32;
        if(k==0) cost=32;
        else cost=55;
        if(n<cost) break;
        ate=true;
        n-=cost;
        if(k==0) cout << t << ": Wayne eats an Apple pie, and now he ";
        else cout << t << ": Wayne drinks a Corn soup, and now he ";

        if(n==0) cout << "doesn't have money." << endl;
        else if(n==1) cout << "has 1 dollar." << endl;
        else cout << "has " << n << " dollars." << endl;

        k=1-k;
        t+=m;
    }
    if(ate==false){
        cout << "Wayne can't eat and drink." << endl;
    }
}