#include <bits/stdc++.h>
using namespace std;
const int maxn = 410, inf = 1e9, mod = 1e9 + 7;
int n;
int C[maxn << 1], f[maxn][maxn];
template <typename T>
inline void read(T &k) {
  int f = 1;
  k = 0;
  char c = getchar();
  while (c < '0' || c > '9') c == '-' && (f = -1), c = getchar();
  while (c <= '9' && c >= '0') k = k * 10 + c - '0', c = getchar();
  k *= f;
}
int main() {
  read(n);
  for (int i = 1; i <= n * 2 + 1; i++) C[i] = 1ll * i * (i - 1) / 2 % mod;
  f[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= n; j++) {
      for (int k = 0; k <= n && j + k - 1 <= n; k++) {
        int x = 1ll * f[i - 1][j] * f[i - 1][k] % mod;
        f[i][j + k] = ((f[i][j + k] + x) >= mod ? (f[i][j + k] + x) - mod
                                                : (f[i][j + k] + x));
        f[i][j + k + 1] =
            ((f[i][j + k + 1] + x) >= mod ? (f[i][j + k + 1] + x) - mod
                                          : (f[i][j + k + 1] + x));
        if (j || k) f[i][j + k] = (f[i][j + k] + 2ll * x * (j + k)) % mod;
        if (j + k > 1)
          f[i][j + k - 1] = (f[i][j + k - 1] + 2ll * x * C[j + k]) % mod;
      }
    }
  }
  printf("%d\n", f[n][1]);
}
