#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long k, f[410][410];
int main() {
  cin >> k;
  for (int i = 1; i <= k; i++) f[i][0] = 1;
  f[1][1] = 1;
  for (int dep = 2; dep <= k; dep++) {
    for (int i = 1; i <= (k - dep + 1); i++) {
      for (int j = 0; j <= i + 1; j++) {
        if (j < i) f[dep][i] += f[dep - 1][j] * f[dep - 1][i - j - 1] % mod;
        if (j <= i)
          f[dep][i] +=
              f[dep - 1][j] * f[dep - 1][i - j] % mod * (i * 2 + 1) % mod;
        f[dep][i] = (f[dep][i] + f[dep - 1][j] * f[dep - 1][i - j + 1] % mod *
                                     i * (i + 1) % mod) %
                    mod;
      }
    }
  }
  cout << f[k][1];
}
