#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll linf = 1e18;
const double eps = 1e-12, pi = acos(-1);
template <typename T>
ll min(ll a, const T&& b) {
  return a < b ? a : b;
}
template <typename T>
ll min(const T&& a, ll b) {
  return a < b ? a : b;
}
template <typename T>
ll max(ll a, const T&& b) {
  return a > b ? a : b;
}
template <typename T>
ll max(const T&& a, ll b) {
  return a > b ? a : b;
}
template <typename Head>
void out(Head h) {
  cout << h << endl;
}
template <typename Head, typename... Tail>
void out(Head h, Tail... t) {
  cout << h << " ";
  out(t...);
}
template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
  for (auto&& x : v) is >> x;
  return is;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  for (ll i = (0), __last_i = (v.size()); i < __last_i; i++) {
    if (i) os << " ";
    os << v[i];
  }
  return os;
}
ostream& operator<<(ostream& os, const vector<string>& v) {
  for (ll i = (0), __last_i = (v.size()); i < __last_i; i++) {
    if (i) os << endl;
    os << v[i];
  }
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
  for (ll i = (0), __last_i = (v.size()); i < __last_i; i++) {
    if (i) os << endl;
    os << v[i];
  }
  return os;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& os, const pair<T1, T2>& p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
struct yes_no : std::numpunct<char> {
  string_type do_truename() const { return "Yes"; }
  string_type do_falsename() const { return "No"; }
};
void solve();
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  locale loc(locale(), new yes_no);
  cout.imbue(loc);
  cout << fixed << setprecision(10) << boolalpha;
  solve();
}
vector<vector<vector<ll>>> ans{
    {{0, 80000000000}, {80000000000, 0}},
    {{0, 9000000000}, {9000000000, 0}},
    {{0, 7271957603, 9000000000},
     {7271957603, 0, 7340271317},
     {9000000000, 7340271317, 0}},
};
void solve() {
  ll n;
  cin >> n;
  assert(n - 2 < ans.size());
  cout << ans[n - 2] << endl;
}
