#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
void add(int& x, int y) { ((x += y) >= MOD) && (x -= MOD); }
int mul(int x, int y) { return x * 1ll * y % MOD; }
int K;
bool read() {
  if (scanf("%d", &K) < 1) {
    return 0;
  }
  return 1;
}
const int MAXK = 400 + 10;
int dp[MAXK][MAXK];
int C[2 * MAXK][2 * MAXK];
void precalc() {
  C[0][0] = 1;
  for (int i = 1; i < 2 * MAXK; ++i) {
    C[i][0] = 1;
    for (int j = 1; j < 2 * MAXK; ++j) {
      C[i][j] = C[i - 1][j];
      add(C[i][j], C[i - 1][j - 1]);
    }
  }
}
int solve() {
  memset(dp, 0, sizeof dp);
  dp[0][0] = 1;
  for (int k = 1; k <= K; ++k) {
    for (int left_________________ = 0; left_________________ < int(MAXK);
         ++left_________________)
      for (int right_______________ = 0; right_______________ < int(MAXK);
           ++right_______________) {
        int coef = mul(dp[k - 1][left_________________],
                       dp[k - 1][right_______________]);
        if (!coef) {
          continue;
        }
        coef = mul(coef, C[left_________________ + right_______________]
                          [left_________________]);
        if (left_________________ + right_______________ < MAXK) {
          add(dp[k][left_________________ + right_______________], coef);
        }
        if (left_________________ + right_______________ + 1 < MAXK) {
          add(dp[k][left_________________ + right_______________ + 1],
              mul(coef, left_________________ + right_______________ + 1));
        }
        if (left_________________ + right_______________ < MAXK) {
          add(dp[k][left_________________ + right_______________],
              mul(coef, (left_________________ + right_______________) * 2));
        }
        if (left_________________ + right_______________ - 1 < MAXK &&
            left_________________ + right_______________ - 1 >= 0) {
          add(dp[k][left_________________ + right_______________ - 1],
              mul(coef, left_________________ + right_______________ - 1));
        }
      }
  }
  for (int i = 1; i <= 400; ++i) {
    cout << "ans[" << i << "] = " << dp[i][1] << ";" << endl;
  }
  return dp[K][1];
}
int ans[500];
int main() {
  ans[1] = 1;
  ans[2] = 9;
  ans[3] = 245;
  ans[4] = 126565;
  ans[5] = 54326037;
  ans[6] = 321837880;
  ans[7] = 323252721;
  ans[8] = 754868154;
  ans[9] = 328083248;
  ans[10] = 838314395;
  ans[11] = 220816781;
  ans[12] = 893672292;
  ans[13] = 166441208;
  ans[14] = 251255697;
  ans[15] = 114256285;
  ans[16] = 118775501;
  ans[17] = 482714697;
  ans[18] = 11784725;
  ans[19] = 460862131;
  ans[20] = 550384565;
  ans[21] = 106742050;
  ans[22] = 425241115;
  ans[23] = 626692854;
  ans[24] = 674266678;
  ans[25] = 320014275;
  ans[26] = 345949512;
  ans[27] = 527320049;
  ans[28] = 897822749;
  ans[29] = 137190263;
  ans[30] = 491039182;
  ans[31] = 810384961;
  ans[32] = 482023334;
  ans[33] = 658099864;
  ans[34] = 886790989;
  ans[35] = 845381174;
  ans[36] = 371433224;
  ans[37] = 278969124;
  ans[38] = 420088324;
  ans[39] = 696766322;
  ans[40] = 388302635;
  ans[41] = 141033366;
  ans[42] = 46387851;
  ans[43] = 932125021;
  ans[44] = 278342766;
  ans[45] = 371131134;
  ans[46] = 922501918;
  ans[47] = 110778457;
  ans[48] = 506223573;
  ans[49] = 806353719;
  ans[50] = 391845991;
  ans[51] = 923507761;
  ans[52] = 780307355;
  ans[53] = 109951115;
  ans[54] = 830090230;
  ans[55] = 605558495;
  ans[56] = 344686604;
  ans[57] = 988110893;
  ans[58] = 944684429;
  ans[59] = 715019947;
  ans[60] = 799898820;
  ans[61] = 384672708;
  ans[62] = 907325090;
  ans[63] = 758952329;
  ans[64] = 550672104;
  ans[65] = 368337206;
  ans[66] = 394915145;
  ans[67] = 401744167;
  ans[68] = 923781939;
  ans[69] = 831857516;
  ans[70] = 407845661;
  ans[71] = 329267374;
  ans[72] = 927004007;
  ans[73] = 891609656;
  ans[74] = 897919613;
  ans[75] = 481297880;
  ans[76] = 737337940;
  ans[77] = 651873737;
  ans[78] = 287246681;
  ans[79] = 973133651;
  ans[80] = 679864988;
  ans[81] = 784719328;
  ans[82] = 820504764;
  ans[83] = 875613823;
  ans[84] = 806512665;
  ans[85] = 164851642;
  ans[86] = 500228957;
  ans[87] = 951814419;
  ans[88] = 447763649;
  ans[89] = 273141670;
  ans[90] = 979349615;
  ans[91] = 964027956;
  ans[92] = 809510400;
  ans[93] = 276634497;
  ans[94] = 116631976;
  ans[95] = 426739449;
  ans[96] = 175282420;
  ans[97] = 885948162;
  ans[98] = 62270880;
  ans[99] = 974395255;
  ans[100] = 675165056;
  ans[101] = 759589968;
  ans[102] = 837957573;
  ans[103] = 931897605;
  ans[104] = 152352780;
  ans[105] = 585420109;
  ans[106] = 1772087;
  ans[107] = 333401718;
  ans[108] = 898833639;
  ans[109] = 745874265;
  ans[110] = 786209423;
  ans[111] = 691982338;
  ans[112] = 498790927;
  ans[113] = 473374639;
  ans[114] = 274302623;
  ans[115] = 971280670;
  ans[116] = 241671319;
  ans[117] = 13070005;
  ans[118] = 302088807;
  ans[119] = 550276351;
  ans[120] = 436592588;
  ans[121] = 631667314;
  ans[122] = 548656698;
  ans[123] = 730626984;
  ans[124] = 146295220;
  ans[125] = 674398632;
  ans[126] = 400383348;
  ans[127] = 454138904;
  ans[128] = 786220712;
  ans[129] = 118620797;
  ans[130] = 233440672;
  ans[131] = 217349271;
  ans[132] = 274853536;
  ans[133] = 310607544;
  ans[134] = 105221205;
  ans[135] = 769566615;
  ans[136] = 853585061;
  ans[137] = 800665807;
  ans[138] = 695377419;
  ans[139] = 924327065;
  ans[140] = 388199705;
  ans[141] = 551624811;
  ans[142] = 721435546;
  ans[143] = 501720515;
  ans[144] = 308465454;
  ans[145] = 825369234;
  ans[146] = 396065729;
  ans[147] = 451899519;
  ans[148] = 295058424;
  ans[149] = 142088952;
  ans[150] = 473485086;
  ans[151] = 378771634;
  ans[152] = 734511215;
  ans[153] = 462404399;
  ans[154] = 959198328;
  ans[155] = 337668263;
  ans[156] = 794122911;
  ans[157] = 38911400;
  ans[158] = 951992982;
  ans[159] = 472696081;
  ans[160] = 373904752;
  ans[161] = 105884826;
  ans[162] = 630251717;
  ans[163] = 28980684;
  ans[164] = 845136347;
  ans[165] = 353665773;
  ans[166] = 691661192;
  ans[167] = 19922354;
  ans[168] = 231463797;
  ans[169] = 757917231;
  ans[170] = 242739918;
  ans[171] = 979036950;
  ans[172] = 713722080;
  ans[173] = 234689388;
  ans[174] = 2243164;
  ans[175] = 209872853;
  ans[176] = 240808787;
  ans[177] = 539523346;
  ans[178] = 425797848;
  ans[179] = 913772061;
  ans[180] = 224613100;
  ans[181] = 421742777;
  ans[182] = 222232478;
  ans[183] = 92712941;
  ans[184] = 215137570;
  ans[185] = 949901408;
  ans[186] = 274827432;
  ans[187] = 15162482;
  ans[188] = 593145989;
  ans[189] = 274574232;
  ans[190] = 239282092;
  ans[191] = 762720192;
  ans[192] = 804146934;
  ans[193] = 500629424;
  ans[194] = 565985054;
  ans[195] = 81127381;
  ans[196] = 671811155;
  ans[197] = 655565571;
  ans[198] = 890331075;
  ans[199] = 237994348;
  ans[200] = 743647404;
  ans[201] = 667160634;
  ans[202] = 713914299;
  ans[203] = 668506729;
  ans[204] = 741341289;
  ans[205] = 277636808;
  ans[206] = 762781382;
  ans[207] = 14272789;
  ans[208] = 902864131;
  ans[209] = 567443405;
  ans[210] = 149113383;
  ans[211] = 648844381;
  ans[212] = 825489976;
  ans[213] = 933016723;
  ans[214] = 192288078;
  ans[215] = 734493315;
  ans[216] = 240985733;
  ans[217] = 861817693;
  ans[218] = 762711459;
  ans[219] = 525904609;
  ans[220] = 532463481;
  ans[221] = 377133989;
  ans[222] = 620711079;
  ans[223] = 772561562;
  ans[224] = 980733194;
  ans[225] = 227599811;
  ans[226] = 162774370;
  ans[227] = 209512798;
  ans[228] = 787116594;
  ans[229] = 3509258;
  ans[230] = 748795368;
  ans[231] = 378035466;
  ans[232] = 612938915;
  ans[233] = 802091952;
  ans[234] = 857679599;
  ans[235] = 481748937;
  ans[236] = 493370392;
  ans[237] = 358420805;
  ans[238] = 48301629;
  ans[239] = 412001241;
  ans[240] = 463126722;
  ans[241] = 509578422;
  ans[242] = 967799131;
  ans[243] = 994766554;
  ans[244] = 687287243;
  ans[245] = 863623583;
  ans[246] = 771554899;
  ans[247] = 690911527;
  ans[248] = 855314994;
  ans[249] = 923686429;
  ans[250] = 246862514;
  ans[251] = 192479791;
  ans[252] = 133487041;
  ans[253] = 703444043;
  ans[254] = 295281758;
  ans[255] = 801816257;
  ans[256] = 920762934;
  ans[257] = 749306433;
  ans[258] = 973004841;
  ans[259] = 848644684;
  ans[260] = 560026478;
  ans[261] = 952127278;
  ans[262] = 616654635;
  ans[263] = 839390326;
  ans[264] = 975154012;
  ans[265] = 409583672;
  ans[266] = 635350249;
  ans[267] = 343228425;
  ans[268] = 335331602;
  ans[269] = 223826406;
  ans[270] = 952341037;
  ans[271] = 589677800;
  ans[272] = 249747234;
  ans[273] = 555694261;
  ans[274] = 137143500;
  ans[275] = 628190328;
  ans[276] = 461598392;
  ans[277] = 431912756;
  ans[278] = 29349807;
  ans[279] = 759199489;
  ans[280] = 783281228;
  ans[281] = 781971312;
  ans[282] = 915823407;
  ans[283] = 388508707;
  ans[284] = 718062705;
  ans[285] = 27424111;
  ans[286] = 309999451;
  ans[287] = 963383322;
  ans[288] = 831185229;
  ans[289] = 132910888;
  ans[290] = 347028136;
  ans[291] = 850484840;
  ans[292] = 223055285;
  ans[293] = 142335980;
  ans[294] = 144754000;
  ans[295] = 772005560;
  ans[296] = 81796039;
  ans[297] = 167696020;
  ans[298] = 79454283;
  ans[299] = 172772542;
  ans[300] = 201056991;
  ans[301] = 484957644;
  ans[302] = 716630285;
  ans[303] = 763194701;
  ans[304] = 211505841;
  ans[305] = 903448791;
  ans[306] = 926964672;
  ans[307] = 257752668;
  ans[308] = 482951716;
  ans[309] = 411539070;
  ans[310] = 620249847;
  ans[311] = 592476107;
  ans[312] = 170473128;
  ans[313] = 814662613;
  ans[314] = 898000271;
  ans[315] = 57354872;
  ans[316] = 361106091;
  ans[317] = 488697643;
  ans[318] = 889007954;
  ans[319] = 138725767;
  ans[320] = 684860983;
  ans[321] = 36248116;
  ans[322] = 304610143;
  ans[323] = 137633385;
  ans[324] = 413715776;
  ans[325] = 99010024;
  ans[326] = 779653665;
  ans[327] = 100387568;
  ans[328] = 286328069;
  ans[329] = 564731826;
  ans[330] = 621740468;
  ans[331] = 943513219;
  ans[332] = 506666491;
  ans[333] = 249987886;
  ans[334] = 553719884;
  ans[335] = 769853086;
  ans[336] = 337485319;
  ans[337] = 702455584;
  ans[338] = 809637762;
  ans[339] = 755400257;
  ans[340] = 892290368;
  ans[341] = 502180086;
  ans[342] = 364275817;
  ans[343] = 118162370;
  ans[344] = 873374339;
  ans[345] = 261271695;
  ans[346] = 970132574;
  ans[347] = 744105500;
  ans[348] = 434447173;
  ans[349] = 117975095;
  ans[350] = 383088393;
  ans[351] = 625447969;
  ans[352] = 180281249;
  ans[353] = 545367713;
  ans[354] = 133236931;
  ans[355] = 360175662;
  ans[356] = 148087453;
  ans[357] = 806871297;
  ans[358] = 498529036;
  ans[359] = 886076476;
  ans[360] = 65645000;
  ans[361] = 465138299;
  ans[362] = 967109895;
  ans[363] = 331362616;
  ans[364] = 472283705;
  ans[365] = 796894900;
  ans[366] = 199697765;
  ans[367] = 503759892;
  ans[368] = 472807906;
  ans[369] = 187586706;
  ans[370] = 941198065;
  ans[371] = 782234442;
  ans[372] = 57693411;
  ans[373] = 18678611;
  ans[374] = 82626204;
  ans[375] = 395317191;
  ans[376] = 570588915;
  ans[377] = 152519440;
  ans[378] = 449852456;
  ans[379] = 63696518;
  ans[380] = 763741345;
  ans[381] = 878748386;
  ans[382] = 494317541;
  ans[383] = 444782633;
  ans[384] = 93316211;
  ans[385] = 929164666;
  ans[386] = 529288371;
  ans[387] = 165769871;
  ans[388] = 730546850;
  ans[389] = 955877127;
  ans[390] = 994202767;
  ans[391] = 492009567;
  ans[392] = 275683011;
  ans[393] = 415902127;
  ans[394] = 95725776;
  ans[395] = 718047399;
  ans[396] = 786963365;
  ans[397] = 73091278;
  ans[398] = 986172399;
  ans[399] = 174591541;
  ans[400] = 913259286;
  int x;
  cin >> x;
  cout << ans[x] << endl;
  return 0;
  precalc();
  while (read()) {
    printf("%d\n", solve());
  }
  return 0;
}
