include <iostream>
using namespace std;
int main() {
int a[10][10];
for (int i=0;i<10;i++)
for (int j=0;j<10;j++)
a[i][j]=i*10+j;
for (int big1=0;big1<1000001;big1++)
for (int big2=0;big2<1000001;big2++)
for (int big3=0;big3<2007;big3++)
for (int i=0,j=1;i+1<10;i+=!(j=(j+1)%10),j+=!j*(i+1))
a[i][j]^=a[j][i]^=a[i][j]^=a[j][i];
for (int i=0;i<10;i++,cout<<endl)
for (int j=0;j<10;j++,cout<<" ")
cout<<a[i][j]/10<<a[i][j]%10;
return 0;
include <iostream>
using namespace std;
int main() {
int a[10][10];
for (int i=0;i<10;i++)
for (int j=0;j<10;j++)
a[i][j]=i*10+j;
for (int big1=0;big1<1000001;big1++)
for (int big2=0;big2<1000001;big2++)
for (int big3=0;big3<2007;big3++)
for (int i=0,j=1;i+1<10;i+=!(j=(j+1)%10),j+=!j*(i+1))
a[i][j]^=a[j][i]^=a[i][j]^=a[j][i];
for (int i=0;i<10;i++,cout<<endl)
for (int j=0;j<10;j++,cout<<" ")
cout<<a[i][j]/10<<a[i][j]%10;
return 0;