#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
void upd(long long& a, const long long& b) {
  a += b;
  if (a >= mod) a -= mod;
}
long long mul(const long long& a, const long long& b) { return (a * b) % mod; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int k;
  cin >> k;
  int maxpaths = k + 2;
  vector<vector<long long> > dp(k + 1, vector<long long>(maxpaths + 2, 0));
  dp[0][0] = 1;
  for (int i = 1; i <= k; i++) {
    for (int l = 0; l <= maxpaths; l++) {
      for (int r = 0; l + r <= maxpaths; r++) {
        long long ways = mul(dp[i - 1][l], dp[i - 1][r]);
        dp[i][l + r] += ways;
        dp[i][l + r + 1] += ways;
        dp[i][l + r] += ways * 2ll * l;
        dp[i][l + r] += ways * 2ll * r;
        if (l > 1) dp[i][l + r - 1] += ways * l * (l - 1);
        if (r > 1) dp[i][l + r - 1] += ways * r * (r - 1);
        if (l * r) dp[i][l + r - 1] += ways * 2 * l * r;
      }
    }
    for (int c = 0; c <= maxpaths; c++) dp[i][c] %= mod;
  }
  cout << dp[k][1] << "\n";
  return 0;
}
