//さすが解説は天才的ですねー
#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
//#include<bits/stdc++.h>
#include<cstdio>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const int mod = 998244353;
ll modpow(ll A, ll B) {
	ll kotae = 1;
	while (B > 0) {
		if (B & 1) kotae = kotae * A % mod;
		A = A * A % mod;
		B >>= 1;
	}
	return kotae;
}

int ifac[5000001];
const int pre[10001] = { 1,777990065,766786010,512513096,705983787,734256002,244148993,533292028,210582481,688517539,215582594,14820617,129246395,150625187,86672976,764239242,21874704,57288446,850657009,774583782,638474417,128284758,786368753,472986042,103549395,495451255,264078536,433635135,625262204,766766525,185226044,35932350,902168850,455715166,218641259,972559028,640480499,206662314,683003246,923831102,876712294,724261094,408525348,763874992,547233394,109140246,300634900,256419515,371584155,276107980,832944090,540250216,893651744,936348937,326512726,516396135,843656716,776879789,359802705,356307409,949283602,121678346,755038370,144825638,398849114,243664371,157125107,752722108,971617941,787502726,951610819,720346213,481304016,361949821,680950950,387120559,575366956,411040690,816984038,668571204,187142323,552289458,722805387,993149209,318238233,904486800,968982693,875054001,578248523,925025550,271818664,509541523,500499768,929802162,849466163,523746388,268604730,311862148,211074478,804711044,373341033,683607517,262864254,899397125,903574757,408123903,570163026,387548298,136310560,757193515,492373922,16092666,218256882,33612616,184219001,645249935,348551228,835533217,302307407,641587141,70007868,840714962,797190974,744571430,180557608,554082240,483244331,924205037,933027896,760946120,890154909,803775227,605185517,868712494,835769462,401208474,689354486,226621123,96687561,38631563,501927483,483249587,593944616,998231222,23528366,842172435,357335185,725982025,398516968,269658881,797725335,59352911,184061655,193546739,303152497,61883255,98078622,195866691,996728981,446353446,796024455,885097692,915829452,732760877,97457057,251606742,829937743,367147609,907175897,989448554,748640136,168580487,42590154,482935433,768160042,31342156,39326209,654029131,72020724,47519485,542991096,876162665,577428803,188685455,233510797,422423143,544780457,613635275,137823240,55715373,97062836,437207675,578565389,794462456,122688768,964014598,148890003,428128959,278232786,996120899,45596018,7163323,387102481,258039391,515773886,830696837,604845763,539553101,384403210,949063076,849317807,630752268,210722610,773591150,869634880,109500248,32144134,224896996,642008315,169507794,283287674,219473392,422410040,174823408,288798151,140807520,497583578,863575707,355648573,272221122,561110485,253470028,580834681,587770974,112220015,850532094,33475427,498807687,317772333,409146882,596316874,331449290,335429501,670238024,900627351,14996190,733198052,307321953,844834750,829096729,400767242,769588955,98032360,560788564,292816061,468314755,983912094,328059458,549942096,45373125,417528165,901294757,895122295,151159745,297548894,203255878,752797429,911093840,496689395,629769991,78939987,459538825,406390137,6879134,257680118,396950159,129807060,715875807,553661506,390811345,191166323,810576750,213045873,942790458,758339094,899444486,309004018,633895784,128589948,937478027,212513874,174345296,62004037,591751261,649329767,366843154,926280101,432150075,354244239,659276328,834980587,136620485,948751335,633318822,299685362,867019421,267600853,697694392,173796099,133939251,167633838,168664055,455355228,509401446,914452079,440577645,29283142,556198383,482874240,923005927,914550501,892014883,550966054,375146890,259320783,391769529,226806694,768163357,300654217,694655521,844638237,661303928,422327106,355635742,489451003,137628974,980318491,361853327,645638169,336599956,688948565,638514939,153383062,889194597,536430068,893849901,923432110,315839722,49382817,516474656,248173708,403609024,833306540,338847731,986694950,790821219,197628535,285108045,285934271,811084650,104964765,243988035,674229619,993956736,147476083,824048109,791673374,111127164,710735456,308066837,815197913,520396119,92412037,174723780,843863210,222304311,70227310,745928328,40367869,201974250,393032085,247592312,302180761,495381981,900779821,42751968,130815209,110950082,445232011,650497384,752109934,369950087,309849396,190399500,497647689,353358328,459852401,546099291,671454973,367352978,623627864,100401244,892602210,941551774,871438080,513287280,28185349,21030930,44275710,449827510,712246343,36889166,383078382,912763782,209588582,66987695,640672435,956971829,371907015,714047850,982424362,437882276,454748600,468777415,226512910,761686008,418711160,679266400,372627958,797779775,242570019,602303606,983737359,585763482,940263818,910024593,182269085,662738675,615426027,638525692,446366139,68263779,710197880,222814184,532876159,24120062,707881939,705340838,809441202,482114351,45768177,722815024,897943079,728188648,339739889,364745005,808452545,151610888,987511783,394592072,407729297,52967962,680043468,502198643,938707127,20993746,222949807,531872391,810935357,892377075,154762272,84787052,486805848,317085134,992754474,195236749,21949307,780187478,413553058,879449557,330880448,81415435,108607930,341779439,784896483,620491631,153641122,534228690,846914883,610414719,232588079,436762323,984600471,75405628,263308959,639543590,265889797,133955315,209305986,554795787,428937595,941877363,184451191,923795936,49525425,312442269,437151206,78919908,325973945,579844487,398204190,422683275,595487166,194914147,918795881,69211505,380683932,530612228,634697067,709623540,897706118,22942978,281839888,735681848,25120123,882619476,174552294,668106640,641839971,777450530,655937896,29612691,76069349,832769992,277055316,877454260,115365802,87835316,262466036,79664056,536236563,425951836,278768863,475769894,90522759,307362605,63204044,648964820,931888706,954449142,938010479,325282066,209053425,396563384,761781696,408508738,591582400,829340326,348639450,905026623,860856448,437296068,435334482,291412970,343673774,828901226,901613695,992541178,920381845,302843711,566172771,736189313,783990843,184030082,33617073,439331499,611136185,574497345,90817591,306143980,945501487,362805859,74284790,641726342,522692857,775884194,549727729,444956677,545075287,892463752,90265520,916637957,178236658,980812214,59569691,932392802,488131279,861287555,954672905,419328334,442819817,357758244,887478702,984290034,939144003,70714661,485961375,177417145,162118962,168070756,174913840,982318186,650727215,846359719,984640166,823933073,243009290,152990121,535790194,842333964,57092875,671223531,933222015,271959156,288003384,421390300,835225795,394537809,243155841,856810726,671154973,919875491,265924126,79436106,994247829,183378915,532312977,641156343,576069340,704676636,14554181,6523850,393621207,962151282,554820476,606567566,540585991,269714976,420527242,902506476,79339328,938346178,906937168,714916297,950663746,924948492,93383124,742471102,96868329,289622464,511596111,892814818,404369049,409642870,925142075,388844266,695178051,924307790,769870823,258352801,37319493,656535362,942160874,643592487,159647979,459668470,339174706,60288630,749230429,137386012,142128101,741523026,932249458,133685955,848166191,971938720,690816329,693509216,256408885,839738215,939641949,589638571,25469448,932714644,275884954,440367728,901736665,872587068,897787042,837977995,499710224,189498332,636546695,512005440,220288536,368285012,522130486,112567128,173590818,787664831,463296900,963431830,585289222,414700630,530772554,520800955,27834666,632926830,108265239,130127802,406984354,885533900,267599206,846568716,925571632,361045177,455835455,631901425,582383970,397418490,902263780,279768062,684207567,555876879,213169731,993545710,281195933,354016936,417452790,325049825,372247494,913454812,229684453,11625560,557539657,158714984,396403031,362573159,559048195,305476857,280520923,172808824,618589023,957745517,507362338,183892698,536827111,136820615,161184916,581288683,788080221,379731237,970234708,512908572,911557655,693532380,75693974,743612959,293425406,460742607,841929891,478466605,131340979,941426392,96506146,734531144,954715348,258071636,267285258,157361051,634098066,847501174,291172701,823316612,287824262,290717927,321615349,597704882,407060168,100064711,40000658,640920375,910618969,5182489,548235654,969546889,238062370,516021134,147732413,370659533,833655840,649202504,283787677,544385077,533215075,245880234,995321109,504089062,527440767,806954080,237670639,972424792,544700093,154025540,542342152,523089929,946800898,320483244,401371823,78384996,62174429,258433535,553295948,127143445,564154450,413488441,991069498,392441240,824132912,514921452,123644879,692841184,618623956,565158616,58529238,150117976,71490068,699156339,333263606,921371650,217507999,741546202,724472787,964898806,817920986,582096713,559153778,903819609,215291535,534168349,488985182,844145821,935050600,371603787,757869745,268970995,792449869,803557966,235112752,659275014,826634010,351488455,176734098,263260251,785552216,299003958,208080760,569058617,360532390,386399723,398762201,33272509,497218769,522181848,976622995,260131094,982778284,77371871,395349740,390214653,531854347,493975992,678229473,574409531,95826270,992726917,458437396,619632461,205161868,549830743,223515902,178482990,310282069,219230309,602291763,929072996,593463923,527802328,636498474,823705589,83857087,778669244,941456377,73301964,898657754,509912480,938900018,435397704,519619493,735044665,265835960,559201172,239826028,312119351,739353209,103208090,135132726,784824707,232832650,736566311,391931702,394509768,469195547,590383266,897215155,458515558,373585170,158729077,952125022,711761227,868405413,226589812,677030475,648757054,454752913,592350159,754968001,137896269,14566430,858673333,60435539,930609495,947940003,321611846,402349796,352034025,951901408,484084529,740021117,952069554,541638394,357815063,74405887,350552020,776016487,155552075,881994814,90947222,26360681,846511130,346814021,447948726,11819857,378653079,716353332,696316282,56457542,302941700,371036503,124047029,390868579,84411314,33882493,204021054,580753084,652653069,601390003,135041016,492401516,817288138,201876905,449498406,264348632,965482620,138310,207110730,107364155,669232095,139014676,180671118,556369147,199407219,671144270,58468077,73314446,890418474,428534311,925456411,262608571,349636135,295201906 };

int main() {
	//cin.tie(0);
	//ios::sync_with_stdio(false);

	int N;
	scanf("%d", &N);

	int N2 = N / 2;
	ll facN = pre[N / 10000];
	int n = N / 10000 * 10000;
	for (int i = n + 1; i <= n + N % 10000; i++) facN = facN * i % mod;
	ifac[0] = modpow(facN, mod - 2);
	rep(i, N2) ifac[i + 1] = (ll)ifac[i] * (N - i) % mod;


	ll kotae = modpow(3, N);
	const int inv2 = 499122177;

	ll hiku = 0;
	ll k = modpow(2, N2 - 1) * ifac[N2] * 2 % mod;
	rep(i, N2) {
		k = k * inv2 % mod;
		k = k * (N2 - i) % mod;
		hiku += ifac[N2 - i - 1] * k % mod;
	}
	hiku = hiku % mod * facN * 2 % mod;
	printf("%lld", (kotae - hiku + mod) % mod);

	Would you please return 0;
}

Measured memory_bytes: 19712