#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b=1,c;
cin>>a;
c=a-1;
for(int i=1;i<=4;i++){
for(int i=1;i<=4;i++){
if(b<=9){
cout<<0<<b;
}else{
cout<<b;
}
b++;
}
cout<<endl;
}
b=1;
for(int i=1;i<=4;i++){
for(int j=1;j<=c;j++){
cout<<" ";
}for(int i=1;i<=a-c;i++){if(b<=9){
cout<<0<<b;
}else{
cout<<b;
}
b++;}
cout<<endl;
c--;
}
}