#include <iostream>
#include <vector>
#include <algorithm>
#include <ctime> // for time
#include <cstdlib> // for srand

using namespace std;

int main(int argc, char** argv) {
  vector<int> v;

  srand(time(0)); // initialize random number generator

  for (int i = 0; i < 30; i++) {
    v.push_back(i);
  }

  for (auto& n : v) {
    cout << n << " ";
  }
  cout << endl;

  random_shuffle(v.begin(), v.end());

  for (auto& n : v) {
    cout << n << " ";
  }
  cout << endl;

  sort(v.begin() + 5, v.end() - 5);

  for (auto& n : v) {
    cout << n << " ";
  }
  cout << endl;
}