#include using namespace std; template T inverse(T a, T m) { T u = 0, v = 1; while (a != 0) { T t = m / a; m -= t * a; u -= t * v; std::swap(a, m); std::swap(u, v); } assert(m == 1); return u; } template class Modular { public: using Type = typename std::decay::type; constexpr Modular() : value() {} template Modular(const U &x) : value(normalize(x)) {} template Type normalize(const U &x) { Type v; if (-mod <= x && x < mod) { v = static_cast(x); } else { v = static_cast(x % mod); } if (v < 0) v += mod; return v; } const Type &operator()() const { return value; } template explicit operator U() const { return static_cast(value); } static inline Type mod = T::value; Modular &operator+=(const Modular &rhs) { if ((value += rhs.value) >= mod) value -= mod; return *this; } Modular &operator-=(const Modular &rhs) { if ((value -= rhs.value) < 0) value += mod; return *this; } template Modular &operator+=(const U &rhs) { return *this += Modular(rhs); } template Modular &operator-=(const U &rhs) { return *this -= Modular(rhs); } Modular &operator++() { return *this += 1; } Modular &operator--() { return *this -= 1; } Modular operator++(int) { Modular res(*this); *this += 1; return res; } Modular operator--(int) { Modular res(*this); *this -= 1; return res; } template typename enable_if::Type, int>::value, Modular>::type & operator*=(const Modular &rhs) { value = normalize(static_cast(value) * static_cast(rhs.value)); return *this; } template typename enable_if< std::is_same::Type, int64_t>::value || std::is_same::Type, std::int_fast64_t>::value, Modular>::type & operator*=(const Modular &rhs) { value = normalize(static_cast<__int128>(value) * static_cast<__int128>(rhs.value)); return *this; } Modular &operator/=(const Modular &rhs) { return *this *= Modular(inverse(rhs.value, mod)); } template friend bool operator==(const Modular &lhs, const Modular &rhs); template friend bool operator<(const Modular &lhs, const Modular &rhs); template friend bool operator>(const Modular &lhs, const Modular &rhs); template friend std::istream &operator>>(std::istream &stream, Modular &rhs); template friend std::ostream &operator<<(std::ostream &stream, const Modular &rhs); private: Type value; }; template bool operator==(const Modular &lhs, const Modular &rhs) { return lhs.value == rhs.value; } template bool operator==(const Modular &lhs, U rhs) { return lhs == Modular(rhs); } template bool operator==(U lhs, const Modular &rhs) { return Modular(lhs) == rhs; } template bool operator!=(const Modular &lhs, const Modular &rhs) { return !(lhs == rhs); } template bool operator!=(const Modular &lhs, U rhs) { return !(lhs == rhs); } template bool operator!=(U lhs, const Modular &rhs) { return !(lhs == rhs); } template bool operator<(const Modular &lhs, const Modular &rhs) { return lhs.value < rhs.value; } template bool operator>(const Modular &lhs, const Modular &rhs) { return lhs.value > rhs.value; } template Modular operator+(const Modular &lhs, const Modular &rhs) { return Modular(lhs) += rhs; } template Modular operator+(const Modular &lhs, U rhs) { return Modular(lhs) += rhs; } template Modular operator+(U lhs, const Modular &rhs) { return Modular(lhs) += rhs; } template Modular operator-(const Modular &lhs, const Modular &rhs) { return Modular(lhs) -= rhs; } template Modular operator-(const Modular &lhs, U rhs) { return Modular(lhs) -= rhs; } template Modular operator-(U lhs, const Modular &rhs) { return Modular(lhs) -= rhs; } template Modular operator*(const Modular &lhs, const Modular &rhs) { return Modular(lhs) *= rhs; } template Modular operator*(const Modular &lhs, U rhs) { return Modular(lhs) *= rhs; } template Modular operator*(U lhs, const Modular &rhs) { return Modular(lhs) *= rhs; } template Modular operator/(const Modular &lhs, const Modular &rhs) { return Modular(lhs) /= rhs; } template Modular operator/(const Modular &lhs, U rhs) { return Modular(lhs) /= rhs; } template Modular operator/(U lhs, const Modular &rhs) { return Modular(lhs) /= rhs; } template Modular power(const Modular &a, const U &b) { assert(b >= 0); Modular x = a, res = 1; U n = b; while (n > 0) { if (n & 1) res *= x; x *= x; n >>= 1; } return res; } template std::istream &operator>>(std::istream &stream, Modular &rhs) { typename common_type::Type, int64_t>::type x; stream >> x; rhs = Modular(x); return stream; } template std::ostream &operator<<(std::ostream &stream, const Modular &rhs) { stream << rhs.value; return stream; } constexpr int64_t mod = 1000000007; using mint = Modular::type, mod>>; int main() { ios::sync_with_stdio(false); cin.tie(0); int64_t M; cin >> M; mint::mod = M; cout << power(static_cast(2), 128) << '\n'; return 0; }