#include #include using namespace std; using namespace atcoder; //定数倍高速化 #pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") struct Fast {Fast() {std::cin.tie(0); ios::sync_with_stdio(false);}} fast; using mint=modint998244353; using ll=long long; using uint=unsigned int; using ull=unsigned long long; using ld=long double; using vec=vector; using mat=vector; using graph=vector > >; #define OVERLOAD_REP(_1, _2, _3, name, ...) name #define REP1(i, n) for (auto i = std::decay_t{}; (i) != (n); ++(i)) #define REP2(i, l, r) for (auto i = (l); (i) != (r); ++(i)) #define rep(...) OVERLOAD_REP(__VA_ARGS__, REP2, REP1)(__VA_ARGS__) #define repd(i,l,r) for (int i=(int)(l); i>=r; i--) #define exit_with(...) ({ __VA_ARGS__; exit(0); }) #define break_with(...) ({ __VA_ARGS__; break; }) #define continue_with(...) ({ __VA_ARGS__; continue; }) #define all(a) (a).begin(), (a).end() #define sz(a) (int)(a).size() #define bs(v, k) (binary_search(all(v),(k))) #define lbs(v, k) (lower_bound(all(v),(k))-v.begin()) #define ubs(v, k) (upper_bound(all(v),(k))-v.begin()) #define app emplace_back #define del pop_back //入出力 #define YESNO(bool) bool?cout<<"YES"< istream& operator>>(istream& is,vector& v) { for (T &in:v) is>>in; return is; } template ostream& operator<<(ostream& out,vector& v) { for (int i=0;i<(int)v.size();i++) { out< istream& operator>>(istream& is,vector>& v) { for (auto &x:v) for (T &in:x) is>>in; return is; } template ostream& operator<<(ostream& out,vector>& v) { for (int i=0;i<(int)v.size();i++) { for (int j=0;j<(int)v[i].size();j++) { out< auto make_vec(const size_t (&d)[n], const T& init) noexcept { if constexpr (idx < n) return std::vector(d[idx], make_vec(d, init)); else return init; } template auto make_vec(const size_t (&d)[n]) noexcept { return make_vec(d, T{}); } template inline void chmax(T& a,const T& b) {if (a inline void chmin(T& a,const T& b) {if (a>b) a=b;} template inline vector set_to_vec(set& S) { set s=S; vector res; while (!s.empty()) {res.emplace_back(*s.begin()); s.erase(*begin(s));} return res; } constexpr ll INF=1e17; constexpr int mod1=998244353; constexpr int mod2=1e9+7; constexpr ld esp=1e-6; signed main() { cout<>N; cout<<(3-N%3)%3<