#include <bits/stdc++.h>
using namespace std;
long long a, b[401][411], mod = 1000000007;
int main() {
  scanf("%lld", &a);
  b[1][1] = 1;
  b[1][0] = 1;
  for (int i = 2; i <= a; i++) {
    for (int j = 0; j <= a; j++) {
      for (int k = 0; k + j <= a; k++) {
        b[i][j + k] += b[i - 1][j] * b[i - 1][k] % mod +
                       b[i - 1][j] * b[i - 1][k] % mod * 2 * (j + k) % mod;
        b[i][j + k + 1] += b[i - 1][j] * b[i - 1][k] % mod;
        if (j + k > 0) {
          b[i][j + k - 1] += b[i - 1][j] * b[i - 1][k] % mod * (j + k) % mod *
                             (j + k - 1) % mod;
          b[i][j + k - 1] %= mod;
        }
      }
    }
  }
  printf("%lld", (b[a][1] + mod) % mod);
  return 0;
}
