#include <iostream>
#include <iomanip>
#include <climits>

#define X 9
#define Y 7
#define S 10

using namespace std;

int main()
  {
   int s=S;
   for(int y=0;y<Y;++y)
     {
      for(int x=0;x<X;++x)
       {
        cout<<setw(3)<<(s++)<<' ';
       }
      cout<<endl;
     }
   cin.ignore(INT_MAX,'\n');
   for(int y=0;y<Y;++y)
     {
      for(int x=0;x<X;++x)
       {
        cout<<setw(3)<<(S+Y*x+y)<<' ';
       }
      cout<<endl;
     }
   cin.ignore(INT_MAX,'\n');
   return 0;
  }
