#include <bits/stdc++.h>
using namespace std;
const int mo = 1000000007;
const int N = 405;
int f[N][N * 2], n;
int main() {
  scanf("%d", &n);
  f[1][0] = f[1][1] = 1;
  for (int i = (int)(2); i <= (int)(n); i++)
    for (int j = (int)(0); j <= (int)(n); j++)
      for (int k = (int)(0); k <= (int)(n + 1 - j); k++) {
        f[i][j + k + 1] =
            (f[i][j + k + 1] + 1ll * f[i - 1][j] * f[i - 1][k]) % mo;
        f[i][j + k] = (f[i][j + k] + 1ll * f[i - 1][j] * f[i - 1][k] % mo *
                                         (2 * j + 2 * k + 1)) %
                      mo;
        if (j + k)
          f[i][j + k - 1] = (f[i][j + k - 1] + 1ll * f[i - 1][j] * f[i - 1][k] %
                                                   mo * (j + k) * (j + k - 1)) %
                            mo;
      }
  printf("%d\n", f[n][1]) % mo;
}
