#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
bool Max(T1 &a, T2 b) {
  return a < b ? a = b, 1 : 0;
}
template <typename T1, typename T2>
bool Min(T1 &a, T2 b) {
  return a > b ? a = b, 1 : 0;
}
template <int MOD>
struct ModInt {
  unsigned x;
  ModInt() : x(0) {}
  ModInt(signed sig) : x(sig) {}
  ModInt(signed long long sig) : x(sig % MOD) {}
  int get() const { return (int)x; }
  ModInt power(unsigned p) {
    ModInt res = 1, a = *this;
    while (p) {
      if (p & 1) res *= a;
      a *= a;
      p >>= 1;
    }
    return res;
  }
  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) { return (*this) *= that.power(MOD - 2); }
  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; }
  ModInt operator/(ModInt that) const { return ModInt(*this) /= that; }
};
const int N = 401;
ModInt<1000000007> f[N][N + 1];
void solve() {
  int k;
  cin >> k;
  f[1][0] = f[1][1] = 1;
  for (int i = 1; i <= (k - 1); ++i) {
    for (int l = 0; l < (k + 1); ++l)
      if (f[i][l].x) {
        for (int r = 0; r < (k + 1); ++r)
          if (f[i][r].x && l + r < 400) {
            ModInt<1000000007> x = f[i][l] * f[i][r];
            f[i + 1][l + r] += x;
            f[i + 1][l + r + 1] += x;
            f[i + 1][l + r] += x * (l + r) * 2;
            if (l + r > 0) f[i + 1][l + r - 1] += x * (l + r) * (l + r - 1);
          }
      }
  }
  cout << f[k][1].x << '\n';
}
void init() {}
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.setf(ios::fixed);
  cout.precision(20);
  init();
  int TC = 1;
  for (int TI = 1; TI <= (TC); ++TI) {
    solve();
  }
  return 0;
}
