CSES - Datatähti 2020 alku - Results
Submission details
Task:Ruudukko
Sender:patamaski
Submission time:2019-09-30 13:45:14 +0300
Language:C++ (C++11)
Status:READY
Result:100
Feedback
groupverdictscore
#1ACCEPTED100
Test results
testverdicttime
#1ACCEPTED0.01 sdetails
#2ACCEPTED0.01 sdetails
#3ACCEPTED0.01 sdetails
#4ACCEPTED0.01 sdetails
#5ACCEPTED0.01 sdetails
#6ACCEPTED0.01 sdetails

Code

#include <bits/stdc++.h>

using namespace std;

int main()
{
	int vastaus[100][100] = {{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100}, {2,1,4,3,6,5,8,7,10,9,12,11,14,13,16,15,18,17,20,19,22,21,24,23,26,25,28,27,30,29,32,31,34,33,36,35,38,37,40,39,42,41,44,43,46,45,48,47,50,49,52,51,54,53,56,55,58,57,60,59,62,61,64,63,66,65,68,67,70,69,72,71,74,73,76,75,78,77,80,79,82,81,84,83,86,85,88,87,90,89,92,91,94,93,96,95,98,97,100,99}, {3,4,1,2,7,8,5,6,11,12,9,10,15,16,13,14,19,20,17,18,23,24,21,22,27,28,25,26,31,32,29,30,35,36,33,34,39,40,37,38,43,44,41,42,47,48,45,46,51,52,49,50,55,56,53,54,59,60,57,58,63,64,61,62,67,68,65,66,71,72,69,70,75,76,73,74,79,80,77,78,83,84,81,82,87,88,85,86,91,92,89,90,95,96,93,94,99,100,97,98}, {4,3,2,1,8,7,6,5,12,11,10,9,16,15,14,13,20,19,18,17,24,23,22,21,28,27,26,25,32,31,30,29,36,35,34,33,40,39,38,37,44,43,42,41,48,47,46,45,52,51,50,49,56,55,54,53,60,59,58,57,64,63,62,61,68,67,66,65,72,71,70,69,76,75,74,73,80,79,78,77,84,83,82,81,88,87,86,85,92,91,90,89,96,95,94,93,100,99,98,97}, {5,6,7,8,1,2,3,4,13,14,15,16,9,10,11,12,21,22,23,24,17,18,19,20,29,30,31,32,25,26,27,28,37,38,39,40,33,34,35,36,45,46,47,48,41,42,43,44,53,54,55,56,49,50,51,52,61,62,63,64,57,58,59,60,69,70,71,72,65,66,67,68,77,78,79,80,73,74,75,76,85,86,87,88,81,82,83,84,93,94,95,96,89,90,91,92,101,102,103,104}, {6,5,8,7,2,1,4,3,14,13,16,15,10,9,12,11,22,21,24,23,18,17,20,19,30,29,32,31,26,25,28,27,38,37,40,39,34,33,36,35,46,45,48,47,42,41,44,43,54,53,56,55,50,49,52,51,62,61,64,63,58,57,60,59,70,69,72,71,66,65,68,67,78,77,80,79,74,73,76,75,86,85,88,87,82,81,84,83,94,93,96,95,90,89,92,91,102,101,104,103}, {7,8,5,6,3,4,1,2,15,16,13,14,11,12,9,10,23,24,21,22,19,20,17,18,31,32,29,30,27,28,25,26,39,40,37,38,35,36,33,34,47,48,45,46,43,44,41,42,55,56,53,54,51,52,49,50,63,64,61,62,59,60,57,58,71,72,69,70,67,68,65,66,79,80,77,78,75,76,73,74,87,88,85,86,83,84,81,82,95,96,93,94,91,92,89,90,103,104,101,102}, {8,7,6,5,4,3,2,1,16,15,14,13,12,11,10,9,24,23,22,21,20,19,18,17,32,31,30,29,28,27,26,25,40,39,38,37,36,35,34,33,48,47,46,45,44,43,42,41,56,55,54,53,52,51,50,49,64,63,62,61,60,59,58,57,72,71,70,69,68,67,66,65,80,79,78,77,76,75,74,73,88,87,86,85,84,83,82,81,96,95,94,93,92,91,90,89,104,103,102,101}, {9,10,11,12,13,14,15,16,1,2,3,4,5,6,7,8,25,26,27,28,29,30,31,32,17,18,19,20,21,22,23,24,41,42,43,44,45,46,47,48,33,34,35,36,37,38,39,40,57,58,59,60,61,62,63,64,49,50,51,52,53,54,55,56,73,74,75,76,77,78,79,80,65,66,67,68,69,70,71,72,89,90,91,92,93,94,95,96,81,82,83,84,85,86,87,88,105,106,107,108}, {10,9,12,11,14,13,16,15,2,1,4,3,6,5,8,7,26,25,28,27,30,29,32,31,18,17,20,19,22,21,24,23,42,41,44,43,46,45,48,47,34,33,36,35,38,37,40,39,58,57,60,59,62,61,64,63,50,49,52,51,54,53,56,55,74,73,76,75,78,77,80,79,66,65,68,67,70,69,72,71,90,89,92,91,94,93,96,95,82,81,84,83,86,85,88,87,106,105,108,107}, {11,12,9,10,15,16,13,14,3,4,1,2,7,8,5,6,27,28,25,26,31,32,29,30,19,20,17,18,23,24,21,22,43,44,41,42,47,48,45,46,35,36,33,34,39,40,37,38,59,60,57,58,63,64,61,62,51,52,49,50,55,56,53,54,75,76,73,74,79,80,77,78,67,68,65,66,71,72,69,70,91,92,89,90,95,96,93,94,83,84,81,82,87,88,85,86,107,108,105,106}, {12,11,10,9,16,15,14,13,4,3,2,1,8,7,6,5,28,27,26,25,32,31,30,29,20,19,18,17,24,23,22,21,44,43,42,41,48,47,46,45,36,35,34,33,40,39,38,37,60,59,58,57,64,63,62,61,52,51,50,49,56,55,54,53,76,75,74,73,80,79,78,77,68,67,66,65,72,71,70,69,92,91,90,89,96,95,94,93,84,83,82,81,88,87,86,85,108,107,106,105}, {13,14,15,16,9,10,11,12,5,6,7,8,1,2,3,4,29,30,31,32,25,26,27,28,21,22,23,24,17,18,19,20,45,46,47,48,41,42,43,44,37,38,39,40,33,34,35,36,61,62,63,64,57,58,59,60,53,54,55,56,49,50,51,52,77,78,79,80,73,74,75,76,69,70,71,72,65,66,67,68,93,94,95,96,89,90,91,92,85,86,87,88,81,82,83,84,109,110,111,112}, {14,13,16,15,10,9,12,11,6,5,8,7,2,1,4,3,30,29,32,31,26,25,28,27,22,21,24,23,18,17,20,19,46,45,48,47,42,41,44,43,38,37,40,39,34,33,36,35,62,61,64,63,58,57,60,59,54,53,56,55,50,49,52,51,78,77,80,79,74,73,76,75,70,69,72,71,66,65,68,67,94,93,96,95,90,89,92,91,86,85,88,87,82,81,84,83,110,109,112,111}, {15,16,13,14,11,12,9,10,7,8,5,6,3,4,1,2,31,32,29,30,27,28,25,26,23,24,21,22,19,20,17,18,47,48,45,46,43,44,41,42,39,40,37,38,35,36,33,34,63,64,61,62,59,60,57,58,55,56,53,54,51,52,49,50,79,80,77,78,75,76,73,74,71,72,69,70,67,68,65,66,95,96,93,94,91,92,89,90,87,88,85,86,83,84,81,82,111,112,109,110}, {16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,64,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,80,79,78,77,76,75,74,73,72,71,70,69,68,67,66,65,96,95,94,93,92,91,90,89,88,87,86,85,84,83,82,81,112,111,110,109}, {17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,113,114,115,116}, {18,17,20,19,22,21,24,23,26,25,28,27,30,29,32,31,2,1,4,3,6,5,8,7,10,9,12,11,14,13,16,15,50,49,52,51,54,53,56,55,58,57,60,59,62,61,64,63,34,33,36,35,38,37,40,39,42,41,44,43,46,45,48,47,82,81,84,83,86,85,88,87,90,89,92,91,94,93,96,95,66,65,68,67,70,69,72,71,74,73,76,75,78,77,80,79,114,113,116,115}, {19,20,17,18,23,24,21,22,27,28,25,26,31,32,29,30,3,4,1,2,7,8,5,6,11,12,9,10,15,16,13,14,51,52,49,50,55,56,53,54,59,60,57,58,63,64,61,62,35,36,33,34,39,40,37,38,43,44,41,42,47,48,45,46,83,84,81,82,87,88,85,86,91,92,89,90,95,96,93,94,67,68,65,66,71,72,69,70,75,76,73,74,79,80,77,78,115,116,113,114}, {20,19,18,17,24,23,22,21,28,27,26,25,32,31,30,29,4,3,2,1,8,7,6,5,12,11,10,9,16,15,14,13,52,51,50,49,56,55,54,53,60,59,58,57,64,63,62,61,36,35,34,33,40,39,38,37,44,43,42,41,48,47,46,45,84,83,82,81,88,87,86,85,92,91,90,89,96,95,94,93,68,67,66,65,72,71,70,69,76,75,74,73,80,79,78,77,116,115,114,113}, {21,22,23,24,17,18,19,20,29,30,31,32,25,26,27,28,5,6,7,8,1,2,3,4,13,14,15,16,9,10,11,12,53,54,55,56,49,50,51,52,61,62,63,64,57,58,59,60,37,38,39,40,33,34,35,36,45,46,47,48,41,42,43,44,85,86,87,88,81,82,83,84,93,94,95,96,89,90,91,92,69,70,71,72,65,66,67,68,77,78,79,80,73,74,75,76,117,118,119,120}, {22,21,24,23,18,17,20,19,30,29,32,31,26,25,28,27,6,5,8,7,2,1,4,3,14,13,16,15,10,9,12,11,54,53,56,55,50,49,52,51,62,61,64,63,58,57,60,59,38,37,40,39,34,33,36,35,46,45,48,47,42,41,44,43,86,85,88,87,82,81,84,83,94,93,96,95,90,89,92,91,70,69,72,71,66,65,68,67,78,77,80,79,74,73,76,75,118,117,120,119}, {23,24,21,22,19,20,17,18,31,32,29,30,27,28,25,26,7,8,5,6,3,4,1,2,15,16,13,14,11,12,9,10,55,56,53,54,51,52,49,50,63,64,61,62,59,60,57,58,39,40,37,38,35,36,33,34,47,48,45,46,43,44,41,42,87,88,85,86,83,84,81,82,95,96,93,94,91,92,89,90,71,72,69,70,67,68,65,66,79,80,77,78,75,76,73,74,119,120,117,118}, {24,23,22,21,20,19,18,17,32,31,30,29,28,27,26,25,8,7,6,5,4,3,2,1,16,15,14,13,12,11,10,9,56,55,54,53,52,51,50,49,64,63,62,61,60,59,58,57,40,39,38,37,36,35,34,33,48,47,46,45,44,43,42,41,88,87,86,85,84,83,82,81,96,95,94,93,92,91,90,89,72,71,70,69,68,67,66,65,80,79,78,77,76,75,74,73,120,119,118,117}, {25,26,27,28,29,30,31,32,17,18,19,20,21,22,23,24,9,10,11,12,13,14,15,16,1,2,3,4,5,6,7,8,57,58,59,60,61,62,63,64,49,50,51,52,53,54,55,56,41,42,43,44,45,46,47,48,33,34,35,36,37,38,39,40,89,90,91,92,93,94,95,96,81,82,83,84,85,86,87,88,73,74,75,76,77,78,79,80,65,66,67,68,69,70,71,72,121,122,123,124}, {26,25,28,27,30,29,32,31,18,17,20,19,22,21,24,23,10,9,12,11,14,13,16,15,2,1,4,3,6,5,8,7,58,57,60,59,62,61,64,63,50,49,52,51,54,53,56,55,42,41,44,43,46,45,48,47,34,33,36,35,38,37,40,39,90,89,92,91,94,93,96,95,82,81,84,83,86,85,88,87,74,73,76,75,78,77,80,79,66,65,68,67,70,69,72,71,122,121,124,123}, {27,28,25,26,31,32,29,30,19,20,17,18,23,24,21,22,11,12,9,10,15,16,13,14,3,4,1,2,7,8,5,6,59,60,57,58,63,64,61,62,51,52,49,50,55,56,53,54,43,44,41,42,47,48,45,46,35,36,33,34,39,40,37,38,91,92,89,90,95,96,93,94,83,84,81,82,87,88,85,86,75,76,73,74,79,80,77,78,67,68,65,66,71,72,69,70,123,124,121,122}, {28,27,26,25,32,31,30,29,20,19,18,17,24,23,22,21,12,11,10,9,16,15,14,13,4,3,2,1,8,7,6,5,60,59,58,57,64,63,62,61,52,51,50,49,56,55,54,53,44,43,42,41,48,47,46,45,36,35,34,33,40,39,38,37,92,91,90,89,96,95,94,93,84,83,82,81,88,87,86,85,76,75,74,73,80,79,78,77,68,67,66,65,72,71,70,69,124,123,122,121}, {29,30,31,32,25,26,27,28,21,22,23,24,17,18,19,20,13,14,15,16,9,10,11,12,5,6,7,8,1,2,3,4,61,62,63,64,57,58,59,60,53,54,55,56,49,50,51,52,45,46,47,48,41,42,43,44,37,38,39,40,33,34,35,36,93,94,95,96,89,90,91,92,85,86,87,88,81,82,83,84,77,78,79,80,73,74,75,76,69,70,71,72,65,66,67,68,125,126,127,128}, {30,29,32,31,26,25,28,27,22,21,24,23,18,17,20,19,14,13,16,15,10,9,12,11,6,5,8,7,2,1,4,3,62,61,64,63,58,57,60,59,54,53,56,55,50,49,52,51,46,45,48,47,42,41,44,43,38,37,40,39,34,33,36,35,94,93,96,95,90,89,92,91,86,85,88,87,82,81,84,83,78,77,80,79,74,73,76,75,70,69,72,71,66,65,68,67,126,125,128,127}, {31,32,29,30,27,28,25,26,23,24,21,22,19,20,17,18,15,16,13,14,11,12,9,10,7,8,5,6,3,4,1,2,63,64,61,62,59,60,57,58,55,56,53,54,51,52,49,50,47,48,45,46,43,44,41,42,39,40,37,38,35,36,33,34,95,96,93,94,91,92,89,90,87,88,85,86,83,84,81,82,79,80,77,78,75,76,73,74,71,72,69,70,67,68,65,66,127,128,125,126}, {32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,64,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,96,95,94,93,92,91,90,89,88,87,86,85,84,83,82,81,80,79,78,77,76,75,74,73,72,71,70,69,68,67,66,65,128,127,126,125}, {33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,65,66,67,68}, {34,33,36,35,38,37,40,39,42,41,44,43,46,45,48,47,50,49,52,51,54,53,56,55,58,57,60,59,62,61,64,63,2,1,4,3,6,5,8,7,10,9,12,11,14,13,16,15,18,17,20,19,22,21,24,23,26,25,28,27,30,29,32,31,98,97,100,99,102,101,104,103,106,105,108,107,110,109,112,111,114,113,116,115,118,117,120,119,122,121,124,123,126,125,128,127,66,65,68,67}, {35,36,33,34,39,40,37,38,43,44,41,42,47,48,45,46,51,52,49,50,55,56,53,54,59,60,57,58,63,64,61,62,3,4,1,2,7,8,5,6,11,12,9,10,15,16,13,14,19,20,17,18,23,24,21,22,27,28,25,26,31,32,29,30,99,100,97,98,103,104,101,102,107,108,105,106,111,112,109,110,115,116,113,114,119,120,117,118,123,124,121,122,127,128,125,126,67,68,65,66}, {36,35,34,33,40,39,38,37,44,43,42,41,48,47,46,45,52,51,50,49,56,55,54,53,60,59,58,57,64,63,62,61,4,3,2,1,8,7,6,5,12,11,10,9,16,15,14,13,20,19,18,17,24,23,22,21,28,27,26,25,32,31,30,29,100,99,98,97,104,103,102,101,108,107,106,105,112,111,110,109,116,115,114,113,120,119,118,117,124,123,122,121,128,127,126,125,68,67,66,65}, {37,38,39,40,33,34,35,36,45,46,47,48,41,42,43,44,53,54,55,56,49,50,51,52,61,62,63,64,57,58,59,60,5,6,7,8,1,2,3,4,13,14,15,16,9,10,11,12,21,22,23,24,17,18,19,20,29,30,31,32,25,26,27,28,101,102,103,104,97,98,99,100,109,110,111,112,105,106,107,108,117,118,119,120,113,114,115,116,125,126,127,128,121,122,123,124,69,70,71,72}, {38,37,40,39,34,33,36,35,46,45,48,47,42,41,44,43,54,53,56,55,50,49,52,51,62,61,64,63,58,57,60,59,6,5,8,7,2,1,4,3,14,13,16,15,10,9,12,11,22,21,24,23,18,17,20,19,30,29,32,31,26,25,28,27,102,101,104,103,98,97,100,99,110,109,112,111,106,105,108,107,118,117,120,119,114,113,116,115,126,125,128,127,122,121,124,123,70,69,72,71}, {39,40,37,38,35,36,33,34,47,48,45,46,43,44,41,42,55,56,53,54,51,52,49,50,63,64,61,62,59,60,57,58,7,8,5,6,3,4,1,2,15,16,13,14,11,12,9,10,23,24,21,22,19,20,17,18,31,32,29,30,27,28,25,26,103,104,101,102,99,100,97,98,111,112,109,110,107,108,105,106,119,120,117,118,115,116,113,114,127,128,125,126,123,124,121,122,71,72,69,70}, {40,39,38,37,36,35,34,33,48,47,46,45,44,43,42,41,56,55,54,53,52,51,50,49,64,63,62,61,60,59,58,57,8,7,6,5,4,3,2,1,16,15,14,13,12,11,10,9,24,23,22,21,20,19,18,17,32,31,30,29,28,27,26,25,104,103,102,101,100,99,98,97,112,111,110,109,108,107,106,105,120,119,118,117,116,115,114,113,128,127,126,125,124,123,122,121,72,71,70,69}, {41,42,43,44,45,46,47,48,33,34,35,36,37,38,39,40,57,58,59,60,61,62,63,64,49,50,51,52,53,54,55,56,9,10,11,12,13,14,15,16,1,2,3,4,5,6,7,8,25,26,27,28,29,30,31,32,17,18,19,20,21,22,23,24,105,106,107,108,109,110,111,112,97,98,99,100,101,102,103,104,121,122,123,124,125,126,127,128,113,114,115,116,117,118,119,120,73,74,75,76}, {42,41,44,43,46,45,48,47,34,33,36,35,38,37,40,39,58,57,60,59,62,61,64,63,50,49,52,51,54,53,56,55,10,9,12,11,14,13,16,15,2,1,4,3,6,5,8,7,26,25,28,27,30,29,32,31,18,17,20,19,22,21,24,23,106,105,108,107,110,109,112,111,98,97,100,99,102,101,104,103,122,121,124,123,126,125,128,127,114,113,116,115,118,117,120,119,74,73,76,75}, {43,44,41,42,47,48,45,46,35,36,33,34,39,40,37,38,59,60,57,58,63,64,61,62,51,52,49,50,55,56,53,54,11,12,9,10,15,16,13,14,3,4,1,2,7,8,5,6,27,28,25,26,31,32,29,30,19,20,17,18,23,24,21,22,107,108,105,106,111,112,109,110,99,100,97,98,103,104,101,102,123,124,121,122,127,128,125,126,115,116,113,114,119,120,117,118,75,76,73,74}, {44,43,42,41,48,47,46,45,36,35,34,33,40,39,38,37,60,59,58,57,64,63,62,61,52,51,50,49,56,55,54,53,12,11,10,9,16,15,14,13,4,3,2,1,8,7,6,5,28,27,26,25,32,31,30,29,20,19,18,17,24,23,22,21,108,107,106,105,112,111,110,109,100,99,98,97,104,103,102,101,124,123,122,121,128,127,126,125,116,115,114,113,120,119,118,117,76,75,74,73}, {45,46,47,48,41,42,43,44,37,38,39,40,33,34,35,36,61,62,63,64,57,58,59,60,53,54,55,56,49,50,51,52,13,14,15,16,9,10,11,12,5,6,7,8,1,2,3,4,29,30,31,32,25,26,27,28,21,22,23,24,17,18,19,20,109,110,111,112,105,106,107,108,101,102,103,104,97,98,99,100,125,126,127,128,121,122,123,124,117,118,119,120,113,114,115,116,77,78,79,80}, {46,45,48,47,42,41,44,43,38,37,40,39,34,33,36,35,62,61,64,63,58,57,60,59,54,53,56,55,50,49,52,51,14,13,16,15,10,9,12,11,6,5,8,7,2,1,4,3,30,29,32,31,26,25,28,27,22,21,24,23,18,17,20,19,110,109,112,111,106,105,108,107,102,101,104,103,98,97,100,99,126,125,128,127,122,121,124,123,118,117,120,119,114,113,116,115,78,77,80,79}, {47,48,45,46,43,44,41,42,39,40,37,38,35,36,33,34,63,64,61,62,59,60,57,58,55,56,53,54,51,52,49,50,15,16,13,14,11,12,9,10,7,8,5,6,3,4,1,2,31,32,29,30,27,28,25,26,23,24,21,22,19,20,17,18,111,112,109,110,107,108,105,106,103,104,101,102,99,100,97,98,127,128,125,126,123,124,121,122,119,120,117,118,115,116,113,114,79,80,77,78}, {48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,64,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,112,111,110,109,108,107,106,105,104,103,102,101,100,99,98,97,128,127,126,125,124,123,122,121,120,119,118,117,116,115,114,113,80,79,78,77}, {49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,81,82,83,84}, {50,49,52,51,54,53,56,55,58,57,60,59,62,61,64,63,34,33,36,35,38,37,40,39,42,41,44,43,46,45,48,47,18,17,20,19,22,21,24,23,26,25,28,27,30,29,32,31,2,1,4,3,6,5,8,7,10,9,12,11,14,13,16,15,114,113,116,115,118,117,120,119,122,121,124,123,126,125,128,127,98,97,100,99,102,101,104,103,106,105,108,107,110,109,112,111,82,81,84,83}, {51,52,49,50,55,56,53,54,59,60,57,58,63,64,61,62,35,36,33,34,39,40,37,38,43,44,41,42,47,48,45,46,19,20,17,18,23,24,21,22,27,28,25,26,31,32,29,30,3,4,1,2,7,8,5,6,11,12,9,10,15,16,13,14,115,116,113,114,119,120,117,118,123,124,121,122,127,128,125,126,99,100,97,98,103,104,101,102,107,108,105,106,111,112,109,110,83,84,81,82}, {52,51,50,49,56,55,54,53,60,59,58,57,64,63,62,61,36,35,34,33,40,39,38,37,44,43,42,41,48,47,46,45,20,19,18,17,24,23,22,21,28,27,26,25,32,31,30,29,4,3,2,1,8,7,6,5,12,11,10,9,16,15,14,13,116,115,114,113,120,119,118,117,124,123,122,121,128,127,126,125,100,99,98,97,104,103,102,101,108,107,106,105,112,111,110,109,84,83,82,81}, {53,54,55,56,49,50,51,52,61,62,63,64,57,58,59,60,37,38,39,40,33,34,35,36,45,46,47,48,41,42,43,44,21,22,23,24,17,18,19,20,29,30,31,32,25,26,27,28,5,6,7,8,1,2,3,4,13,14,15,16,9,10,11,12,117,118,119,120,113,114,115,116,125,126,127,128,121,122,123,124,101,102,103,104,97,98,99,100,109,110,111,112,105,106,107,108,85,86,87,88}, {54,53,56,55,50,49,52,51,62,61,64,63,58,57,60,59,38,37,40,39,34,33,36,35,46,45,48,47,42,41,44,43,22,21,24,23,18,17,20,19,30,29,32,31,26,25,28,27,6,5,8,7,2,1,4,3,14,13,16,15,10,9,12,11,118,117,120,119,114,113,116,115,126,125,128,127,122,121,124,123,102,101,104,103,98,97,100,99,110,109,112,111,106,105,108,107,86,85,88,87}, {55,56,53,54,51,52,49,50,63,64,61,62,59,60,57,58,39,40,37,38,35,36,33,34,47,48,45,46,43,44,41,42,23,24,21,22,19,20,17,18,31,32,29,30,27,28,25,26,7,8,5,6,3,4,1,2,15,16,13,14,11,12,9,10,119,120,117,118,115,116,113,114,127,128,125,126,123,124,121,122,103,104,101,102,99,100,97,98,111,112,109,110,107,108,105,106,87,88,85,86}, {56,55,54,53,52,51,50,49,64,63,62,61,60,59,58,57,40,39,38,37,36,35,34,33,48,47,46,45,44,43,42,41,24,23,22,21,20,19,18,17,32,31,30,29,28,27,26,25,8,7,6,5,4,3,2,1,16,15,14,13,12,11,10,9,120,119,118,117,116,115,114,113,128,127,126,125,124,123,122,121,104,103,102,101,100,99,98,97,112,111,110,109,108,107,106,105,88,87,86,85}, {57,58,59,60,61,62,63,64,49,50,51,52,53,54,55,56,41,42,43,44,45,46,47,48,33,34,35,36,37,38,39,40,25,26,27,28,29,30,31,32,17,18,19,20,21,22,23,24,9,10,11,12,13,14,15,16,1,2,3,4,5,6,7,8,121,122,123,124,125,126,127,128,113,114,115,116,117,118,119,120,105,106,107,108,109,110,111,112,97,98,99,100,101,102,103,104,89,90,91,92}, {58,57,60,59,62,61,64,63,50,49,52,51,54,53,56,55,42,41,44,43,46,45,48,47,34,33,36,35,38,37,40,39,26,25,28,27,30,29,32,31,18,17,20,19,22,21,24,23,10,9,12,11,14,13,16,15,2,1,4,3,6,5,8,7,122,121,124,123,126,125,128,127,114,113,116,115,118,117,120,119,106,105,108,107,110,109,112,111,98,97,100,99,102,101,104,103,90,89,92,91}, {59,60,57,58,63,64,61,62,51,52,49,50,55,56,53,54,43,44,41,42,47,48,45,46,35,36,33,34,39,40,37,38,27,28,25,26,31,32,29,30,19,20,17,18,23,24,21,22,11,12,9,10,15,16,13,14,3,4,1,2,7,8,5,6,123,124,121,122,127,128,125,126,115,116,113,114,119,120,117,118,107,108,105,106,111,112,109,110,99,100,97,98,103,104,101,102,91,92,89,90}, {60,59,58,57,64,63,62,61,52,51,50,49,56,55,54,53,44,43,42,41,48,47,46,45,36,35,34,33,40,39,38,37,28,27,26,25,32,31,30,29,20,19,18,17,24,23,22,21,12,11,10,9,16,15,14,13,4,3,2,1,8,7,6,5,124,123,122,121,128,127,126,125,116,115,114,113,120,119,118,117,108,107,106,105,112,111,110,109,100,99,98,97,104,103,102,101,92,91,90,89}, {61,62,63,64,57,58,59,60,53,54,55,56,49,50,51,52,45,46,47,48,41,42,43,44,37,38,39,40,33,34,35,36,29,30,31,32,25,26,27,28,21,22,23,24,17,18,19,20,13,14,15,16,9,10,11,12,5,6,7,8,1,2,3,4,125,126,127,128,121,122,123,124,117,118,119,120,113,114,115,116,109,110,111,112,105,106,107,108,101,102,103,104,97,98,99,100,93,94,95,96}, {62,61,64,63,58,57,60,59,54,53,56,55,50,49,52,51,46,45,48,47,42,41,44,43,38,37,40,39,34,33,36,35,30,29,32,31,26,25,28,27,22,21,24,23,18,17,20,19,14,13,16,15,10,9,12,11,6,5,8,7,2,1,4,3,126,125,128,127,122,121,124,123,118,117,120,119,114,113,116,115,110,109,112,111,106,105,108,107,102,101,104,103,98,97,100,99,94,93,96,95}, {63,64,61,62,59,60,57,58,55,56,53,54,51,52,49,50,47,48,45,46,43,44,41,42,39,40,37,38,35,36,33,34,31,32,29,30,27,28,25,26,23,24,21,22,19,20,17,18,15,16,13,14,11,12,9,10,7,8,5,6,3,4,1,2,127,128,125,126,123,124,121,122,119,120,117,118,115,116,113,114,111,112,109,110,107,108,105,106,103,104,101,102,99,100,97,98,95,96,93,94}, {64,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,128,127,126,125,124,123,122,121,120,119,118,117,116,115,114,113,112,111,110,109,108,107,106,105,104,103,102,101,100,99,98,97,96,95,94,93}, {65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36}, {66,65,68,67,70,69,72,71,74,73,76,75,78,77,80,79,82,81,84,83,86,85,88,87,90,89,92,91,94,93,96,95,98,97,100,99,102,101,104,103,106,105,108,107,110,109,112,111,114,113,116,115,118,117,120,119,122,121,124,123,126,125,128,127,2,1,4,3,6,5,8,7,10,9,12,11,14,13,16,15,18,17,20,19,22,21,24,23,26,25,28,27,30,29,32,31,34,33,36,35}, {67,68,65,66,71,72,69,70,75,76,73,74,79,80,77,78,83,84,81,82,87,88,85,86,91,92,89,90,95,96,93,94,99,100,97,98,103,104,101,102,107,108,105,106,111,112,109,110,115,116,113,114,119,120,117,118,123,124,121,122,127,128,125,126,3,4,1,2,7,8,5,6,11,12,9,10,15,16,13,14,19,20,17,18,23,24,21,22,27,28,25,26,31,32,29,30,35,36,33,34}, {68,67,66,65,72,71,70,69,76,75,74,73,80,79,78,77,84,83,82,81,88,87,86,85,92,91,90,89,96,95,94,93,100,99,98,97,104,103,102,101,108,107,106,105,112,111,110,109,116,115,114,113,120,119,118,117,124,123,122,121,128,127,126,125,4,3,2,1,8,7,6,5,12,11,10,9,16,15,14,13,20,19,18,17,24,23,22,21,28,27,26,25,32,31,30,29,36,35,34,33}, {69,70,71,72,65,66,67,68,77,78,79,80,73,74,75,76,85,86,87,88,81,82,83,84,93,94,95,96,89,90,91,92,101,102,103,104,97,98,99,100,109,110,111,112,105,106,107,108,117,118,119,120,113,114,115,116,125,126,127,128,121,122,123,124,5,6,7,8,1,2,3,4,13,14,15,16,9,10,11,12,21,22,23,24,17,18,19,20,29,30,31,32,25,26,27,28,37,38,39,40}, {70,69,72,71,66,65,68,67,78,77,80,79,74,73,76,75,86,85,88,87,82,81,84,83,94,93,96,95,90,89,92,91,102,101,104,103,98,97,100,99,110,109,112,111,106,105,108,107,118,117,120,119,114,113,116,115,126,125,128,127,122,121,124,123,6,5,8,7,2,1,4,3,14,13,16,15,10,9,12,11,22,21,24,23,18,17,20,19,30,29,32,31,26,25,28,27,38,37,40,39}, {71,72,69,70,67,68,65,66,79,80,77,78,75,76,73,74,87,88,85,86,83,84,81,82,95,96,93,94,91,92,89,90,103,104,101,102,99,100,97,98,111,112,109,110,107,108,105,106,119,120,117,118,115,116,113,114,127,128,125,126,123,124,121,122,7,8,5,6,3,4,1,2,15,16,13,14,11,12,9,10,23,24,21,22,19,20,17,18,31,32,29,30,27,28,25,26,39,40,37,38}, {72,71,70,69,68,67,66,65,80,79,78,77,76,75,74,73,88,87,86,85,84,83,82,81,96,95,94,93,92,91,90,89,104,103,102,101,100,99,98,97,112,111,110,109,108,107,106,105,120,119,118,117,116,115,114,113,128,127,126,125,124,123,122,121,8,7,6,5,4,3,2,1,16,15,14,13,12,11,10,9,24,23,22,21,20,19,18,17,32,31,30,29,28,27,26,25,40,39,38,37}, {73,74,75,76,77,78,79,80,65,66,67,68,69,70,71,72,89,90,91,92,93,94,95,96,81,82,83,84,85,86,87,88,105,106,107,108,109,110,111,112,97,98,99,100,101,102,103,104,121,122,123,124,125,126,127,128,113,114,115,116,117,118,119,120,9,10,11,12,13,14,15,16,1,2,3,4,5,6,7,8,25,26,27,28,29,30,31,32,17,18,19,20,21,22,23,24,41,42,43,44}, {74,73,76,75,78,77,80,79,66,65,68,67,70,69,72,71,90,89,92,91,94,93,96,95,82,81,84,83,86,85,88,87,106,105,108,107,110,109,112,111,98,97,100,99,102,101,104,103,122,121,124,123,126,125,128,127,114,113,116,115,118,117,120,119,10,9,12,11,14,13,16,15,2,1,4,3,6,5,8,7,26,25,28,27,30,29,32,31,18,17,20,19,22,21,24,23,42,41,44,43}, {75,76,73,74,79,80,77,78,67,68,65,66,71,72,69,70,91,92,89,90,95,96,93,94,83,84,81,82,87,88,85,86,107,108,105,106,111,112,109,110,99,100,97,98,103,104,101,102,123,124,121,122,127,128,125,126,115,116,113,114,119,120,117,118,11,12,9,10,15,16,13,14,3,4,1,2,7,8,5,6,27,28,25,26,31,32,29,30,19,20,17,18,23,24,21,22,43,44,41,42}, {76,75,74,73,80,79,78,77,68,67,66,65,72,71,70,69,92,91,90,89,96,95,94,93,84,83,82,81,88,87,86,85,108,107,106,105,112,111,110,109,100,99,98,97,104,103,102,101,124,123,122,121,128,127,126,125,116,115,114,113,120,119,118,117,12,11,10,9,16,15,14,13,4,3,2,1,8,7,6,5,28,27,26,25,32,31,30,29,20,19,18,17,24,23,22,21,44,43,42,41}, {77,78,79,80,73,74,75,76,69,70,71,72,65,66,67,68,93,94,95,96,89,90,91,92,85,86,87,88,81,82,83,84,109,110,111,112,105,106,107,108,101,102,103,104,97,98,99,100,125,126,127,128,121,122,123,124,117,118,119,120,113,114,115,116,13,14,15,16,9,10,11,12,5,6,7,8,1,2,3,4,29,30,31,32,25,26,27,28,21,22,23,24,17,18,19,20,45,46,47,48}, {78,77,80,79,74,73,76,75,70,69,72,71,66,65,68,67,94,93,96,95,90,89,92,91,86,85,88,87,82,81,84,83,110,109,112,111,106,105,108,107,102,101,104,103,98,97,100,99,126,125,128,127,122,121,124,123,118,117,120,119,114,113,116,115,14,13,16,15,10,9,12,11,6,5,8,7,2,1,4,3,30,29,32,31,26,25,28,27,22,21,24,23,18,17,20,19,46,45,48,47}, {79,80,77,78,75,76,73,74,71,72,69,70,67,68,65,66,95,96,93,94,91,92,89,90,87,88,85,86,83,84,81,82,111,112,109,110,107,108,105,106,103,104,101,102,99,100,97,98,127,128,125,126,123,124,121,122,119,120,117,118,115,116,113,114,15,16,13,14,11,12,9,10,7,8,5,6,3,4,1,2,31,32,29,30,27,28,25,26,23,24,21,22,19,20,17,18,47,48,45,46}, {80,79,78,77,76,75,74,73,72,71,70,69,68,67,66,65,96,95,94,93,92,91,90,89,88,87,86,85,84,83,82,81,112,111,110,109,108,107,106,105,104,103,102,101,100,99,98,97,128,127,126,125,124,123,122,121,120,119,118,117,116,115,114,113,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,48,47,46,45}, {81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,49,50,51,52}, {82,81,84,83,86,85,88,87,90,89,92,91,94,93,96,95,66,65,68,67,70,69,72,71,74,73,76,75,78,77,80,79,114,113,116,115,118,117,120,119,122,121,124,123,126,125,128,127,98,97,100,99,102,101,104,103,106,105,108,107,110,109,112,111,18,17,20,19,22,21,24,23,26,25,28,27,30,29,32,31,2,1,4,3,6,5,8,7,10,9,12,11,14,13,16,15,50,49,52,51}, {83,84,81,82,87,88,85,86,91,92,89,90,95,96,93,94,67,68,65,66,71,72,69,70,75,76,73,74,79,80,77,78,115,116,113,114,119,120,117,118,123,124,121,122,127,128,125,126,99,100,97,98,103,104,101,102,107,108,105,106,111,112,109,110,19,20,17,18,23,24,21,22,27,28,25,26,31,32,29,30,3,4,1,2,7,8,5,6,11,12,9,10,15,16,13,14,51,52,49,50}, {84,83,82,81,88,87,86,85,92,91,90,89,96,95,94,93,68,67,66,65,72,71,70,69,76,75,74,73,80,79,78,77,116,115,114,113,120,119,118,117,124,123,122,121,128,127,126,125,100,99,98,97,104,103,102,101,108,107,106,105,112,111,110,109,20,19,18,17,24,23,22,21,28,27,26,25,32,31,30,29,4,3,2,1,8,7,6,5,12,11,10,9,16,15,14,13,52,51,50,49}, {85,86,87,88,81,82,83,84,93,94,95,96,89,90,91,92,69,70,71,72,65,66,67,68,77,78,79,80,73,74,75,76,117,118,119,120,113,114,115,116,125,126,127,128,121,122,123,124,101,102,103,104,97,98,99,100,109,110,111,112,105,106,107,108,21,22,23,24,17,18,19,20,29,30,31,32,25,26,27,28,5,6,7,8,1,2,3,4,13,14,15,16,9,10,11,12,53,54,55,56}, {86,85,88,87,82,81,84,83,94,93,96,95,90,89,92,91,70,69,72,71,66,65,68,67,78,77,80,79,74,73,76,75,118,117,120,119,114,113,116,115,126,125,128,127,122,121,124,123,102,101,104,103,98,97,100,99,110,109,112,111,106,105,108,107,22,21,24,23,18,17,20,19,30,29,32,31,26,25,28,27,6,5,8,7,2,1,4,3,14,13,16,15,10,9,12,11,54,53,56,55}, {87,88,85,86,83,84,81,82,95,96,93,94,91,92,89,90,71,72,69,70,67,68,65,66,79,80,77,78,75,76,73,74,119,120,117,118,115,116,113,114,127,128,125,126,123,124,121,122,103,104,101,102,99,100,97,98,111,112,109,110,107,108,105,106,23,24,21,22,19,20,17,18,31,32,29,30,27,28,25,26,7,8,5,6,3,4,1,2,15,16,13,14,11,12,9,10,55,56,53,54}, {88,87,86,85,84,83,82,81,96,95,94,93,92,91,90,89,72,71,70,69,68,67,66,65,80,79,78,77,76,75,74,73,120,119,118,117,116,115,114,113,128,127,126,125,124,123,122,121,104,103,102,101,100,99,98,97,112,111,110,109,108,107,106,105,24,23,22,21,20,19,18,17,32,31,30,29,28,27,26,25,8,7,6,5,4,3,2,1,16,15,14,13,12,11,10,9,56,55,54,53}, {89,90,91,92,93,94,95,96,81,82,83,84,85,86,87,88,73,74,75,76,77,78,79,80,65,66,67,68,69,70,71,72,121,122,123,124,125,126,127,128,113,114,115,116,117,118,119,120,105,106,107,108,109,110,111,112,97,98,99,100,101,102,103,104,25,26,27,28,29,30,31,32,17,18,19,20,21,22,23,24,9,10,11,12,13,14,15,16,1,2,3,4,5,6,7,8,57,58,59,60}, {90,89,92,91,94,93,96,95,82,81,84,83,86,85,88,87,74,73,76,75,78,77,80,79,66,65,68,67,70,69,72,71,122,121,124,123,126,125,128,127,114,113,116,115,118,117,120,119,106,105,108,107,110,109,112,111,98,97,100,99,102,101,104,103,26,25,28,27,30,29,32,31,18,17,20,19,22,21,24,23,10,9,12,11,14,13,16,15,2,1,4,3,6,5,8,7,58,57,60,59}, {91,92,89,90,95,96,93,94,83,84,81,82,87,88,85,86,75,76,73,74,79,80,77,78,67,68,65,66,71,72,69,70,123,124,121,122,127,128,125,126,115,116,113,114,119,120,117,118,107,108,105,106,111,112,109,110,99,100,97,98,103,104,101,102,27,28,25,26,31,32,29,30,19,20,17,18,23,24,21,22,11,12,9,10,15,16,13,14,3,4,1,2,7,8,5,6,59,60,57,58}, {92,91,90,89,96,95,94,93,84,83,82,81,88,87,86,85,76,75,74,73,80,79,78,77,68,67,66,65,72,71,70,69,124,123,122,121,128,127,126,125,116,115,114,113,120,119,118,117,108,107,106,105,112,111,110,109,100,99,98,97,104,103,102,101,28,27,26,25,32,31,30,29,20,19,18,17,24,23,22,21,12,11,10,9,16,15,14,13,4,3,2,1,8,7,6,5,60,59,58,57}, {93,94,95,96,89,90,91,92,85,86,87,88,81,82,83,84,77,78,79,80,73,74,75,76,69,70,71,72,65,66,67,68,125,126,127,128,121,122,123,124,117,118,119,120,113,114,115,116,109,110,111,112,105,106,107,108,101,102,103,104,97,98,99,100,29,30,31,32,25,26,27,28,21,22,23,24,17,18,19,20,13,14,15,16,9,10,11,12,5,6,7,8,1,2,3,4,61,62,63,64}, {94,93,96,95,90,89,92,91,86,85,88,87,82,81,84,83,78,77,80,79,74,73,76,75,70,69,72,71,66,65,68,67,126,125,128,127,122,121,124,123,118,117,120,119,114,113,116,115,110,109,112,111,106,105,108,107,102,101,104,103,98,97,100,99,30,29,32,31,26,25,28,27,22,21,24,23,18,17,20,19,14,13,16,15,10,9,12,11,6,5,8,7,2,1,4,3,62,61,64,63}, {95,96,93,94,91,92,89,90,87,88,85,86,83,84,81,82,79,80,77,78,75,76,73,74,71,72,69,70,67,68,65,66,127,128,125,126,123,124,121,122,119,120,117,118,115,116,113,114,111,112,109,110,107,108,105,106,103,104,101,102,99,100,97,98,31,32,29,30,27,28,25,26,23,24,21,22,19,20,17,18,15,16,13,14,11,12,9,10,7,8,5,6,3,4,1,2,63,64,61,62}, {96,95,94,93,92,91,90,89,88,87,86,85,84,83,82,81,80,79,78,77,76,75,74,73,72,71,70,69,68,67,66,65,128,127,126,125,124,123,122,121,120,119,118,117,116,115,114,113,112,111,110,109,108,107,106,105,104,103,102,101,100,99,98,97,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,64,63,62,61}, {97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,1,2,3,4}, {98,97,100,99,102,101,104,103,106,105,108,107,110,109,112,111,114,113,116,115,118,117,120,119,122,121,124,123,126,125,128,127,66,65,68,67,70,69,72,71,74,73,76,75,78,77,80,79,82,81,84,83,86,85,88,87,90,89,92,91,94,93,96,95,34,33,36,35,38,37,40,39,42,41,44,43,46,45,48,47,50,49,52,51,54,53,56,55,58,57,60,59,62,61,64,63,2,1,4,3}, {99,100,97,98,103,104,101,102,107,108,105,106,111,112,109,110,115,116,113,114,119,120,117,118,123,124,121,122,127,128,125,126,67,68,65,66,71,72,69,70,75,76,73,74,79,80,77,78,83,84,81,82,87,88,85,86,91,92,89,90,95,96,93,94,35,36,33,34,39,40,37,38,43,44,41,42,47,48,45,46,51,52,49,50,55,56,53,54,59,60,57,58,63,64,61,62,3,4,1,2}, {100,99,98,97,104,103,102,101,108,107,106,105,112,111,110,109,116,115,114,113,120,119,118,117,124,123,122,121,128,127,126,125,68,67,66,65,72,71,70,69,76,75,74,73,80,79,78,77,84,83,82,81,88,87,86,85,92,91,90,89,96,95,94,93,36,35,34,33,40,39,38,37,44,43,42,41,48,47,46,45,52,51,50,49,56,55,54,53,60,59,58,57,64,63,62,61,4,3,2,1}};

	int n;
	cin >> n;

	for (int i = 0; i < n; ++i)
	{
		for (int j = 0; j < n; ++j)
		{
			cout << vastaus[i][j];
			if (j != n-1)
			{
				cout << " ";
			}
		}
		cout << "\n";
	}
	return 0;
}

Test details

Test 1

Verdict: ACCEPTED

input
1

correct output

user output
1

Test 2

Verdict: ACCEPTED

input
2

correct output
1 2 
2 1 

user output
1 2
2 1

Test 3

Verdict: ACCEPTED

input
5

correct output
1 2 3 4 5 
2 1 4 3 6 
3 4 1 2 7 
4 3 2 1 8 
5 6 7 8 1 

user output
1 2 3 4 5
2 1 4 3 6
3 4 1 2 7
4 3 2 1 8
5 6 7 8 1

Test 4

Verdict: ACCEPTED

input
42

correct output
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

user output
1 2 3 4 5 6 7 8 9 10 11 12 13 ...
Truncated

Test 5

Verdict: ACCEPTED

input
99

correct output
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

user output
1 2 3 4 5 6 7 8 9 10 11 12 13 ...
Truncated

Test 6

Verdict: ACCEPTED

input
100

correct output
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

user output
1 2 3 4 5 6 7 8 9 10 11 12 13 ...
Truncated