#include <bits/stdc++.h>
long long dp[1001][1001];
int main() {
  int k;
  scanf("%d", &k);
  dp[1][0] = 1;
  dp[1][1] = 1;
  for (int m = 2; m <= k; m++)
    for (int i = 0; i <= k - m + 2; i++)
      for (int j = 0; i + j - 1 <= k - m + 2; j++) {
        dp[m][i + j + 1] =
            (dp[m][i + j + 1] + ((dp[m - 1][i] * dp[m - 1][j]) % 1000000007)) %
            1000000007;
        dp[m][i + j] =
            (dp[m][i + j] + ((dp[m - 1][i] * dp[m - 1][j]) % 1000000007)) %
            1000000007;
        dp[m][i + j] =
            (dp[m][i + j] + (((2 * i) % 1000000007) *
                             ((dp[m - 1][i] * dp[m - 1][j]) % 1000000007)) %
                                1000000007) %
            1000000007;
        dp[m][i + j] =
            (dp[m][i + j] + (((2 * j) % 1000000007) *
                             ((dp[m - 1][i] * dp[m - 1][j]) % 1000000007)) %
                                1000000007) %
            1000000007;
        if (i + j >= 2)
          dp[m][i + j - 1] =
              (dp[m][i + j - 1] +
               (((dp[m - 1][i] * dp[m - 1][j]) % 1000000007) *
                (((i + j) * (i + j - 1)) % 1000000007) % 1000000007)) %
              1000000007;
      }
  printf("%I64d\n", dp[k][1]);
  return 0;
}
