#include <bits/stdc++.h>
const long long mod = 1000000007;
long long n, f[510][510];
signed main() {
  scanf("%lld", &n);
  f[1][0] = f[1][1] = 1;
  for (long long i = 2; i <= n; i++)
    for (long long j = 0; j <= n; j++)
      for (long long k = 0; j + k - 1 <= n; k++) {
        long long tmp = f[i - 1][j] * f[i - 1][k] % mod;
        if (!tmp) continue;
        (f[i][j + k + 1] += tmp) %= mod;
        (f[i][j + k] += tmp * (2 * j + 2 * k + 1) % mod) %= mod;
        if (j + k) (f[i][j + k - 1] += tmp * (j + k) * (j + k - 1)) %= mod;
      }
  printf("%lld\n", f[n][1]);
}
