#include <bits/stdc++.h>
using namespace std;
template <typename T>
void read(T &x) {
  x = 0;
  char c = getchar();
  bool p = 0;
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') p = 1;
  for (; c >= '0' && c <= '9'; c = getchar())
    x = (x << 3) + (x << 1) + (c ^ 48);
  if (p) x = -x;
}
const int N = 505;
const long long MOD = 1000000007;
long long f[N][N];
int n;
long long ksm(long long basic, long long mi) {
  long long tmp = 1;
  while (mi) {
    if (mi & 1) tmp = tmp * basic % MOD;
    mi >>= 1;
    basic = basic * basic % MOD;
  }
  return tmp;
}
int main() {
  read(n);
  f[1][1] = f[1][0] = 1;
  for (int i = 2; i <= n; ++i) {
    for (int j = 0; j <= n; ++j) {
      if (!f[i - 1][j]) continue;
      for (int k = 0; j + k <= n; ++k) {
        if (!f[i - 1][k]) continue;
        long long tmp = f[i - 1][j] * f[i - 1][k] % MOD;
        f[i][j + k] = (f[i][j + k] + 1ll * (2 * (j + k) + 1) * tmp % MOD) % MOD;
        f[i][j + k + 1] = (f[i][j + k + 1] + tmp) % MOD;
        f[i][j + k - 1] =
            (f[i][j + k - 1] + 1ll * (j + k) * (j + k - 1) * tmp % MOD) % MOD;
      }
    }
  }
  printf("%lld\n", f[n][1]);
  return 0;
}
