//
// APPROXIMATE LIMITS
// 05/27/15 (dkc)
//
int frac[1000]={
 0,
 -499999,
 -249999,
 -333333,
 -166666,
 -399999,
 -133332,
 -295237,
 -207142,
 -452381,
 -97618,
 -197403,
 -130519,
 -525175,
 -276972,
 -295438,
 -63901,
 -302957,
 -42008,
 -254746,
 -267484,
 -565936,
 -182567,
 -277463,
 -205690,
 -533918,
 -169837,
 -139090,
 105942,
 -131786,
 30489,
 -291106,
 -362705,
 -737334,
 -406076,
 -417678,
 -262615,
 -594038,
 -214931,
 -143520,
 127891,
 -88503,
 123677,
 -152517,
 -201438,
 -517026,
 -115222,
 -202779,
 -123672,
 -473134,
 -222596,
 -285785,
 -118202,
 -441189,
 -264176,
 -450796,
 -423133,
 -711255,
 -275242,
 -330755,
 -252934,
 -666918,
 -355093,
 -328985,
 -52875,
 -145996,
 215431,
 84318,
 188497,
 -26162,
 273465,
 80131,
 53468,
 -466347,
 -256432,
 -313187,
 -133097,
 -342618,
 -90597,
 -332253,
 -373907,
 -748893,
 -392170,
 -529426,
 -523827,
 -894693,
 -533002,
 -493153,
 -226027,
 -453288,
 -280548,
 -503410,
 -487145,
 -793457,
 -365728,
 -316946,
 -101499,
 -380893,
 -17433,
 42997,
 303426,
 68806,
 304775,
 45600,
 17188,
 -239788,
 239084,
 222624,
 372830,
 27633,
 227879,
 103808,
 194021,
 -211342,
 -143022,
 -457303,
 -530216,
 -910814,
 -554128,
 -600800,
 -514141,
 -882026,
 -512206,
 -467586,
 -181040,
 -294483,
 20636,
 -160306,
 -91246,
 -347762,
 -50440,
 -249296,
 -296640,
 -750000,
 -464549,
 -445772,
 -191696,
 -433970,
 -197984,
 -458401,
 -547391,
 -962619,
 -638416,
 -733784,
 -662492,
 -977408,
 -552598,
 -413496,
 -31156,
 -145457,
 140236,
 -70752,
 -44907,
 -332780,
 -36238,
 -126792,
 -63504,
 -497028,
 -190051,
 -210112,
 -30177,
 -260175,
 9824,
 -217109,
 -200143,
 -425594,
 89912,
 108416,
 269774,
 -30403,
 234122,
 182859,
 375781,
 71598,
 250164,
 85886,
 148871,
 -115828,
 361056,
 340728,
 453725,
 69496,
 278668,
 159969,
 280404,
 11655,
 226768,
 14082,
 46066,
 -207658,
 107038,
 -75646,
 -91664,
 -605091,
 -376257,
 -393570,
 -196596,
 -497084,
 -343031,
 -686465,
 -829900,
 -1301686,
 -1030905,
 -1173916,
 -1160061,
 -1536451,
 -1170124,
 -1122635,
 -844381,
 -996742,
 -806257,
 -1113394,
 -1175247,
 -1565741,
 -1213243,
 -1251444,
 -1122980,
 -1409261,
 -952425,
 -824349,
 -514463,
 -638962,
 -276972,
 -412750,
 -334235,
 -522382,
 32827,
 90241,
 305546,
 23043,
 314442,
 346105,
 619149,
 394338,
 631074,
 476304,
 567307,
 329201,
 696124,
 565149,
 567500,
 71932,
 258179,
 111096,
 209904,
 -34133,
 209633,
 16143,
 64603,
 -216263,
 102870,
 -76006,
 -112025,
 -582816,
 -309523,
 -287196,
 -14889,
 -240630,
 22002,
 -132350,
 -102094,
 -393671,
 59030,
 13623,
 119735,
 -166603,
 156077,
 149170,
 388534,
 129754,
 270978,
 -85958,
 -207600,
 -592970,
 -233822,
 -238310,
 -83376,
 -426639,
 -25294,
 53467,
 303667,
 55629,
 296962,
 40063,
 29642,
 -233412,
 132904,
 81097,
 195960,
 -159762,
 63832,
 -42485,
 97779,
 -260244,
 -189702,
 -512380,
 -591813,
 -974275,
 -611772,
 -690747,
 -636378,
 -1000618,
 -619826,
 -569066,
 -281466,
 -387303,
 -22558,
 -156183,
 -95003,
 -363917,
 -52192,
 -238858,
 -271669,
 -802889,
 -588882,
 -603456,
 -371195,
 -637336,
 -412927,
 -627388,
 -641851,
 -986524,
 -716298,
 -891890,
 -900817,
 -1278979,
 -911728,
 -874765,
 -593894,
 -732473,
 -507427,
 -780864,
 -807312,
 -1158091,
 -763342,
 -762640,
 -619081,
 -974032,
 -636673,
 -629703,
 -434497,
 -679169,
 -450160,
 -649729,
 -605105,
 -815550,
 -280334,
 -243686,
 -46105,
 -347101,
 -133805,
 -228209,
 -95332,
 -461036,
 -335223,
 -603764,
 -625129,
 -915402,
 -459853,
 -502919,
 -412642,
 -796066,
 -433619,
 -374214,
 -116995,
 -254296,
 100197,
 -43942,
 51037,
 -179167,
 174395,
 107477,
 201855,
 -202425,
 35001,
 5749,
 221198,
 -8985,
 189412,
 -110880,
 -221702,
 -663228,
 -358679,
 -552828,
 -580309,
 -919480,
 -512536,
 -431173,
 -102393,
 -272318,
 -73018,
 -323836,
 -360387,
 -727711,
 -348848,
 -364922,
 -229480,
 -592776,
 -209840,
 -97586,
 214666,
 28173,
 334211,
 193599,
 300511,
 140763,
 601704,
 620389,
 795918,
 472683,
 734811,
 666034,
 844837,
 602333,
 838089,
 678661,
 750003,
 490413,
 876751,
 764290,
 766105,
 269115,
 518570,
 441781,
 610272,
 402300,
 687281,
 550713,
 661819,
 493195,
 910620,
 829204,
 914462,
 500868,
 709394,
 660455,
 859211,
 604891,
 843707,
 583672,
 505458,
 141523,
 429165,
 217954,
 168890,
 -275673,
 26398,
 -2617,
 182643,
 -130984,
 -44614,
 -401691,
 -510985,
 -951405,
 -645137,
 -655348,
 -507661,
 -858876,
 -463374,
 -381595,
 -108511,
 -334342,
 -170566,
 -505710,
 -599467,
 -951297,
 -556343,
 -660315,
 -610449,
 -982754,
 -767823,
 -884104,
 -754613,
 -1069113,
 -889932,
 -1089702,
 -1087785,
 -1412917,
 -991189,
 -1068415,
 -1012308,
 -1405261,
 -1051331,
 -970691,
 -662777,
 -750745,
 -338709,
 -425646,
 -266688,
 -439003,
 -97048,
 -254067,
 -248485,
 -697265,
 -490175,
 -525505,
 -318909,
 -534845,
 -256796,
 -477754,
 -498708,
 -850997,
 -456283,
 -560570,
 -522000,
 -879463,
 -584768,
 -597750,
 -362704,
 -626683,
 -514186,
 -824395,
 -884595,
 -1260589,
 -889496,
 -914523,
 -776767,
 -1083872,
 -765504,
 -778541,
 -606958,
 -934423,
 -779121,
 -1122871,
 -1218524,
 -1542752,
 -1119827,
 -1152311,
 -1033281,
 -1392515,
 -1163068,
 -1261295,
 -1156523,
 -1502036,
 -1353168,
 -1600557,
 -1601674,
 -1934267,
 -1519642,
 -1494639,
 -1336298,
 -1677025,
 -1270515,
 -1195513,
 -885210,
 -971246,
 -661666,
 -851177,
 -792510,
 -1061714,
 -785460,
 -966561,
 -988245,
 -1433063,
 -1130595,
 -1087589,
 -796379,
 -1004276,
 -728293,
 -903120,
 -906517,
 -1195125,
 -736393,
 -776783,
 -654040,
 -927773,
 -454142,
 -266235,
 168155,
 103427,
 417644,
 232743,
 257615,
 -49082,
 271395,
 209256,
 313780,
 -80822,
 230455,
 210127,
 382902,
 132269,
 376484,
 174736,
 219551,
 18219,
 564324,
 611286,
 801094,
 532507,
 853750,
 843342,
 1076191,
 809876,
 998106,
 863654,
 977520,
 759726,
 1204144,
 1149393,
 1227970,
 807385,
 1014706,
 893669,
 1020977,
 784647,
 1043366,
 802908,
 799290,
 519825,
 830516,
 689479,
 705313,
 221968,
 486162,
 490217,
 689057,
 388714,
 583517,
 279126,
 168288,
 -261387,
 56512,
 -49329,
 -1326,
 -353326,
 42277,
 150792,
 507716,
 406773,
 648690,
 391395,
 380935,
 38742,
 444154,
 452730,
 624824,
 401316,
 836109,
 942271,
 1248433,
 1055375,
 1357638,
 1160683,
 1168695,
 916247,
 1332529,
 1249572,
 1333291,
 970171,
 1160890,
 1075128,
 1237812,
 901273,
 1060146,
 822070,
 827893,
 504949,
 811196,
 618181,
 546390,
 -24641,
 152055,
 39168,
 173264,
 -17449,
 278318,
 112319,
 194806,
 -54519,
 287192,
 181806,
 219280,
 -242498,
 43487,
 62814,
 312913,
 63731,
 310147,
 132396,
 142883,
 -178481,
 159960,
 -864,
 -3793,
 -403791,
 -160938,
 -249967,
 -94805,
 -392476,
 -307542,
 -721880,
 -887660,
 -1313194,
 -990864,
 -1065676,
 -979568,
 -1352565,
 -977708,
 -934758,
 -720381,
 -1005280,
 -828656,
 -1112900,
 -1169887,
 -1487853,
 -1057946,
 -1052376,
 -882956,
 -1212835,
 -951171,
 -1018611,
 -838860,
 -1121946,
 -1001654,
 -1217047,
 -1183834,
 -1482562,
 -1033371,
 -1083492,
 -1000271,
 -1341460,
 -972129,
 -934734,
 -648740,
 -748951,
 -394617,
 -539571,
 -486753,
 -767254,
 -455972,
 -604340,
 -588773,
 -1072515,
 -808309,
 -772689,
 -497916,
 -670904,
 -356095,
 -540630,
 -530540,
 -811952,
 -462651,
 -612650,
 -601388,
 -987423,
 -625487,
 -592855,
 -346320,
 -524347,
 -302381,
 -579746,
 -612445,
 -977126,
 -673377,
 -766984,
 -717739,
 -1167829,
 -869895,
 -861830,
 -664274,
 -966063,
 -771799,
 -1002161,
 -983841,
 -1216505,
 -701125,
 -639457,
 -411114,
 -682127,
 -485622,
 -621138,
 -507952,
 -894113,
 -791917,
 -1076808,
 -1114275,
 -1429741,
 -997127,
 -1026653,
 -933097,
 -1287688,
 -967077,
 -968320,
 -755261,
 -939656,
 -627879,
 -815471,
 -754322,
 -1025234,
 -703760,
 -807047,
 -758817,
 -1164570,
 -822197,
 -741481,
 -412003,
 -581906,
 -345799,
 -570262,
 -594725,
 -948773,
 -554698,
 -608922,
 -499002,
 -716995,
 -265043,
 -145174,
 222221,
 90237,
 358241,
 126874,
 102406,
 -254178,
 52638,
 -38100,
 28036,
 -368508,
 -16875,
 71010,
 354027,
 137652,
 417622,
 198209,
 226355,
 12090,
 429773,
 348063,
 425789,
 4097,
 175192,
 14148,
 83883,
 -249745,
 -86979,
 -321809,
 -341338,
 -683441,
 -277341,
 -370636,
 -349650,
 -811415,
 -524982,
 -570670,
 -367563,
 -533670,
 -210437,
 -276799,
 -97869,
 -251111,
 160355,
 106489,
 216952,
 -172010,
 71342,
 62076,
 300463,
 39431,
 197993,
 -142873,
 -288390,
 -712651,
 -388650,
 -564072,
 -572831,
 -979260,
 -637441,
 -609346,
 -373874,
 -587191,
 -414289,
 -696071,
 -730114,
 -1094061,
 -778388,
 -805565,
 -668354,
 -1030568,
 -644495,
 -590628,
 -354940,
 -618685,
 -453850,
 -788455,
 -905859,
 -1285405,
 -916657,
 -1047335,
 -1015866,
 -1409587,
 -1210043,
 -1313537,
 -1168151,
 -1486365,
 -1307938,
 -1527274,
 -1532332,
 -1831696,
 -1382730,
 -1400958,
 -1285844,
 -1632435,
 -1313859,
 -1274349,
 -987024,
 -1097509,
 -711298,
 -824549,
 -688895,
 -883276,
 -602925,
 -822027,
 -883236,
 -1393517,
 -1155426,
 -1179645,
 -954949,
 -1155555,
 -885565,
 -1115043,
 -1153219,
 -1523626,
 -1145664,
 -1222752,
 -1169960,
 -1506360,
 -1094380,
 -1012496,
 -689235,
 -865433,
 -654537,
 -849659,
 -795848,
 -1074294,
 -604357,
 -476657,
 -195119,
 -413039,
 2299,
 85359,
 364179,
 143523,
 419689,
 229250,
 284573,
 111331,
 604055,
 597295,
 755102,
 457700,
 728701,
 667419,
 807828,
 448748,
 580252,
 313845,
 296392,
 -13649,
 424755,
 437720,
 584007,
 246425,
 582438,
 588236,
 842993,
 699824,
 966597,
 733889,
 728447,
 425781,
 716948,
 508622,
 466961,
 -194,
 281134,
 316294,
 597355,
 378936,
 657436,
 486504,
 486989,
 157218,
 575921,
 495113,
 576922,
 260754,
 626137,
 711871,
 1016237,
 853464,
 1054325,
 755690,
 698986,
 309971,
 554745,
 401545,
 412987,
 -75068,
 185390,
 121497};