#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long sum = 0, f = 0;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar()) f |= (ch == '-');
  for (; isdigit(ch); ch = getchar())
    sum = ((sum << 1) + (sum << 3) + (ch ^ 48));
  return f ? -sum : sum;
}
void write(const long long x) {
  if (x < 0) {
    putchar('-');
    write(-x);
    return;
  }
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
long long n, f[440][440], p = 1e9 + 7;
int main() {
  n = read();
  for (register long long i = (1); i <= (n); i++) f[i][0] = 1;
  f[1][1] = 1;
  for (register long long i = (2); i <= (n); i++)
    for (register long long j = (1); j <= (n - i + 1); j++)
      for (register long long k = (0); k <= (j + 1); k++) {
        if (k <= j - 1) f[i][j] += f[i - 1][k] * f[i - 1][j - k - 1] % p;
        if (k <= j)
          f[i][j] += f[i - 1][k] * f[i - 1][j - k] % p * (2 * j + 1) % p;
        f[i][j] += f[i - 1][k] * f[i - 1][j - k + 1] % p * j * (j + 1) % p;
        f[i][j] %= p;
      }
  write(f[n][1]);
}
