1 #include <stdio.h>
 2 #define bool char
 3 #define MAX 5000002
 4 int heap[MAX],end=-1;
 5 void heap_add(int a){
 6     end++;
 7     heap[end]=a;
 8     int father,now=end,tmp;
 9     while(heap[father=(now-1)/2] > heap[now]){
10         tmp=heap[now];
11         heap[now]=heap[father];
12         heap[father]=tmp;
13         now=father;
14     }
15 }
16 int heap_del(void){
17     int tore=heap[0];
18     heap[0]=heap[end];
19     end--;
20     int child,mod,now=0,tmp;
21     while(1){
22         child=now*2+1;
23         if(end >= child){
24             mod=child;
25         }else{
26             return tore;
27         }
28         if(end >= child+1){
29             if(!(heap[child] < heap[now] || heap[child+1] < heap[now])){
30                 return tore;
31             }
32             if(heap[child+1] < heap[child]){
33                 mod=child+1;
34             }
35         }else{
36             if(!(heap[child] < heap[now])){
37                 return tore;
38             }
39         }
40         tmp=heap[now];
41         heap[now]=heap[mod];
42         heap[mod]=tmp;
43         now=mod;
44     }
45     return tore;
46 }
47 int main(){
48     int p;
49     int i,day,what;
50     bool good=1;
51     for(day=1;;day++){
52         scanf("%d",&p);
53         if(p==-1){
54             if(good){
55                 puts("Good");
56             }
57             if(end < 0){
58                 puts("0");
59             }else{
60                 printf("%d\n",end+1);
61             }
62             return 0;
63         }
64         for(i=1;i<=p;i++){
65             scanf("%d",&what);
66             heap_add(what);
67         }
68         for(i=0;heap[0] < day && end>=0;i++){
69             heap_del();
70         }
71         if(end>=0){
72             heap_del();
73         }else{
74             puts("No flour!");
75         }
76         if(i){
77             good=0;
78             printf("%d: %d\n",day,i);
79         }
80     }
81     return 0;
82 }