#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
long long f[1000][1000];
int main() {
  int n;
  scanf("%d", &n);
  f[1][0] = f[1][1] = 1;
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j <= n; ++j) {
      for (int k = 0; k <= n; ++k) {
        if (j + k > n) continue;
        long long S = f[i][j] * f[i][k] % mod;
        (f[i + 1][j + k] += S) %= mod;
        (f[i + 1][j + k + 1] += S) %= mod;
        (f[i + 1][j + k] += S * (j + k) * 2) %= mod;
        if (j + k > 0)
          (f[i + 1][j + k - 1] += S * (j + k) * (j + k - 1)) %= mod;
      }
    }
  }
  printf("%I64d\n", f[n][1]);
  return 0;
}
