#include <bits/stdc++.h>
using namespace std;
static const int INF = 0x3f3f3f3f;
static const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
template <typename T, typename U>
static void amin(T &x, U y) {
  if (y < x) x = y;
}
template <typename T, typename U>
static void amax(T &x, U y) {
  if (x < y) x = y;
}
template <int MOD>
struct ModInt {
  static const int Mod = MOD;
  unsigned x;
  ModInt() : x(0) {}
  ModInt(signed sig) {
    int sigt = sig % MOD;
    if (sigt < 0) sigt += MOD;
    x = sigt;
  }
  ModInt(signed long long sig) {
    int sigt = sig % MOD;
    if (sigt < 0) sigt += MOD;
    x = sigt;
  }
  int get() const { return (int)x; }
  ModInt &operator+=(ModInt that) {
    if ((x += that.x) >= MOD) x -= MOD;
    return *this;
  }
  ModInt &operator-=(ModInt that) {
    if ((x += MOD - that.x) >= MOD) x -= MOD;
    return *this;
  }
  ModInt &operator*=(ModInt that) {
    x = (unsigned long long)x * that.x % MOD;
    return *this;
  }
  ModInt operator+(ModInt that) const { return ModInt(*this) += that; }
  ModInt operator-(ModInt that) const { return ModInt(*this) -= that; }
  ModInt operator*(ModInt that) const { return ModInt(*this) *= that; }
};
int main() {
  int n;
  while (~scanf("%d", &n)) {
    vector<vector<ModInt<1000000007>>> dp(n + 1,
                                          vector<ModInt<1000000007>>(n + 5));
    dp[0][0] = 1;
    for (int(i) = 0; (i) < (int)(n); ++(i)) {
      for (int(l) = (int)(0); (l) <= (int)(n + 4); ++(l))
        for (int(r) = (int)(0); (r) <= (int)(n + 4); ++(r))
          if (l + r <= n + 3) {
            ModInt<1000000007> x = dp[i][l] * dp[i][r];
            dp[i + 1][l + r] += x * (1 + (l + r) * 2);
            dp[i + 1][l + r + 1] += x;
            if (l + r > 0)
              dp[i + 1][l + r - 1] +=
                  x * (l * (l - 1) + r * (r - 1) + (l * r) * 2);
          }
    }
    ModInt<1000000007> ans = dp[n][1];
    printf("%d\n", ans.get());
  }
  return 0;
}
