#include <bits/stdc++.h>
using namespace std;
int main()
{
int a, b, sum = 0, cnt = 0;
cin >> a >> b;
for (int i = a; i <= b; i++)
{
printf("%5d", i);
sum += i;
cnt++;
if (cnt % 5 == 0)
cout << endl;
}
if (cnt % 5) cout << endl;
cout << "Sum = " << sum << endl;
return 0;
}