#include <bits/stdc++.h>
using namespace std;
const int iinf = 1e9 + 7;
const int oo = 0x3f3f3f3f;
const long long linf = 1ll << 60;
const double dinf = 1e60;
template <typename T>
inline void scf(T &x) {
  bool f = 0;
  x = 0;
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  if (c == '-') {
    f = 1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  if (f) x = -x;
  return;
}
template <typename T1, typename T2>
void scf(T1 &x, T2 &y) {
  scf(x);
  return scf(y);
}
template <typename T1, typename T2, typename T3>
void scf(T1 &x, T2 &y, T3 &z) {
  scf(x);
  scf(y);
  return scf(z);
}
template <typename T1, typename T2, typename T3, typename T4>
void scf(T1 &x, T2 &y, T3 &z, T4 &w) {
  scf(x);
  scf(y);
  scf(z);
  return scf(w);
}
inline char mygetchar() {
  char c = getchar();
  while (c == ' ' || c == '\n') c = getchar();
  return c;
}
template <typename T>
inline bool chkmax(T &x, const T &y) {
  return y > x ? x = y, 1 : 0;
}
template <typename T>
inline bool chkmin(T &x, const T &y) {
  return y < x ? x = y, 1 : 0;
}
const int mod = 1e9 + 7;
const int maxn = 420;
int n;
long long dp[maxn][maxn + 10];
void trans(int lvl) {
  long long fl, fr;
  for (int lsz = 0, _end_ = (maxn); lsz < _end_; ++lsz)
    for (int rsz = 0, _end_ = (maxn - lsz); rsz < _end_; ++rsz)
      if ((fl = dp[lvl][lsz]) && (fr = dp[lvl][rsz])) {
        int sz = lsz + rsz;
        (dp[lvl + 1][sz] += fl * fr % mod * (1 + lsz * 2 + rsz * 2)) %= mod;
        if (sz + 1 < maxn) (dp[lvl + 1][sz + 1] += fl * fr) %= mod;
        if (sz)
          (dp[lvl + 1][sz - 1] +=
           fl * fr % mod *
           (lsz * (lsz - 1) + rsz * (rsz - 1) + 2 * lsz * rsz)) %= mod;
      }
  return;
}
int main() {
  scf(n);
  dp[1][0] = dp[1][1] = 1;
  for (int i = (1), _end_ = (n - 1); i <= _end_; ++i) trans(i);
  printf("%I64d\n", dp[n][1]);
  return 0;
}
