#include<stdio.h>
using namespace std;
int main()
{
   int a,b;
   while(~scanf("%d%d",&a,&b))
   {
       if(a-b<0)
       {printf("0\n");
        printf("All %d grams of sand will be gone, resulting in 0 grams.\n",a);}
       else
        {printf("%d\n",a-b);
        if(a-b>0)
            printf("%d out of the initial %d grams of sand will be consumed, resulting in %d grams.\n",b,a,a-b);
        }

   }
}
