#include #include #include using namespace std; int main() { int A[170]; A[0] = 0; A[1] = 1; A[2] = 1; for (int i=3;i<170;i++){ set k; k.insert(A[i-2]); k.insert(A[i-3]); for (int a=0;a<=i-3;a++){ int x = A[a] ^ A[i-3-a]; k.insert(x); } for (int j=0;;j++) if (!k.count(j)){ A[i] = j; break; } } int N,V[500500]; scanf ("%d",&N); for (int i=0;i= 136){ l = l % 34 + 136; } return A[l]; }; int l = 0, x = 0; for (int i=0;i