#include <bits/stdc++.h>
using namespace std;
inline char gc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline int read() {
  char c = getchar();
  int tot = 1;
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  if (c == '-') {
    tot = -1;
    c = getchar();
  }
  int sum = 0;
  while (c >= '0' && c <= '9') {
    sum = sum * 10 + c - '0';
    c = getchar();
  }
  return sum * tot;
}
inline void wr(int x) {
  if (x < 0) {
    putchar('-');
    wr(-x);
    return;
  }
  if (x >= 10) wr(x / 10);
  putchar(x % 10 + '0');
}
inline void wrn(int x) {
  wr(x);
  putchar('\n');
}
inline void wri(int x) {
  wr(x);
  putchar(' ');
}
inline void wrn(int x, int y) {
  wri(x);
  wrn(y);
}
inline void wrn(int a, int b, int c) {
  wri(a);
  wrn(b, c);
}
int n, m, f[455][455], g[455];
inline void add(int &x, int k) {
  x += k;
  x -= (x >= 1000000007) ? 1000000007 : 0;
}
signed main() {
  n = read();
  f[1][0] = f[1][1] = 1;
  for (int i = (2); i <= (n); i++) g[i] = 1LL * i * (i - 1) % 1000000007;
  for (int i = (2); i <= (n); i++)
    for (int j = (0); j <= (n); j++)
      for (int k = (0); k <= (n - j); k++) {
        int t = 1LL * f[i - 1][j] * f[i - 1][k] % 1000000007;
        add(f[i][j + k], 1LL * t * ((j + k) * 2 + 1) % 1000000007);
        if (j || k) add(f[i][j + k - 1], 1LL * t * g[j + k] % 1000000007);
        add(f[i][j + k + 1], t);
      }
  wrn(f[n][1]);
  return 0;
}
