#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
int b=1;
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
if(b<10){
cout<<"0"<<b;
b++;
}
else{
cout<<b;
b++;
}
}
cout<<endl;
}
cout<<endl;
b=1;
for(int i=1;i<=n;i++){
for(int j=1;j<=i;j++){
if(b<10){
cout<<"0"<<b;
b++;
}
else{
cout<<b;
b++;
}
}
cout<<endl;
}
return 0;
}