#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int mod = 1e9 + 7;
  vector<vector<long long>> dp(N + 1, vector<long long>(N + 1));
  dp[0][0] = 1;
  dp[1][0] = 1;
  dp[1][1] = 1;
  for (int i = 2; i <= N; i++) {
    for (int j = 0; j <= N; j++) {
      for (int k = 0; j + k <= N; k++) {
        long long x = (dp[i - 1][j] * dp[i - 1][k]) % mod;
        if (j + k <= N) {
          long long v = (x * (2 * (j + k) + 1)) % mod;
          long long d = dp[i][j + k];
          dp[i][j + k] = (d + v) % mod;
        }
        if (j + k + 1 <= N) {
          long long d = dp[i][j + k + 1];
          dp[i][j + k + 1] = (d + x) % mod;
        }
        if (j + k - 1 >= 0 && j + k - 1 <= N) {
          long long v = (x * (j + k) * (j + k - 1)) % mod;
          long long d = dp[i][j + k - 1];
          dp[i][j + k - 1] = (d + v) % mod;
        }
      }
    }
  }
  cout << dp[N][1];
  return (0);
}
