#include <bits/stdc++.h>
using namespace std;

int n;
int main(){

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    cin >> n;
    cout << 8 << " " << 1 << " " << 7 << " " << 4 << '\n';
    cout << 6 << " " << 2 << " " << 5 << " " << 3 << '\n';

    return 0;
}