/* Note:Your choice is C IDE */
#include "stdio.h"
main()
{
int a,b,c,d,e,f;
scanf("%d",&a);
if(0<=a&&a<=9) printf("1\n");
else if(10<=a&&a<=99) printf("2\n");
else if(100<=a&&a<=999) printf("3\n");
else if(1000<=a&&a<=9999) printf("4\n");
else if(10000<=a&&a<=99999) printf("5\n");
else printf("wrong\n");
if(0<=a&&a<=9) a=f;
else if (10<=a&&a<=99) a=10*e+f;
else if (100<=a&&a<=999) a=100*d+10*e+f;
else if(1000<=a&&a<=9999) a=1000*c+100*d+10*e+f;
else if(10000<=a&&a<=99999) a=10000*b+1000*c+100*d+10*e+f;
else printf("wrong\n");
if(0<=a&&a<=9) printf("%d\n",f);
else if (10<=a&&a<=99) printf("%d,%d\n",e,f);
else if (100<=a&&a<=999) printf("%d,%d,%d\n",d,e,f);
else if(1000<=a&&a<=9999) printf("%d,%d,%d,%d\n",c,d,e,f);
else if(10000<=a&&a<=99999) printf("%d,%d,%d,%d,%d\n",b,c,d,e,f);
else printf("wrong\n");
if(0<=a&&a<=9) printf("%d\n",f);
else if (10<=a&&a<=99) printf("%d,%d\n",f,e);
else if (100<=a&&a<=999) printf("%d,%d,%d\n",f,e,d);
else if(1000<=a&&a<=9999) printf("%d,%d,%d,%d\n",f,e,d,c);
else if(10000<=a&&a<=99999) printf("%d,%d,%d,%d,%d\n",f,e,d,c,b);
else printf("wrong\n");
}