There is a new prodigy in town and he has challenged people to a game. They have to give him an integer N and he will immediately respond with a number which has more than N factors.
What the prodigy really does is to do some complex calculations in his head to find out the smallest integer with more than N factors. However, he has a weakness - he knows to do those calculation only on numbers up to 1019, so if the answer to be reported is more than 1019, he will not be able to come up with his solution and will lose the game.
Given the integer the people give to the prodigy, you need to report whether he wins the game or not. If he wins, also output his answer.

-----Input-----
The first line of input contains T (T ≤ 25), the number of test cases. Following this are T lines, each containing an integer N (1 ≤ N ≤ 109) - the number which is given to the prodigy.

-----Output-----
Output one line per test case. If the smallest integer X with more than N factors is bigger than 1019 so that the prodigy does not win, print "lose". Otherwise print "win X" (quotes for clarity).

-----Example-----
Input:
3
3
5
12345678

Output:
win 6
win 12
lose

Difficulty: interview

Starter code:

Solutions:
divisors = [1 , 2 , 3 , 4 , 6 , 8 , 9 , 10 , 12 , 16 , 18 , 20 , 24 , 30 , 32 , 36 , 40 , 48 , 60 , 64 , 72 , 80 , 84 , 90 , 96 , 100 , 108 , 120 , 128 , 144 , 160 , 168 , 180 , 192 , 200 , 216 , 224 , 240 , 256 , 288 , 320 , 336 , 360 , 384 , 400 , 432 , 448 , 480 , 504 , 512 , 576 , 600 , 640 , 672 , 720 , 768 , 800 , 864 , 896 , 960 , 1008 , 1024 , 1152 , 1200 , 1280 , 1344 , 1440 , 1536 , 1600 , 1680 , 1728 , 1792 , 1920 , 2016 , 2048 , 2304 , 2400 , 2688 , 2880 , 3072 , 3360 , 3456 , 3584 , 3600 , 3840 , 4032 , 4096 , 4320 , 4608 , 4800 , 5040 , 5376 , 5760 , 6144 , 6720 , 6912 , 7168 , 7200 , 7680 , 8064 , 8192 , 8640 , 9216 , 10080 , 10368 , 10752 , 11520 , 12288 , 12960 , 13440 , 13824 , 14336 , 14400 , 15360 , 16128 , 16384 , 17280 , 18432 , 20160 , 20736 , 21504 , 23040 , 24576 , 25920 , 26880 , 27648 , 28672 , 28800 , 30720 , 32256 , 32768 , 34560 , 36864 , 40320 , 41472 , 43008 , 46080 , 48384 , 49152 , 51840 , 53760 , 55296 , 57600 , 61440 , 62208 , 64512 , 65536 , 69120 , 73728 , 80640 , 82944 , 86016 , 92160 , 96768 , 98304 , 103680 , 107520 , 110592 , 115200 , 122880 , 124416 , 129024 , 131072 , 138240 , 147456 , 153600 , 161280 , 165888 , 172032 , 184320 , 193536 , 196608 , 207360 , 215040 , 221184 , 230400 , 245760]
numbers = [1 , 2 , 4 , 6 , 12 , 24 , 36 , 48 , 60 , 120 , 180 , 240 , 360 , 720 , 840 , 1260 , 1680 , 2520 , 5040 , 7560 , 10080 , 15120 , 20160 , 25200 , 27720 , 45360 , 50400 , 55440 , 83160 , 110880 , 166320 , 221760 , 277200 , 332640 , 498960 , 554400 , 665280 , 720720 , 1081080 , 1441440 , 2162160 , 2882880 , 3603600 , 4324320 , 6486480 , 7207200 , 8648640 , 10810800 , 14414400 , 17297280 , 21621600 , 32432400 , 36756720 , 43243200 , 61261200 , 73513440 , 110270160 , 122522400 , 147026880 , 183783600 , 245044800 , 294053760 , 367567200 , 551350800 , 698377680 , 735134400 , 1102701600 , 1396755360 , 2095133040 , 2205403200 , 2327925600 , 2793510720 , 3491888400 , 4655851200 , 5587021440 , 6983776800 , 10475665200 , 13967553600 , 20951330400 , 27935107200 , 41902660800 , 48886437600 , 64250746560 , 73329656400 , 80313433200 , 97772875200 , 128501493120 , 146659312800 , 160626866400 , 240940299600 , 293318625600 , 321253732800 , 481880599200 , 642507465600 , 963761198400 , 1124388064800 , 1606268664000 , 1686582097200 , 1927522396800 , 2248776129600 , 3212537328000 , 3373164194400 , 4497552259200 , 6746328388800 , 8995104518400 , 9316358251200 , 13492656777600 , 18632716502400 , 26985313555200 , 27949074753600 , 32607253879200 , 46581791256000 , 48910880818800 , 55898149507200 , 65214507758400 , 93163582512000 , 97821761637600 , 130429015516800 , 195643523275200 , 260858031033600 , 288807105787200 , 391287046550400 , 577614211574400 , 782574093100800 , 866421317361600 , 1010824870255200 , 1444035528936000 , 1516237305382800 , 1732842634723200 , 2021649740510400 , 2888071057872000 , 3032474610765600 , 4043299481020800 , 6064949221531200 , 8086598962041600 , 10108248702552000 , 12129898443062400 , 18194847664593600 , 20216497405104000 , 24259796886124800 , 30324746107656000 , 36389695329187200 , 48519593772249600 , 60649492215312000 , 72779390658374400 , 74801040398884800 , 106858629141264000 , 112201560598327200 , 149602080797769600 , 224403121196654400 , 299204161595539200 , 374005201994424000 , 448806242393308800 , 673209363589963200 , 748010403988848000 , 897612484786617600 , 1122015605983272000 , 1346418727179926400 , 1795224969573235200 , 2244031211966544000 , 2692837454359852800 , 3066842656354276800 , 4381203794791824000 , 4488062423933088000 , 6133685312708553600 , 8976124847866176000 , 9200527969062830400]
t = int(input())
for x in range(0, t):
    a = int(input())
    i = 0
    for y in divisors:
        if y > a:
            print("win", numbers[i])
            break
        i = i+1
    else:
        print("lose")


arr=((1,1),(2,2),(4,3),(6,4),(12,6),(24,8),(36,9),(48,10),(60,12),(120,16),(180,18),(240,20),(360,24),(720,30),(840,32),(1260,36),(1680,40),(2520,48),(5040,60),(7560,64),(10080,72),(15120,80),(20160,84),(25200,90),(27720,96),(45360,100),(50400,108),(55440,120),(83160,128),(110880,144),(166320,160),(221760,168),(277200,180),(332640,192),(498960,200),(554400,216),(665280,224),(720720,240),(1081080,256),(1441440,288),(2162160,320),(2882880,336),(3603600,360),(4324320,384),(6486480,400),(7207200,432),(8648640,448),(10810800,480),(14414400,504),(17297280,512),(21621600,576),(32432400,600),(36756720,640),(43243200,672),(61261200,720),(73513440,768),(110270160,800),(122522400,864),(147026880,896),(183783600,960),(245044800,1008),(294053760,1024),(367567200,1152),(551350800,1200),(698377680,1280),(735134400,1344),(1102701600,1440),(1396755360,1536),(2095133040,1600),(2205403200,1680),(2327925600,1728),(2793510720,1792),(3491888400,1920),(4655851200,2016),(5587021440,2048),(6983776800,2304),(10475665200,2400),(13967553600,2688),(20951330400,2880),(27935107200,3072),(41902660800,3360),(48886437600,3456),(64250746560,3584),(73329656400,3600),(80313433200,3840),(97772875200,4032),(128501493120,4096),(146659312800,4320),(160626866400,4608),(240940299600,4800),(293318625600,5040),(321253732800,5376),(481880599200,5760),(642507465600,6144),(963761198400,6720),(1124388064800,6912),(1606268664000,7168),(1686582097200,7200),(1927522396800,7680),(2248776129600,8064),(3212537328000,8192),(3373164194400,8640),(4497552259200,9216),(6746328388800,10080),(8995104518400,10368),(9316358251200,10752),(13492656777600,11520),(18632716502400,12288),(26985313555200,12960),(27949074753600,13440),(32607253879200,13824),(46581791256000,14336),(48910880818800,14400),(55898149507200,15360),(65214507758400,16128),(93163582512000,16384),(97821761637600,17280),(130429015516800,18432),(195643523275200,20160),(260858031033600,20736),(288807105787200,21504),(391287046550400,23040),(577614211574400,24576),(782574093100800,25920),(866421317361600,26880),(1010824870255200,27648),(1444035528936000,28672),(1516237305382800,28800),(1732842634723200,30720),(2021649740510400,32256),(2888071057872000,32768),(3032474610765600,34560),(4043299481020800,36864),(6064949221531200,40320),(8086598962041600,41472),(10108248702552000,43008),(12129898443062400,46080),(18194847664593600,48384),(20216497405104000,49152),(24259796886124800,51840),(30324746107656000,53760),(36389695329187200,55296),(48519593772249600,57600),(60649492215312000,61440),(72779390658374400,62208),(74801040398884800,64512),(106858629141264000,65536),(112201560598327200,69120),(149602080797769600,73728),(224403121196654400,80640),(299204161595539200,82944),(374005201994424000,86016),(448806242393308800,92160),(673209363589963200,96768),(748010403988848000,98304),(897612484786617600,103680),(1122015605983272000,107520),(1346418727179926400,110592),(1795224969573235200,115200),(2244031211966544000,122880),
(2692837454359852800,124416),(3066842656354276800,129024),(4381203794791824000,131072),(4488062423933088000,138240),(6133685312708553600,147456),(8976124847866176000,153600),(9200527969062830400,161280));
t=int(input())
while(t!=0):
	t-=1
	num=int(input())
	if( num>=161280):
		print("lose\n", end=' ')
	else :
		for i in range(168):
			if(arr[i][1]>num):
				print("win",arr[i][0])
				break



arr=((1,1),(2,2),(4,3),(6,4),(12,6),(24,8),(36,9),(48,10),(60,12),(120,16),(180,18),(240,20),
                        (360,24),(720,30),(840,32),(1260,36),(1680,40),(2520,48),(5040,60),(7560,64),(10080,72),(15120,80),(20160,84),(25200,90),(27720,96),
                        (45360,100),(50400,108),(55440,120),(83160,128),(110880,144),(166320,160),(221760,168),(277200,180),(332640,192),(498960,200),
                        (554400,216),(665280,224),(720720,240),(1081080,256),(1441440,288),(2162160,320),(2882880,336),
                        (3603600,360),(4324320,384),(6486480,400),(7207200,432),(8648640,448),(10810800,480),(14414400,504),(17297280,512),
                        (21621600,576),(32432400,600),(36756720,640),(43243200,672),(61261200,720),(73513440,768),(110270160,800),
                        (122522400,864),(147026880,896),(183783600,960),(245044800,1008),(294053760,1024),(367567200,1152),(551350800,1200),
                        (698377680,1280),(735134400,1344),(1102701600,1440),(1396755360,1536),(2095133040,1600),(2205403200,1680),
                        (2327925600,1728),(2793510720,1792),(3491888400,1920),(4655851200,2016),(5587021440,2048),(6983776800,2304),
                        (10475665200,2400),(13967553600,2688),(20951330400,2880),(27935107200,3072),(41902660800,3360),(48886437600,3456),
                        (64250746560,3584),(73329656400,3600),(80313433200,3840),(97772875200,4032),(128501493120,4096),(146659312800,4320),
                        (160626866400,4608),(240940299600,4800),(293318625600,5040),(321253732800,5376),(481880599200,5760),(642507465600,6144),
                        (963761198400,6720),(1124388064800,6912),(1606268664000,7168),(1686582097200,7200),(1927522396800,7680),(2248776129600,8064),
                        (3212537328000,8192),(3373164194400,8640),(4497552259200,9216),(6746328388800,10080),(8995104518400,10368),(9316358251200,10752),
                        (13492656777600,11520),(18632716502400,12288),(26985313555200,12960),(27949074753600,13440),(32607253879200,13824),
                        (46581791256000,14336),(48910880818800,14400),(55898149507200,15360),(65214507758400,16128),(93163582512000,16384),
                        (97821761637600,17280),(130429015516800,18432),(195643523275200,20160),(260858031033600,20736),(288807105787200,21504),
                        (391287046550400,23040),(577614211574400,24576),(782574093100800,25920),(866421317361600,26880),(1010824870255200,27648),
                        (1444035528936000,28672),(1516237305382800,28800),(1732842634723200,30720),(2021649740510400,32256),(2888071057872000,32768),
                        (3032474610765600,34560),(4043299481020800,36864),(6064949221531200,40320),(8086598962041600,41472),(10108248702552000,43008),
                        (12129898443062400,46080),(18194847664593600,48384),(20216497405104000,49152),(24259796886124800,51840),(30324746107656000,53760),
                        (36389695329187200,55296),(48519593772249600,57600),(60649492215312000,61440),(72779390658374400,62208),(74801040398884800,64512),
                        (106858629141264000,65536),(112201560598327200,69120),(149602080797769600,73728),(224403121196654400,80640),
                        (299204161595539200,82944),(374005201994424000,86016),(448806242393308800,92160),(673209363589963200,96768),
                        (748010403988848000,98304),(897612484786617600,103680),(1122015605983272000,107520),(1346418727179926400,110592),
                        (1795224969573235200,115200),(2244031211966544000,122880),(2692837454359852800,124416),
                        (3066842656354276800,129024),(4381203794791824000,131072),(4488062423933088000,138240),(6133685312708553600,147456),
                        (8976124847866176000,153600),
                        (9200527969062830400,161280)) ;
tcase=int(eval(input()))
while(tcase):
	tcase=tcase-1
	inp=int(eval(input()))
	if(inp>=161280):
		print("lose")
	else:
		for i in range(0,168):
			if(arr[i][1]>inp):
				print("win",arr[i][0])
				break