#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops")
using namespace std;
const long long MXN = 400 + 10;
const long long Mod = 1e9 + 7;
inline void mkay(long long &x) {
  if (x >= Mod) x -= Mod;
}
long long n;
long long dp[MXN][MXN], c2[MXN];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  for (int i = 2; i < MXN; i++) c2[i] = i * (i - 1) % Mod;
  cin >> n;
  dp[1][0] = dp[1][1] = 1;
  for (int i = 2; i <= n; i++) {
    for (int l = 0; l <= n; l++) {
      for (int r = 0; l + r - 1 <= n; r++) {
        long long zr = dp[i - 1][l] * dp[i - 1][r] % Mod;
        if (l + r - 1 <= n) {
          dp[i][l + r - 1] += zr * c2[l + r] % Mod;
          mkay(dp[i][l + r - 1]);
        }
        if (l + r <= n) {
          dp[i][l + r] += (zr + zr * (l + r) * 2) % Mod;
          mkay(dp[i][l + r]);
        }
        if (l + r + 1 <= n) {
          dp[i][l + r + 1] += zr;
          mkay(dp[i][l + r + 1]);
        }
      }
    }
  }
  cout << dp[n][1] << '\n';
  return 0;
}
