diff --git a/public/images/updates/scientific_notation.png b/public/images/updates/scientific_notation.png new file mode 100644 index 00000000..a4075a9c Binary files /dev/null and b/public/images/updates/scientific_notation.png differ diff --git a/src/App.svelte b/src/App.svelte index a0f1b66c..7d99431b 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -96,7 +96,7 @@ const apiUrl = window.location.origin; - const currentVersion = 20240818; + const currentVersion = 20240824; const tutorialHash = "hUts8q3sKUqJGFUwSdL5ZS"; const termsVersion = 20240110; diff --git a/src/KeyboardShortcuts.svelte b/src/KeyboardShortcuts.svelte index 25e789f8..2a3657e1 100644 --- a/src/KeyboardShortcuts.svelte +++ b/src/KeyboardShortcuts.svelte @@ -52,6 +52,10 @@ / Divide + + {modifier} + E + Insert *10^ for scientific notation + < then = Insert less than or equal to symbol (≤) diff --git a/src/MathField.svelte b/src/MathField.svelte index f2f88d46..53fe3a0e 100644 --- a/src/MathField.svelte +++ b/src/MathField.svelte @@ -70,45 +70,65 @@ } function handleKeyDown(e: KeyboardEvent) { - if (e.key === 'Tab' && !e.shiftKey) { - e.preventDefault(); - let hasPlaceholder = false; - let startingPosition: number | undefined; - if ( !mathLiveField.value.includes('placeholder') ) { - startingPosition = mathLiveField.position; - mathLiveField.executeCommand('moveAfterParent'); - } else { - hasPlaceholder = true - } - if (hasPlaceholder || startingPosition === mathLiveField.position) { - mathLiveField.executeCommand('moveToNextPlaceholder'); - } - } else if (e.key === '|') { - e.preventDefault(); - mathLiveField.executeCommand(['insert', '|']); - } else if (e.key === 'Enter') { - if (!mathLiveField.shadowRoot.querySelector(".ui-menu-container")) { + switch (e.key) { + case 'Tab': + if(!e.shiftKey) { + e.preventDefault(); + let hasPlaceholder = false; + let startingPosition: number | undefined; + if ( !mathLiveField.value.includes('placeholder') ) { + startingPosition = mathLiveField.position; + mathLiveField.executeCommand('moveAfterParent'); + } else { + hasPlaceholder = true + } + if (hasPlaceholder || startingPosition === mathLiveField.position) { + mathLiveField.executeCommand('moveToNextPlaceholder'); + } + } + break; + case '|': e.preventDefault(); - if ($activeMathField?.pendingNewLatex && !e.shiftKey && !e[$modifierKey]) { - $activeMathField.setPendingLatex(); - } else if(e.shiftKey) { - dispatch('shiftEnter'); - } else if(e[$modifierKey]) { - dispatch('modifierEnter'); - } else { - dispatch('enter'); + mathLiveField.executeCommand(['insert', '|']); + break; + case 'Enter': + if (!mathLiveField.shadowRoot.querySelector(".ui-menu-container")) { + e.preventDefault(); + if ($activeMathField?.pendingNewLatex && !e.shiftKey && !e[$modifierKey]) { + $activeMathField.setPendingLatex(); + } else if(e.shiftKey) { + dispatch('shiftEnter'); + } else if(e[$modifierKey]) { + dispatch('modifierEnter'); + } else { + dispatch('enter'); + } } - } - } else if (e.key === '*' && e[$modifierKey]) { - e.preventDefault(); - mathLiveField.executeCommand(['insert', '\\times']); - } else if (e.key === "'") { - e.preventDefault(); - mathLiveField.executeCommand(['insert', '^{\\mathrm{T}}']); - } else if (e.key === "F10" && e.shiftKey) { - e.preventDefault(); - //@ts-ignore - mathLiveField.showMenu(); + break; + case '*': + if (e[$modifierKey]) { + e.preventDefault(); + mathLiveField.executeCommand(['insert', '\\times']); + } + break; + case "'": + e.preventDefault(); + mathLiveField.executeCommand(['insert', '^{\\mathrm{T}}']); + break; + case "F10": + if(e.shiftKey) { + e.preventDefault(); + //@ts-ignore + mathLiveField.showMenu(); + } + break; + case "e": + case "E": + if (e[$modifierKey]) { + e.preventDefault(); + mathLiveField.executeCommand(['insert', '#@\\cdot10^{#?}']); + } + break; } } diff --git a/src/Updates.svelte b/src/Updates.svelte index 0decdf2c..0523d5c0 100644 --- a/src/Updates.svelte +++ b/src/Updates.svelte @@ -16,6 +16,23 @@ } +August 24, 2024 +

Scientific Notation Improvements

+

+ A frequent point of confusion was the lack of support for units immediately following + a number expressed in scientific notation. Units now work as expected when used with + scientific notation (see image below). Additionally, the {modifier}-E keyboard shortcut + can be used to insert scientific notation and a new scientific notation button has been + added to the virtual keyboard. +

+
+

+ New scientific notation with units support: + Math cell shown with scientific notation number with units +

+ +
+ August 18, 2024

New Show Intermediate Results Feature

diff --git a/src/keyboard/Keyboard.ts b/src/keyboard/Keyboard.ts index c2f4d9f1..60d2a837 100644 --- a/src/keyboard/Keyboard.ts +++ b/src/keyboard/Keyboard.ts @@ -508,7 +508,7 @@ export const keyboards: Keyboards = { new Button({ buttonText: '=', content: '=', command: "typedText" }), new Button({ buttonText: '+', content: '+', command: "typedText" }), new Blank('0.25fr'), - new Button({ buttonText: ',', content: ',', command: "typedText" }), + new Button({ buttonText: '\\cdot 10^{\\mathrm{x}}', content: '#@\\cdot10^{#?}' }), new Button({ buttonText: 'x_a', content: '#@_{#?}' }), new Button({ buttonText: '\\approx', content: '\\approx' }) ]] diff --git a/src/parser/LatexLexer.g4 b/src/parser/LatexLexer.g4 index fac4becf..eb743d77 100644 --- a/src/parser/LatexLexer.g4 +++ b/src/parser/LatexLexer.g4 @@ -97,7 +97,8 @@ fragment IDENTIFIER : [a-zA-Z] [a-zA-Z0-9]*; fragment -EXP : ('E' | 'e') ('+' | '-')? DIGIT+ ; +EXP : ('E' | 'e' ) ('+' | '-')? DIGIT+ + | ' '* ( CMD_CDOT | CMD_TIMES) ' '* '10' CARET ( DIGIT | ( L_BRACE ('+' | '-')? DIGIT+ R_BRACE) ); fragment GREEK_CHAR: '\\' ('alpha' | 'beta' | 'gamma' | 'delta' | 'epsilon' | 'zeta' | diff --git a/src/parser/LatexLexer.ts b/src/parser/LatexLexer.ts index b4c4daed..c9ce36ab 100644 --- a/src/parser/LatexLexer.ts +++ b/src/parser/LatexLexer.ts @@ -235,7 +235,7 @@ export default class LatexLexer extends Lexer { public get modeNames(): string[] { return LatexLexer.modeNames; } - public static readonly _serializedATN: number[] = [4,0,97,1040,6,-1,6,-1, + public static readonly _serializedATN: number[] = [4,0,97,1076,6,-1,6,-1, 2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8, 2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16, 7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7, @@ -283,7 +283,10 @@ export default class LatexLexer extends Lexer { 61,12,61,620,1,61,3,61,624,8,61,1,61,4,61,627,8,61,11,61,12,61,628,1,61, 3,61,632,8,61,3,61,634,8,61,1,62,1,62,1,63,1,63,5,63,640,8,63,10,63,12, 63,643,9,63,1,64,1,64,3,64,647,8,64,1,64,4,64,650,8,64,11,64,12,64,651, - 1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1, + 1,64,5,64,655,8,64,10,64,12,64,658,9,64,1,64,1,64,3,64,662,8,64,1,64,5, + 64,665,8,64,10,64,12,64,668,9,64,1,64,1,64,1,64,1,64,1,64,1,64,1,64,3,64, + 677,8,64,1,64,4,64,680,8,64,11,64,12,64,681,1,64,1,64,3,64,686,8,64,3,64, + 688,8,64,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1, 65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65, 1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1, 65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65, @@ -292,295 +295,307 @@ export default class LatexLexer extends Lexer { 1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1, 65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65, 1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1, - 65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,3,65,794,8,65,1,66,1,66, + 65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,1,65,3,65,830,8,65, 1,66,1,66,1,66,1,66,1,66,1,66,1,66,1,66,1,66,1,66,1,66,1,66,1,66,1,66,1, - 67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,68, - 1,68,1,69,1,69,1,69,1,70,5,70,832,8,70,10,70,12,70,835,9,70,1,70,1,70,1, - 70,1,70,4,70,841,8,70,11,70,12,70,842,1,70,1,70,5,70,847,8,70,10,70,12, - 70,850,9,70,1,70,1,70,3,70,854,8,70,1,71,1,71,1,71,1,71,1,72,1,72,3,72, - 862,8,72,1,72,3,72,865,8,72,1,73,4,73,868,8,73,11,73,12,73,869,1,73,1,73, - 1,74,1,74,1,74,1,74,1,74,1,75,1,75,1,75,1,75,1,75,1,76,1,76,1,76,1,76,1, - 77,1,77,1,78,1,78,1,78,1,78,1,79,1,79,1,79,1,79,1,79,1,79,1,79,1,79,1,79, - 1,79,1,80,1,80,1,80,1,80,1,80,1,80,1,81,1,81,1,81,1,81,1,81,1,81,1,81,5, - 81,917,8,81,10,81,12,81,920,9,81,1,81,1,81,1,81,1,82,1,82,1,82,1,82,1,82, - 1,82,1,83,1,83,1,83,1,83,1,83,1,83,1,83,1,84,1,84,1,84,1,84,1,84,1,84,1, - 85,1,85,1,86,1,86,1,87,1,87,5,87,950,8,87,10,87,12,87,953,9,87,1,88,1,88, - 1,89,1,89,1,90,1,90,1,91,1,91,1,92,1,92,1,93,3,93,966,8,93,1,93,4,93,969, - 8,93,11,93,12,93,970,1,93,1,93,5,93,975,8,93,10,93,12,93,978,9,93,1,93, - 3,93,981,8,93,1,93,1,93,4,93,985,8,93,11,93,12,93,986,1,93,3,93,990,8,93, - 1,93,4,93,993,8,93,11,93,12,93,994,3,93,997,8,93,1,94,1,94,1,95,1,95,1, - 95,1,95,1,95,1,95,1,95,1,95,1,96,1,96,1,96,1,96,1,96,1,96,1,96,1,96,1,96, - 1,97,4,97,1019,8,97,11,97,12,97,1020,1,97,1,97,1,98,1,98,1,98,1,98,1,98, - 1,99,1,99,1,99,1,99,1,99,1,100,1,100,1,100,1,100,1,101,1,101,1,538,0,102, - 2,1,4,2,6,3,8,4,10,5,12,6,14,7,16,8,18,9,20,10,22,11,24,12,26,13,28,14, - 30,15,32,16,34,17,36,18,38,19,40,20,42,21,44,22,46,23,48,24,50,25,52,26, - 54,27,56,28,58,29,60,30,62,31,64,32,66,33,68,34,70,35,72,36,74,37,76,38, - 78,39,80,40,82,41,84,42,86,43,88,44,90,45,92,46,94,47,96,48,98,49,100,50, - 102,51,104,52,106,53,108,54,110,55,112,56,114,57,116,58,118,59,120,60,122, - 61,124,62,126,0,128,0,130,0,132,0,134,63,136,64,138,65,140,66,142,67,144, - 68,146,69,148,70,150,71,152,72,154,73,156,74,158,75,160,76,162,77,164,78, - 166,79,168,80,170,81,172,82,174,83,176,84,178,85,180,86,182,87,184,88,186, - 89,188,90,190,0,192,91,194,92,196,93,198,94,200,95,202,96,204,97,2,0,1, - 8,1,0,32,32,1,0,48,57,2,0,65,90,97,122,1,0,115,115,3,0,48,57,65,90,97,122, - 2,0,69,69,101,101,2,0,43,43,45,45,3,0,9,10,13,13,32,32,1111,0,2,1,0,0,0, - 0,4,1,0,0,0,0,6,1,0,0,0,0,8,1,0,0,0,0,10,1,0,0,0,0,12,1,0,0,0,0,14,1,0, - 0,0,0,16,1,0,0,0,0,18,1,0,0,0,0,20,1,0,0,0,0,22,1,0,0,0,0,24,1,0,0,0,0, - 26,1,0,0,0,0,28,1,0,0,0,0,30,1,0,0,0,0,32,1,0,0,0,0,34,1,0,0,0,0,36,1,0, - 0,0,0,38,1,0,0,0,0,40,1,0,0,0,0,42,1,0,0,0,0,44,1,0,0,0,0,46,1,0,0,0,0, - 48,1,0,0,0,0,50,1,0,0,0,0,52,1,0,0,0,0,54,1,0,0,0,0,56,1,0,0,0,0,58,1,0, - 0,0,0,60,1,0,0,0,0,62,1,0,0,0,0,64,1,0,0,0,0,66,1,0,0,0,0,68,1,0,0,0,0, - 70,1,0,0,0,0,72,1,0,0,0,0,74,1,0,0,0,0,76,1,0,0,0,0,78,1,0,0,0,0,80,1,0, - 0,0,0,82,1,0,0,0,0,84,1,0,0,0,0,86,1,0,0,0,0,88,1,0,0,0,0,90,1,0,0,0,0, - 92,1,0,0,0,0,94,1,0,0,0,0,96,1,0,0,0,0,98,1,0,0,0,0,100,1,0,0,0,0,102,1, - 0,0,0,0,104,1,0,0,0,0,106,1,0,0,0,0,108,1,0,0,0,0,110,1,0,0,0,0,112,1,0, - 0,0,0,114,1,0,0,0,0,116,1,0,0,0,0,118,1,0,0,0,0,120,1,0,0,0,0,122,1,0,0, - 0,0,124,1,0,0,0,0,134,1,0,0,0,0,136,1,0,0,0,0,138,1,0,0,0,0,140,1,0,0,0, - 0,142,1,0,0,0,0,144,1,0,0,0,0,146,1,0,0,0,0,148,1,0,0,0,0,150,1,0,0,0,0, - 152,1,0,0,0,0,154,1,0,0,0,0,156,1,0,0,0,1,158,1,0,0,0,1,160,1,0,0,0,1,162, - 1,0,0,0,1,164,1,0,0,0,1,166,1,0,0,0,1,168,1,0,0,0,1,170,1,0,0,0,1,172,1, - 0,0,0,1,174,1,0,0,0,1,176,1,0,0,0,1,178,1,0,0,0,1,180,1,0,0,0,1,182,1,0, - 0,0,1,184,1,0,0,0,1,186,1,0,0,0,1,188,1,0,0,0,1,192,1,0,0,0,1,194,1,0,0, - 0,1,196,1,0,0,0,1,198,1,0,0,0,1,200,1,0,0,0,1,202,1,0,0,0,1,204,1,0,0,0, - 2,206,1,0,0,0,4,210,1,0,0,0,6,220,1,0,0,0,8,222,1,0,0,0,10,224,1,0,0,0, - 12,226,1,0,0,0,14,228,1,0,0,0,16,230,1,0,0,0,18,239,1,0,0,0,20,241,1,0, - 0,0,22,243,1,0,0,0,24,247,1,0,0,0,26,252,1,0,0,0,28,265,1,0,0,0,30,279, - 1,0,0,0,32,293,1,0,0,0,34,301,1,0,0,0,36,307,1,0,0,0,38,322,1,0,0,0,40, - 328,1,0,0,0,42,335,1,0,0,0,44,341,1,0,0,0,46,355,1,0,0,0,48,360,1,0,0,0, - 50,368,1,0,0,0,52,381,1,0,0,0,54,395,1,0,0,0,56,397,1,0,0,0,58,415,1,0, - 0,0,60,419,1,0,0,0,62,423,1,0,0,0,64,427,1,0,0,0,66,431,1,0,0,0,68,435, - 1,0,0,0,70,439,1,0,0,0,72,446,1,0,0,0,74,453,1,0,0,0,76,460,1,0,0,0,78, - 465,1,0,0,0,80,470,1,0,0,0,82,475,1,0,0,0,84,480,1,0,0,0,86,483,1,0,0,0, - 88,487,1,0,0,0,90,500,1,0,0,0,92,514,1,0,0,0,94,528,1,0,0,0,96,545,1,0, - 0,0,98,556,1,0,0,0,100,568,1,0,0,0,102,573,1,0,0,0,104,575,1,0,0,0,106, - 577,1,0,0,0,108,579,1,0,0,0,110,581,1,0,0,0,112,583,1,0,0,0,114,585,1,0, - 0,0,116,589,1,0,0,0,118,593,1,0,0,0,120,595,1,0,0,0,122,598,1,0,0,0,124, - 633,1,0,0,0,126,635,1,0,0,0,128,637,1,0,0,0,130,644,1,0,0,0,132,653,1,0, - 0,0,134,795,1,0,0,0,136,811,1,0,0,0,138,825,1,0,0,0,140,827,1,0,0,0,142, - 853,1,0,0,0,144,855,1,0,0,0,146,861,1,0,0,0,148,867,1,0,0,0,150,873,1,0, - 0,0,152,878,1,0,0,0,154,883,1,0,0,0,156,887,1,0,0,0,158,889,1,0,0,0,160, - 893,1,0,0,0,162,903,1,0,0,0,164,909,1,0,0,0,166,924,1,0,0,0,168,930,1,0, - 0,0,170,937,1,0,0,0,172,943,1,0,0,0,174,945,1,0,0,0,176,947,1,0,0,0,178, - 954,1,0,0,0,180,956,1,0,0,0,182,958,1,0,0,0,184,960,1,0,0,0,186,962,1,0, - 0,0,188,996,1,0,0,0,190,998,1,0,0,0,192,1000,1,0,0,0,194,1008,1,0,0,0,196, - 1018,1,0,0,0,198,1024,1,0,0,0,200,1029,1,0,0,0,202,1034,1,0,0,0,204,1038, - 1,0,0,0,206,207,5,91,0,0,207,208,1,0,0,0,208,209,6,0,0,0,209,3,1,0,0,0, - 210,211,5,92,0,0,211,212,5,108,0,0,212,213,5,98,0,0,213,214,5,114,0,0,214, - 215,5,97,0,0,215,216,5,99,0,0,216,217,5,107,0,0,217,218,1,0,0,0,218,219, - 6,1,0,0,219,5,1,0,0,0,220,221,5,59,0,0,221,7,1,0,0,0,222,223,5,123,0,0, - 223,9,1,0,0,0,224,225,5,125,0,0,225,11,1,0,0,0,226,227,5,40,0,0,227,13, - 1,0,0,0,228,229,5,41,0,0,229,15,1,0,0,0,230,231,5,124,0,0,231,17,1,0,0, - 0,232,233,5,124,0,0,233,240,5,124,0,0,234,235,5,92,0,0,235,236,5,86,0,0, - 236,237,5,101,0,0,237,238,5,114,0,0,238,240,5,116,0,0,239,232,1,0,0,0,239, - 234,1,0,0,0,240,19,1,0,0,0,241,242,5,95,0,0,242,21,1,0,0,0,243,244,5,92, - 0,0,244,245,5,112,0,0,245,246,5,105,0,0,246,23,1,0,0,0,247,248,5,92,0,0, - 248,249,5,105,0,0,249,250,5,110,0,0,250,251,5,116,0,0,251,25,1,0,0,0,252, - 253,5,92,0,0,253,254,5,105,0,0,254,255,5,110,0,0,255,256,5,116,0,0,256, - 260,1,0,0,0,257,259,7,0,0,0,258,257,1,0,0,0,259,262,1,0,0,0,260,258,1,0, - 0,0,260,261,1,0,0,0,261,263,1,0,0,0,262,260,1,0,0,0,263,264,5,95,0,0,264, - 27,1,0,0,0,265,266,5,92,0,0,266,267,5,105,0,0,267,268,5,110,0,0,268,269, - 5,116,0,0,269,273,1,0,0,0,270,272,7,0,0,0,271,270,1,0,0,0,272,275,1,0,0, - 0,273,271,1,0,0,0,273,274,1,0,0,0,274,276,1,0,0,0,275,273,1,0,0,0,276,277, - 5,95,0,0,277,278,7,1,0,0,278,29,1,0,0,0,279,280,5,92,0,0,280,281,5,105, - 0,0,281,282,5,110,0,0,282,283,5,116,0,0,283,287,1,0,0,0,284,286,7,0,0,0, - 285,284,1,0,0,0,286,289,1,0,0,0,287,285,1,0,0,0,287,288,1,0,0,0,288,290, - 1,0,0,0,289,287,1,0,0,0,290,291,5,95,0,0,291,292,7,2,0,0,292,31,1,0,0,0, - 293,294,5,92,0,0,294,295,5,109,0,0,295,296,5,97,0,0,296,297,5,116,0,0,297, - 298,5,104,0,0,298,299,5,114,0,0,299,300,5,109,0,0,300,33,1,0,0,0,301,302, - 5,92,0,0,302,303,5,102,0,0,303,304,5,114,0,0,304,305,5,97,0,0,305,306,5, - 99,0,0,306,35,1,0,0,0,307,308,5,92,0,0,308,309,5,102,0,0,309,310,5,114, - 0,0,310,311,5,97,0,0,311,312,5,99,0,0,312,316,1,0,0,0,313,315,7,0,0,0,314, - 313,1,0,0,0,315,318,1,0,0,0,316,314,1,0,0,0,316,317,1,0,0,0,317,319,1,0, - 0,0,318,316,1,0,0,0,319,320,7,1,0,0,320,321,7,1,0,0,321,37,1,0,0,0,322, - 323,5,92,0,0,323,324,5,99,0,0,324,325,5,100,0,0,325,326,5,111,0,0,326,327, - 5,116,0,0,327,39,1,0,0,0,328,329,5,92,0,0,329,330,5,116,0,0,330,331,5,105, - 0,0,331,332,5,109,0,0,332,333,5,101,0,0,333,334,5,115,0,0,334,41,1,0,0, - 0,335,336,5,92,0,0,336,337,5,115,0,0,337,338,5,113,0,0,338,339,5,114,0, - 0,339,340,5,116,0,0,340,43,1,0,0,0,341,342,5,92,0,0,342,343,5,115,0,0,343, - 344,5,113,0,0,344,345,5,114,0,0,345,346,5,116,0,0,346,350,1,0,0,0,347,349, - 7,0,0,0,348,347,1,0,0,0,349,352,1,0,0,0,350,348,1,0,0,0,350,351,1,0,0,0, - 351,353,1,0,0,0,352,350,1,0,0,0,353,354,7,1,0,0,354,45,1,0,0,0,355,356, - 5,92,0,0,356,357,5,115,0,0,357,358,5,105,0,0,358,359,5,109,0,0,359,47,1, - 0,0,0,360,361,5,92,0,0,361,362,5,97,0,0,362,363,5,112,0,0,363,364,5,112, - 0,0,364,365,5,114,0,0,365,366,5,111,0,0,366,367,5,120,0,0,367,49,1,0,0, - 0,368,369,5,92,0,0,369,370,5,112,0,0,370,371,5,108,0,0,371,372,5,97,0,0, - 372,373,5,99,0,0,373,374,5,101,0,0,374,375,5,104,0,0,375,376,5,111,0,0, - 376,377,5,108,0,0,377,378,5,100,0,0,378,379,5,101,0,0,379,380,5,114,0,0, - 380,51,1,0,0,0,381,382,5,94,0,0,382,383,5,123,0,0,383,384,5,92,0,0,384, - 385,5,109,0,0,385,386,5,97,0,0,386,387,5,116,0,0,387,388,5,104,0,0,388, - 389,5,114,0,0,389,390,5,109,0,0,390,391,5,123,0,0,391,392,5,84,0,0,392, - 393,5,125,0,0,393,394,5,125,0,0,394,53,1,0,0,0,395,396,5,92,0,0,396,55, - 1,0,0,0,397,398,5,97,0,0,398,399,5,115,0,0,399,403,1,0,0,0,400,404,5,32, - 0,0,401,402,5,92,0,0,402,404,5,58,0,0,403,400,1,0,0,0,403,401,1,0,0,0,404, - 405,1,0,0,0,405,403,1,0,0,0,405,406,1,0,0,0,406,407,1,0,0,0,407,408,5,108, - 0,0,408,409,5,105,0,0,409,410,5,110,0,0,410,411,5,101,0,0,411,413,1,0,0, - 0,412,414,7,3,0,0,413,412,1,0,0,0,413,414,1,0,0,0,414,57,1,0,0,0,415,416, - 5,115,0,0,416,417,5,105,0,0,417,418,5,110,0,0,418,59,1,0,0,0,419,420,5, - 99,0,0,420,421,5,111,0,0,421,422,5,115,0,0,422,61,1,0,0,0,423,424,5,116, - 0,0,424,425,5,97,0,0,425,426,5,110,0,0,426,63,1,0,0,0,427,428,5,99,0,0, - 428,429,5,111,0,0,429,430,5,116,0,0,430,65,1,0,0,0,431,432,5,115,0,0,432, - 433,5,101,0,0,433,434,5,99,0,0,434,67,1,0,0,0,435,436,5,99,0,0,436,437, - 5,115,0,0,437,438,5,99,0,0,438,69,1,0,0,0,439,440,5,97,0,0,440,441,5,114, - 0,0,441,442,5,99,0,0,442,443,5,115,0,0,443,444,5,105,0,0,444,445,5,110, - 0,0,445,71,1,0,0,0,446,447,5,97,0,0,447,448,5,114,0,0,448,449,5,99,0,0, - 449,450,5,99,0,0,450,451,5,111,0,0,451,452,5,115,0,0,452,73,1,0,0,0,453, - 454,5,97,0,0,454,455,5,114,0,0,455,456,5,99,0,0,456,457,5,116,0,0,457,458, - 5,97,0,0,458,459,5,110,0,0,459,75,1,0,0,0,460,461,5,115,0,0,461,462,5,105, - 0,0,462,463,5,110,0,0,463,464,5,104,0,0,464,77,1,0,0,0,465,466,5,99,0,0, - 466,467,5,111,0,0,467,468,5,115,0,0,468,469,5,104,0,0,469,79,1,0,0,0,470, - 471,5,116,0,0,471,472,5,97,0,0,472,473,5,110,0,0,473,474,5,104,0,0,474, - 81,1,0,0,0,475,476,5,99,0,0,476,477,5,111,0,0,477,478,5,116,0,0,478,479, - 5,104,0,0,479,83,1,0,0,0,480,481,5,108,0,0,481,482,5,110,0,0,482,85,1,0, - 0,0,483,484,5,108,0,0,484,485,5,111,0,0,485,486,5,103,0,0,486,87,1,0,0, - 0,487,488,5,92,0,0,488,489,5,108,0,0,489,490,5,111,0,0,490,491,5,103,0, - 0,491,495,1,0,0,0,492,494,7,0,0,0,493,492,1,0,0,0,494,497,1,0,0,0,495,493, - 1,0,0,0,495,496,1,0,0,0,496,498,1,0,0,0,497,495,1,0,0,0,498,499,5,95,0, - 0,499,89,1,0,0,0,500,501,5,92,0,0,501,502,5,108,0,0,502,503,5,111,0,0,503, - 504,5,103,0,0,504,508,1,0,0,0,505,507,7,0,0,0,506,505,1,0,0,0,507,510,1, - 0,0,0,508,506,1,0,0,0,508,509,1,0,0,0,509,511,1,0,0,0,510,508,1,0,0,0,511, - 512,5,95,0,0,512,513,7,1,0,0,513,91,1,0,0,0,514,515,5,92,0,0,515,516,5, - 108,0,0,516,517,5,111,0,0,517,518,5,103,0,0,518,522,1,0,0,0,519,521,7,0, - 0,0,520,519,1,0,0,0,521,524,1,0,0,0,522,520,1,0,0,0,522,523,1,0,0,0,523, - 525,1,0,0,0,524,522,1,0,0,0,525,526,5,95,0,0,526,527,7,2,0,0,527,93,1,0, - 0,0,528,529,5,92,0,0,529,530,5,116,0,0,530,531,5,101,0,0,531,532,5,120, - 0,0,532,533,5,116,0,0,533,534,5,123,0,0,534,538,1,0,0,0,535,537,9,0,0,0, - 536,535,1,0,0,0,537,540,1,0,0,0,538,539,1,0,0,0,538,536,1,0,0,0,539,541, - 1,0,0,0,540,538,1,0,0,0,541,542,5,125,0,0,542,543,1,0,0,0,543,544,6,46, - 1,0,544,95,1,0,0,0,545,546,5,92,0,0,546,547,5,108,0,0,547,548,5,101,0,0, - 548,549,5,102,0,0,549,550,5,116,0,0,550,552,1,0,0,0,551,553,5,46,0,0,552, - 551,1,0,0,0,552,553,1,0,0,0,553,554,1,0,0,0,554,555,6,47,1,0,555,97,1,0, - 0,0,556,557,5,92,0,0,557,558,5,114,0,0,558,559,5,105,0,0,559,560,5,103, - 0,0,560,561,5,104,0,0,561,562,5,116,0,0,562,564,1,0,0,0,563,565,5,46,0, - 0,564,563,1,0,0,0,564,565,1,0,0,0,565,566,1,0,0,0,566,567,6,48,1,0,567, - 99,1,0,0,0,568,569,5,36,0,0,569,570,5,36,0,0,570,571,1,0,0,0,571,572,6, - 49,1,0,572,101,1,0,0,0,573,574,5,43,0,0,574,103,1,0,0,0,575,576,5,45,0, - 0,576,105,1,0,0,0,577,578,5,94,0,0,578,107,1,0,0,0,579,580,5,61,0,0,580, - 109,1,0,0,0,581,582,5,60,0,0,582,111,1,0,0,0,583,584,5,62,0,0,584,113,1, - 0,0,0,585,586,5,92,0,0,586,587,5,108,0,0,587,588,5,101,0,0,588,115,1,0, - 0,0,589,590,5,92,0,0,590,591,5,103,0,0,591,592,5,101,0,0,592,117,1,0,0, - 0,593,594,5,44,0,0,594,119,1,0,0,0,595,596,5,94,0,0,596,597,7,1,0,0,597, - 121,1,0,0,0,598,599,5,94,0,0,599,600,7,2,0,0,600,123,1,0,0,0,601,603,3, - 126,62,0,602,601,1,0,0,0,603,604,1,0,0,0,604,602,1,0,0,0,604,605,1,0,0, - 0,605,606,1,0,0,0,606,610,5,46,0,0,607,609,3,126,62,0,608,607,1,0,0,0,609, - 612,1,0,0,0,610,608,1,0,0,0,610,611,1,0,0,0,611,614,1,0,0,0,612,610,1,0, - 0,0,613,615,3,130,64,0,614,613,1,0,0,0,614,615,1,0,0,0,615,634,1,0,0,0, - 616,618,5,46,0,0,617,619,3,126,62,0,618,617,1,0,0,0,619,620,1,0,0,0,620, - 618,1,0,0,0,620,621,1,0,0,0,621,623,1,0,0,0,622,624,3,130,64,0,623,622, - 1,0,0,0,623,624,1,0,0,0,624,634,1,0,0,0,625,627,3,126,62,0,626,625,1,0, - 0,0,627,628,1,0,0,0,628,626,1,0,0,0,628,629,1,0,0,0,629,631,1,0,0,0,630, - 632,3,130,64,0,631,630,1,0,0,0,631,632,1,0,0,0,632,634,1,0,0,0,633,602, - 1,0,0,0,633,616,1,0,0,0,633,626,1,0,0,0,634,125,1,0,0,0,635,636,7,1,0,0, - 636,127,1,0,0,0,637,641,7,2,0,0,638,640,7,4,0,0,639,638,1,0,0,0,640,643, - 1,0,0,0,641,639,1,0,0,0,641,642,1,0,0,0,642,129,1,0,0,0,643,641,1,0,0,0, - 644,646,7,5,0,0,645,647,7,6,0,0,646,645,1,0,0,0,646,647,1,0,0,0,647,649, - 1,0,0,0,648,650,3,126,62,0,649,648,1,0,0,0,650,651,1,0,0,0,651,649,1,0, - 0,0,651,652,1,0,0,0,652,131,1,0,0,0,653,793,5,92,0,0,654,655,5,97,0,0,655, - 656,5,108,0,0,656,657,5,112,0,0,657,658,5,104,0,0,658,794,5,97,0,0,659, - 660,5,98,0,0,660,661,5,101,0,0,661,662,5,116,0,0,662,794,5,97,0,0,663,664, - 5,103,0,0,664,665,5,97,0,0,665,666,5,109,0,0,666,667,5,109,0,0,667,794, - 5,97,0,0,668,669,5,100,0,0,669,670,5,101,0,0,670,671,5,108,0,0,671,672, - 5,116,0,0,672,794,5,97,0,0,673,674,5,101,0,0,674,675,5,112,0,0,675,676, - 5,115,0,0,676,677,5,105,0,0,677,678,5,108,0,0,678,679,5,111,0,0,679,794, - 5,110,0,0,680,681,5,122,0,0,681,682,5,101,0,0,682,683,5,116,0,0,683,794, - 5,97,0,0,684,685,5,101,0,0,685,686,5,116,0,0,686,794,5,97,0,0,687,688,5, - 116,0,0,688,689,5,104,0,0,689,690,5,101,0,0,690,691,5,116,0,0,691,794,5, - 97,0,0,692,693,5,105,0,0,693,694,5,111,0,0,694,695,5,116,0,0,695,794,5, - 97,0,0,696,697,5,107,0,0,697,698,5,97,0,0,698,699,5,112,0,0,699,700,5,112, - 0,0,700,794,5,97,0,0,701,702,5,108,0,0,702,703,5,97,0,0,703,704,5,109,0, - 0,704,705,5,98,0,0,705,706,5,100,0,0,706,794,5,97,0,0,707,708,5,109,0,0, - 708,794,5,117,0,0,709,710,5,110,0,0,710,794,5,117,0,0,711,712,5,120,0,0, - 712,794,5,105,0,0,713,714,5,114,0,0,714,715,5,104,0,0,715,794,5,111,0,0, - 716,717,5,115,0,0,717,718,5,105,0,0,718,719,5,103,0,0,719,720,5,109,0,0, - 720,794,5,97,0,0,721,722,5,116,0,0,722,723,5,97,0,0,723,794,5,117,0,0,724, - 725,5,117,0,0,725,726,5,112,0,0,726,727,5,115,0,0,727,728,5,105,0,0,728, - 729,5,108,0,0,729,730,5,111,0,0,730,794,5,110,0,0,731,732,5,112,0,0,732, - 733,5,104,0,0,733,794,5,105,0,0,734,735,5,99,0,0,735,736,5,104,0,0,736, - 794,5,105,0,0,737,738,5,112,0,0,738,739,5,115,0,0,739,794,5,105,0,0,740, - 741,5,111,0,0,741,742,5,109,0,0,742,743,5,101,0,0,743,744,5,103,0,0,744, - 794,5,97,0,0,745,746,5,71,0,0,746,747,5,97,0,0,747,748,5,109,0,0,748,749, - 5,109,0,0,749,794,5,97,0,0,750,751,5,68,0,0,751,752,5,101,0,0,752,753,5, - 108,0,0,753,754,5,116,0,0,754,794,5,97,0,0,755,756,5,84,0,0,756,757,5,104, - 0,0,757,758,5,101,0,0,758,759,5,116,0,0,759,794,5,97,0,0,760,761,5,76,0, - 0,761,762,5,97,0,0,762,763,5,109,0,0,763,764,5,98,0,0,764,765,5,100,0,0, - 765,794,5,97,0,0,766,767,5,88,0,0,767,794,5,105,0,0,768,769,5,80,0,0,769, - 794,5,105,0,0,770,771,5,83,0,0,771,772,5,105,0,0,772,773,5,103,0,0,773, - 774,5,109,0,0,774,794,5,97,0,0,775,776,5,85,0,0,776,777,5,112,0,0,777,778, - 5,115,0,0,778,779,5,105,0,0,779,780,5,108,0,0,780,781,5,111,0,0,781,794, - 5,110,0,0,782,783,5,80,0,0,783,784,5,104,0,0,784,794,5,105,0,0,785,786, - 5,80,0,0,786,787,5,115,0,0,787,794,5,105,0,0,788,789,5,79,0,0,789,790,5, - 109,0,0,790,791,5,101,0,0,791,792,5,103,0,0,792,794,5,97,0,0,793,654,1, - 0,0,0,793,659,1,0,0,0,793,663,1,0,0,0,793,668,1,0,0,0,793,673,1,0,0,0,793, - 680,1,0,0,0,793,684,1,0,0,0,793,687,1,0,0,0,793,692,1,0,0,0,793,696,1,0, - 0,0,793,701,1,0,0,0,793,707,1,0,0,0,793,709,1,0,0,0,793,711,1,0,0,0,793, - 713,1,0,0,0,793,716,1,0,0,0,793,721,1,0,0,0,793,724,1,0,0,0,793,731,1,0, - 0,0,793,734,1,0,0,0,793,737,1,0,0,0,793,740,1,0,0,0,793,745,1,0,0,0,793, - 750,1,0,0,0,793,755,1,0,0,0,793,760,1,0,0,0,793,766,1,0,0,0,793,768,1,0, - 0,0,793,770,1,0,0,0,793,775,1,0,0,0,793,782,1,0,0,0,793,785,1,0,0,0,793, - 788,1,0,0,0,794,133,1,0,0,0,795,796,5,92,0,0,796,797,5,98,0,0,797,798,5, - 101,0,0,798,799,5,103,0,0,799,800,5,105,0,0,800,801,5,110,0,0,801,802,5, - 123,0,0,802,803,5,98,0,0,803,804,5,109,0,0,804,805,5,97,0,0,805,806,5,116, - 0,0,806,807,5,114,0,0,807,808,5,105,0,0,808,809,5,120,0,0,809,810,5,125, - 0,0,810,135,1,0,0,0,811,812,5,92,0,0,812,813,5,101,0,0,813,814,5,110,0, - 0,814,815,5,100,0,0,815,816,5,123,0,0,816,817,5,98,0,0,817,818,5,109,0, - 0,818,819,5,97,0,0,819,820,5,116,0,0,820,821,5,114,0,0,821,822,5,105,0, - 0,822,823,5,120,0,0,823,824,5,125,0,0,824,137,1,0,0,0,825,826,5,38,0,0, - 826,139,1,0,0,0,827,828,5,92,0,0,828,829,5,92,0,0,829,141,1,0,0,0,830,832, - 7,0,0,0,831,830,1,0,0,0,832,835,1,0,0,0,833,831,1,0,0,0,833,834,1,0,0,0, - 834,836,1,0,0,0,835,833,1,0,0,0,836,837,5,95,0,0,837,838,5,123,0,0,838, - 840,1,0,0,0,839,841,7,4,0,0,840,839,1,0,0,0,841,842,1,0,0,0,842,840,1,0, - 0,0,842,843,1,0,0,0,843,844,1,0,0,0,844,854,5,125,0,0,845,847,7,0,0,0,846, - 845,1,0,0,0,847,850,1,0,0,0,848,846,1,0,0,0,848,849,1,0,0,0,849,851,1,0, - 0,0,850,848,1,0,0,0,851,852,5,95,0,0,852,854,7,4,0,0,853,833,1,0,0,0,853, - 848,1,0,0,0,854,143,1,0,0,0,855,856,5,94,0,0,856,857,7,2,0,0,857,858,3, - 142,70,0,858,145,1,0,0,0,859,862,3,128,63,0,860,862,3,132,65,0,861,859, - 1,0,0,0,861,860,1,0,0,0,862,864,1,0,0,0,863,865,3,142,70,0,864,863,1,0, - 0,0,864,865,1,0,0,0,865,147,1,0,0,0,866,868,7,7,0,0,867,866,1,0,0,0,868, - 869,1,0,0,0,869,867,1,0,0,0,869,870,1,0,0,0,870,871,1,0,0,0,871,872,6,73, - 1,0,872,149,1,0,0,0,873,874,5,92,0,0,874,875,5,32,0,0,875,876,1,0,0,0,876, - 877,6,74,1,0,877,151,1,0,0,0,878,879,5,92,0,0,879,880,5,58,0,0,880,881, - 1,0,0,0,881,882,6,75,1,0,882,153,1,0,0,0,883,884,5,160,0,0,884,885,1,0, - 0,0,885,886,6,76,1,0,886,155,1,0,0,0,887,888,9,0,0,0,888,157,1,0,0,0,889, - 890,5,93,0,0,890,891,1,0,0,0,891,892,6,78,2,0,892,159,1,0,0,0,893,894,5, - 92,0,0,894,895,5,114,0,0,895,896,5,98,0,0,896,897,5,114,0,0,897,898,5,97, - 0,0,898,899,5,99,0,0,899,900,5,107,0,0,900,901,1,0,0,0,901,902,6,79,2,0, - 902,161,1,0,0,0,903,904,5,92,0,0,904,905,5,102,0,0,905,906,5,114,0,0,906, - 907,5,97,0,0,907,908,5,99,0,0,908,163,1,0,0,0,909,910,5,92,0,0,910,911, - 5,102,0,0,911,912,5,114,0,0,912,913,5,97,0,0,913,914,5,99,0,0,914,918,1, - 0,0,0,915,917,7,0,0,0,916,915,1,0,0,0,917,920,1,0,0,0,918,916,1,0,0,0,918, - 919,1,0,0,0,919,921,1,0,0,0,920,918,1,0,0,0,921,922,7,1,0,0,922,923,7,1, - 0,0,923,165,1,0,0,0,924,925,5,92,0,0,925,926,5,99,0,0,926,927,5,100,0,0, - 927,928,5,111,0,0,928,929,5,116,0,0,929,167,1,0,0,0,930,931,5,92,0,0,931, - 932,5,116,0,0,932,933,5,105,0,0,933,934,5,109,0,0,934,935,5,101,0,0,935, - 936,5,115,0,0,936,169,1,0,0,0,937,938,5,92,0,0,938,939,5,115,0,0,939,940, - 5,113,0,0,940,941,5,114,0,0,941,942,5,116,0,0,942,171,1,0,0,0,943,944,5, - 44,0,0,944,173,1,0,0,0,945,946,5,94,0,0,946,175,1,0,0,0,947,951,7,2,0,0, - 948,950,7,4,0,0,949,948,1,0,0,0,950,953,1,0,0,0,951,949,1,0,0,0,951,952, - 1,0,0,0,952,177,1,0,0,0,953,951,1,0,0,0,954,955,5,40,0,0,955,179,1,0,0, - 0,956,957,5,41,0,0,957,181,1,0,0,0,958,959,5,123,0,0,959,183,1,0,0,0,960, - 961,5,125,0,0,961,185,1,0,0,0,962,963,5,49,0,0,963,187,1,0,0,0,964,966, - 5,45,0,0,965,964,1,0,0,0,965,966,1,0,0,0,966,968,1,0,0,0,967,969,3,190, - 94,0,968,967,1,0,0,0,969,970,1,0,0,0,970,968,1,0,0,0,970,971,1,0,0,0,971, - 972,1,0,0,0,972,976,5,46,0,0,973,975,3,190,94,0,974,973,1,0,0,0,975,978, - 1,0,0,0,976,974,1,0,0,0,976,977,1,0,0,0,977,997,1,0,0,0,978,976,1,0,0,0, - 979,981,5,45,0,0,980,979,1,0,0,0,980,981,1,0,0,0,981,982,1,0,0,0,982,984, - 5,46,0,0,983,985,3,190,94,0,984,983,1,0,0,0,985,986,1,0,0,0,986,984,1,0, - 0,0,986,987,1,0,0,0,987,997,1,0,0,0,988,990,5,45,0,0,989,988,1,0,0,0,989, - 990,1,0,0,0,990,992,1,0,0,0,991,993,3,190,94,0,992,991,1,0,0,0,993,994, - 1,0,0,0,994,992,1,0,0,0,994,995,1,0,0,0,995,997,1,0,0,0,996,965,1,0,0,0, - 996,980,1,0,0,0,996,989,1,0,0,0,997,189,1,0,0,0,998,999,7,1,0,0,999,191, - 1,0,0,0,1000,1001,5,92,0,0,1001,1002,5,108,0,0,1002,1003,5,101,0,0,1003, - 1004,5,102,0,0,1004,1005,5,116,0,0,1005,1006,1,0,0,0,1006,1007,6,95,1,0, - 1007,193,1,0,0,0,1008,1009,5,92,0,0,1009,1010,5,114,0,0,1010,1011,5,105, - 0,0,1011,1012,5,103,0,0,1012,1013,5,104,0,0,1013,1014,5,116,0,0,1014,1015, - 1,0,0,0,1015,1016,6,96,1,0,1016,195,1,0,0,0,1017,1019,7,7,0,0,1018,1017, - 1,0,0,0,1019,1020,1,0,0,0,1020,1018,1,0,0,0,1020,1021,1,0,0,0,1021,1022, - 1,0,0,0,1022,1023,6,97,1,0,1023,197,1,0,0,0,1024,1025,5,92,0,0,1025,1026, - 5,32,0,0,1026,1027,1,0,0,0,1027,1028,6,98,1,0,1028,199,1,0,0,0,1029,1030, - 5,92,0,0,1030,1031,5,58,0,0,1031,1032,1,0,0,0,1032,1033,6,99,1,0,1033,201, - 1,0,0,0,1034,1035,5,160,0,0,1035,1036,1,0,0,0,1036,1037,6,100,1,0,1037, - 203,1,0,0,0,1038,1039,9,0,0,0,1039,205,1,0,0,0,47,0,1,239,260,273,287,316, - 350,403,405,413,495,508,522,538,552,564,604,610,614,620,623,628,631,633, - 641,646,651,793,833,842,848,853,861,864,869,918,951,965,970,976,980,986, - 989,994,996,1020,3,2,1,0,6,0,0,2,0,0]; + 66,1,66,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67, + 1,67,1,68,1,68,1,69,1,69,1,69,1,70,5,70,868,8,70,10,70,12,70,871,9,70,1, + 70,1,70,1,70,1,70,4,70,877,8,70,11,70,12,70,878,1,70,1,70,5,70,883,8,70, + 10,70,12,70,886,9,70,1,70,1,70,3,70,890,8,70,1,71,1,71,1,71,1,71,1,72,1, + 72,3,72,898,8,72,1,72,3,72,901,8,72,1,73,4,73,904,8,73,11,73,12,73,905, + 1,73,1,73,1,74,1,74,1,74,1,74,1,74,1,75,1,75,1,75,1,75,1,75,1,76,1,76,1, + 76,1,76,1,77,1,77,1,78,1,78,1,78,1,78,1,79,1,79,1,79,1,79,1,79,1,79,1,79, + 1,79,1,79,1,79,1,80,1,80,1,80,1,80,1,80,1,80,1,81,1,81,1,81,1,81,1,81,1, + 81,1,81,5,81,953,8,81,10,81,12,81,956,9,81,1,81,1,81,1,81,1,82,1,82,1,82, + 1,82,1,82,1,82,1,83,1,83,1,83,1,83,1,83,1,83,1,83,1,84,1,84,1,84,1,84,1, + 84,1,84,1,85,1,85,1,86,1,86,1,87,1,87,5,87,986,8,87,10,87,12,87,989,9,87, + 1,88,1,88,1,89,1,89,1,90,1,90,1,91,1,91,1,92,1,92,1,93,3,93,1002,8,93,1, + 93,4,93,1005,8,93,11,93,12,93,1006,1,93,1,93,5,93,1011,8,93,10,93,12,93, + 1014,9,93,1,93,3,93,1017,8,93,1,93,1,93,4,93,1021,8,93,11,93,12,93,1022, + 1,93,3,93,1026,8,93,1,93,4,93,1029,8,93,11,93,12,93,1030,3,93,1033,8,93, + 1,94,1,94,1,95,1,95,1,95,1,95,1,95,1,95,1,95,1,95,1,96,1,96,1,96,1,96,1, + 96,1,96,1,96,1,96,1,96,1,97,4,97,1055,8,97,11,97,12,97,1056,1,97,1,97,1, + 98,1,98,1,98,1,98,1,98,1,99,1,99,1,99,1,99,1,99,1,100,1,100,1,100,1,100, + 1,101,1,101,1,538,0,102,2,1,4,2,6,3,8,4,10,5,12,6,14,7,16,8,18,9,20,10, + 22,11,24,12,26,13,28,14,30,15,32,16,34,17,36,18,38,19,40,20,42,21,44,22, + 46,23,48,24,50,25,52,26,54,27,56,28,58,29,60,30,62,31,64,32,66,33,68,34, + 70,35,72,36,74,37,76,38,78,39,80,40,82,41,84,42,86,43,88,44,90,45,92,46, + 94,47,96,48,98,49,100,50,102,51,104,52,106,53,108,54,110,55,112,56,114, + 57,116,58,118,59,120,60,122,61,124,62,126,0,128,0,130,0,132,0,134,63,136, + 64,138,65,140,66,142,67,144,68,146,69,148,70,150,71,152,72,154,73,156,74, + 158,75,160,76,162,77,164,78,166,79,168,80,170,81,172,82,174,83,176,84,178, + 85,180,86,182,87,184,88,186,89,188,90,190,0,192,91,194,92,196,93,198,94, + 200,95,202,96,204,97,2,0,1,8,1,0,32,32,1,0,48,57,2,0,65,90,97,122,1,0,115, + 115,3,0,48,57,65,90,97,122,2,0,69,69,101,101,2,0,43,43,45,45,3,0,9,10,13, + 13,32,32,1154,0,2,1,0,0,0,0,4,1,0,0,0,0,6,1,0,0,0,0,8,1,0,0,0,0,10,1,0, + 0,0,0,12,1,0,0,0,0,14,1,0,0,0,0,16,1,0,0,0,0,18,1,0,0,0,0,20,1,0,0,0,0, + 22,1,0,0,0,0,24,1,0,0,0,0,26,1,0,0,0,0,28,1,0,0,0,0,30,1,0,0,0,0,32,1,0, + 0,0,0,34,1,0,0,0,0,36,1,0,0,0,0,38,1,0,0,0,0,40,1,0,0,0,0,42,1,0,0,0,0, + 44,1,0,0,0,0,46,1,0,0,0,0,48,1,0,0,0,0,50,1,0,0,0,0,52,1,0,0,0,0,54,1,0, + 0,0,0,56,1,0,0,0,0,58,1,0,0,0,0,60,1,0,0,0,0,62,1,0,0,0,0,64,1,0,0,0,0, + 66,1,0,0,0,0,68,1,0,0,0,0,70,1,0,0,0,0,72,1,0,0,0,0,74,1,0,0,0,0,76,1,0, + 0,0,0,78,1,0,0,0,0,80,1,0,0,0,0,82,1,0,0,0,0,84,1,0,0,0,0,86,1,0,0,0,0, + 88,1,0,0,0,0,90,1,0,0,0,0,92,1,0,0,0,0,94,1,0,0,0,0,96,1,0,0,0,0,98,1,0, + 0,0,0,100,1,0,0,0,0,102,1,0,0,0,0,104,1,0,0,0,0,106,1,0,0,0,0,108,1,0,0, + 0,0,110,1,0,0,0,0,112,1,0,0,0,0,114,1,0,0,0,0,116,1,0,0,0,0,118,1,0,0,0, + 0,120,1,0,0,0,0,122,1,0,0,0,0,124,1,0,0,0,0,134,1,0,0,0,0,136,1,0,0,0,0, + 138,1,0,0,0,0,140,1,0,0,0,0,142,1,0,0,0,0,144,1,0,0,0,0,146,1,0,0,0,0,148, + 1,0,0,0,0,150,1,0,0,0,0,152,1,0,0,0,0,154,1,0,0,0,0,156,1,0,0,0,1,158,1, + 0,0,0,1,160,1,0,0,0,1,162,1,0,0,0,1,164,1,0,0,0,1,166,1,0,0,0,1,168,1,0, + 0,0,1,170,1,0,0,0,1,172,1,0,0,0,1,174,1,0,0,0,1,176,1,0,0,0,1,178,1,0,0, + 0,1,180,1,0,0,0,1,182,1,0,0,0,1,184,1,0,0,0,1,186,1,0,0,0,1,188,1,0,0,0, + 1,192,1,0,0,0,1,194,1,0,0,0,1,196,1,0,0,0,1,198,1,0,0,0,1,200,1,0,0,0,1, + 202,1,0,0,0,1,204,1,0,0,0,2,206,1,0,0,0,4,210,1,0,0,0,6,220,1,0,0,0,8,222, + 1,0,0,0,10,224,1,0,0,0,12,226,1,0,0,0,14,228,1,0,0,0,16,230,1,0,0,0,18, + 239,1,0,0,0,20,241,1,0,0,0,22,243,1,0,0,0,24,247,1,0,0,0,26,252,1,0,0,0, + 28,265,1,0,0,0,30,279,1,0,0,0,32,293,1,0,0,0,34,301,1,0,0,0,36,307,1,0, + 0,0,38,322,1,0,0,0,40,328,1,0,0,0,42,335,1,0,0,0,44,341,1,0,0,0,46,355, + 1,0,0,0,48,360,1,0,0,0,50,368,1,0,0,0,52,381,1,0,0,0,54,395,1,0,0,0,56, + 397,1,0,0,0,58,415,1,0,0,0,60,419,1,0,0,0,62,423,1,0,0,0,64,427,1,0,0,0, + 66,431,1,0,0,0,68,435,1,0,0,0,70,439,1,0,0,0,72,446,1,0,0,0,74,453,1,0, + 0,0,76,460,1,0,0,0,78,465,1,0,0,0,80,470,1,0,0,0,82,475,1,0,0,0,84,480, + 1,0,0,0,86,483,1,0,0,0,88,487,1,0,0,0,90,500,1,0,0,0,92,514,1,0,0,0,94, + 528,1,0,0,0,96,545,1,0,0,0,98,556,1,0,0,0,100,568,1,0,0,0,102,573,1,0,0, + 0,104,575,1,0,0,0,106,577,1,0,0,0,108,579,1,0,0,0,110,581,1,0,0,0,112,583, + 1,0,0,0,114,585,1,0,0,0,116,589,1,0,0,0,118,593,1,0,0,0,120,595,1,0,0,0, + 122,598,1,0,0,0,124,633,1,0,0,0,126,635,1,0,0,0,128,637,1,0,0,0,130,687, + 1,0,0,0,132,689,1,0,0,0,134,831,1,0,0,0,136,847,1,0,0,0,138,861,1,0,0,0, + 140,863,1,0,0,0,142,889,1,0,0,0,144,891,1,0,0,0,146,897,1,0,0,0,148,903, + 1,0,0,0,150,909,1,0,0,0,152,914,1,0,0,0,154,919,1,0,0,0,156,923,1,0,0,0, + 158,925,1,0,0,0,160,929,1,0,0,0,162,939,1,0,0,0,164,945,1,0,0,0,166,960, + 1,0,0,0,168,966,1,0,0,0,170,973,1,0,0,0,172,979,1,0,0,0,174,981,1,0,0,0, + 176,983,1,0,0,0,178,990,1,0,0,0,180,992,1,0,0,0,182,994,1,0,0,0,184,996, + 1,0,0,0,186,998,1,0,0,0,188,1032,1,0,0,0,190,1034,1,0,0,0,192,1036,1,0, + 0,0,194,1044,1,0,0,0,196,1054,1,0,0,0,198,1060,1,0,0,0,200,1065,1,0,0,0, + 202,1070,1,0,0,0,204,1074,1,0,0,0,206,207,5,91,0,0,207,208,1,0,0,0,208, + 209,6,0,0,0,209,3,1,0,0,0,210,211,5,92,0,0,211,212,5,108,0,0,212,213,5, + 98,0,0,213,214,5,114,0,0,214,215,5,97,0,0,215,216,5,99,0,0,216,217,5,107, + 0,0,217,218,1,0,0,0,218,219,6,1,0,0,219,5,1,0,0,0,220,221,5,59,0,0,221, + 7,1,0,0,0,222,223,5,123,0,0,223,9,1,0,0,0,224,225,5,125,0,0,225,11,1,0, + 0,0,226,227,5,40,0,0,227,13,1,0,0,0,228,229,5,41,0,0,229,15,1,0,0,0,230, + 231,5,124,0,0,231,17,1,0,0,0,232,233,5,124,0,0,233,240,5,124,0,0,234,235, + 5,92,0,0,235,236,5,86,0,0,236,237,5,101,0,0,237,238,5,114,0,0,238,240,5, + 116,0,0,239,232,1,0,0,0,239,234,1,0,0,0,240,19,1,0,0,0,241,242,5,95,0,0, + 242,21,1,0,0,0,243,244,5,92,0,0,244,245,5,112,0,0,245,246,5,105,0,0,246, + 23,1,0,0,0,247,248,5,92,0,0,248,249,5,105,0,0,249,250,5,110,0,0,250,251, + 5,116,0,0,251,25,1,0,0,0,252,253,5,92,0,0,253,254,5,105,0,0,254,255,5,110, + 0,0,255,256,5,116,0,0,256,260,1,0,0,0,257,259,7,0,0,0,258,257,1,0,0,0,259, + 262,1,0,0,0,260,258,1,0,0,0,260,261,1,0,0,0,261,263,1,0,0,0,262,260,1,0, + 0,0,263,264,5,95,0,0,264,27,1,0,0,0,265,266,5,92,0,0,266,267,5,105,0,0, + 267,268,5,110,0,0,268,269,5,116,0,0,269,273,1,0,0,0,270,272,7,0,0,0,271, + 270,1,0,0,0,272,275,1,0,0,0,273,271,1,0,0,0,273,274,1,0,0,0,274,276,1,0, + 0,0,275,273,1,0,0,0,276,277,5,95,0,0,277,278,7,1,0,0,278,29,1,0,0,0,279, + 280,5,92,0,0,280,281,5,105,0,0,281,282,5,110,0,0,282,283,5,116,0,0,283, + 287,1,0,0,0,284,286,7,0,0,0,285,284,1,0,0,0,286,289,1,0,0,0,287,285,1,0, + 0,0,287,288,1,0,0,0,288,290,1,0,0,0,289,287,1,0,0,0,290,291,5,95,0,0,291, + 292,7,2,0,0,292,31,1,0,0,0,293,294,5,92,0,0,294,295,5,109,0,0,295,296,5, + 97,0,0,296,297,5,116,0,0,297,298,5,104,0,0,298,299,5,114,0,0,299,300,5, + 109,0,0,300,33,1,0,0,0,301,302,5,92,0,0,302,303,5,102,0,0,303,304,5,114, + 0,0,304,305,5,97,0,0,305,306,5,99,0,0,306,35,1,0,0,0,307,308,5,92,0,0,308, + 309,5,102,0,0,309,310,5,114,0,0,310,311,5,97,0,0,311,312,5,99,0,0,312,316, + 1,0,0,0,313,315,7,0,0,0,314,313,1,0,0,0,315,318,1,0,0,0,316,314,1,0,0,0, + 316,317,1,0,0,0,317,319,1,0,0,0,318,316,1,0,0,0,319,320,7,1,0,0,320,321, + 7,1,0,0,321,37,1,0,0,0,322,323,5,92,0,0,323,324,5,99,0,0,324,325,5,100, + 0,0,325,326,5,111,0,0,326,327,5,116,0,0,327,39,1,0,0,0,328,329,5,92,0,0, + 329,330,5,116,0,0,330,331,5,105,0,0,331,332,5,109,0,0,332,333,5,101,0,0, + 333,334,5,115,0,0,334,41,1,0,0,0,335,336,5,92,0,0,336,337,5,115,0,0,337, + 338,5,113,0,0,338,339,5,114,0,0,339,340,5,116,0,0,340,43,1,0,0,0,341,342, + 5,92,0,0,342,343,5,115,0,0,343,344,5,113,0,0,344,345,5,114,0,0,345,346, + 5,116,0,0,346,350,1,0,0,0,347,349,7,0,0,0,348,347,1,0,0,0,349,352,1,0,0, + 0,350,348,1,0,0,0,350,351,1,0,0,0,351,353,1,0,0,0,352,350,1,0,0,0,353,354, + 7,1,0,0,354,45,1,0,0,0,355,356,5,92,0,0,356,357,5,115,0,0,357,358,5,105, + 0,0,358,359,5,109,0,0,359,47,1,0,0,0,360,361,5,92,0,0,361,362,5,97,0,0, + 362,363,5,112,0,0,363,364,5,112,0,0,364,365,5,114,0,0,365,366,5,111,0,0, + 366,367,5,120,0,0,367,49,1,0,0,0,368,369,5,92,0,0,369,370,5,112,0,0,370, + 371,5,108,0,0,371,372,5,97,0,0,372,373,5,99,0,0,373,374,5,101,0,0,374,375, + 5,104,0,0,375,376,5,111,0,0,376,377,5,108,0,0,377,378,5,100,0,0,378,379, + 5,101,0,0,379,380,5,114,0,0,380,51,1,0,0,0,381,382,5,94,0,0,382,383,5,123, + 0,0,383,384,5,92,0,0,384,385,5,109,0,0,385,386,5,97,0,0,386,387,5,116,0, + 0,387,388,5,104,0,0,388,389,5,114,0,0,389,390,5,109,0,0,390,391,5,123,0, + 0,391,392,5,84,0,0,392,393,5,125,0,0,393,394,5,125,0,0,394,53,1,0,0,0,395, + 396,5,92,0,0,396,55,1,0,0,0,397,398,5,97,0,0,398,399,5,115,0,0,399,403, + 1,0,0,0,400,404,5,32,0,0,401,402,5,92,0,0,402,404,5,58,0,0,403,400,1,0, + 0,0,403,401,1,0,0,0,404,405,1,0,0,0,405,403,1,0,0,0,405,406,1,0,0,0,406, + 407,1,0,0,0,407,408,5,108,0,0,408,409,5,105,0,0,409,410,5,110,0,0,410,411, + 5,101,0,0,411,413,1,0,0,0,412,414,7,3,0,0,413,412,1,0,0,0,413,414,1,0,0, + 0,414,57,1,0,0,0,415,416,5,115,0,0,416,417,5,105,0,0,417,418,5,110,0,0, + 418,59,1,0,0,0,419,420,5,99,0,0,420,421,5,111,0,0,421,422,5,115,0,0,422, + 61,1,0,0,0,423,424,5,116,0,0,424,425,5,97,0,0,425,426,5,110,0,0,426,63, + 1,0,0,0,427,428,5,99,0,0,428,429,5,111,0,0,429,430,5,116,0,0,430,65,1,0, + 0,0,431,432,5,115,0,0,432,433,5,101,0,0,433,434,5,99,0,0,434,67,1,0,0,0, + 435,436,5,99,0,0,436,437,5,115,0,0,437,438,5,99,0,0,438,69,1,0,0,0,439, + 440,5,97,0,0,440,441,5,114,0,0,441,442,5,99,0,0,442,443,5,115,0,0,443,444, + 5,105,0,0,444,445,5,110,0,0,445,71,1,0,0,0,446,447,5,97,0,0,447,448,5,114, + 0,0,448,449,5,99,0,0,449,450,5,99,0,0,450,451,5,111,0,0,451,452,5,115,0, + 0,452,73,1,0,0,0,453,454,5,97,0,0,454,455,5,114,0,0,455,456,5,99,0,0,456, + 457,5,116,0,0,457,458,5,97,0,0,458,459,5,110,0,0,459,75,1,0,0,0,460,461, + 5,115,0,0,461,462,5,105,0,0,462,463,5,110,0,0,463,464,5,104,0,0,464,77, + 1,0,0,0,465,466,5,99,0,0,466,467,5,111,0,0,467,468,5,115,0,0,468,469,5, + 104,0,0,469,79,1,0,0,0,470,471,5,116,0,0,471,472,5,97,0,0,472,473,5,110, + 0,0,473,474,5,104,0,0,474,81,1,0,0,0,475,476,5,99,0,0,476,477,5,111,0,0, + 477,478,5,116,0,0,478,479,5,104,0,0,479,83,1,0,0,0,480,481,5,108,0,0,481, + 482,5,110,0,0,482,85,1,0,0,0,483,484,5,108,0,0,484,485,5,111,0,0,485,486, + 5,103,0,0,486,87,1,0,0,0,487,488,5,92,0,0,488,489,5,108,0,0,489,490,5,111, + 0,0,490,491,5,103,0,0,491,495,1,0,0,0,492,494,7,0,0,0,493,492,1,0,0,0,494, + 497,1,0,0,0,495,493,1,0,0,0,495,496,1,0,0,0,496,498,1,0,0,0,497,495,1,0, + 0,0,498,499,5,95,0,0,499,89,1,0,0,0,500,501,5,92,0,0,501,502,5,108,0,0, + 502,503,5,111,0,0,503,504,5,103,0,0,504,508,1,0,0,0,505,507,7,0,0,0,506, + 505,1,0,0,0,507,510,1,0,0,0,508,506,1,0,0,0,508,509,1,0,0,0,509,511,1,0, + 0,0,510,508,1,0,0,0,511,512,5,95,0,0,512,513,7,1,0,0,513,91,1,0,0,0,514, + 515,5,92,0,0,515,516,5,108,0,0,516,517,5,111,0,0,517,518,5,103,0,0,518, + 522,1,0,0,0,519,521,7,0,0,0,520,519,1,0,0,0,521,524,1,0,0,0,522,520,1,0, + 0,0,522,523,1,0,0,0,523,525,1,0,0,0,524,522,1,0,0,0,525,526,5,95,0,0,526, + 527,7,2,0,0,527,93,1,0,0,0,528,529,5,92,0,0,529,530,5,116,0,0,530,531,5, + 101,0,0,531,532,5,120,0,0,532,533,5,116,0,0,533,534,5,123,0,0,534,538,1, + 0,0,0,535,537,9,0,0,0,536,535,1,0,0,0,537,540,1,0,0,0,538,539,1,0,0,0,538, + 536,1,0,0,0,539,541,1,0,0,0,540,538,1,0,0,0,541,542,5,125,0,0,542,543,1, + 0,0,0,543,544,6,46,1,0,544,95,1,0,0,0,545,546,5,92,0,0,546,547,5,108,0, + 0,547,548,5,101,0,0,548,549,5,102,0,0,549,550,5,116,0,0,550,552,1,0,0,0, + 551,553,5,46,0,0,552,551,1,0,0,0,552,553,1,0,0,0,553,554,1,0,0,0,554,555, + 6,47,1,0,555,97,1,0,0,0,556,557,5,92,0,0,557,558,5,114,0,0,558,559,5,105, + 0,0,559,560,5,103,0,0,560,561,5,104,0,0,561,562,5,116,0,0,562,564,1,0,0, + 0,563,565,5,46,0,0,564,563,1,0,0,0,564,565,1,0,0,0,565,566,1,0,0,0,566, + 567,6,48,1,0,567,99,1,0,0,0,568,569,5,36,0,0,569,570,5,36,0,0,570,571,1, + 0,0,0,571,572,6,49,1,0,572,101,1,0,0,0,573,574,5,43,0,0,574,103,1,0,0,0, + 575,576,5,45,0,0,576,105,1,0,0,0,577,578,5,94,0,0,578,107,1,0,0,0,579,580, + 5,61,0,0,580,109,1,0,0,0,581,582,5,60,0,0,582,111,1,0,0,0,583,584,5,62, + 0,0,584,113,1,0,0,0,585,586,5,92,0,0,586,587,5,108,0,0,587,588,5,101,0, + 0,588,115,1,0,0,0,589,590,5,92,0,0,590,591,5,103,0,0,591,592,5,101,0,0, + 592,117,1,0,0,0,593,594,5,44,0,0,594,119,1,0,0,0,595,596,5,94,0,0,596,597, + 7,1,0,0,597,121,1,0,0,0,598,599,5,94,0,0,599,600,7,2,0,0,600,123,1,0,0, + 0,601,603,3,126,62,0,602,601,1,0,0,0,603,604,1,0,0,0,604,602,1,0,0,0,604, + 605,1,0,0,0,605,606,1,0,0,0,606,610,5,46,0,0,607,609,3,126,62,0,608,607, + 1,0,0,0,609,612,1,0,0,0,610,608,1,0,0,0,610,611,1,0,0,0,611,614,1,0,0,0, + 612,610,1,0,0,0,613,615,3,130,64,0,614,613,1,0,0,0,614,615,1,0,0,0,615, + 634,1,0,0,0,616,618,5,46,0,0,617,619,3,126,62,0,618,617,1,0,0,0,619,620, + 1,0,0,0,620,618,1,0,0,0,620,621,1,0,0,0,621,623,1,0,0,0,622,624,3,130,64, + 0,623,622,1,0,0,0,623,624,1,0,0,0,624,634,1,0,0,0,625,627,3,126,62,0,626, + 625,1,0,0,0,627,628,1,0,0,0,628,626,1,0,0,0,628,629,1,0,0,0,629,631,1,0, + 0,0,630,632,3,130,64,0,631,630,1,0,0,0,631,632,1,0,0,0,632,634,1,0,0,0, + 633,602,1,0,0,0,633,616,1,0,0,0,633,626,1,0,0,0,634,125,1,0,0,0,635,636, + 7,1,0,0,636,127,1,0,0,0,637,641,7,2,0,0,638,640,7,4,0,0,639,638,1,0,0,0, + 640,643,1,0,0,0,641,639,1,0,0,0,641,642,1,0,0,0,642,129,1,0,0,0,643,641, + 1,0,0,0,644,646,7,5,0,0,645,647,7,6,0,0,646,645,1,0,0,0,646,647,1,0,0,0, + 647,649,1,0,0,0,648,650,3,126,62,0,649,648,1,0,0,0,650,651,1,0,0,0,651, + 649,1,0,0,0,651,652,1,0,0,0,652,688,1,0,0,0,653,655,5,32,0,0,654,653,1, + 0,0,0,655,658,1,0,0,0,656,654,1,0,0,0,656,657,1,0,0,0,657,661,1,0,0,0,658, + 656,1,0,0,0,659,662,3,38,18,0,660,662,3,40,19,0,661,659,1,0,0,0,661,660, + 1,0,0,0,662,666,1,0,0,0,663,665,5,32,0,0,664,663,1,0,0,0,665,668,1,0,0, + 0,666,664,1,0,0,0,666,667,1,0,0,0,667,669,1,0,0,0,668,666,1,0,0,0,669,670, + 5,49,0,0,670,671,5,48,0,0,671,672,1,0,0,0,672,685,3,106,52,0,673,686,3, + 126,62,0,674,676,3,8,3,0,675,677,7,6,0,0,676,675,1,0,0,0,676,677,1,0,0, + 0,677,679,1,0,0,0,678,680,3,126,62,0,679,678,1,0,0,0,680,681,1,0,0,0,681, + 679,1,0,0,0,681,682,1,0,0,0,682,683,1,0,0,0,683,684,3,10,4,0,684,686,1, + 0,0,0,685,673,1,0,0,0,685,674,1,0,0,0,686,688,1,0,0,0,687,644,1,0,0,0,687, + 656,1,0,0,0,688,131,1,0,0,0,689,829,5,92,0,0,690,691,5,97,0,0,691,692,5, + 108,0,0,692,693,5,112,0,0,693,694,5,104,0,0,694,830,5,97,0,0,695,696,5, + 98,0,0,696,697,5,101,0,0,697,698,5,116,0,0,698,830,5,97,0,0,699,700,5,103, + 0,0,700,701,5,97,0,0,701,702,5,109,0,0,702,703,5,109,0,0,703,830,5,97,0, + 0,704,705,5,100,0,0,705,706,5,101,0,0,706,707,5,108,0,0,707,708,5,116,0, + 0,708,830,5,97,0,0,709,710,5,101,0,0,710,711,5,112,0,0,711,712,5,115,0, + 0,712,713,5,105,0,0,713,714,5,108,0,0,714,715,5,111,0,0,715,830,5,110,0, + 0,716,717,5,122,0,0,717,718,5,101,0,0,718,719,5,116,0,0,719,830,5,97,0, + 0,720,721,5,101,0,0,721,722,5,116,0,0,722,830,5,97,0,0,723,724,5,116,0, + 0,724,725,5,104,0,0,725,726,5,101,0,0,726,727,5,116,0,0,727,830,5,97,0, + 0,728,729,5,105,0,0,729,730,5,111,0,0,730,731,5,116,0,0,731,830,5,97,0, + 0,732,733,5,107,0,0,733,734,5,97,0,0,734,735,5,112,0,0,735,736,5,112,0, + 0,736,830,5,97,0,0,737,738,5,108,0,0,738,739,5,97,0,0,739,740,5,109,0,0, + 740,741,5,98,0,0,741,742,5,100,0,0,742,830,5,97,0,0,743,744,5,109,0,0,744, + 830,5,117,0,0,745,746,5,110,0,0,746,830,5,117,0,0,747,748,5,120,0,0,748, + 830,5,105,0,0,749,750,5,114,0,0,750,751,5,104,0,0,751,830,5,111,0,0,752, + 753,5,115,0,0,753,754,5,105,0,0,754,755,5,103,0,0,755,756,5,109,0,0,756, + 830,5,97,0,0,757,758,5,116,0,0,758,759,5,97,0,0,759,830,5,117,0,0,760,761, + 5,117,0,0,761,762,5,112,0,0,762,763,5,115,0,0,763,764,5,105,0,0,764,765, + 5,108,0,0,765,766,5,111,0,0,766,830,5,110,0,0,767,768,5,112,0,0,768,769, + 5,104,0,0,769,830,5,105,0,0,770,771,5,99,0,0,771,772,5,104,0,0,772,830, + 5,105,0,0,773,774,5,112,0,0,774,775,5,115,0,0,775,830,5,105,0,0,776,777, + 5,111,0,0,777,778,5,109,0,0,778,779,5,101,0,0,779,780,5,103,0,0,780,830, + 5,97,0,0,781,782,5,71,0,0,782,783,5,97,0,0,783,784,5,109,0,0,784,785,5, + 109,0,0,785,830,5,97,0,0,786,787,5,68,0,0,787,788,5,101,0,0,788,789,5,108, + 0,0,789,790,5,116,0,0,790,830,5,97,0,0,791,792,5,84,0,0,792,793,5,104,0, + 0,793,794,5,101,0,0,794,795,5,116,0,0,795,830,5,97,0,0,796,797,5,76,0,0, + 797,798,5,97,0,0,798,799,5,109,0,0,799,800,5,98,0,0,800,801,5,100,0,0,801, + 830,5,97,0,0,802,803,5,88,0,0,803,830,5,105,0,0,804,805,5,80,0,0,805,830, + 5,105,0,0,806,807,5,83,0,0,807,808,5,105,0,0,808,809,5,103,0,0,809,810, + 5,109,0,0,810,830,5,97,0,0,811,812,5,85,0,0,812,813,5,112,0,0,813,814,5, + 115,0,0,814,815,5,105,0,0,815,816,5,108,0,0,816,817,5,111,0,0,817,830,5, + 110,0,0,818,819,5,80,0,0,819,820,5,104,0,0,820,830,5,105,0,0,821,822,5, + 80,0,0,822,823,5,115,0,0,823,830,5,105,0,0,824,825,5,79,0,0,825,826,5,109, + 0,0,826,827,5,101,0,0,827,828,5,103,0,0,828,830,5,97,0,0,829,690,1,0,0, + 0,829,695,1,0,0,0,829,699,1,0,0,0,829,704,1,0,0,0,829,709,1,0,0,0,829,716, + 1,0,0,0,829,720,1,0,0,0,829,723,1,0,0,0,829,728,1,0,0,0,829,732,1,0,0,0, + 829,737,1,0,0,0,829,743,1,0,0,0,829,745,1,0,0,0,829,747,1,0,0,0,829,749, + 1,0,0,0,829,752,1,0,0,0,829,757,1,0,0,0,829,760,1,0,0,0,829,767,1,0,0,0, + 829,770,1,0,0,0,829,773,1,0,0,0,829,776,1,0,0,0,829,781,1,0,0,0,829,786, + 1,0,0,0,829,791,1,0,0,0,829,796,1,0,0,0,829,802,1,0,0,0,829,804,1,0,0,0, + 829,806,1,0,0,0,829,811,1,0,0,0,829,818,1,0,0,0,829,821,1,0,0,0,829,824, + 1,0,0,0,830,133,1,0,0,0,831,832,5,92,0,0,832,833,5,98,0,0,833,834,5,101, + 0,0,834,835,5,103,0,0,835,836,5,105,0,0,836,837,5,110,0,0,837,838,5,123, + 0,0,838,839,5,98,0,0,839,840,5,109,0,0,840,841,5,97,0,0,841,842,5,116,0, + 0,842,843,5,114,0,0,843,844,5,105,0,0,844,845,5,120,0,0,845,846,5,125,0, + 0,846,135,1,0,0,0,847,848,5,92,0,0,848,849,5,101,0,0,849,850,5,110,0,0, + 850,851,5,100,0,0,851,852,5,123,0,0,852,853,5,98,0,0,853,854,5,109,0,0, + 854,855,5,97,0,0,855,856,5,116,0,0,856,857,5,114,0,0,857,858,5,105,0,0, + 858,859,5,120,0,0,859,860,5,125,0,0,860,137,1,0,0,0,861,862,5,38,0,0,862, + 139,1,0,0,0,863,864,5,92,0,0,864,865,5,92,0,0,865,141,1,0,0,0,866,868,7, + 0,0,0,867,866,1,0,0,0,868,871,1,0,0,0,869,867,1,0,0,0,869,870,1,0,0,0,870, + 872,1,0,0,0,871,869,1,0,0,0,872,873,5,95,0,0,873,874,5,123,0,0,874,876, + 1,0,0,0,875,877,7,4,0,0,876,875,1,0,0,0,877,878,1,0,0,0,878,876,1,0,0,0, + 878,879,1,0,0,0,879,880,1,0,0,0,880,890,5,125,0,0,881,883,7,0,0,0,882,881, + 1,0,0,0,883,886,1,0,0,0,884,882,1,0,0,0,884,885,1,0,0,0,885,887,1,0,0,0, + 886,884,1,0,0,0,887,888,5,95,0,0,888,890,7,4,0,0,889,869,1,0,0,0,889,884, + 1,0,0,0,890,143,1,0,0,0,891,892,5,94,0,0,892,893,7,2,0,0,893,894,3,142, + 70,0,894,145,1,0,0,0,895,898,3,128,63,0,896,898,3,132,65,0,897,895,1,0, + 0,0,897,896,1,0,0,0,898,900,1,0,0,0,899,901,3,142,70,0,900,899,1,0,0,0, + 900,901,1,0,0,0,901,147,1,0,0,0,902,904,7,7,0,0,903,902,1,0,0,0,904,905, + 1,0,0,0,905,903,1,0,0,0,905,906,1,0,0,0,906,907,1,0,0,0,907,908,6,73,1, + 0,908,149,1,0,0,0,909,910,5,92,0,0,910,911,5,32,0,0,911,912,1,0,0,0,912, + 913,6,74,1,0,913,151,1,0,0,0,914,915,5,92,0,0,915,916,5,58,0,0,916,917, + 1,0,0,0,917,918,6,75,1,0,918,153,1,0,0,0,919,920,5,160,0,0,920,921,1,0, + 0,0,921,922,6,76,1,0,922,155,1,0,0,0,923,924,9,0,0,0,924,157,1,0,0,0,925, + 926,5,93,0,0,926,927,1,0,0,0,927,928,6,78,2,0,928,159,1,0,0,0,929,930,5, + 92,0,0,930,931,5,114,0,0,931,932,5,98,0,0,932,933,5,114,0,0,933,934,5,97, + 0,0,934,935,5,99,0,0,935,936,5,107,0,0,936,937,1,0,0,0,937,938,6,79,2,0, + 938,161,1,0,0,0,939,940,5,92,0,0,940,941,5,102,0,0,941,942,5,114,0,0,942, + 943,5,97,0,0,943,944,5,99,0,0,944,163,1,0,0,0,945,946,5,92,0,0,946,947, + 5,102,0,0,947,948,5,114,0,0,948,949,5,97,0,0,949,950,5,99,0,0,950,954,1, + 0,0,0,951,953,7,0,0,0,952,951,1,0,0,0,953,956,1,0,0,0,954,952,1,0,0,0,954, + 955,1,0,0,0,955,957,1,0,0,0,956,954,1,0,0,0,957,958,7,1,0,0,958,959,7,1, + 0,0,959,165,1,0,0,0,960,961,5,92,0,0,961,962,5,99,0,0,962,963,5,100,0,0, + 963,964,5,111,0,0,964,965,5,116,0,0,965,167,1,0,0,0,966,967,5,92,0,0,967, + 968,5,116,0,0,968,969,5,105,0,0,969,970,5,109,0,0,970,971,5,101,0,0,971, + 972,5,115,0,0,972,169,1,0,0,0,973,974,5,92,0,0,974,975,5,115,0,0,975,976, + 5,113,0,0,976,977,5,114,0,0,977,978,5,116,0,0,978,171,1,0,0,0,979,980,5, + 44,0,0,980,173,1,0,0,0,981,982,5,94,0,0,982,175,1,0,0,0,983,987,7,2,0,0, + 984,986,7,4,0,0,985,984,1,0,0,0,986,989,1,0,0,0,987,985,1,0,0,0,987,988, + 1,0,0,0,988,177,1,0,0,0,989,987,1,0,0,0,990,991,5,40,0,0,991,179,1,0,0, + 0,992,993,5,41,0,0,993,181,1,0,0,0,994,995,5,123,0,0,995,183,1,0,0,0,996, + 997,5,125,0,0,997,185,1,0,0,0,998,999,5,49,0,0,999,187,1,0,0,0,1000,1002, + 5,45,0,0,1001,1000,1,0,0,0,1001,1002,1,0,0,0,1002,1004,1,0,0,0,1003,1005, + 3,190,94,0,1004,1003,1,0,0,0,1005,1006,1,0,0,0,1006,1004,1,0,0,0,1006,1007, + 1,0,0,0,1007,1008,1,0,0,0,1008,1012,5,46,0,0,1009,1011,3,190,94,0,1010, + 1009,1,0,0,0,1011,1014,1,0,0,0,1012,1010,1,0,0,0,1012,1013,1,0,0,0,1013, + 1033,1,0,0,0,1014,1012,1,0,0,0,1015,1017,5,45,0,0,1016,1015,1,0,0,0,1016, + 1017,1,0,0,0,1017,1018,1,0,0,0,1018,1020,5,46,0,0,1019,1021,3,190,94,0, + 1020,1019,1,0,0,0,1021,1022,1,0,0,0,1022,1020,1,0,0,0,1022,1023,1,0,0,0, + 1023,1033,1,0,0,0,1024,1026,5,45,0,0,1025,1024,1,0,0,0,1025,1026,1,0,0, + 0,1026,1028,1,0,0,0,1027,1029,3,190,94,0,1028,1027,1,0,0,0,1029,1030,1, + 0,0,0,1030,1028,1,0,0,0,1030,1031,1,0,0,0,1031,1033,1,0,0,0,1032,1001,1, + 0,0,0,1032,1016,1,0,0,0,1032,1025,1,0,0,0,1033,189,1,0,0,0,1034,1035,7, + 1,0,0,1035,191,1,0,0,0,1036,1037,5,92,0,0,1037,1038,5,108,0,0,1038,1039, + 5,101,0,0,1039,1040,5,102,0,0,1040,1041,5,116,0,0,1041,1042,1,0,0,0,1042, + 1043,6,95,1,0,1043,193,1,0,0,0,1044,1045,5,92,0,0,1045,1046,5,114,0,0,1046, + 1047,5,105,0,0,1047,1048,5,103,0,0,1048,1049,5,104,0,0,1049,1050,5,116, + 0,0,1050,1051,1,0,0,0,1051,1052,6,96,1,0,1052,195,1,0,0,0,1053,1055,7,7, + 0,0,1054,1053,1,0,0,0,1055,1056,1,0,0,0,1056,1054,1,0,0,0,1056,1057,1,0, + 0,0,1057,1058,1,0,0,0,1058,1059,6,97,1,0,1059,197,1,0,0,0,1060,1061,5,92, + 0,0,1061,1062,5,32,0,0,1062,1063,1,0,0,0,1063,1064,6,98,1,0,1064,199,1, + 0,0,0,1065,1066,5,92,0,0,1066,1067,5,58,0,0,1067,1068,1,0,0,0,1068,1069, + 6,99,1,0,1069,201,1,0,0,0,1070,1071,5,160,0,0,1071,1072,1,0,0,0,1072,1073, + 6,100,1,0,1073,203,1,0,0,0,1074,1075,9,0,0,0,1075,205,1,0,0,0,54,0,1,239, + 260,273,287,316,350,403,405,413,495,508,522,538,552,564,604,610,614,620, + 623,628,631,633,641,646,651,656,661,666,676,681,685,687,829,869,878,884, + 889,897,900,905,954,987,1001,1006,1012,1016,1022,1025,1030,1032,1056,3, + 2,1,0,6,0,0,2,0,0]; private static __ATN: ATN; public static get _ATN(): ATN { diff --git a/src/parser/LatexToSympy.ts b/src/parser/LatexToSympy.ts index 02c3c945..ae4f6679 100644 --- a/src/parser/LatexToSympy.ts +++ b/src/parser/LatexToSympy.ts @@ -35,9 +35,9 @@ import { type Derivative_cmdContext, type NDerivativeContext, type N_derivative_cmdContext, type TrigFunctionContext, type UnitExponentContext, type UnitFractionalExponentContext, type SqrtContext, type LnContext, type LogContext, type AbsContext, type UnaryMinusContext, - type BaseLogContext, type UnitSqrtContext, type MultiplyContext, type UnitMultiplyContext, + type BaseLogContext, type UnitSqrtContext, type MultiplyContext, Number_with_unitsContext, type UnitMultiplyContext, type DivideContext, type UnitDivideContext, type AddContext, - type SubtractContext, type VariableContext, type Number_with_unitsContext, + type SubtractContext, type VariableContext, type NumberContext, type NumberExprContext, type NumberWithUnitsExprContext, type SubExprContext, type UnitSubExprContext, type UnitNameContext, type U_blockContext, type Condition_singleContext, type Condition_chainContext, @@ -1111,6 +1111,12 @@ export class LatexToSympy extends LatexParserVisitor= 0) { + this.addParsingErrorMessage("Exponent cannot be applied directly to a number with units when using scientific notation, enclose the number with units in parenthesis and then add the exponent to eliminate this order of operations ambiguity. Correct example: (2*10^2[m])^3"); + } + } + base = this.visit(ctx.expr(0)) as string; cursor = this.params.length; @@ -2033,7 +2039,7 @@ export class LatexToSympy extends LatexParserVisitor { - const stringNumber = ctx.NUMBER().toString(); + const stringNumber = ctx.NUMBER().toString().replace(/ |{|}/g,'').replace(/\\cdot10\^|\\times10\^/g,'e'); if (this.type === "data_table_assign" && Number(stringNumber) === 0) { return ZERO_PLACEHOLDER; diff --git a/tests/test_latex_scientific_notation.spec.mjs b/tests/test_latex_scientific_notation.spec.mjs new file mode 100644 index 00000000..6de4b4fb --- /dev/null +++ b/tests/test_latex_scientific_notation.spec.mjs @@ -0,0 +1,147 @@ +import { test, expect } from '@playwright/test'; +import { cot, pi, sqrt, tan, cos} from 'mathjs'; + +import { precision, loadPyodide, newSheet, complexLatex, parseLatexFloat } from './utility.mjs'; + +let page; + +// loading pyodide takes a long time (especially in resource constrained CI environments) +// load page once and use for all tests in this file +test.beforeAll(async ({ browser }) => {page = await loadPyodide(browser, page);} ); + +// give each test a blank sheet to start with (this doesn't reload pyodide) +test.beforeEach(async () => newSheet(page)); + + +test('Test basic latex scientific notation', async () => { + await page.setLatex(0, String.raw`3.5\cdot10^3\left\lbrack mm\right\rbrack=`); + + await page.locator('#add-math-cell').click(); + await page.setLatex(1, String.raw`3.5\cdot10^{-10}\left\lbrack mm\right\rbrack=`); + + await page.locator('#add-math-cell').click(); + await page.setLatex(2, String.raw`3.5\times10^{-9}\left\lbrack mm\right\rbrack=`); + + await page.locator('#add-math-cell').click(); + await page.setLatex(3, String.raw`-3.5 \cdot 10^{10}\left\lbrack mm\right\rbrack=`); + + await page.waitForSelector('text=Updating...', {state: 'detached'}); + + let content = await page.textContent('#result-value-0'); + expect(parseLatexFloat(content)).toBeCloseTo(3.5, precision); + content = await page.textContent('#result-units-0'); + expect(content).toBe('m'); + + content = await page.textContent('#result-value-1'); + expect(parseLatexFloat(content)).toBeCloseTo(3.5e-13, precision); + content = await page.textContent('#result-units-1'); + expect(content).toBe('m'); + + content = await page.textContent('#result-value-2'); + expect(parseLatexFloat(content)).toBeCloseTo(3.5e-12, precision); + content = await page.textContent('#result-units-2'); + expect(content).toBe('m'); + + content = await page.textContent('#result-value-3'); + expect(parseLatexFloat(content)).toBeCloseTo(-3.5e7, precision); + content = await page.textContent('#result-units-3'); + expect(content).toBe('m'); +}); + +test('Test exponent error checking for exponents applied to numbers with units ', async () => { + await page.setLatex(0, String.raw`2\cdot10^2\left\lbrack m\right\rbrack^2=`); + await expect(page.locator("#cell-0 >> text=Exponent cannot be applied directly to a number with units")).toBeAttached(); + + await page.setLatex(0, String.raw`2\times10^2\left\lbrack m\right\rbrack^2=`); + await expect(page.locator("#cell-0 >> text=Exponent cannot be applied directly to a number with units")).toBeAttached(); + + await page.setLatex(0, String.raw`\left(2\cdot10^2\left\lbrack m\right\rbrack\right)^2=`); + + await page.waitForSelector('text=Updating...', {state: 'detached'}); + + let content = await page.textContent('#result-value-0'); + expect(parseLatexFloat(content)).toBeCloseTo(40000, precision); + content = await page.textContent('#result-units-0'); + expect(content).toBe('m^2'); +}); + +test('Test latex scientific notation order of operations', async () => { + await page.setLatex(0, String.raw`\left(-2\cdot10^4\left\lbrack mm\right\rbrack+2\left\lbrack m\right\rbrack\right)\cdot2=`); + + await page.locator('#add-math-cell').click(); + await page.setLatex(1, String.raw`\left(1\left\lbrack m\right\rbrack-2\cdot10^4\left\lbrack mm\right\rbrack\right)\cdot2=`); + + await page.locator('#add-math-cell').click(); + await page.setLatex(2, String.raw`\left(-\left(4\cdot10^4\left\lbrack m^2\right\rbrack\right)^{\frac12}+2000\left\lbrack mm\right\rbrack\right)\cdot2=`); + + await page.locator('#add-math-cell').click(); + await page.setLatex(3, String.raw`\left(2\cdot10^4\left\lbrack m^2\right\rbrack+20000\left\lbrack m^2\right\rbrack\right)^{\frac12}\cdot2=`); + + await page.locator('#add-math-cell').click(); + await page.setLatex(4, String.raw`\left(1\left\lbrack m\right\rbrack-4\cdot2\cdot10^4\left\lbrack mm\right\rbrack\right)\cdot2=`); + + await page.locator('#add-math-cell').click(); + await page.setLatex(5, String.raw`2\cdot10^4\cdot3-10000=`); + + await page.waitForSelector('text=Updating...', {state: 'detached'}); + + let content = await page.textContent('#result-value-0'); + expect(parseLatexFloat(content)).toBeCloseTo(-36, precision); + content = await page.textContent('#result-units-0'); + expect(content).toBe('m'); + + content = await page.textContent('#result-value-1'); + expect(parseLatexFloat(content)).toBeCloseTo(-38, precision); + content = await page.textContent('#result-units-1'); + expect(content).toBe('m'); + + content = await page.textContent('#result-value-2'); + expect(parseLatexFloat(content)).toBeCloseTo(-396, precision); + content = await page.textContent('#result-units-2'); + expect(content).toBe('m'); + + content = await page.textContent('#result-value-3'); + expect(parseLatexFloat(content)).toBeCloseTo(400, precision); + content = await page.textContent('#result-units-3'); + expect(content).toBe('m'); + + content = await page.textContent('#result-value-4'); + expect(parseLatexFloat(content)).toBeCloseTo(-158, precision); + content = await page.textContent('#result-units-4'); + expect(content).toBe('m'); + + content = await page.textContent('#result-value-5'); + expect(parseLatexFloat(content)).toBeCloseTo(50000, precision); + content = await page.textContent('#result-units-5'); + expect(content).toBe(''); +}); + +test('Test latex scientific notation keyboard shortcut and virtual keyboard', async () => { + const modifierKey = (await page.evaluate('window.modifierKey') )=== "metaKey" ? "Meta" : "Control"; + + await page.locator('#cell-0 >> math-field.editable').type("2"); + await page.locator('#cell-0 >> math-field.editable').press(`${modifierKey}+e`); + await page.locator('#cell-0 >> math-field.editable').type("3"); + await page.locator('#cell-0 >> math-field.editable').press("Tab"); + await page.locator('#cell-0 >> math-field.editable').type("[mm]="); + + await page.locator('#add-math-cell').click(); + await page.locator('button').filter({ hasText: '⋅10x⋅10x' }).click(); + await page.locator('#cell-1 >> math-field.editable').type("-30"); + await page.locator('#cell-1 >> math-field.editable').press("Tab"); + await page.locator('#cell-1 >> math-field.editable').type("-3"); + await page.locator('#cell-1 >> math-field.editable').press("Tab"); + await page.locator('#cell-1 >> math-field.editable').type("[km]="); + + await page.waitForSelector('text=Updating...', {state: 'detached'}); + + let content = await page.textContent('#result-value-0'); + expect(parseLatexFloat(content)).toBeCloseTo(2, precision); + content = await page.textContent('#result-units-0'); + expect(content).toBe('m'); + + content = await page.textContent('#result-value-1'); + expect(parseLatexFloat(content)).toBeCloseTo(-30, precision); + content = await page.textContent('#result-units-1'); + expect(content).toBe('m'); +});