#include <bits/stdc++.h>
using namespace std;
const int mod(1e9 + 7);
static int n, m, f[441][440];
int main() {
  scanf("%d", &n);
  f[0][0] = 1;
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j <= n - i + 2; ++j) {
      long long tmp = 0;
      for (register int k = 0; k <= j; ++k)
        tmp = (tmp + (long long)f[i - 1][k] * f[i - 1][j - k] % mod) % mod;
      for (register int k = 0; k <= j - 1; ++k)
        tmp = (tmp + (long long)f[i - 1][k] * f[i - 1][j - k - 1] % mod) % mod;
      for (register int k = 0; k <= j; ++k)
        tmp = (tmp + (long long)f[i - 1][k] * f[i - 1][j - k] % mod * j % mod *
                         2 % mod) %
              mod;
      for (register int k = 0; k <= j + 1; ++k)
        tmp = (tmp + (long long)f[i - 1][k] * f[i - 1][j - k + 1] % mod *
                         (j + 1) % mod * j % mod) %
              mod;
      f[i][j] = tmp % mod;
    }
  }
  cout << f[n][1];
}
