#include <bits/stdc++.h>
using namespace std;
const int max_n = 404, log_n = 32, max_m = 111, mod = 1000000007,
          inf = 1000111222;
int n, dp[max_n][max_n];
int main() {
  cin >> n;
  dp[1][0] = dp[1][1] = 1;
  for (int i = 2; i <= n; ++i) {
    dp[i][0] = 1;
    for (int q = 1; q <= n + 2; ++q) {
      if (i < 10 && (1 << i) <= q) {
        break;
      }
      long long tmp = 0;
      for (int w = 0; w <= q + 1; ++w) {
        if (w <= q - 1) {
          tmp += 1LL * dp[i - 1][w] * dp[i - 1][q - w - 1];
        }
        if (w <= q) {
          tmp += (((2LL * q + 1) * dp[i - 1][w]) % mod) * dp[i - 1][q - w];
        }
        tmp += ((1LL * q * dp[i - 1][w]) % mod) *
               (1LL * (q + 1) * dp[i - 1][q + 1 - w] % mod);
        tmp %= mod;
      }
      dp[i][q] = tmp;
    }
  }
  cout << dp[n][1] << endl;
  return 0;
}
