#include <iostream>
#include <algorithm>
#include <vector>
#include <iterator>
#include <random>
#include <ctime>
#include <functional>
using namespace std;
int main() {
int n;
cin>>n;
vector<int>v(n);
mt19937 gen(time(nullptr));
uniform_int_distribution<>dist(0,20);
generate(v.begin(),v.end(),bind(dist,gen));
copy(v.cbegin(),v.cend(),ostream_iterator<int>(cout," "));
cout<<endl;
rotate(v.begin(),v.begin()+1,v.end());
}
#include <iostream>
#include <algorithm>
#include <vector>
#include <iterator>
#include <random>
#include <ctime>
#include <functional>
using namespace std;
int main() {
int n;
cin>>n;
vector<int>v(n);
mt19937 gen(time(nullptr));
uniform_int_distribution<>dist(0,20);
generate(v.begin(),v.end(),bind(dist,gen));
copy(v.cbegin(),v.cend(),ostream_iterator<int>(cout," "));
cout<<endl;
rotate(v.begin(),v.begin()+1,v.end());
copy(v.cbegin(),v.cend(),ostream_iterator<int>(cout," "));
}