#include<iostream>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<queue>
#include<deque>
#include<stack>
#include<cmath>
#include<algorithm>
#include<iomanip>
#include<unordered_map>
#include<unordered_set>
#include<bitset>
#include<random>
#include<ctime>

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx,avx2,bmi,sse4,popcnt")

using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using uint = unsigned int;

const int N = 2e6 + 2, inf = 1e9 + 100;
const ll llinf = 1e18 + 1000;
mt19937 mt(time(0));

vector<int> getVisionPattern1d() {
	return { 3, 1, 2, 1, 1 };
}
int getMove1d(vector<int> a) {
	int len = a.size();
	int x = len / 2;
	if (x == 1) {
		if (a[0] != 1) return 0;
		else
			return 2;
	}
	else if (x == 2) {
		if (a[0] == 1) return 0;
		else
			return 4;
	}
	else {
		if (a[1] == 2) return 0;
		else
			return 6;
	}
}
vector<vector<int>> getVisionPattern2d() {
	return { {1} };
}
pair<int, int> getMove2d(vector<vector<int>> a) {
	return { 0, 0 };
}

void solve() {
	vector<int> a1 = getVisionPattern1d();
	vector<int> a;
	for (int it = 0; it < 100; ++it) {
		for (auto i : a1) a.push_back(i);
	}
	int x;
	cin >> x;
	while (x > 10 && x < 100) {
		cout << x << ' ';
		vector<int> b;
		int l = x - a[x], r = x + a[x];
		for (int i = l; i <= r; ++i) b.push_back(a[i]);
		bool f1 = 0;
		if (mt() % 2) {
			reverse(all(b));
			f1 = 1;
		}
		int go = getMove1d(b);
		go -= a[x];
		if (f1) {
			go *= -1;
		}
		x += go;
	}
}

//signed main() {
//	ios_base::sync_with_stdio(0);
//	cin.tie(0);
//	int tt = 1;
//	//cin >> tt;
//	while (tt--) {
//		solve();
//		cout << '\n';
//		cout.flush();
//	}
//	return 0;
//}