#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char ch = getchar();
  while (ch < '0' || ch > '9') ch = getchar();
  int res = 0;
  while (ch >= '0' && ch <= '9') {
    res = res * 10 + ch - '0';
    ch = getchar();
  }
  return res;
}
const int Mod = 1e9 + 7;
int n, f[401][401];
int dfs(int n, int k) {
  if (k == 0) return 1;
  if (n == 1) return k == 1;
  if (f[n][k] >= 0) return f[n][k];
  f[n][k] = 0;
  for (int i = 0; i <= k; i++)
    f[n][k] = (f[n][k] + (long long)dfs(n - 1, i) * dfs(n - 1, k - i)) % Mod;
  for (int i = 0; i < k; i++)
    f[n][k] =
        (f[n][k] + (long long)dfs(n - 1, i) * dfs(n - 1, k - i - 1)) % Mod;
  for (int i = 0; i <= k; i++)
    f[n][k] = (f[n][k] + (long long)dfs(n - 1, i) * dfs(n - 1, k - i) % Mod *
                             k * 2 % Mod) %
              Mod;
  for (int i = 0; i <= k + 1; i++)
    f[n][k] = (f[n][k] + (long long)dfs(n - 1, i) * dfs(n - 1, k + 1 - i) %
                             Mod * (k + 1) % Mod * k % Mod) %
              Mod;
  return f[n][k];
}
int main() {
  n = read();
  memset(f, -1, sizeof(f));
  printf("%d\n", dfs(n, 1));
  return 0;
}
