#include <cstdio>
#include <ctime>
template<class T> struct Vector
{
T *b, *e;
Vector(size_t n) : b(new T[n]), e(b + n) { }
T &operator[](size_t i) { return b[i]; }
T &at(size_t i) { if (i >= e - b) { throw "invalid"; } return b[i]; }
};
#define at operator[] // Comment this out to enable bounds-checking
int main(int argc, char **argv)
{
Vector<size_t> v(1 << 16);
for (size_t *p = v.b; p != v.e; ++p) { *p = 1; }
clock_t begin = clock();
for (int j = 0; j < 1 << 12; ++j)
{
for (size_t i = 8, n = v.e - v.b; i < n; ++i)
{
v.at(i) += v.at(i - 8);
v.at(i) ^= v.at(i - 7);
v.at(i) -= v.at(i - 6);
v.at(i) ^= v.at(i - 5);
v.at(i) += v.at(i - 4);
v.at(i) ^= v.at(i - 3);
v.at(i) -= v.at(i - 2);
v.at(i) ^= v.at(i - 1);
}
}
clock_t end = clock();
fprintf(stderr, "%u\n", clock() - begin);
}
I2luY2x1ZGUgPGNzdGRpbz4KI2luY2x1ZGUgPGN0aW1lPgoKdGVtcGxhdGU8Y2xhc3MgVD4gc3RydWN0IFZlY3Rvcgp7CglUICpiLCAqZTsKCVZlY3RvcihzaXplX3QgbikgOiBiKG5ldyBUW25dKSwgZShiICsgbikgeyB9CglUICZvcGVyYXRvcltdKHNpemVfdCBpKSB7IHJldHVybiBiW2ldOyB9CglUICZhdChzaXplX3QgaSkgeyBpZiAoaSA+PSBlIC0gYikgeyB0aHJvdyAiaW52YWxpZCI7IH0gcmV0dXJuIGJbaV07IH0KfTsKCiNkZWZpbmUgYXQgb3BlcmF0b3JbXSAgLy8gQ29tbWVudCB0aGlzIG91dCB0byBlbmFibGUgYm91bmRzLWNoZWNraW5nCgppbnQgbWFpbihpbnQgYXJnYywgY2hhciAqKmFyZ3YpCnsKCVZlY3RvcjxzaXplX3Q+IHYoMSA8PCAxNik7Cglmb3IgKHNpemVfdCAqcCA9IHYuYjsgcCAhPSB2LmU7ICsrcCkgeyAqcCA9IDE7IH0KCWNsb2NrX3QgYmVnaW4gPSBjbG9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