#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int dp[405][405];
int main() {
  int k;
  scanf("%d", &k);
  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 - i + 5) {
          int aux = (1LL * dp[i - 1][l] * dp[i - 1][r]) % MOD;
          dp[i][l + r + 1] = (1LL * dp[i][l + r + 1] + 1LL * aux) % MOD;
          dp[i][l + r] =
              (1LL * dp[i][l + r] + 1LL * aux + (1LL * 2 * l * aux) % MOD +
               (1LL * 2 * r * aux) % MOD) %
              MOD;
          if (l + r > 0)
            dp[i][l + r - 1] =
                (1LL * dp[i][l + r - 1] +
                 (1LL * aux * (1LL * (l + r) * (l + r - 1))) % MOD) %
                MOD;
        }
      }
    }
  }
  printf("%d\n", dp[k][1]);
  return 0;
}
