#include <bits/stdc++.h>
using namespace std;
using int64 = long long int;
namespace io {
template <typename T>
T Read() {
  T result;
  cin >> result;
  return result;
}
string ReadWord() { return Read<string>(); }
template <typename T>
vector<T> ReadVector(const int n) {
  vector<T> result(n);
  for (int i = 0; i < n; ++i) {
    result[i] = Read<T>();
  }
  return result;
}
}  // namespace io
const int64 kModulo = 1000000007;
int main() {
  const int n = io::Read<int>();
  vector<vector<int64>> c(n + 1, vector<int64>(n + 1));
  for (int i = 0; i <= n; ++i) {
    c[i][0] = c[i][i] = 1;
    for (int j = 1; j < i; ++j) {
      c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % kModulo;
    }
  }
  vector<vector<int64>> a(n + 1, vector<int64>(n + 1));
  a[1][0] = a[1][1] = 1;
  for (int k = 2; k <= n; ++k) {
    a[k][0] = 1;
    for (int p = 1; k + p <= n + 1; ++p) {
      int64 s1 = 0;
      for (int t = 0; t <= p - 1; ++t) {
        const int64 tmp = (a[k - 1][t] * a[k - 1][p - 1 - t]) % kModulo;
        s1 = (s1 + c[p - 1][t] * tmp) % kModulo;
      }
      s1 = (s1 * p) % kModulo;
      int64 s2 = 0;
      for (int t = 0; t <= p; ++t) {
        const int64 tmp = (a[k - 1][t] * a[k - 1][p - t]) % kModulo;
        s2 = (s2 + c[p][t] * tmp) % kModulo;
      }
      s2 = (s2 * 2 * p) % kModulo;
      int64 s3 = 0;
      for (int t = 0; t <= p + 1; ++t) {
        const int64 tmp = (a[k - 1][t] * a[k - 1][p + 1 - t]) % kModulo;
        s3 = (s3 + c[p + 1][t] * tmp) % kModulo;
      }
      s3 = (s3 * p) % kModulo;
      int64 s4 = 0;
      for (int t = 0; t <= p; ++t) {
        const int64 tmp = (a[k - 1][t] * a[k - 1][p - t]) % kModulo;
        s4 = (s4 + c[p][t] * tmp) % kModulo;
      }
      a[k][p] = (s1 + s2 + s3 + s4) % kModulo;
    }
  }
  cout << a[n][1] << "\n";
  return 0;
}
