R=range count=[[0]*26 for i in R(6)] count[1][1]=[0,1] count[1][2]=[0,2,1] count[1][3]=[0,5,2,1] count[1][4]=[0,12,5,2,1] count[1][5]=[0,28,12,5,2,1] count[1][6]=[0,64,28,12,5,2,1] count[1][7]=[0,144,64,28,12,5,2,1] count[1][8]=[0,320,144,64,28,12,5,2,1] count[1][9]=[0,704,320,144,64,28,12,5,2,1] count[1][10]=[0,1536,704,320,144,64,28,12,5,2,1] count[1][11]=[0,3328,1536,704,320,144,64,28,12,5,2,1] count[1][12]=[0,7168,3328,1536,704,320,144,64,28,12,5,2,1] count[1][13]=[0,15360,7168,3328,1536,704,320,144,64,28,12,5,2,1] count[1][14]=[0,32768,15360,7168,3328,1536,704,320,144,64,28,12,5,2,1] count[1][15]=[0,69632,32768,15360,7168,3328,1536,704,320,144,64,28,12,5,2,1] count[1][16]=[0,147456,69632,32768,15360,7168,3328,1536,704,320,144,64,28,12,5,2,1] count[1][17]=[0,311296,147456,69632,32768,15360,7168,3328,1536,704,320,144,64,28,12,5,2,1] count[1][18]=[0,655360,311296,147456,69632,32768,15360,7168,3328,1536,704,320,144,64,28,12,5,2,1] count[1][19]=[0,1376256,655360,311296,147456,69632,32768,15360,7168,3328,1536,704,320,144,64,28,12,5,2,1] count[1][20]=[0,2883584,1376256,655360,311296,147456,69632,32768,15360,7168,3328,1536,704,320,144,64,28,12,5,2,1] count[1][21]=[0,6029312,2883584,1376256,655360,311296,147456,69632,32768,15360,7168,3328,1536,704,320,144,64,28,12,5,2,1] count[1][22]=[0,12582912,6029312,2883584,1376256,655360,311296,147456,69632,32768,15360,7168,3328,1536,704,320,144,64,28,12,5,2,1] count[1][23]=[0,26214400,12582912,6029312,2883584,1376256,655360,311296,147456,69632,32768,15360,7168,3328,1536,704,320,144,64,28,12,5,2,1] count[1][24]=[0,54525952,26214400,12582912,6029312,2883584,1376256,655360,311296,147456,69632,32768,15360,7168,3328,1536,704,320,144,64,28,12,5,2,1] count[1][25]=[0,113246208,54525952,26214400,12582912,6029312,2883584,1376256,655360,311296,147456,69632,32768,15360,7168,3328,1536,704,320,144,64,28,12,5,2,1] count[2][2]=[0,8,4,4,1] count[2][3]=[0,40,17,14,10,6,1] count[2][4]=[0,192,80,64,39,28,20,8,1] count[2][5]=[0,896,368,296,184,120,81,58,34,10,1] count[2][6]=[0,4096,1664,1344,856,560,368,240,167,112,52,12,1] count[2][7]=[0,18432,7424,6016,3904,2568,1712,1112,728,488,337,198,74,14,1] count[2][8]=[0,81920,32768,26624,17536,11584,7816,5136,3384,2208,1456,992,647,324,100,16,1] count[2][9]=[0,360448,143360,116736,77824,51584,35136,23304,15520,10232,6704,4392,2936,1976,1169,498,130,18,1] count[2][10]=[0,1572864,622592,507904,342016,227328,156032,104256,70024,46640,30888,20320,13304,8784,5904,3792,1991,728,164,20,1] count[2][11]=[0,6815744,2686976,2195456,1490944,993280,686080,461184,311872,209416,139968,93048,61440,40328,26480,17624,11672,6952,3217,1022,202,22,1] count[2][12]=[0,29360128,11534336,9437184,6455296,4308992,2992128,2021376,1374592,929088,625544,419408,279656,185376,122088,80112,52888,35200,22416,12160,4967,1388,244,24,1] count[3][3]=[0,400,144,106,84,69,52,32,9,1] count[3][4]=[0,3840,1360,952,705,550,445,360,270,164,62,12,1] count[3][5]=[0,35840,12544,8720,6408,4897,3772,2972,2371,1873,1385,854,376,101,15,1] count[3][6]=[0,327680,113664,78592,57936,44456,34161,26334,20329,15846,12510,9758,7131,4478,2164,714,149,18,1] count[3][7]=[0,2949120,1015808,699392,516864,398928,308296,238385,183352,140476,108244,84130,65926,50898,36946,23558,12123,4602,1205,206,21,1] count[3][8]=[0,26214400,8978432,6160384,4561920,3537664,2748496,2136040,1652625,1269794,973997,746362,574842,446028,347449,266040,192322,124150,66909,28072,8654,1876,272,24,1] count[4][4]=[0,73728,25600,17152,11728,9040,7504,6288,5340,4436,3432,2360,1296,492,116,16,1] count[4][5]=[0,1376256,471040,314368,213248,158976,128272,105936,89480,75998,64363,53486,42473,31078,19942,10358,3972,1054,186,20,1] count[4][6]=[0,25165824,8519680,5668864,3856384,2863104,2288896,1868032,1553240,1299184,1090650,919360,774295,643000,517972,394544,274893,167464,83894,32492,9316,1920,272,24,1] count[5][5]=[0,51380224,17301504,11501568,7749632,5599232,4361216,3564416,3023760,2603088,2265120,1971974,1703398,1448460,1194986,939036,687581,454452,258314,119182,42437,11295,2192,296,25,1] H,W,K,M=map(int,input().split()) if H>W:H,W=W,H HW=H*W print(sum(pow(c,K,M)*count[H][W][c]for c in R(1,HW+1))*sum(pow(HW-n+1,-1,M)for n in R(1,HW+1))*pow(2,-HW,M)%M)