#include <bits/stdc++.h>
using namespace std;
const int inf = 2 * 1e9 + 1e8;
const int maxn = 402;
const int mod = 1e9 + 7;
const int obrt = 500000004;
int k;
int dp[maxn][maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> k;
  long long ans = 0;
  dp[1][0] = dp[1][1] = 1;
  for (int i = 2; i <= k; ++i) {
    for (int l = 0; l <= k; ++l) {
      for (int r = 0; r <= k; ++r) {
        if (l + r <= k)
          dp[i][l + r] = (dp[i][l + r] + 1LL * dp[i - 1][l] * dp[i - 1][r] %
                                             mod * (2 * l + 2 * r + 1)) %
                         mod;
        if (l + r + 1 <= k)
          dp[i][l + r + 1] =
              (dp[i][l + r + 1] + 1LL * dp[i - 1][l] * dp[i - 1][r]) % mod;
        if (l + r - 1 <= k)
          dp[i][l + r - 1] =
              (dp[i][l + r - 1] + 1LL * dp[i - 1][l] * dp[i - 1][r] % mod *
                                      (l + r) * (l + r - 1)) %
              mod;
      }
    }
  }
  cout << dp[k][1];
  return 0;
}
