#include <bits/stdc++.h>
template <typename Tp>
inline void read(Tp &x) {
  x = 0;
  bool f = true;
  char ch = getchar();
  for (; ch < '0' || ch > '9'; ch = getchar()) f ^= ch == '-';
  for (; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + (ch ^ 48);
  x = f ? x : -x;
}
const int N = 400, Mod = 1e9 + 7;
int dp[N + 5][N + 5];
int main() {
  int n;
  read(n);
  dp[1][1] = 1;
  for (int i = 1; i <= n; ++i) dp[i][0] = 1;
  for (int i = 2; i <= n; ++i)
    for (int j = 1; j <= n + 1 - i; ++j) {
      for (int k = 0; k < j; ++k)
        dp[i][j] = (dp[i][j] + 1LL * dp[i - 1][k] * dp[i - 1][j - 1 - k]) % Mod;
      for (int k = 0; k <= j; ++k)
        dp[i][j] = (dp[i][j] + 1LL * dp[i - 1][k] * dp[i - 1][j - k]) % Mod;
      for (int k = 0; k <= j; ++k)
        dp[i][j] =
            (dp[i][j] + 2LL * dp[i - 1][k] * dp[i - 1][j - k] % Mod * j) % Mod;
      for (int k = 0; k <= j + 1; ++k)
        dp[i][j] = (dp[i][j] + 1LL * dp[i - 1][k] * dp[i - 1][j + 1 - k] % Mod *
                                   j * (j + 1)) %
                   Mod;
    }
  printf("%d\n", dp[n][1]);
  return 0;
}
