#include <bits/stdc++.h>
using namespace std;
const int MAXN = 405, Mod = 1e9 + 7;
char buf[1 << 12], *pp1 = buf, *pp2 = buf, nc;
int ny;
inline char gc() {
  return pp1 == pp2 &&
                 (pp2 = (pp1 = buf) + fread(buf, 1, 1 << 12, stdin), pp1 == pp2)
             ? EOF
             : *pp1++;
}
inline int read() {
  int x = 0;
  for (ny = 1; nc = gc(), (nc < 48 || nc > 57) && nc != EOF;)
    if (nc == 45) ny = -1;
  if (nc < 0) return nc;
  for (x = nc - 48; nc = gc(), 47 < nc && nc < 58 && nc != EOF;
       x = (x << 3) + (x << 1) + (nc ^ 48))
    ;
  return x * ny;
}
int n, f[MAXN][MAXN];
int main() {
  n = read(), f[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    f[i][0] = 1;
    for (int j = 1; j <= n - i + 1; j++) {
      for (int k = 0; k <= j; k++)
        f[i][j] = (f[i][j] + 1ll * f[i - 1][k] * f[i - 1][j - k]) % Mod;
      f[i][j] = 1ll * f[i][j] * (2 * j + 1) % Mod;
      for (int k = 0; k <= j - 1; k++)
        f[i][j] = (f[i][j] + 1ll * f[i - 1][k] * f[i - 1][j - k - 1]) % Mod;
      for (int k = 0; k <= j + 1; k++)
        f[i][j] = (f[i][j] + 1ll * f[i - 1][k] * f[i - 1][j - k + 1] % Mod *
                                 (j + 1) * j) %
                  Mod;
    }
  }
  cout << f[n][1];
  return 0;
}
