#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<set>
#include<queue>
using namespace std;
int main()
{
int m,n,num=0,sum=0;
scanf("%d%d",&m,&n);
for(int i=m;i<=n;i++)
{
printf("%5d",i);
sum+=i;
num++;
if((num%5)==0) printf("\n");
}
if((num%5)!=0) printf("\nSum = %d\n",sum);
else printf("Sum = %d\n",sum);
return 0;
}