#include <bits/stdc++.h>
using namespace std;
const int N = 410;
const int MOD = 1e9 + 7;
int f[N][N];
int dp(int i, int k) {
  if (!k) return 1;
  if (i == 1) return k == 1;
  if (f[i][k] != -1) return f[i][k];
  f[i][k] = 0;
  for (int j = 0; j < k; j++)
    f[i][k] = (f[i][k] + 1LL * dp(i - 1, j) * dp(i - 1, k - j - 1)) % MOD;
  for (int j = 0; j <= k; j++) {
    f[i][k] = (f[i][k] + 1LL * dp(i - 1, j) * dp(i - 1, k - j)) % MOD;
    f[i][k] =
        (f[i][k] + 1LL * dp(i - 1, j) * dp(i - 1, k - j) % MOD * k * 2 % MOD) %
        MOD;
  }
  for (int j = 0; j <= k + 1; j++)
    f[i][k] = (f[i][k] + 1LL * dp(i - 1, j) * dp(i - 1, k - j + 1) % MOD * k *
                             (k + 1) % MOD) %
              MOD;
  return f[i][k];
}
int main() {
  int n;
  memset(f, -1, sizeof(f));
  scanf("%d", &n);
  printf("%d\n", dp(n, 1));
  return 0;
}
