#include <iostream>
#include <string.h>
using namespace std;
int sum;
int c[4], v[4] = {1, 5, 10, 25}, cnt[4], map[26];
int num[10005];
int pre[10005];
int f[10005];
int main()
{
map[1] = 0; map[5] = 1; map[10] = 2; map[25] = 3;
while(scanf("%d", &sum))
{
memset(pre,0,sizeof(pre));
int i, j, k, tp = sum;
for(i = 0; i < 4; i ++)
{
scanf("%d", &c[i]);
tp += c[i];
}
if(tp == 0) break;
f[0] = 1;
pre[0] = -1;
for(i = 0; i < 4; i ++)
{
for(j = v[i]; j <= sum; j ++)
if( (!f[j] || f[j] < f[j - v[i]] + 1) && f[j - v[i]] && num[j - v[i]] < c[i])
{
f[j] = f[j - v[i]] + 1;
pre[j] = j - v[i];
num[j] = num[j - v[i]] + 1;
}
for(j = v[i]; j <= sum; j ++) num[j] = 0;
}
if(f[sum])
{
memset(cnt, 0, sizeof(cnt));
i = sum;
while(1)
{
j = pre[i];
if(j == -1) break;
cnt[map[i - j]] ++;
i = j;
}
printf("Throw in %d cents, %d nickels, %d dimes, and %d quarters.\n",
cnt[0], cnt[1], cnt[2], cnt[3]);
}
else puts("Charlie cannot buy coffee.");
for(i = 0; i <= sum; i ++) f[i] = 0;
}
}