#include <bits/stdc++.h>
using namespace std;
const int maxn = 405, mod = 1e9 + 7;
inline int gi() {
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  int sum = 0;
  while ('0' <= c && c <= '9') sum = sum * 10 + c - 48, c = getchar();
  return sum;
}
inline void inc(int &a, int b) {
  a += b;
  if (a >= mod) a -= mod;
}
int n, f[maxn][maxn];
int main() {
  n = gi();
  f[0][0] = f[0][1] = 1;
  for (int i = 1; i < n; ++i)
    for (int j = 0; j <= n; ++j)
      if (f[i - 1][j])
        for (int k = 0; k <= n - j; ++k)
          if (f[i - 1][k]) {
            long long t = (long long)f[i - 1][j] * f[i - 1][k] % mod;
            inc(f[i][j + k], t);
            inc(f[i][j + k], (long long)2 * t * (j + k) % mod);
            if (j + k)
              inc(f[i][j + k - 1], (long long)t * (j + k) * (j + k - 1) % mod);
            inc(f[i][j + k + 1], t);
          }
  printf("%d\n", f[n - 1][1]);
  return 0;
}
