#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline void wrote(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x >= 10) wrote(x / 10);
  putchar(x % 10 + '0');
}
inline void writeln(long long x) {
  wrote(x);
  puts("");
}
long long n, c[410][410], f[410][410];
const long long mod = 1e9 + 7;
inline void add(long long &x, long long y) { x = (x + y) % mod; }
int main() {
  for (long long i = 0; i <= 400; ++i) {
    c[i][0] = c[i][i] = 1;
    for (long long j = 1; j <= i - 1; ++j)
      c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % mod;
  }
  n = read();
  f[1][0] = 1;
  f[1][1] = 1;
  for (long long i = 2; i <= n; ++i)
    for (long long j = 0; j <= n; ++j)
      for (long long k = 0; k <= n; ++k)
        if (j + k <= n) {
          if (j + k + 1 <= n) add(f[i][j + k + 1], f[i - 1][j] * f[i - 1][k]);
          if (j + k <= n)
            add(f[i][j + k],
                f[i - 1][j] * f[i - 1][k] % mod * (j + k) * 2 % mod +
                    f[i - 1][j] * f[i - 1][k] % mod);
          if (j || k)
            add(f[i][j + k - 1],
                f[i - 1][j] * f[i - 1][k] % mod * c[j + k][2] * 2);
        } else
          break;
  writeln(f[n][1]);
}
