#include <bits/stdc++.h>
using namespace std;
const int MAXN = 805;
int k;
long long f[MAXN][MAXN];
inline int calc(int x) { return x * (x - 1) / 2; }
int main() {
  cin >> k;
  f[1][0] = f[1][1] = 1;
  for (int i = 2; i <= k; i++)
    for (int l = 0; l <= k; l++)
      for (int r = 0; r <= k; r++) {
        long long x = f[i - 1][l] * f[i - 1][r] % 1000000007;
        f[i][l + r + 1] = (f[i][l + r + 1] + x) % 1000000007;
        f[i][l + r] = (f[i][l + r] + x + x * (l + r) * 2) % 1000000007;
        if (l + r)
          f[i][l + r - 1] =
              (f[i][l + r - 1] + x * calc(l + r) * 2) % 1000000007;
      }
  cout << f[k][1] << endl;
  return 0;
}
