#include using ll = long long; using u8 = uint8_t; using i32 = int32_t; using u32 = uint32_t; using i64 = int64_t; using u64 = uint64_t; using i128 = __int128_t; using u128 = __uint128_t; using namespace std; template class y_combinator { F f; public: y_combinator(F&& f) : f(std::forward(f)) {} template auto operator()(Args&&... args) const { return f(*this, std::forward(args)...); } }; using ll = long long; using ld = long double; template > using prique = std::priority_queue, U>; template T floor(T a, T b) noexcept { return a / b - (a % b && (a ^ b) < 0); } template T ceil(T a, T b) noexcept { return floor(a + b - 1, b); } template bool chmin(T& x, const T& y) noexcept { return (x > y ? x = y, true : false); } template bool chmax(T& x, const T& y) noexcept { return (x < y ? x = y, true : false); } #define overload4(a, b, c, d, e, ...) e #define rep1(a) for (long long _i = 0; _i < (a); _i++) #define rep2(i, a) for (long long i = 0; i < (a); i++) #define rep3(i, a, b) for (long long i = (a); i < (b); i++) #define rep4(i, a, b, c) for (long long i = (a); i < (b); i += (c)) #define rep(...) overload4(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__) #define rrep(i, a, b, c) for (long long i = (a); i > (b); i += (c)) #define all(x) std::begin(x), std::end(x) #define rall(x) std::rbegin(x), std::rend(x) #define pb push_back #ifndef LOCAL #define debug(...) #endif namespace type_traits { template using is_signed_int = std::integral_constant::value && std::is_signed::value) || std::is_same::value>; template using is_unsigned_int = std::integral_constant::value && std::is_unsigned::value) || std::is_same::value>; template using is_int = std::integral_constant::value || is_unsigned_int::value>; template using make_signed_int = typename std::conditional< std::is_same::value || std::is_same::value, std::common_type, std::make_signed>::type; template using make_unsigned_int = typename std::conditional< std::is_same::value || std::is_same::value, std::common_type, std::make_unsigned>::type; template struct is_range : std::false_type {}; template struct is_range< T, decltype(std::begin(std::declval::type>()), std::end(std::declval::type>()), (void)0)> : std::true_type {}; template ::value> struct range_rank : std::integral_constant {}; template struct range_rank : std::integral_constant::value + 1> {}; template struct int_least { static_assert(size <= 128, "size must be less than or equal to 128"); using type = typename std::conditional< size <= 8, std::int_least8_t, typename std::conditional< size <= 16, std::int_least16_t, typename std::conditional< size <= 32, std::int_least32_t, typename std::conditional::type>::type>::type>::type; }; template using int_least_t = typename int_least::type; template struct uint_least { static_assert(size <= 128, "size must be less than or equal to 128"); using type = typename std::conditional< size <= 8, std::uint_least8_t, typename std::conditional< size <= 16, std::uint_least16_t, typename std::conditional< size <= 32, std::uint_least32_t, typename std::conditional::type>::type>::type>::type; }; template using uint_least_t = typename uint_least::type; template using double_size_int = int_least::digits * 2 + 1>; template using double_size_int_t = typename double_size_int::type; template using double_size_uint = uint_least::digits * 2>; template using double_size_uint_t = typename double_size_uint::type; template using double_size = typename std::conditional::value, double_size_int, double_size_uint>::type; template using double_size_t = typename double_size::type; } // namespace type_traits #include namespace fastio { constexpr size_t buf_size = 1 << 17; template class Scanner { private: template struct has_scan : std::false_type {}; template struct has_scan().scan(std::declval()), (void)0)> : std::true_type {}; int fd; int idx, sz; bool state; std::array buffer; inline char cur() { if (idx == sz) load(); if (idx == sz) { state = false; return '\0'; } return buffer[idx]; } inline void next() { if (idx == sz) load(); if (idx == sz) return; ++idx; } public: inline void load() { int len = sz - idx; if (idx < len) return; std::memcpy(buffer.begin(), buffer.begin() + idx, len); sz = len + read(fd, buffer.data() + len, buf_size - len); buffer[sz] = 0; idx = 0; } Scanner(int fd) : fd(fd), idx(0), sz(0), state(true) {} Scanner(FILE* fp) : fd(fileno(fp)), idx(0), sz(0), state(true) {} inline char scan_char() { if (idx == sz) load(); return idx == sz ? '\0' : buffer[idx++]; } Scanner ignore(int n = 1) { if (idx + n > sz) load(); idx += n; return *this; } inline void discard_space() { if (idx == sz) load(); while (('\t' <= buffer[idx] && buffer[idx] <= '\r') || buffer[idx] == ' ') { if (++idx == sz) load(); } } void scan(char& a) { discard_space(); a = scan_char(); } void scan(bool& a) { discard_space(); a = scan_char() != '0'; } void scan(std::string& a) { discard_space(); a.clear(); while (cur() != '\0' && (buffer[idx] < '\t' || '\r' < buffer[idx]) && buffer[idx] != ' ') { a += scan_char(); } } template ::value && !has_scan::value>::type* = nullptr> void scan(T& a) { discard_space(); if (buffer[idx] == '-') { ++idx; if (idx + 40 > sz && (idx == sz || ('0' <= buffer[sz - 1] && buffer[sz - 1] <= '9'))) load(); a = 0; while ('0' <= buffer[idx] && buffer[idx] <= '9') { a = a * 10 - (buffer[idx++] - '0'); } } else { if (idx + 40 > sz && '0' <= buffer[sz - 1] && buffer[sz - 1] <= '9') load(); a = 0; while ('0' <= buffer[idx] && buffer[idx] <= '9') { a = a * 10 + (buffer[idx++] - '0'); } } } template ::value && !has_scan::value>::type* = nullptr> void scan(T& a) { discard_space(); if (idx + 40 > sz && '0' <= buffer[sz - 1] && buffer[sz - 1] <= '9') load(); a = 0; while ('0' <= buffer[idx] && buffer[idx] <= '9') { a = a * 10 + (buffer[idx++] - '0'); } } template ::value && !has_scan::value>::type* = nullptr> void scan(T& a) { discard_space(); bool sgn = false; if (cur() == '-') { sgn = true; next(); } a = 0; while ('0' <= cur() && cur() <= '9') { a = a * 10 + cur() - '0'; next(); } if (cur() == '.') { next(); T n = 0, d = 1; for (int i = 0; '0' <= cur() && cur() <= '9' && i < (int)decimal_precision; ++i) { n = n * 10 + cur() - '0'; d *= 10; next(); } while ('0' <= cur() && cur() <= '9') next(); a += n / d; } if (sgn) a = -a; } private: template void scan(std::tuple& a) { if constexpr (i < sizeof...(Args)) { scan(std::get(a)); scan(a); } } public: template void scan(std::tuple& a) { scan<0, Args...>(a); } template void scan(std::pair& a) { scan(a.first); scan(a.second); } template ::value && !has_scan::value>::type* = nullptr> void scan(T& a) { for (auto&& i : a) scan(i); } template ::value>::type* = nullptr> void scan(T& a) { a.scan(*this); } void operator()() {} template void operator()(Head& head, Args&... args) { scan(head); operator()(args...); } template Scanner& operator>>(T& a) { scan(a); return *this; } explicit operator bool() const { return state; } friend Scanner& getline(Scanner& scan, std::string& a) { a.erase(); char c; if ((c = scan.scan_char()) == '\n' || c == '\0') return scan; a += c; while ((c = scan.scan_char()) != '\n' && c != '\0') a += c; scan.state = true; return scan; } }; Scanner<> scan(0); struct Pre { char num[10000][4]; constexpr Pre() : num() { for (int i = 0; i < 10000; i++) { int n = i; for (int j = 3; j >= 0; j--) { num[i][j] = n % 10 | '0'; n /= 10; } } } } constexpr pre; class Printer { template struct has_print : std::false_type {}; template struct has_print().print(std::declval()), (void)0)> : std::true_type {}; static constexpr std::size_t TMP_SIZE = 1 << 7; char buf[buf_size], tmp[TMP_SIZE]; int fd; std::size_t pos = 0, decimal_precision; void wt_char(char ch) { buf[pos++] = ch; if (pos == buf_size) flush(); } template ::value && !has_print::value>::type* = nullptr> void wt_integer(T x) { char* p = tmp + TMP_SIZE - 1; bool sgn = false; if (x < 0) { sgn = true; x = -x; } while (x >= 10000) { std::memcpy(p -= 4, pre.num[x % 10000], 4); x /= 10000; } if (x >= 1000) { memcpy(p -= 4, pre.num[x], 4); } else if (x >= 100) { memcpy(p -= 3, pre.num[x] + 1, 3); } else if (x >= 10) { memcpy(p -= 2, pre.num[x] + 2, 2); } else { *--p = pre.num[x][3]; } if (sgn) *--p = '-'; std::size_t len = (tmp + TMP_SIZE - 1) - p; if (len >= buf_size - pos) flush(); std::memcpy(buf + pos, p, len); pos += len; } template void wt_tuple(const Tuple& t) { if constexpr (I < std::tuple_size::value) { if (I > 0) wt_char(' '); wt(std::get(t)); wt_tuple(t); } } public: Printer(int fd) : fd(fd), pos(0), decimal_precision(16) {} Printer(FILE* fp) : fd(fileno(fp)), pos(0), decimal_precision(16) {} ~Printer() { flush(); } void wt(char ch) { wt_char(ch); } void wt(bool b) { wt_char(char(b + '0')); } void wt(const char* a) { for (; *a != '\0'; a++) wt_char(*a); } void wt(const std::string& s) { for (char ch : s) wt_char(ch); } template ::value && !has_print::value>::type* = nullptr> void wt(const T& x) { wt_integer(x); } template ::value && !has_print::value>::type* = nullptr> void wt(const T& x) { std::ostringstream oss; oss << std::fixed << std::setprecision(decimal_precision) << x; wt(oss.str()); } template ::value && !has_print::value>::type* = nullptr> void wt(const T& a) { for (auto it = a.begin(); it != a.end(); it++) { if (it != a.begin()) { wt_char(' '); } wt(*it); } } template void wt(const std::tuple& t) { wt_tuple<>(t); } template void wt(const std::pair& p) { wt(p.first); wt(' '); wt(p.second); } template ::value>::type* = nullptr> void wt(const T& a) { a.print(*this); } void flush() { write(fd, buf, pos); pos = 0; } void operator()() {} template void operator()(const Head& head, const Tails&... tails) { wt(head); wt(' '); (*this)(tails...); } template Printer& operator<<(const T& a) { wt(a); return *this; } Printer& operator<<(Printer& (*func)(Printer&)) { return func(*this); } }; Printer emit(1); inline Printer& endl(Printer& os) { os.wt('\n'); os.flush(); return os; } inline Printer& flush(Printer& os) { os.flush(); return os; } } // namespace fastio using fastio::emit, fastio::endl, fastio::flush, fastio::scan; int main() { i128 N; scan >> N; if (N == 1) { cout << -1 << "\n"; } else if (N & 1) { cout << 1 << "\n"; } else if (N == 4) { cout << -1 << "\n"; } else if(N % 4 == 0){ cout << 1 << "\n"; } else { cout << -1 << "\n"; } }