#include template inline bool chmin(T&x,U y){if(x>y){x=y;return true;}return false;} template inline bool chmax(T&x,U y){if(x>&e, std::vector&vis, std::vector&d, std::vector&tmp, std::vector&ans){ int D{}, idx{-1}; for(int i{};i idxs; idxs.reserve(D); for(auto&j:e[idx]) if(!vis[j]){ idxs.push_back(j); vis[j]=true; for(auto&k:e[j]) --d[k]; } tmp.push_back(idx); rec_MIS(n, e, vis, d, tmp, ans); tmp.pop_back(); for(auto&j:idxs){ vis[j]=false; for(auto&k:e[j]) ++d[k]; if(D>2) --d[j]; } if(D>2){ rec_MIS(n, e, vis, d, tmp, ans); for(auto&j:idxs) ++d[j]; } vis[idx] = false; } std::vector MIS(std::vector>&e){ int n = e.size(); std::vector vis(n); std::vector d; d.reserve(n); for(auto&v:e) d.push_back(v.size()); std::vector tmp,ans; rec_MIS(n, e, vis, d, tmp, ans); return ans; } int main(){ int64_t s; constexpr int64_t base = 12345, mod = 1000003; std::cin>>s; (s*=base) %= mod; int n = s%120 + 2; (s*=base) %= mod; int p = s; std::vector> e(n); for(int i{};i<(n);++i){ for(int j{i+1};j=p){ e[i].push_back(j); e[j].push_back(i); } } } auto v=MIS(e); int N = v.size(); if(n==N){ std::cout<<-1<<'\n'; return 0; } std::cout<