#include <bits/stdc++.h>
using namespace std;
long long f[444][444];
inline long long r() {
  char h = getchar();
  long long y = 0, q = 1;
  while (h < '0' || h > '9') {
    if (h == '-') q = -1;
    h = getchar();
  }
  while (h >= '0' && h <= '9') {
    y = y * 10 + h - '0';
    h = getchar();
  }
  return y * q;
}
inline void jj(long long &a, long long b) {
  a += b;
  if (a >= 1000000007) a -= 1000000007;
}
long long dfs(long long n, long long k) {
  if (k == 0) return 1;
  if (n == 1) return k == 1;
  if (f[n][k] != -1) return f[n][k];
  long long da = 0;
  for (long long i = 0; i < k; i++)
    jj(da, dfs(n - 1, i) * dfs(n - 1, k - 1 - i) % 1000000007);
  for (long long i = 0; i <= k; i++)
    jj(da, dfs(n - 1, i) * dfs(n - 1, k - i) % 1000000007);
  for (long long i = 0; i <= k; i++)
    jj(da, dfs(n - 1, i) * dfs(n - 1, k - i) % 1000000007 * 2 * k % 1000000007);
  for (long long i = 0; i <= k + 1; i++)
    jj(da, dfs(n - 1, i) * dfs(n - 1, k + 1 - i) % 1000000007 * (k + 1) * k %
               1000000007);
  return f[n][k] = da;
}
signed main() {
  for (long long i = 0; i < 444; i++)
    for (long long j = 0; j < 444; j++) f[i][j] = -1;
  long long n = r();
  printf("%lld\n", dfs(n, 1));
}
