#include <iostream>
using namespace std;
int n;
int main()
{
cin >> n;
int f1=1,f2=1;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=n;j++)
if(i==1 and (j==1 or j==2)) cout << f1 << " ";
else
{
int aux=f2%10;
f2=(f1+f2)%10;
f1=aux;
cout << f2 << " ";
}
cout << endl;
}
return 0;
}