#include <bits/stdc++.h>
using namespace std;
int main() {
int money, minu, k;
cin >> money >> minu >> k;
int totim = (-1) * minu;
int whether = 0;
while (money > 0) {
if (k == 1) {
if (money > 55) {
money -= 55;
totim += minu;
whether = 1;
cout << totim << ": "
<< "Wayne drinks a Corn soup, and now he has " << money;
k = 0;
if (money == 1) {
cout << " dollar." << endl;
} else {
cout << " dollars." << endl;
}
continue;
}
if (money == 55) {
money -= 55;
totim += minu;
whether = 1;
cout << totim << ": "
<< "Wayne drinks a Corn soup, and now he doesn't have money.";
}
if (money < 55) {
break;
}
k = 0;
}
if (k == 0) {
if (money > 32) {
money -= 32;
totim += minu;
whether = 1;
cout << totim << ": "
<< "Wayne eats an Apple pie, and now he has " << money;
if (money == 1) {
cout << " dollar." << endl;
} else {
cout << " dollars." << endl;
}
k = 1;
continue;
}
if (money == 32) {
money -= 32;
totim += minu;
whether = 1;
cout << totim << ": "
<< "Wayne eats an Apple pie, and now he doesn't have money.";
}
if (money < 32) {
break;
}
}
}
if (whether == 0) {
cout << "Wayne can't eat and drink.";
}
}