diff --git a/.github/workflows/build-hogql-parser.yml b/.github/workflows/build-hogql-parser.yml index 73a22754f8994..21e153660dd13 100644 --- a/.github/workflows/build-hogql-parser.yml +++ b/.github/workflows/build-hogql-parser.yml @@ -80,6 +80,21 @@ jobs: with: python-version: '3.11' + # # This is an alternative way to install Python 3.11 on ARM if the above fails + # - if: ${{ endsWith(matrix.os, '-arm') }} + # name: Install Python 3.11 on ARM (compile from source) + # run: | + # sudo apt-get update + # sudo apt-get install -y build-essential libssl-dev zlib1g-dev \ + # libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev \ + # libgdbm-dev libdb5.3-dev libbz2-dev libexpat1-dev liblzma-dev tk-dev + # wget https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tar.xz + # tar -xf Python-3.11.0.tar.xz + # cd Python-3.11.0 + # ./configure --enable-optimizations + # make -j 2 + # sudo make altinstall + - name: Build sdist if: matrix.os == 'ubuntu-22.04' # Only build the sdist once run: cd hogql_parser && python setup.py sdist diff --git a/ee/api/billing.py b/ee/api/billing.py index f8d17abc1237f..4fc575f3f20fd 100644 --- a/ee/api/billing.py +++ b/ee/api/billing.py @@ -93,6 +93,7 @@ class ActivateSerializer(serializers.Serializer): required=False ) # This is required but in order to support an error for the legacy 'plan' param we need to set required=False redirect_path = serializers.CharField(required=False) + intent_product = serializers.CharField(required=False) def validate(self, data): plan = data.get("plan") @@ -137,6 +138,10 @@ def handle_activate(self, request: Request, *args: Any, **kwargs: Any) -> HttpRe products = serializer.validated_data.get("products") url = f"{url}&products={products}" + intent_product = serializer.validated_data.get("intent_product") + if intent_product: + url = f"{url}&intent_product={intent_product}" + if license: billing_service_token = build_billing_token(license, organization) url = f"{url}&token={billing_service_token}" diff --git a/frontend/__snapshots__/scenes-app-insights--funnel-left-to-right-breakdown-edit--light--webkit.png b/frontend/__snapshots__/scenes-app-insights--funnel-left-to-right-breakdown-edit--light--webkit.png index 8d03b460eaa59..334fe2456043a 100644 Binary files a/frontend/__snapshots__/scenes-app-insights--funnel-left-to-right-breakdown-edit--light--webkit.png and b/frontend/__snapshots__/scenes-app-insights--funnel-left-to-right-breakdown-edit--light--webkit.png differ diff --git a/frontend/__snapshots__/scenes-app-insights--funnel-top-to-bottom-breakdown-edit--light--webkit.png b/frontend/__snapshots__/scenes-app-insights--funnel-top-to-bottom-breakdown-edit--light--webkit.png index 39a80754dc23b..c6748bed94cfe 100644 Binary files a/frontend/__snapshots__/scenes-app-insights--funnel-top-to-bottom-breakdown-edit--light--webkit.png and b/frontend/__snapshots__/scenes-app-insights--funnel-top-to-bottom-breakdown-edit--light--webkit.png differ diff --git a/frontend/__snapshots__/scenes-other-billing-v2--billing-unsubscribe-modal--dark.png b/frontend/__snapshots__/scenes-other-billing-v2--billing-unsubscribe-modal--dark.png index bb6e192a5657f..d431e3917d1e0 100644 Binary files a/frontend/__snapshots__/scenes-other-billing-v2--billing-unsubscribe-modal--dark.png and b/frontend/__snapshots__/scenes-other-billing-v2--billing-unsubscribe-modal--dark.png differ diff --git a/frontend/__snapshots__/scenes-other-billing-v2--billing-unsubscribe-modal--light.png b/frontend/__snapshots__/scenes-other-billing-v2--billing-unsubscribe-modal--light.png index 8f4d1ee744de6..7f0e7183c9c42 100644 Binary files a/frontend/__snapshots__/scenes-other-billing-v2--billing-unsubscribe-modal--light.png and b/frontend/__snapshots__/scenes-other-billing-v2--billing-unsubscribe-modal--light.png differ diff --git a/frontend/__snapshots__/scenes-other-billing-v2--billing-unsubscribe-modal-data-pipelines--dark.png b/frontend/__snapshots__/scenes-other-billing-v2--billing-unsubscribe-modal-data-pipelines--dark.png index 7051bac980dcd..740ad3e2472c9 100644 Binary files a/frontend/__snapshots__/scenes-other-billing-v2--billing-unsubscribe-modal-data-pipelines--dark.png and b/frontend/__snapshots__/scenes-other-billing-v2--billing-unsubscribe-modal-data-pipelines--dark.png differ diff --git a/frontend/__snapshots__/scenes-other-billing-v2--billing-unsubscribe-modal-data-pipelines--light.png b/frontend/__snapshots__/scenes-other-billing-v2--billing-unsubscribe-modal-data-pipelines--light.png index 8b8412564ad3f..edec49654e3fb 100644 Binary files a/frontend/__snapshots__/scenes-other-billing-v2--billing-unsubscribe-modal-data-pipelines--light.png and b/frontend/__snapshots__/scenes-other-billing-v2--billing-unsubscribe-modal-data-pipelines--light.png differ diff --git a/frontend/__snapshots__/scenes-other-billing-v2--billing-v-2--dark.png b/frontend/__snapshots__/scenes-other-billing-v2--billing-v-2--dark.png index dd8385c01c855..93c95b9ab39fc 100644 Binary files a/frontend/__snapshots__/scenes-other-billing-v2--billing-v-2--dark.png and b/frontend/__snapshots__/scenes-other-billing-v2--billing-v-2--dark.png differ diff --git a/frontend/__snapshots__/scenes-other-billing-v2--billing-v-2--light.png b/frontend/__snapshots__/scenes-other-billing-v2--billing-v-2--light.png index 5a047eae33621..0543328b68b13 100644 Binary files a/frontend/__snapshots__/scenes-other-billing-v2--billing-v-2--light.png and b/frontend/__snapshots__/scenes-other-billing-v2--billing-v-2--light.png differ diff --git a/frontend/__snapshots__/scenes-other-billing-v2--billing-v-2-with-discount--dark.png b/frontend/__snapshots__/scenes-other-billing-v2--billing-v-2-with-discount--dark.png index 53c517a1d76bd..8379eea3966ed 100644 Binary files a/frontend/__snapshots__/scenes-other-billing-v2--billing-v-2-with-discount--dark.png and b/frontend/__snapshots__/scenes-other-billing-v2--billing-v-2-with-discount--dark.png differ diff --git a/frontend/__snapshots__/scenes-other-billing-v2--billing-v-2-with-discount--light.png b/frontend/__snapshots__/scenes-other-billing-v2--billing-v-2-with-discount--light.png index 8739317556a85..84c7358818a49 100644 Binary files a/frontend/__snapshots__/scenes-other-billing-v2--billing-v-2-with-discount--light.png and b/frontend/__snapshots__/scenes-other-billing-v2--billing-v-2-with-discount--light.png differ diff --git a/frontend/__snapshots__/scenes-other-billing-v2--billing-v-2-with-limit-and-100-percent-discount--dark.png b/frontend/__snapshots__/scenes-other-billing-v2--billing-v-2-with-limit-and-100-percent-discount--dark.png index 41cf076d4b61a..a0c43fd960e26 100644 Binary files a/frontend/__snapshots__/scenes-other-billing-v2--billing-v-2-with-limit-and-100-percent-discount--dark.png and b/frontend/__snapshots__/scenes-other-billing-v2--billing-v-2-with-limit-and-100-percent-discount--dark.png differ diff --git a/frontend/__snapshots__/scenes-other-billing-v2--billing-v-2-with-limit-and-100-percent-discount--light.png b/frontend/__snapshots__/scenes-other-billing-v2--billing-v-2-with-limit-and-100-percent-discount--light.png index c21fbc19dae0b..ceda7e31b5207 100644 Binary files a/frontend/__snapshots__/scenes-other-billing-v2--billing-v-2-with-limit-and-100-percent-discount--light.png and b/frontend/__snapshots__/scenes-other-billing-v2--billing-v-2-with-limit-and-100-percent-discount--light.png differ diff --git a/frontend/__snapshots__/scenes-other-onboarding--onboarding-billing--dark.png b/frontend/__snapshots__/scenes-other-onboarding--onboarding-billing--dark.png index 5f7d18dd2a783..73463aef127dd 100644 Binary files a/frontend/__snapshots__/scenes-other-onboarding--onboarding-billing--dark.png and b/frontend/__snapshots__/scenes-other-onboarding--onboarding-billing--dark.png differ diff --git a/frontend/__snapshots__/scenes-other-onboarding--onboarding-billing--light.png b/frontend/__snapshots__/scenes-other-onboarding--onboarding-billing--light.png index a9e3a5f2b7551..61c378927dc4c 100644 Binary files a/frontend/__snapshots__/scenes-other-onboarding--onboarding-billing--light.png and b/frontend/__snapshots__/scenes-other-onboarding--onboarding-billing--light.png differ diff --git a/frontend/src/lib/components/PayGateMini/PayGateButton.tsx b/frontend/src/lib/components/PayGateMini/PayGateButton.tsx index 31a18e5eee854..26790cf7d138e 100644 --- a/frontend/src/lib/components/PayGateMini/PayGateButton.tsx +++ b/frontend/src/lib/components/PayGateMini/PayGateButton.tsx @@ -1,4 +1,8 @@ import { LemonButton } from '@posthog/lemon-ui' +import { useValues } from 'kea' +import { FEATURE_FLAGS } from 'lib/constants' +import { featureFlagLogic, FeatureFlagsSet } from 'lib/logic/featureFlagLogic' +import { urls } from 'scenes/urls' import { BillingProductV2AddonType, BillingProductV2Type, BillingV2FeatureType, BillingV2Type } from '~/types' @@ -8,6 +12,7 @@ interface PayGateButtonProps { featureInfo: BillingV2FeatureType onCtaClick: () => void billing: BillingV2Type | null + isAddonProduct?: boolean scrollToProduct: boolean } @@ -17,16 +22,27 @@ export const PayGateButton = ({ featureInfo, onCtaClick, billing, + isAddonProduct, scrollToProduct = true, }: PayGateButtonProps): JSX.Element => { + const { featureFlags } = useValues(featureFlagLogic) return ( - {getCtaLabel(gateVariant, billing)} + {getCtaLabel(gateVariant, billing, featureFlags)} ) } @@ -35,9 +51,21 @@ const getCtaLink = ( gateVariant: 'add-card' | 'contact-sales' | 'move-to-cloud' | null, productWithFeature: BillingProductV2AddonType | BillingProductV2Type, featureInfo: BillingV2FeatureType, + featureFlags: FeatureFlagsSet, + subscriptionLevel?: BillingV2Type['subscription_level'], + isAddonProduct?: boolean, scrollToProduct: boolean = true ): string | undefined => { - if (gateVariant === 'add-card') { + if ( + gateVariant === 'add-card' && + !isAddonProduct && + featureFlags[FEATURE_FLAGS.SUBSCRIBE_TO_ALL_PRODUCTS] === 'test' && + subscriptionLevel === 'free' + ) { + return `/api/billing/activate?products=all_products:&redirect_path=${urls.organizationBilling()}&intent_product=${ + productWithFeature.type + }` + } else if (gateVariant === 'add-card') { return `/organization/billing${scrollToProduct ? `?products=${productWithFeature.type}` : ''}` } else if (gateVariant === 'contact-sales') { return `mailto:sales@posthog.com?subject=Inquiring about ${featureInfo.name}` @@ -49,9 +77,16 @@ const getCtaLink = ( const getCtaLabel = ( gateVariant: 'add-card' | 'contact-sales' | 'move-to-cloud' | null, - billing: BillingV2Type | null + billing: BillingV2Type | null, + featureFlags: FeatureFlagsSet ): string => { - if (gateVariant === 'add-card') { + if ( + gateVariant === 'add-card' && + featureFlags[FEATURE_FLAGS.SUBSCRIBE_TO_ALL_PRODUCTS] === 'test' && + billing?.subscription_level === 'free' + ) { + return 'Upgrade now' + } else if (gateVariant === 'add-card') { return billing?.has_active_subscription ? 'Upgrade now' : 'Subscribe now' } else if (gateVariant === 'contact-sales') { return 'Contact sales' diff --git a/frontend/src/lib/components/PayGateMini/PayGateMini.tsx b/frontend/src/lib/components/PayGateMini/PayGateMini.tsx index de33f34fbcc25..c76e4a7c030d9 100644 --- a/frontend/src/lib/components/PayGateMini/PayGateMini.tsx +++ b/frontend/src/lib/components/PayGateMini/PayGateMini.tsx @@ -2,13 +2,21 @@ import { IconInfo, IconOpenSidebar } from '@posthog/icons' import { LemonButton, Link, Tooltip } from '@posthog/lemon-ui' import clsx from 'clsx' import { useActions, useValues } from 'kea' +import { FEATURE_FLAGS } from 'lib/constants' +import { featureFlagLogic, FeatureFlagsSet } from 'lib/logic/featureFlagLogic' import posthog from 'posthog-js' import { useEffect } from 'react' import { billingLogic } from 'scenes/billing/billingLogic' import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic' import { getProductIcon } from 'scenes/products/Products' -import { AvailableFeature, BillingProductV2AddonType, BillingProductV2Type, BillingV2FeatureType } from '~/types' +import { + AvailableFeature, + BillingProductV2AddonType, + BillingProductV2Type, + BillingV2FeatureType, + BillingV2Type, +} from '~/types' import { upgradeModalLogic } from '../UpgradeModal/upgradeModalLogic' import { PayGateButton } from './PayGateButton' @@ -95,6 +103,7 @@ export function PayGateMini({ productWithFeature={productWithFeature} isGrandfathered={isGrandfathered} isAddonProduct={isAddonProduct} + billing={billing} featureInfoOnNextPlan={featureInfoOnNextPlan} handleCtaClick={handleCtaClick} > @@ -106,6 +115,7 @@ export function PayGateMini({ onCtaClick={handleCtaClick} billing={billing} scrollToProduct={scrollToProduct} + isAddonProduct={isAddonProduct} /> {docsLink && isCloudOrDev && ( void @@ -149,10 +160,12 @@ function PayGateContent({ productWithFeature, isGrandfathered, isAddonProduct, + billing, featureInfoOnNextPlan, children, handleCtaClick, }: PayGateContentProps): JSX.Element { + const { featureFlags } = useValues(featureFlagLogic) return (
void ): JSX.Element => { @@ -223,9 +240,13 @@ const renderUsageLimitMessage = ( .

+ ) : featureFlags[FEATURE_FLAGS.SUBSCRIBE_TO_ALL_PRODUCTS] === 'test' && + billing?.subscription_level === 'free' && + !isAddonProduct ? ( +

Upgrade to create more {featureInfo.name}

) : (

- Please upgrade your {productWithFeature.name} plan to create more {featureInfo.name} + Upgrade your {productWithFeature.name} plan to create more {featureInfo.name}

)}
@@ -234,7 +255,7 @@ const renderUsageLimitMessage = ( return ( <>

{featureInfo.description}

-

{renderGateVariantMessage(gateVariant, productWithFeature, isAddonProduct)}

+

{renderGateVariantMessage(gateVariant, productWithFeature, billing, featureFlags, isAddonProduct)}

) } @@ -242,6 +263,8 @@ const renderUsageLimitMessage = ( const renderGateVariantMessage = ( gateVariant: 'add-card' | 'contact-sales' | 'move-to-cloud' | null, productWithFeature: BillingProductV2AddonType | BillingProductV2Type, + billing: BillingV2Type | null, + featureFlags: FeatureFlagsSet, isAddonProduct?: boolean ): JSX.Element => { if (gateVariant === 'move-to-cloud') { @@ -252,7 +275,13 @@ const renderGateVariantMessage = ( Subscribe to the {productWithFeature?.name} addon to use this feature. ) + } else if ( + featureFlags[FEATURE_FLAGS.SUBSCRIBE_TO_ALL_PRODUCTS] === 'test' && + billing?.subscription_level === 'free' + ) { + return <>Upgrade to use this feature. } + return ( <> Upgrade your {productWithFeature?.name} plan to use this feature. diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx index c4009ae7d77d6..92327684c1fc2 100644 --- a/frontend/src/lib/constants.tsx +++ b/frontend/src/lib/constants.tsx @@ -206,6 +206,7 @@ export const FEATURE_FLAGS = { PERSONLESS_EVENTS_NOT_SUPPORTED: 'personless-events-not-supported', // owner: @raquelmsmith SESSION_REPLAY_UNIVERSAL_FILTERS: 'session-replay-universal-filters', // owner: #team-replay ALERTS: 'alerts', // owner: github.com/nikitaevg + SUBSCRIBE_TO_ALL_PRODUCTS: 'subscribe-to-all-products', // owner: #team-growth ERROR_TRACKING: 'error-tracking', // owner: #team-replay SETTINGS_BOUNCE_RATE_PAGE_VIEW_MODE: 'settings-bounce-rate-page-view-mode', // owner: @robbie-c SURVEYS_BRANCHING_LOGIC: 'surveys-branching-logic', // owner: @jurajmajerik #team-feature-success diff --git a/frontend/src/lib/lemon-ui/LemonBanner/LemonBanner.tsx b/frontend/src/lib/lemon-ui/LemonBanner/LemonBanner.tsx index 9ce2a5eb28fa2..c49bf90d79933 100644 --- a/frontend/src/lib/lemon-ui/LemonBanner/LemonBanner.tsx +++ b/frontend/src/lib/lemon-ui/LemonBanner/LemonBanner.tsx @@ -19,6 +19,7 @@ export interface LemonBannerProps { className?: string /** If provided, the banner will be dismissed and hidden when the key is set in localStorage. */ dismissKey?: string + hideIcon?: boolean } /** Generic alert message. */ @@ -29,6 +30,7 @@ export function LemonBanner({ action, className, dismissKey = '', + hideIcon = false, }: LemonBannerProps): JSX.Element | null { const logic = lemonBannerLogic({ dismissKey }) const { isDismissed } = useValues(logic) @@ -49,11 +51,12 @@ export function LemonBanner({ return (
- {type === 'warning' || type === 'error' ? ( - - ) : ( - - )} + {!hideIcon && + (type === 'warning' || type === 'error' ? ( + + ) : ( + + ))}
{children}
{action && } {showCloseButton && } onClick={_onClose} aria-label="close" />} diff --git a/frontend/src/mocks/fixtures/_billing.tsx b/frontend/src/mocks/fixtures/_billing.tsx index 0b24ab031e9f2..f8fa0010554ff 100644 --- a/frontend/src/mocks/fixtures/_billing.tsx +++ b/frontend/src/mocks/fixtures/_billing.tsx @@ -3835,4 +3835,5 @@ export const billingJson: BillingV2Type = { custom_limits_usd: {}, stripe_portal_url: 'https://billing.stripe.com/p/session/test_YWNjdF8xSElNRERFdUlhdFJYU2R6LF9QaEVJR3VyemlvMDZzRzdiQXZrc1AxSjNXZk1BellP0100ZsforDQG', + subscription_level: 'paid', } diff --git a/frontend/src/scenes/billing/AllProductsPlanComparison.tsx b/frontend/src/scenes/billing/AllProductsPlanComparison.tsx new file mode 100644 index 0000000000000..2817ee2129cce --- /dev/null +++ b/frontend/src/scenes/billing/AllProductsPlanComparison.tsx @@ -0,0 +1,557 @@ +import { IconCheckCircle, IconWarning, IconX } from '@posthog/icons' +import { LemonCollapse, LemonModal, LemonTag, Link } from '@posthog/lemon-ui' +import clsx from 'clsx' +import { useActions, useValues } from 'kea' +import { BillingUpgradeCTA } from 'lib/components/BillingUpgradeCTA' +import { FEATURE_FLAGS, UNSUBSCRIBE_SURVEY_ID } from 'lib/constants' +import { Tooltip } from 'lib/lemon-ui/Tooltip' +import { featureFlagLogic } from 'lib/logic/featureFlagLogic' +import { eventUsageLogic } from 'lib/utils/eventUsageLogic' +import React, { useState } from 'react' +import { getProductIcon } from 'scenes/products/Products' +import useResizeObserver from 'use-resize-observer' + +import { BillingProductV2AddonType, BillingProductV2Type, BillingV2FeatureType, BillingV2PlanType } from '~/types' + +import { convertLargeNumberToWords, getProration, getProrationMessage, getUpgradeProductLink } from './billing-utils' +import { billingLogic } from './billingLogic' +import { billingProductLogic } from './billingProductLogic' +import { UnsubscribeSurveyModal } from './UnsubscribeSurveyModal' + +export function PlanIcon({ + feature, + className, + timeDenominator, +}: { + feature?: BillingV2FeatureType + className?: string + timeDenominator?: string +}): JSX.Element { + return ( +
+ {!feature ? ( + <> + + + ) : feature.limit ? ( + <> + + {feature.limit && + `${convertLargeNumberToWords(feature.limit, null)} ${feature.unit && feature.unit}${ + timeDenominator ? `/${timeDenominator}` : '' + }`} + {feature.note} + + ) : ( + <> + + {feature.note} + + )} +
+ ) +} + +const PricingTiers = ({ + plan, + product, +}: { + plan: BillingV2PlanType + product: BillingProductV2Type | BillingProductV2AddonType +}): JSX.Element => { + const { width, ref: tiersRef } = useResizeObserver() + const tiers = plan?.tiers + + const allTierPrices = tiers?.map((tier) => parseFloat(tier.unit_amount_usd)) + const sigFigs = allTierPrices?.map((price) => price?.toString().split('.')[1]?.length).sort((a, b) => b - a)[0] + + return ( + <> + {tiers ? ( + tiers?.map((tier, i) => ( +
+ + {convertLargeNumberToWords(tier.up_to, tiers[i - 1]?.up_to, true, product.unit)} + + + {i === 0 && parseFloat(tier.unit_amount_usd) === 0 + ? 'Free' + : `$${parseFloat(tier.unit_amount_usd).toFixed(sigFigs)}`} + +
+ )) + ) : product?.free_allocation ? ( +
+ + Up to {convertLargeNumberToWords(product?.free_allocation, null)} {product?.unit}s/mo + + Free +
+ ) : null} + + ) +} + +/** + * Determines the pricing description for a given plan. + * + * @param {Object} plan + * @param {boolean} plan.free_allocation - Indicates if the plan has a free allocation. + * @param {boolean} plan.tiers - Indicates if the plan has tiers. + * @param {string} plan.unit_amount_usd - The unit amount in USD. + * @param {boolean} plan.contact_support - Indicates if the plan requires contacting support. + * @param {string} plan.included_if - Condition for plan inclusion. + * @returns {string} - The pricing description for the plan. + */ +function getPlanDescription(plan: BillingV2PlanType): string { + if (plan.free_allocation && !plan.tiers) { + return 'Free forever' + } else if (plan.unit_amount_usd) { + return `$${parseFloat(plan.unit_amount_usd).toFixed(0)} per month` + } else if (plan.contact_support) { + return 'Custom' + } else if (plan.included_if === 'has_subscription') { + return 'Usage-based - starting at $0 per month' + } + return '$0 per month' +} + +export const AllProductsPlanComparison = ({ + product, + includeAddons = false, +}: { + product: BillingProductV2Type + includeAddons?: boolean +}): JSX.Element | null => { + const plans = product.plans?.filter( + (plan) => !plan.included_if || plan.included_if == 'has_subscription' || plan.current_plan + ) + if (plans?.length === 0) { + return null + } + const { billing, redirectPath, timeRemainingInSeconds, timeTotalInSeconds } = useValues(billingLogic) + const { ref: planComparisonRef } = useResizeObserver() + const { reportBillingUpgradeClicked } = useActions(eventUsageLogic) + const currentPlanIndex = plans.findIndex((plan) => plan.current_plan) + const { surveyID, comparisonModalHighlightedFeatureKey } = useValues(billingProductLogic({ product })) + const { reportSurveyShown, setSurveyResponse } = useActions(billingProductLogic({ product })) + const { featureFlags } = useValues(featureFlagLogic) + + const nonInclusionProducts = billing?.products.filter((p) => !p.inclusion_only) || [] + const inclusionProducts = billing?.products.filter((p) => !!p.inclusion_only) || [] + const sortedProducts = nonInclusionProducts + ?.filter((p) => p.type === product.type) + .slice() + .concat(nonInclusionProducts.filter((p) => p.type !== product.type)) + const platformAndSupportProduct = inclusionProducts.find((p) => p.type === 'platform_and_support') + const platformAndSupportPlans = platformAndSupportProduct?.plans.filter((p) => !p.contact_support) || [] + + const upgradeButtons = plans?.map((plan, i) => { + return ( + + = currentPlanIndex) + ? 'default' + : 'alt' + } + fullWidth + center + disableClientSideRouting={!plan.contact_support} + disabledReason={ + plan.included_if == 'has_subscription' && i >= currentPlanIndex + ? billing?.has_active_subscription + ? 'Unsubscribe from all products to remove' + : null + : plan.current_plan + ? 'Current plan' + : undefined + } + onClick={() => { + if (!plan.current_plan) { + // TODO: add current plan key and new plan key + reportBillingUpgradeClicked(product.type) + } + if (plan.included_if == 'has_subscription' && !plan.current_plan && i < currentPlanIndex) { + setSurveyResponse(product.type, '$survey_response_1') + reportSurveyShown(UNSUBSCRIBE_SURVEY_ID, product.type) + } + }} + data-attr={`upgrade-${plan.name}`} + > + {plan.current_plan + ? 'Current plan' + : i < currentPlanIndex + ? 'Downgrade' + : plan.contact_support + ? 'Get in touch' + : plan.included_if == 'has_subscription' && + i >= currentPlanIndex && + !billing?.has_active_subscription + ? 'Upgrade' + : plan.free_allocation && !plan.tiers + ? 'Select' // Free plan + : 'Upgrade'} + + + ) + }) + + return ( +
+ {surveyID && } + + + {/* Plan name header row */} + + + ))} + + + + {/* Plan price row */} + + + {platformAndSupportPlans?.map((plan) => { + const { prorationAmount, isProrated } = getProration({ + timeRemainingInSeconds, + timeTotalInSeconds, + amountUsd: plan.unit_amount_usd, + hasActiveSubscription: billing?.has_active_subscription, + }) + return ( + + ) + })} + + {/* CTA Row */} + + + {/* Inclusion products */} + {inclusionProducts.reverse().map((includedProduct) => { + const includedPlans = includedProduct.plans.filter( + (plan) => plan.included_if == 'has_subscription' || plan.current_plan + ) + return ( + + + {/* Inclusion product title row */} + + + {includedPlans + .find((plan: BillingV2PlanType) => plan.included_if == 'has_subscription') + ?.features?.map((feature) => ( + // Inclusion product feature row + + + {includedPlans?.map((plan) => ( + + {/* Some products don't have a free plan, so we need to pretend there is one + so the features line up in the correct columns in the UI. This is kind of + hacky because it assumes we only have 2 plans total, but it works for now. + */} + {includedPlans?.length === 1 && ( + + )} + + + ))} + + ))} + + ) + })} + +
+ {platformAndSupportPlans?.map((plan) => ( + +

{plan.name}

+
Monthly {product.tiered && 'base '} price + {getPlanDescription(plan)} + {isProrated && ( +

+ {getProrationMessage(prorationAmount, plan.unit_amount_usd)} +

+ )} +
+ {upgradeButtons} +
+
+ {getProductIcon(includedProduct.name, includedProduct.icon_key, 'text-2xl')} + + {includedProduct.name} + +
+
+ + {feature.name} + + + + + feature.key === thisPlanFeature.key + )} + className="text-base" + /> +
+ +

Product features breakdown:

+ ({ + header: ( + + {getProductIcon(currentProduct.name, currentProduct.icon_key, 'text-2xl')} + + {currentProduct.name} {currentProduct.type === product.type ? '(this product)' : ''} + + + ), + className: 'bg-white', + key: currentProduct.type, + content: ( + + + {/* Pricing row */} + + + {currentProduct.plans?.map((plan) => ( + + ))} + + + +

Product Features:

+ + + {currentProduct.plans[currentProduct.plans.length - 1]?.features?.map( + (feature, i) => ( + + + {currentProduct.plans?.map((plan) => ( + + ))} + + ) + )} + {includeAddons && product.addons.length > 0 && ( + + + + )} + {includeAddons && + currentProduct.addons + ?.filter((addon) => { + if (addon.inclusion_only) { + if (featureFlags[FEATURE_FLAGS.PERSONLESS_EVENTS_NOT_SUPPORTED]) { + return false + } + } + return true + }) + .map((addon) => { + return addon.tiered ? ( + + + {plans?.map((plan, i) => { + // If the parent plan is free, the addon isn't available + return !addon.inclusion_only ? ( + plan.free_allocation && !plan.tiers ? ( + + ) : ( + + ) + ) : plan.free_allocation && !plan.tiers ? ( + + ) : ( + + ) + })} + + ) : null + })} + +
+ {includeAddons && currentProduct.addons?.length > 0 && ( +

+ {currentProduct.name} +

+ )} +

Priced per {currentProduct.unit}

+
+ +
+ +
+ {feature.name} +
+
+
+ feature.key === thisPlanFeature.key + )} + className="text-base" + /> +
+

Available add-ons:

+
+

+ + + {addon.name} + + + + + {addon.inclusion_only ? 'config' : 'add-on'} + + +

+

+ Priced per {addon.unit} +

+
+

+ Not available on this plan. +

+
+ + + + + +
+ ), + })) || [] + } + /> +
+ ) +} + +export const AllProductsPlanComparisonModal = ({ + product, + title, + includeAddons = false, + modalOpen, + onClose, +}: { + product: BillingProductV2Type + title?: string + includeAddons?: boolean + modalOpen: boolean + onClose?: () => void +}): JSX.Element | null => { + return ( + +
+
+ {title ?

{title}

:

{product.name} plans

} + +
+
+
+ ) +} + +const AddonPlanTiers = ({ + plan, + addon, +}: { + plan: BillingV2PlanType + addon: BillingProductV2AddonType +}): JSX.Element => { + const [showTiers, setShowTiers] = useState(false) + + return showTiers ? ( + <> + +

+ setShowTiers(false)} className="text-xs"> + Hide volume discounts + +

+ + ) : ( + <> +

+ + First {convertLargeNumberToWords(plan?.tiers?.[0].up_to || 0, null)} {addon.unit}s free + + , then just ${plan?.tiers?.[1].unit_amount_usd}. +

+

+ setShowTiers(true)} className="text-xs"> + Show volume discounts + +

+ + ) +} diff --git a/frontend/src/scenes/billing/Billing.tsx b/frontend/src/scenes/billing/Billing.tsx index c6cb267ffd255..7052186af73f6 100644 --- a/frontend/src/scenes/billing/Billing.tsx +++ b/frontend/src/scenes/billing/Billing.tsx @@ -8,20 +8,24 @@ import { Field, Form } from 'kea-forms' import { router } from 'kea-router' import { SurprisedHog } from 'lib/components/hedgehogs' import { supportLogic } from 'lib/components/Support/supportLogic' +import { FEATURE_FLAGS } from 'lib/constants' import { dayjs } from 'lib/dayjs' import { useResizeBreakpoints } from 'lib/hooks/useResizeObserver' import { LemonBanner } from 'lib/lemon-ui/LemonBanner' import { LemonLabel } from 'lib/lemon-ui/LemonLabel/LemonLabel' import { SpinnerOverlay } from 'lib/lemon-ui/Spinner/Spinner' import { Tooltip } from 'lib/lemon-ui/Tooltip' +import { featureFlagLogic } from 'lib/logic/featureFlagLogic' import { useEffect } from 'react' import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic' import { SceneExport } from 'scenes/sceneTypes' import { urls } from 'scenes/urls' +import { BillingCTAHero } from './BillingCTAHero' import { BillingHero } from './BillingHero' import { billingLogic } from './billingLogic' import { BillingProduct } from './BillingProduct' +import { UnsubscribeCard } from './UnsubscribeCard' export const scene: SceneExport = { component: Billing, @@ -42,6 +46,7 @@ export function Billing(): JSX.Element { const { reportBillingV2Shown } = useActions(billingLogic) const { preflight, isCloudOrDev } = useValues(preflightLogic) const { openSupportForm } = useActions(supportLogic) + const { featureFlags } = useValues(featureFlagLogic) if (preflight && !isCloudOrDev) { router.actions.push(urls.default()) @@ -87,8 +92,9 @@ export function Billing(): JSX.Element { } const products = billing?.products + const platformAndSupportProduct = products?.find((product) => product.type === 'platform_and_support') return ( -
+
{showLicenseDirectInput && ( <>
@@ -119,11 +125,15 @@ export function Billing(): JSX.Element { ) : null} {!billing?.has_active_subscription && ( - <> -
+
+ {featureFlags[FEATURE_FLAGS.SUBSCRIBE_TO_ALL_PRODUCTS] === 'test' ? ( + platformAndSupportProduct ? ( + + ) : null + ) : ( -
- + )} +
)}
{!isOnboarding && billing?.billing_period && ( -
+
{billing?.has_active_subscription && ( <> @@ -204,7 +214,7 @@ export function Billing(): JSX.Element {
{!isOnboarding && billing?.has_active_subscription && ( -
+
+ +

Products

- {products ?.filter((product) => !product.inclusion_only || product.plans.some((plan) => !plan.included_if)) @@ -278,6 +289,16 @@ export function Billing(): JSX.Element {
))} +
+ {featureFlags[FEATURE_FLAGS.SUBSCRIBE_TO_ALL_PRODUCTS] === 'test' && + billing?.subscription_level == 'paid' && + !!platformAndSupportProduct ? ( + <> + + + + ) : null} +
) } diff --git a/frontend/src/scenes/billing/BillingCTAHero.tsx b/frontend/src/scenes/billing/BillingCTAHero.tsx new file mode 100644 index 0000000000000..16b6b9338f2c8 --- /dev/null +++ b/frontend/src/scenes/billing/BillingCTAHero.tsx @@ -0,0 +1,67 @@ +import { LemonButton } from '@posthog/lemon-ui' +import { useActions, useValues } from 'kea' +import { BlushingHog } from 'lib/components/hedgehogs' +import useResizeObserver from 'use-resize-observer' + +import { BillingProductV2Type } from '~/types' + +import { billingLogic } from './billingLogic' +import { billingProductLogic } from './billingProductLogic' +import { PlanComparisonModal } from './PlanComparison' + +export const BillingCTAHero = ({ product }: { product: BillingProductV2Type }): JSX.Element => { + const { width, ref: billingHeroRef } = useResizeObserver() + + const { redirectPath } = useValues(billingLogic) + const { isPlanComparisonModalOpen, billingProductLoading } = useValues(billingProductLogic({ product })) + const { toggleIsPlanComparisonModalOpen, setBillingProductLoading } = useActions(billingProductLogic({ product })) + + return ( +
+
+

Get the whole hog.

+

Only pay for what you use.

+
+

PostHog comes with all product features on every plan.

+

+ Add your credit card to remove usage limits and unlock all platform features. Set billing limits + as low as $0 to control your spend. +

+

P.S. You still keep the monthly free allotment for every product!

+
+
+ setBillingProductLoading(product.type)} + > + Upgrade now + + toggleIsPlanComparisonModalOpen()} + type="primary" + > + Compare plans + +
+
+ {width && width > 500 && ( +
+ +
+ )} + toggleIsPlanComparisonModalOpen()} + /> +
+ ) +} diff --git a/frontend/src/scenes/billing/BillingHero.tsx b/frontend/src/scenes/billing/BillingHero.tsx index 7045b3b048af9..af8e4639e7ef4 100644 --- a/frontend/src/scenes/billing/BillingHero.tsx +++ b/frontend/src/scenes/billing/BillingHero.tsx @@ -13,7 +13,7 @@ export const BillingHero = (): JSX.Element => {

Get the whole hog.

Only pay for what you use.

- Subscribe to get access to premium product and platform features. Set billing limits as low as $0 to + Upgrade to get access to premium product and platform features. Set billing limits as low as $0 to control spend.

diff --git a/frontend/src/scenes/billing/BillingProduct.tsx b/frontend/src/scenes/billing/BillingProduct.tsx index 7d48c0c2e079d..c07f58b1f1d04 100644 --- a/frontend/src/scenes/billing/BillingProduct.tsx +++ b/frontend/src/scenes/billing/BillingProduct.tsx @@ -78,8 +78,12 @@ export const BillingProduct = ({ product }: { product: BillingProductV2Type }): const upgradeToPlanKey = upgradePlan?.plan_key const currentPlanKey = currentPlan?.plan_key + + // Note(@zach): The upgrade card will be removed when Subscribe to all products is fully rolled out const showUpgradeCard = - (upgradePlan?.product_key !== 'platform_and_support' || product?.addons?.length === 0) && upgradePlan + (upgradePlan?.product_key !== 'platform_and_support' || product?.addons?.length === 0) && + upgradePlan && + (featureFlags[FEATURE_FLAGS.SUBSCRIBE_TO_ALL_PRODUCTS] !== 'test' || billing?.subscription_level == 'custom') const { ref, size } = useResizeBreakpoints({ 0: 'small', @@ -88,7 +92,7 @@ export const BillingProduct = ({ product }: { product: BillingProductV2Type }): return (
Learn how to reduce your bill - {product.plans?.length > 0 ? ( - { - setSurveyResponse(product.type, '$survey_response_1') - reportSurveyShown(UNSUBSCRIBE_SURVEY_ID, product.type) - }} - > - Unsubscribe - - ) : ( - - Contact support to unsubscribe - - )} + {featureFlags[FEATURE_FLAGS.SUBSCRIBE_TO_ALL_PRODUCTS] !== 'test' && + (product.plans?.length > 0 ? ( + { + setSurveyResponse(product.type, '$survey_response_1') + reportSurveyShown(UNSUBSCRIBE_SURVEY_ID, product.type) + }} + > + Unsubscribe + + ) : ( + + Contact support to unsubscribe + + ))} } /> @@ -284,7 +289,29 @@ export const BillingProduct = ({ product }: { product: BillingProductV2Type }): {showTierBreakdown && } {product.addons?.length > 0 && (
-

Addons

+

Add-ons

+ {featureFlags[FEATURE_FLAGS.SUBSCRIBE_TO_ALL_PRODUCTS] == 'test' && + billing?.subscription_level == 'free' && ( + +
+
+ Add-ons are only available on paid plans. Upgrade to access these + features. +
+ setBillingProductLoading(product.type)} + > + Upgrade now + +
+
+ )}
{product.addons // TODO: enhanced_persons: remove this filter @@ -392,12 +419,14 @@ export const BillingProduct = ({ product }: { product: BillingProductV2Type }): !upgradePlan.unit_amount_usd && ( } disableClientSideRouting diff --git a/frontend/src/scenes/billing/BillingProductAddon.tsx b/frontend/src/scenes/billing/BillingProductAddon.tsx index 7456c4baedee1..ff1ea9842f1b3 100644 --- a/frontend/src/scenes/billing/BillingProductAddon.tsx +++ b/frontend/src/scenes/billing/BillingProductAddon.tsx @@ -1,8 +1,9 @@ -import { IconCheckCircle, IconDocument, IconPlus } from '@posthog/icons' +import { IconCheckCircle, IconPlus } from '@posthog/icons' import { LemonButton, LemonSelectOptions, LemonTag, Link, Tooltip } from '@posthog/lemon-ui' import { useActions, useValues } from 'kea' -import { UNSUBSCRIBE_SURVEY_ID } from 'lib/constants' +import { FEATURE_FLAGS, UNSUBSCRIBE_SURVEY_ID } from 'lib/constants' import { More } from 'lib/lemon-ui/LemonButton/More' +import { featureFlagLogic } from 'lib/logic/featureFlagLogic' import { ReactNode, useMemo, useRef } from 'react' import { getProductIcon } from 'scenes/products/Products' @@ -29,6 +30,7 @@ const formatFlatRate = (flatRate: number, unit: string | null): string | ReactNo export const BillingProductAddon = ({ addon }: { addon: BillingProductV2AddonType }): JSX.Element => { const productRef = useRef(null) + const { featureFlags } = useValues(featureFlagLogic) const { billing, redirectPath, billingError, timeTotalInSeconds, timeRemainingInSeconds } = useValues(billingLogic) const { isPricingModalOpen, currentAndUpgradePlans, surveyID, billingProductLoading } = useValues( billingProductLogic({ product: addon, productRef }) @@ -93,7 +95,14 @@ export const BillingProductAddon = ({ addon }: { addon: BillingProductV2AddonTyp ) )}
-

{addon.description}

+

+ {addon.description}{' '} + {addon.docs_url && ( + <> + Read the docs for more information. + + )} +

{is_enhanced_persons_og_customer && (

- {addon.docs_url && ( - } - size="small" - to={addon.docs_url} - tooltip="Read the docs" - /> - )} {addon.subscribed && !addon.inclusion_only ? ( <> - Remove addon + Remove add-on } @@ -164,7 +165,12 @@ export const BillingProductAddon = ({ addon }: { addon: BillingProductV2AddonTyp icon={} size="small" disableClientSideRouting - disabledReason={billingError && billingError.message} + disabledReason={ + (billingError && billingError.message) || + (featureFlags[FEATURE_FLAGS.SUBSCRIBE_TO_ALL_PRODUCTS] === 'test' && + billing?.subscription_level === 'free' && + 'Upgrade to add add-ons') + } loading={billingProductLoading === addon.type} onClick={() => initiateProductUpgrade( @@ -191,7 +197,7 @@ export const BillingProductAddon = ({ addon }: { addon: BillingProductV2AddonTyp
- {addonFeatures?.length > 1 && ( + {addonFeatures?.length > 2 && (

Features included:

diff --git a/frontend/src/scenes/billing/PlanComparison.scss b/frontend/src/scenes/billing/PlanComparison.scss index 6f72a074f8b61..93ec0768904b3 100644 --- a/frontend/src/scenes/billing/PlanComparison.scss +++ b/frontend/src/scenes/billing/PlanComparison.scss @@ -6,7 +6,7 @@ table.PlanComparison { table-layout: fixed; td { - padding: 0.75rem 1.25rem; + padding: 0.75rem 1rem; vertical-align: top; &.PlanTable__td__upgradeButton { @@ -16,22 +16,22 @@ table.PlanComparison { } th { - padding: 0.75rem 1.25rem; + padding: 0.75rem 1rem; font-weight: 600; text-align: left; vertical-align: top; &.PlanTable__th__section { - padding: 0.25rem 1.25rem; + padding: 0.25rem 1rem; font-weight: 500; } &.PlanTable__th__feature { - padding: 0.75rem 1.25rem 0.75rem 3.25rem; + padding: 0.75rem 1rem 0.75rem 3.25rem; font-weight: 600; &.PlanTable__th__feature--reduced_padding { - padding: 0.75rem 1.25rem; + padding: 0.75rem 1rem; } } diff --git a/frontend/src/scenes/billing/PlanComparison.tsx b/frontend/src/scenes/billing/PlanComparison.tsx index 42c627495c64e..741609879ffd2 100644 --- a/frontend/src/scenes/billing/PlanComparison.tsx +++ b/frontend/src/scenes/billing/PlanComparison.tsx @@ -11,7 +11,6 @@ import { featureFlagLogic } from 'lib/logic/featureFlagLogic' import { eventUsageLogic } from 'lib/utils/eventUsageLogic' import React, { useState } from 'react' import { getProductIcon } from 'scenes/products/Products' -import { urls } from 'scenes/urls' import useResizeObserver from 'use-resize-observer' import { BillingProductV2AddonType, BillingProductV2Type, BillingV2FeatureType, BillingV2PlanType } from '~/types' @@ -128,6 +127,7 @@ export const PlanComparison = ({ const { reportSurveyShown, setSurveyResponse } = useActions(billingProductLogic({ product })) const { featureFlags } = useValues(featureFlagLogic) + const ctaAction = featureFlags[FEATURE_FLAGS.SUBSCRIBE_TO_ALL_PRODUCTS] === 'test' ? 'Upgrade' : 'Subscribe' const upgradeButtons = plans?.map((plan, i) => { return ( @@ -135,13 +135,14 @@ export const PlanComparison = ({ to={ plan.contact_support ? 'mailto:sales@posthog.com?subject=Enterprise%20plan%20request' - : !plan.included_if - ? getUpgradeProductLink(product, plan.plan_key || '', redirectPath, includeAddons) - : plan.included_if == 'has_subscription' && - i >= currentPlanIndex && - !billing?.has_active_subscription - ? urls.organizationBilling() - : undefined + : getUpgradeProductLink({ + product, + upgradeToPlanKey: plan.plan_key || '', + redirectPath, + includeAddons, + subscriptionLevel: billing?.subscription_level, + featureFlags, + }) } type={plan.current_plan || i < currentPlanIndex ? 'secondary' : 'primary'} status={ @@ -182,15 +183,20 @@ export const PlanComparison = ({ : plan.included_if == 'has_subscription' && i >= currentPlanIndex && !billing?.has_active_subscription - ? 'View products' + ? ctaAction : plan.free_allocation && !plan.tiers ? 'Select' // Free plan - : 'Subscribe'} + : ctaAction} {!plan.current_plan && !plan.free_allocation && includeAddons && product.addons?.length > 0 && (

@@ -233,7 +239,9 @@ export const PlanComparison = ({ : plan.contact_support ? 'Custom' : plan.included_if == 'has_subscription' - ? 'Free, included with any product subscription' + ? featureFlags[FEATURE_FLAGS.SUBSCRIBE_TO_ALL_PRODUCTS] === 'test' + ? 'Usage-based - starting at $0' + : 'Free, included with any product subscription' : '$0 per month'} {isProrated && (

@@ -336,7 +344,9 @@ export const PlanComparison = ({ })} -

Product Features:

+

+ {product.type === 'platform_and_support' ? 'Platform' : 'Product'} features: +

{fullyFeaturedPlan?.features?.map((feature, i) => ( @@ -480,20 +490,22 @@ export const PlanComparison = ({ export const PlanComparisonModal = ({ product, + title, includeAddons = false, modalOpen, onClose, }: { product: BillingProductV2Type + title?: string includeAddons?: boolean modalOpen: boolean onClose?: () => void }): JSX.Element | null => { return ( -
+
-

{product.name} plans

+ {title ?

{title}

:

{product.name} plans

}
diff --git a/frontend/src/scenes/billing/UnsubscribeCard.tsx b/frontend/src/scenes/billing/UnsubscribeCard.tsx new file mode 100644 index 0000000000000..017378fb0077f --- /dev/null +++ b/frontend/src/scenes/billing/UnsubscribeCard.tsx @@ -0,0 +1,52 @@ +import { LemonButton, Link } from '@posthog/lemon-ui' +import { useActions } from 'kea' +import { UNSUBSCRIBE_SURVEY_ID } from 'lib/constants' + +import { BillingProductV2Type } from '~/types' + +import { billingProductLogic } from './billingProductLogic' + +export const UnsubscribeCard = ({ product }: { product: BillingProductV2Type }): JSX.Element => { + const { reportSurveyShown, setSurveyResponse } = useActions(billingProductLogic({ product })) + + return ( +
+
+

Need to take a break?

+

+ Downgrade to the free plan at any time. You'll lose access to platform features and usage limits + will apply immediately. +

+

+ Need to control your costs? Learn about ways to{' '} + + reduce your bill + {' '} + or{' '} + + chat with support. + {' '} + Check out more about our pricing on our{' '} + + pricing page + + . +

+ { + setSurveyResponse(product.type, '$survey_response_1') + reportSurveyShown(UNSUBSCRIBE_SURVEY_ID, product.type) + }} + > + Downgrade to free plan + +
+
+ ) +} diff --git a/frontend/src/scenes/billing/UnsubscribeSurveyModal.tsx b/frontend/src/scenes/billing/UnsubscribeSurveyModal.tsx index 042c1b2f95c47..78020c5de6112 100644 --- a/frontend/src/scenes/billing/UnsubscribeSurveyModal.tsx +++ b/frontend/src/scenes/billing/UnsubscribeSurveyModal.tsx @@ -2,6 +2,8 @@ import './UnsubscribeSurveyModal.scss' import { LemonBanner, LemonButton, LemonModal, LemonTextArea, Link } from '@posthog/lemon-ui' import { useActions, useValues } from 'kea' +import { FEATURE_FLAGS } from 'lib/constants' +import { featureFlagLogic } from 'lib/logic/featureFlagLogic' import { BillingProductV2AddonType, BillingProductV2Type } from '~/types' @@ -14,7 +16,8 @@ export const UnsubscribeSurveyModal = ({ }: { product: BillingProductV2Type | BillingProductV2AddonType }): JSX.Element | null => { - const { surveyID, surveyResponse } = useValues(billingProductLogic({ product })) + const { featureFlags } = useValues(featureFlagLogic) + const { surveyID, surveyResponse, isAddonProduct } = useValues(billingProductLogic({ product })) const { setSurveyResponse, reportSurveyDismissed } = useActions(billingProductLogic({ product })) const { deactivateProduct, resetUnsubscribeError } = useActions(billingLogic) const { unsubscribeError, billingLoading, billing } = useValues(billingLogic) @@ -25,7 +28,17 @@ export const UnsubscribeSurveyModal = ({ product.type == 'data_pipelines' || (product.type == 'product_analytics' && (product as BillingProductV2Type)?.addons?.filter((addon) => addon.type === 'data_pipelines')[0] - ?.subscribed) + ?.subscribed) || + billing?.subscription_level === 'paid' + + const subscribeToAllProductsAndPaid = + featureFlags[FEATURE_FLAGS.SUBSCRIBE_TO_ALL_PRODUCTS] === 'test' && billing?.subscription_level === 'paid' + let action = 'Unsubscribe' + let actionVerb = 'unsubscribing' + if (subscribeToAllProductsAndPaid) { + action = isAddonProduct ? 'Remove addon' : 'Downgrade' + actionVerb = isAddonProduct ? 'removing this addon' : 'downgrading' + } return ( { - deactivateProduct(product.type) + deactivateProduct( + featureFlags[FEATURE_FLAGS.SUBSCRIBE_TO_ALL_PRODUCTS] === 'test' && + billing?.subscription_level === 'paid' && + !isAddonProduct + ? 'all_products' + : product.type + ) }} loading={billingLoading} > - Unsubscribe + {action} } @@ -68,7 +91,7 @@ export const UnsubscribeSurveyModal = ({ ) : (

- Your invoice will be billed immediately.{' '} + Any outstanding invoices will be billed immediately.{' '} View invoices @@ -77,7 +100,7 @@ export const UnsubscribeSurveyModal = ({ )} { setSurveyResponse(value, '$survey_response') diff --git a/frontend/src/scenes/billing/billing-utils.ts b/frontend/src/scenes/billing/billing-utils.ts index 07d738e9efbd3..49457eb9a6a16 100644 --- a/frontend/src/scenes/billing/billing-utils.ts +++ b/frontend/src/scenes/billing/billing-utils.ts @@ -1,4 +1,6 @@ +import { FEATURE_FLAGS } from 'lib/constants' import { dayjs } from 'lib/dayjs' +import { FeatureFlagsSet } from 'lib/logic/featureFlagLogic' import { BillingProductV2Type, BillingV2TierType, BillingV2Type } from '~/types' @@ -158,14 +160,32 @@ export const convertAmountToUsage = ( return Math.round(usage) } -export const getUpgradeProductLink = ( - product: BillingProductV2Type, - upgradeToPlanKey: string, - redirectPath?: string, - includeAddons: boolean = true -): string => { - let url = '/api/billing/activate?products=' - url += `${product.type}:${upgradeToPlanKey},` +export const getUpgradeProductLink = ({ + product, + upgradeToPlanKey, + redirectPath, + includeAddons = true, + subscriptionLevel, + featureFlags, +}: { + product: BillingProductV2Type + upgradeToPlanKey: string + redirectPath?: string + includeAddons: boolean + subscriptionLevel?: BillingV2Type['subscription_level'] + featureFlags: FeatureFlagsSet +}): string => { + let url = '/api/billing/activate?' + if (redirectPath) { + url += `redirect_path=${redirectPath}&` + } + + if (featureFlags[FEATURE_FLAGS.SUBSCRIBE_TO_ALL_PRODUCTS] === 'test' && subscriptionLevel == 'free') { + url += `products=all_products:&intent_product=${product.type}` + return url + } + url += `products=${product.type}:${upgradeToPlanKey},` + if (includeAddons && product.addons?.length) { for (const addon of product.addons) { if ( @@ -179,9 +199,6 @@ export const getUpgradeProductLink = ( } // remove the trailing comma that will be at the end of the url url = url.slice(0, -1) - if (redirectPath) { - url += `&redirect_path=${redirectPath}` - } return url } @@ -251,3 +268,7 @@ export const getProration = ({ prorationAmount: prorationAmount.toFixed(2), } } + +export const getProrationMessage = (prorationAmount: string, unitAmountUsd: string | null): string => { + return `Pay ~$${prorationAmount} today (prorated) and $${parseInt(unitAmountUsd || '0')} every month thereafter.` +} diff --git a/frontend/src/scenes/billing/billingLogic.tsx b/frontend/src/scenes/billing/billingLogic.tsx index dcfce29f300af..30604688729a5 100644 --- a/frontend/src/scenes/billing/billingLogic.tsx +++ b/frontend/src/scenes/billing/billingLogic.tsx @@ -202,7 +202,7 @@ export const billingLogic = kea([ try { const response = await api.getResponse('api/billing/deactivate?products=' + key) const jsonRes = await getJSONOrNull(response) - lemonToast.success('Product unsubscribed') + lemonToast.success('You have been unsubscribed') actions.reportProductUnsubscribed(key) return parseBillingResponse(jsonRes) } catch (error: any) { diff --git a/frontend/src/scenes/billing/billingProductLogic.ts b/frontend/src/scenes/billing/billingProductLogic.ts index c66abb53c5f43..e365ca8fa2e72 100644 --- a/frontend/src/scenes/billing/billingProductLogic.ts +++ b/frontend/src/scenes/billing/billingProductLogic.ts @@ -1,6 +1,8 @@ import { LemonDialog } from '@posthog/lemon-ui' import { actions, connect, events, kea, key, listeners, path, props, reducers, selectors } from 'kea' import { forms } from 'kea-forms' +import { FEATURE_FLAGS } from 'lib/constants' +import { featureFlagLogic } from 'lib/logic/featureFlagLogic' import posthog from 'posthog-js' import React from 'react' @@ -24,7 +26,12 @@ export const billingProductLogic = kea([ key((props) => props.product.type), path(['scenes', 'billing', 'billingProductLogic']), connect({ - values: [billingLogic, ['billing', 'isUnlicensedDebug', 'scrollToProductKey', 'unsubscribeError']], + values: [ + billingLogic, + ['billing', 'isUnlicensedDebug', 'scrollToProductKey', 'unsubscribeError'], + featureFlagLogic, + ['featureFlags'], + ], actions: [ billingLogic, [ @@ -63,13 +70,8 @@ export const billingProductLogic = kea([ product, redirectPath, }), - handleProductUpgrade: ( - product: BillingProductV2Type | BillingProductV2AddonType, - plan: BillingV2PlanType, - redirectPath?: string - ) => ({ - plan, - product, + handleProductUpgrade: (products: string, redirectPath?: string) => ({ + products, redirectPath, }), }), @@ -237,6 +239,11 @@ export const billingProductLogic = kea([ ].filter(Boolean) }, ], + isAddonProduct: [ + (s, p) => [s.billing, p.product], + (billing, product): boolean => + !!billing?.products?.some((p) => p.addons?.some((addon) => addon.type === product?.type)), + ], })), listeners(({ actions, values, props }) => ({ updateBillingLimitsSuccess: () => { @@ -313,8 +320,6 @@ export const billingProductLogic = kea([ behavior: 'smooth', block: 'center', }) - props.productRef?.current.classList.add('border') - props.productRef?.current.classList.add('border-primary-3000') } }, 0) } @@ -322,10 +327,17 @@ export const billingProductLogic = kea([ }, initiateProductUpgrade: ({ plan, product, redirectPath }) => { actions.setBillingProductLoading(product.type) - actions.handleProductUpgrade(product, plan, redirectPath) + let products = `${product.type}:${plan?.plan_key}` + if ( + values.featureFlags[FEATURE_FLAGS.SUBSCRIBE_TO_ALL_PRODUCTS] === 'test' && + values.billing?.subscription_level == 'free' + ) { + products += ',all_products:' + } + actions.handleProductUpgrade(products, redirectPath) }, - handleProductUpgrade: ({ plan, product, redirectPath }) => { - window.location.href = `/api/billing/activate?products=${product.type}:${plan?.plan_key}${ + handleProductUpgrade: ({ products, redirectPath }) => { + window.location.href = `/api/billing/activate?products=${products}${ redirectPath && `&redirect_path=${redirectPath}` }` }, diff --git a/frontend/src/scenes/onboarding/OnboardingBillingStep.tsx b/frontend/src/scenes/onboarding/OnboardingBillingStep.tsx index 463b3a80918f6..c66febd36d5d6 100644 --- a/frontend/src/scenes/onboarding/OnboardingBillingStep.tsx +++ b/frontend/src/scenes/onboarding/OnboardingBillingStep.tsx @@ -3,9 +3,12 @@ import { LemonBanner, LemonButton } from '@posthog/lemon-ui' import { useActions, useValues } from 'kea' import { BillingUpgradeCTA } from 'lib/components/BillingUpgradeCTA' import { StarHog } from 'lib/components/hedgehogs' +import { FEATURE_FLAGS } from 'lib/constants' import { Spinner } from 'lib/lemon-ui/Spinner' +import { featureFlagLogic } from 'lib/logic/featureFlagLogic' import { eventUsageLogic } from 'lib/utils/eventUsageLogic' import { useState } from 'react' +import { AllProductsPlanComparison } from 'scenes/billing/AllProductsPlanComparison' import { getUpgradeProductLink } from 'scenes/billing/billing-utils' import { BillingHero } from 'scenes/billing/BillingHero' import { billingLogic } from 'scenes/billing/billingLogic' @@ -24,6 +27,7 @@ export const OnboardingBillingStep = ({ product: BillingProductV2Type stepKey?: OnboardingStepKey }): JSX.Element => { + const { featureFlags } = useValues(featureFlagLogic) const { billing, redirectPath } = useValues(billingLogic) const { productKey } = useValues(onboardingLogic) const { currentAndUpgradePlans } = useValues(billingProductLogic({ product })) @@ -33,6 +37,7 @@ export const OnboardingBillingStep = ({ const [showPlanComp, setShowPlanComp] = useState(false) + const action = featureFlags[FEATURE_FLAGS.SUBSCRIBE_TO_ALL_PRODUCTS] === 'test' ? 'Upgrade' : 'Subscribe' return ( - Subscribe to paid plan + {action} ) } @@ -65,7 +77,7 @@ export const OnboardingBillingStep = ({

-

Subscribe successful

+

{action} successful

You're all ready to use {product.name}.

@@ -95,7 +107,11 @@ export const OnboardingBillingStep = ({ {(!product.subscribed || showPlanComp) && ( <> - + {featureFlags[FEATURE_FLAGS.SUBSCRIBE_TO_ALL_PRODUCTS] === 'test' ? ( + + ) : ( + + )} )}
diff --git a/frontend/src/types.ts b/frontend/src/types.ts index 7e3996c6ffc93..3e5b2d6500099 100644 --- a/frontend/src/types.ts +++ b/frontend/src/types.ts @@ -1578,6 +1578,7 @@ export interface BillingProductV2AddonType { export interface BillingV2Type { customer_id: string has_active_subscription: boolean + subscription_level: 'free' | 'paid' | 'custom' free_trial_until?: Dayjs stripe_portal_url?: string deactivated?: boolean diff --git a/hogql_parser/HogQLParser.cpp b/hogql_parser/HogQLParser.cpp index 8ea044e4e5afc..340ddb8020c51 100644 --- a/hogql_parser/HogQLParser.cpp +++ b/hogql_parser/HogQLParser.cpp @@ -250,8 +250,8 @@ void hogqlparserParserInitialize() { 1,0,0,0,194,192,1,0,0,0,194,195,1,0,0,0,195,198,1,0,0,0,196,194,1,0,0, 0,197,199,5,112,0,0,198,197,1,0,0,0,198,199,1,0,0,0,199,9,1,0,0,0,200, 210,3,12,6,0,201,210,3,14,7,0,202,210,3,16,8,0,203,210,3,18,9,0,204,210, - 3,20,10,0,205,210,3,22,11,0,206,210,3,24,12,0,207,210,3,26,13,0,208,210, - 3,28,14,0,209,200,1,0,0,0,209,201,1,0,0,0,209,202,1,0,0,0,209,203,1,0, + 3,20,10,0,205,210,3,22,11,0,206,210,3,28,14,0,207,210,3,24,12,0,208,210, + 3,26,13,0,209,200,1,0,0,0,209,201,1,0,0,0,209,202,1,0,0,0,209,203,1,0, 0,0,209,204,1,0,0,0,209,205,1,0,0,0,209,206,1,0,0,0,209,207,1,0,0,0,209, 208,1,0,0,0,210,11,1,0,0,0,211,213,5,70,0,0,212,214,3,4,2,0,213,212,1, 0,0,0,213,214,1,0,0,0,214,216,1,0,0,0,215,217,5,145,0,0,216,215,1,0,0, @@ -1118,6 +1118,10 @@ HogQLParser::VarAssignmentContext* HogQLParser::StatementContext::varAssignment( return getRuleContext(0); } +HogQLParser::BlockContext* HogQLParser::StatementContext::block() { + return getRuleContext(0); +} + HogQLParser::ExprStmtContext* HogQLParser::StatementContext::exprStmt() { return getRuleContext(0); } @@ -1126,10 +1130,6 @@ HogQLParser::EmptyStmtContext* HogQLParser::StatementContext::emptyStmt() { return getRuleContext(0); } -HogQLParser::BlockContext* HogQLParser::StatementContext::block() { - return getRuleContext(0); -} - size_t HogQLParser::StatementContext::getRuleIndex() const { return HogQLParser::RuleStatement; @@ -1203,21 +1203,21 @@ HogQLParser::StatementContext* HogQLParser::statement() { case 7: { enterOuterAlt(_localctx, 7); setState(206); - exprStmt(); + block(); break; } case 8: { enterOuterAlt(_localctx, 8); setState(207); - emptyStmt(); + exprStmt(); break; } case 9: { enterOuterAlt(_localctx, 9); setState(208); - block(); + emptyStmt(); break; } diff --git a/hogql_parser/HogQLParser.h b/hogql_parser/HogQLParser.h index fe5efcdeccb57..3bc58cc5d7314 100644 --- a/hogql_parser/HogQLParser.h +++ b/hogql_parser/HogQLParser.h @@ -258,9 +258,9 @@ class HogQLParser : public antlr4::Parser { ForStmtContext *forStmt(); FuncStmtContext *funcStmt(); VarAssignmentContext *varAssignment(); + BlockContext *block(); ExprStmtContext *exprStmt(); EmptyStmtContext *emptyStmt(); - BlockContext *block(); virtual std::any accept(antlr4::tree::ParseTreeVisitor *visitor) override; diff --git a/hogql_parser/HogQLParser.interp b/hogql_parser/HogQLParser.interp index 40009f67387f5..da0b0cb00c46d 100644 --- a/hogql_parser/HogQLParser.interp +++ b/hogql_parser/HogQLParser.interp @@ -400,4 +400,4 @@ stringContentsFull atn: -[4, 1, 154, 1237, 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, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78, 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, 2, 83, 7, 83, 1, 0, 5, 0, 170, 8, 0, 10, 0, 12, 0, 173, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 179, 8, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 188, 8, 3, 1, 4, 1, 4, 1, 4, 5, 4, 193, 8, 4, 10, 4, 12, 4, 196, 9, 4, 1, 4, 3, 4, 199, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 210, 8, 5, 1, 6, 1, 6, 3, 6, 214, 8, 6, 1, 6, 3, 6, 217, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 226, 8, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 234, 8, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 241, 8, 9, 1, 9, 1, 9, 3, 9, 245, 8, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 251, 8, 9, 1, 9, 1, 9, 1, 9, 3, 9, 256, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 262, 8, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 3, 12, 274, 8, 12, 1, 13, 1, 13, 1, 14, 1, 14, 5, 14, 280, 8, 14, 10, 14, 12, 14, 283, 9, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 5, 16, 294, 8, 16, 10, 16, 12, 16, 297, 9, 16, 1, 16, 3, 16, 300, 8, 16, 1, 17, 1, 17, 1, 17, 3, 17, 305, 8, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 5, 18, 313, 8, 18, 10, 18, 12, 18, 316, 9, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 324, 8, 19, 1, 20, 3, 20, 327, 8, 20, 1, 20, 1, 20, 3, 20, 331, 8, 20, 1, 20, 3, 20, 334, 8, 20, 1, 20, 1, 20, 3, 20, 338, 8, 20, 1, 20, 3, 20, 341, 8, 20, 1, 20, 3, 20, 344, 8, 20, 1, 20, 3, 20, 347, 8, 20, 1, 20, 3, 20, 350, 8, 20, 1, 20, 1, 20, 3, 20, 354, 8, 20, 1, 20, 1, 20, 3, 20, 358, 8, 20, 1, 20, 3, 20, 361, 8, 20, 1, 20, 3, 20, 364, 8, 20, 1, 20, 3, 20, 367, 8, 20, 1, 20, 1, 20, 3, 20, 371, 8, 20, 1, 20, 3, 20, 374, 8, 20, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 383, 8, 22, 1, 23, 1, 23, 1, 23, 1, 24, 3, 24, 389, 8, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 5, 25, 408, 8, 25, 10, 25, 12, 25, 411, 9, 25, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 3, 28, 427, 8, 28, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 3, 32, 444, 8, 32, 1, 32, 1, 32, 1, 32, 1, 32, 3, 32, 450, 8, 32, 1, 32, 1, 32, 1, 32, 1, 32, 3, 32, 456, 8, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 3, 32, 467, 8, 32, 3, 32, 469, 8, 32, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 3, 35, 480, 8, 35, 1, 35, 3, 35, 483, 8, 35, 1, 35, 1, 35, 1, 35, 1, 35, 3, 35, 489, 8, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 3, 35, 497, 8, 35, 1, 35, 1, 35, 1, 35, 1, 35, 5, 35, 503, 8, 35, 10, 35, 12, 35, 506, 9, 35, 1, 36, 3, 36, 509, 8, 36, 1, 36, 1, 36, 1, 36, 3, 36, 514, 8, 36, 1, 36, 3, 36, 517, 8, 36, 1, 36, 3, 36, 520, 8, 36, 1, 36, 1, 36, 3, 36, 524, 8, 36, 1, 36, 1, 36, 3, 36, 528, 8, 36, 1, 36, 3, 36, 531, 8, 36, 3, 36, 533, 8, 36, 1, 36, 3, 36, 536, 8, 36, 1, 36, 1, 36, 3, 36, 540, 8, 36, 1, 36, 1, 36, 3, 36, 544, 8, 36, 1, 36, 3, 36, 547, 8, 36, 3, 36, 549, 8, 36, 3, 36, 551, 8, 36, 1, 37, 1, 37, 1, 37, 3, 37, 556, 8, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 3, 38, 567, 8, 38, 1, 39, 1, 39, 1, 39, 1, 39, 3, 39, 573, 8, 39, 1, 40, 1, 40, 1, 40, 5, 40, 578, 8, 40, 10, 40, 12, 40, 581, 9, 40, 1, 41, 1, 41, 3, 41, 585, 8, 41, 1, 41, 1, 41, 3, 41, 589, 8, 41, 1, 41, 1, 41, 3, 41, 593, 8, 41, 1, 42, 1, 42, 1, 42, 1, 42, 3, 42, 599, 8, 42, 3, 42, 601, 8, 42, 1, 43, 1, 43, 1, 43, 5, 43, 606, 8, 43, 10, 43, 12, 43, 609, 9, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 3, 45, 616, 8, 45, 1, 45, 3, 45, 619, 8, 45, 1, 45, 3, 45, 622, 8, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 641, 8, 49, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 3, 50, 655, 8, 50, 1, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 5, 52, 669, 8, 52, 10, 52, 12, 52, 672, 9, 52, 1, 52, 3, 52, 675, 8, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 5, 52, 684, 8, 52, 10, 52, 12, 52, 687, 9, 52, 1, 52, 3, 52, 690, 8, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 5, 52, 699, 8, 52, 10, 52, 12, 52, 702, 9, 52, 1, 52, 3, 52, 705, 8, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 3, 52, 712, 8, 52, 1, 52, 1, 52, 3, 52, 716, 8, 52, 1, 53, 1, 53, 1, 53, 5, 53, 721, 8, 53, 10, 53, 12, 53, 724, 9, 53, 1, 53, 3, 53, 727, 8, 53, 1, 54, 1, 54, 1, 54, 3, 54, 732, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 4, 54, 739, 8, 54, 11, 54, 12, 54, 740, 1, 54, 1, 54, 3, 54, 745, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 769, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 786, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 792, 8, 54, 1, 54, 3, 54, 795, 8, 54, 1, 54, 3, 54, 798, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 808, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 814, 8, 54, 1, 54, 3, 54, 817, 8, 54, 1, 54, 3, 54, 820, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 828, 8, 54, 1, 54, 3, 54, 831, 8, 54, 1, 54, 1, 54, 3, 54, 835, 8, 54, 1, 54, 3, 54, 838, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 852, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 869, 8, 54, 1, 54, 1, 54, 1, 54, 3, 54, 874, 8, 54, 1, 54, 1, 54, 3, 54, 878, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 884, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 891, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 903, 8, 54, 1, 54, 1, 54, 3, 54, 907, 8, 54, 1, 54, 3, 54, 910, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 919, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 933, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 960, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 968, 8, 54, 5, 54, 970, 8, 54, 10, 54, 12, 54, 973, 9, 54, 1, 55, 1, 55, 1, 55, 5, 55, 978, 8, 55, 10, 55, 12, 55, 981, 9, 55, 1, 55, 3, 55, 984, 8, 55, 1, 56, 1, 56, 3, 56, 988, 8, 56, 1, 57, 1, 57, 1, 57, 1, 57, 5, 57, 994, 8, 57, 10, 57, 12, 57, 997, 9, 57, 1, 57, 3, 57, 1000, 8, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 5, 57, 1007, 8, 57, 10, 57, 12, 57, 1010, 9, 57, 1, 57, 3, 57, 1013, 8, 57, 3, 57, 1015, 8, 57, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, 5, 58, 1023, 8, 58, 10, 58, 12, 58, 1026, 9, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 5, 58, 1034, 8, 58, 10, 58, 12, 58, 1037, 9, 58, 1, 58, 1, 58, 3, 58, 1041, 8, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 3, 58, 1048, 8, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 3, 59, 1061, 8, 59, 1, 60, 1, 60, 1, 60, 5, 60, 1066, 8, 60, 10, 60, 12, 60, 1069, 9, 60, 1, 60, 3, 60, 1072, 8, 60, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 3, 61, 1084, 8, 61, 1, 62, 1, 62, 1, 62, 1, 62, 3, 62, 1090, 8, 62, 1, 62, 3, 62, 1093, 8, 62, 1, 63, 1, 63, 1, 63, 5, 63, 1098, 8, 63, 10, 63, 12, 63, 1101, 9, 63, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 3, 64, 1112, 8, 64, 1, 64, 1, 64, 1, 64, 1, 64, 3, 64, 1118, 8, 64, 5, 64, 1120, 8, 64, 10, 64, 12, 64, 1123, 9, 64, 1, 65, 1, 65, 1, 65, 3, 65, 1128, 8, 65, 1, 65, 1, 65, 1, 66, 1, 66, 1, 66, 3, 66, 1135, 8, 66, 1, 66, 1, 66, 1, 67, 1, 67, 1, 67, 5, 67, 1142, 8, 67, 10, 67, 12, 67, 1145, 9, 67, 1, 67, 3, 67, 1148, 8, 67, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 3, 69, 1158, 8, 69, 3, 69, 1160, 8, 69, 1, 70, 3, 70, 1163, 8, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 3, 70, 1171, 8, 70, 1, 71, 1, 71, 1, 71, 3, 71, 1176, 8, 71, 1, 72, 1, 72, 1, 73, 1, 73, 1, 74, 1, 74, 1, 75, 1, 75, 3, 75, 1186, 8, 75, 1, 76, 1, 76, 1, 76, 3, 76, 1191, 8, 76, 1, 77, 1, 77, 1, 77, 1, 77, 1, 78, 1, 78, 1, 78, 1, 78, 1, 79, 1, 79, 3, 79, 1203, 8, 79, 1, 80, 1, 80, 5, 80, 1207, 8, 80, 10, 80, 12, 80, 1210, 9, 80, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 3, 81, 1219, 8, 81, 1, 82, 1, 82, 5, 82, 1223, 8, 82, 10, 82, 12, 82, 1226, 9, 82, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 3, 83, 1235, 8, 83, 1, 83, 0, 3, 70, 108, 128, 84, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 0, 16, 2, 0, 17, 17, 72, 72, 2, 0, 42, 42, 49, 49, 3, 0, 1, 1, 4, 4, 8, 8, 4, 0, 1, 1, 3, 4, 8, 8, 78, 78, 2, 0, 49, 49, 71, 71, 2, 0, 1, 1, 4, 4, 2, 0, 7, 7, 21, 22, 2, 0, 28, 28, 47, 47, 2, 0, 69, 69, 74, 74, 3, 0, 10, 10, 48, 48, 87, 87, 2, 0, 39, 39, 51, 51, 1, 0, 103, 104, 2, 0, 114, 114, 134, 134, 7, 0, 20, 20, 36, 36, 53, 54, 68, 68, 76, 76, 93, 93, 99, 99, 12, 0, 1, 19, 21, 28, 30, 35, 37, 40, 42, 49, 51, 52, 56, 56, 58, 67, 69, 75, 77, 92, 94, 95, 97, 98, 4, 0, 19, 19, 28, 28, 37, 37, 46, 46, 1394, 0, 171, 1, 0, 0, 0, 2, 178, 1, 0, 0, 0, 4, 180, 1, 0, 0, 0, 6, 182, 1, 0, 0, 0, 8, 189, 1, 0, 0, 0, 10, 209, 1, 0, 0, 0, 12, 211, 1, 0, 0, 0, 14, 218, 1, 0, 0, 0, 16, 227, 1, 0, 0, 0, 18, 235, 1, 0, 0, 0, 20, 257, 1, 0, 0, 0, 22, 266, 1, 0, 0, 0, 24, 271, 1, 0, 0, 0, 26, 275, 1, 0, 0, 0, 28, 277, 1, 0, 0, 0, 30, 286, 1, 0, 0, 0, 32, 290, 1, 0, 0, 0, 34, 304, 1, 0, 0, 0, 36, 308, 1, 0, 0, 0, 38, 323, 1, 0, 0, 0, 40, 326, 1, 0, 0, 0, 42, 375, 1, 0, 0, 0, 44, 378, 1, 0, 0, 0, 46, 384, 1, 0, 0, 0, 48, 388, 1, 0, 0, 0, 50, 394, 1, 0, 0, 0, 52, 412, 1, 0, 0, 0, 54, 415, 1, 0, 0, 0, 56, 418, 1, 0, 0, 0, 58, 428, 1, 0, 0, 0, 60, 431, 1, 0, 0, 0, 62, 435, 1, 0, 0, 0, 64, 468, 1, 0, 0, 0, 66, 470, 1, 0, 0, 0, 68, 473, 1, 0, 0, 0, 70, 488, 1, 0, 0, 0, 72, 550, 1, 0, 0, 0, 74, 555, 1, 0, 0, 0, 76, 566, 1, 0, 0, 0, 78, 568, 1, 0, 0, 0, 80, 574, 1, 0, 0, 0, 82, 582, 1, 0, 0, 0, 84, 600, 1, 0, 0, 0, 86, 602, 1, 0, 0, 0, 88, 610, 1, 0, 0, 0, 90, 615, 1, 0, 0, 0, 92, 623, 1, 0, 0, 0, 94, 627, 1, 0, 0, 0, 96, 631, 1, 0, 0, 0, 98, 640, 1, 0, 0, 0, 100, 654, 1, 0, 0, 0, 102, 656, 1, 0, 0, 0, 104, 715, 1, 0, 0, 0, 106, 717, 1, 0, 0, 0, 108, 877, 1, 0, 0, 0, 110, 974, 1, 0, 0, 0, 112, 987, 1, 0, 0, 0, 114, 1014, 1, 0, 0, 0, 116, 1047, 1, 0, 0, 0, 118, 1060, 1, 0, 0, 0, 120, 1062, 1, 0, 0, 0, 122, 1083, 1, 0, 0, 0, 124, 1092, 1, 0, 0, 0, 126, 1094, 1, 0, 0, 0, 128, 1111, 1, 0, 0, 0, 130, 1124, 1, 0, 0, 0, 132, 1134, 1, 0, 0, 0, 134, 1138, 1, 0, 0, 0, 136, 1149, 1, 0, 0, 0, 138, 1159, 1, 0, 0, 0, 140, 1162, 1, 0, 0, 0, 142, 1175, 1, 0, 0, 0, 144, 1177, 1, 0, 0, 0, 146, 1179, 1, 0, 0, 0, 148, 1181, 1, 0, 0, 0, 150, 1185, 1, 0, 0, 0, 152, 1190, 1, 0, 0, 0, 154, 1192, 1, 0, 0, 0, 156, 1196, 1, 0, 0, 0, 158, 1202, 1, 0, 0, 0, 160, 1204, 1, 0, 0, 0, 162, 1218, 1, 0, 0, 0, 164, 1220, 1, 0, 0, 0, 166, 1234, 1, 0, 0, 0, 168, 170, 3, 2, 1, 0, 169, 168, 1, 0, 0, 0, 170, 173, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, 171, 172, 1, 0, 0, 0, 172, 174, 1, 0, 0, 0, 173, 171, 1, 0, 0, 0, 174, 175, 5, 0, 0, 1, 175, 1, 1, 0, 0, 0, 176, 179, 3, 6, 3, 0, 177, 179, 3, 10, 5, 0, 178, 176, 1, 0, 0, 0, 178, 177, 1, 0, 0, 0, 179, 3, 1, 0, 0, 0, 180, 181, 3, 108, 54, 0, 181, 5, 1, 0, 0, 0, 182, 183, 5, 50, 0, 0, 183, 187, 3, 152, 76, 0, 184, 185, 5, 111, 0, 0, 185, 186, 5, 118, 0, 0, 186, 188, 3, 4, 2, 0, 187, 184, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 7, 1, 0, 0, 0, 189, 194, 3, 152, 76, 0, 190, 191, 5, 112, 0, 0, 191, 193, 3, 152, 76, 0, 192, 190, 1, 0, 0, 0, 193, 196, 1, 0, 0, 0, 194, 192, 1, 0, 0, 0, 194, 195, 1, 0, 0, 0, 195, 198, 1, 0, 0, 0, 196, 194, 1, 0, 0, 0, 197, 199, 5, 112, 0, 0, 198, 197, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, 9, 1, 0, 0, 0, 200, 210, 3, 12, 6, 0, 201, 210, 3, 14, 7, 0, 202, 210, 3, 16, 8, 0, 203, 210, 3, 18, 9, 0, 204, 210, 3, 20, 10, 0, 205, 210, 3, 22, 11, 0, 206, 210, 3, 24, 12, 0, 207, 210, 3, 26, 13, 0, 208, 210, 3, 28, 14, 0, 209, 200, 1, 0, 0, 0, 209, 201, 1, 0, 0, 0, 209, 202, 1, 0, 0, 0, 209, 203, 1, 0, 0, 0, 209, 204, 1, 0, 0, 0, 209, 205, 1, 0, 0, 0, 209, 206, 1, 0, 0, 0, 209, 207, 1, 0, 0, 0, 209, 208, 1, 0, 0, 0, 210, 11, 1, 0, 0, 0, 211, 213, 5, 70, 0, 0, 212, 214, 3, 4, 2, 0, 213, 212, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, 216, 1, 0, 0, 0, 215, 217, 5, 145, 0, 0, 216, 215, 1, 0, 0, 0, 216, 217, 1, 0, 0, 0, 217, 13, 1, 0, 0, 0, 218, 219, 5, 38, 0, 0, 219, 220, 5, 126, 0, 0, 220, 221, 3, 4, 2, 0, 221, 222, 5, 144, 0, 0, 222, 225, 3, 10, 5, 0, 223, 224, 5, 24, 0, 0, 224, 226, 3, 10, 5, 0, 225, 223, 1, 0, 0, 0, 225, 226, 1, 0, 0, 0, 226, 15, 1, 0, 0, 0, 227, 228, 5, 96, 0, 0, 228, 229, 5, 126, 0, 0, 229, 230, 3, 4, 2, 0, 230, 231, 5, 144, 0, 0, 231, 233, 3, 10, 5, 0, 232, 234, 5, 145, 0, 0, 233, 232, 1, 0, 0, 0, 233, 234, 1, 0, 0, 0, 234, 17, 1, 0, 0, 0, 235, 236, 5, 31, 0, 0, 236, 240, 5, 126, 0, 0, 237, 241, 3, 6, 3, 0, 238, 241, 3, 22, 11, 0, 239, 241, 3, 4, 2, 0, 240, 237, 1, 0, 0, 0, 240, 238, 1, 0, 0, 0, 240, 239, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 244, 5, 145, 0, 0, 243, 245, 3, 4, 2, 0, 244, 243, 1, 0, 0, 0, 244, 245, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, 246, 250, 5, 145, 0, 0, 247, 251, 3, 6, 3, 0, 248, 251, 3, 22, 11, 0, 249, 251, 3, 4, 2, 0, 250, 247, 1, 0, 0, 0, 250, 248, 1, 0, 0, 0, 250, 249, 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 252, 1, 0, 0, 0, 252, 253, 5, 144, 0, 0, 253, 255, 3, 10, 5, 0, 254, 256, 5, 145, 0, 0, 255, 254, 1, 0, 0, 0, 255, 256, 1, 0, 0, 0, 256, 19, 1, 0, 0, 0, 257, 258, 5, 29, 0, 0, 258, 259, 3, 152, 76, 0, 259, 261, 5, 126, 0, 0, 260, 262, 3, 8, 4, 0, 261, 260, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 264, 5, 144, 0, 0, 264, 265, 3, 28, 14, 0, 265, 21, 1, 0, 0, 0, 266, 267, 3, 4, 2, 0, 267, 268, 5, 111, 0, 0, 268, 269, 5, 118, 0, 0, 269, 270, 3, 4, 2, 0, 270, 23, 1, 0, 0, 0, 271, 273, 3, 4, 2, 0, 272, 274, 5, 145, 0, 0, 273, 272, 1, 0, 0, 0, 273, 274, 1, 0, 0, 0, 274, 25, 1, 0, 0, 0, 275, 276, 5, 145, 0, 0, 276, 27, 1, 0, 0, 0, 277, 281, 5, 124, 0, 0, 278, 280, 3, 2, 1, 0, 279, 278, 1, 0, 0, 0, 280, 283, 1, 0, 0, 0, 281, 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 284, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, 284, 285, 5, 142, 0, 0, 285, 29, 1, 0, 0, 0, 286, 287, 3, 4, 2, 0, 287, 288, 5, 111, 0, 0, 288, 289, 3, 4, 2, 0, 289, 31, 1, 0, 0, 0, 290, 295, 3, 30, 15, 0, 291, 292, 5, 112, 0, 0, 292, 294, 3, 30, 15, 0, 293, 291, 1, 0, 0, 0, 294, 297, 1, 0, 0, 0, 295, 293, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 299, 1, 0, 0, 0, 297, 295, 1, 0, 0, 0, 298, 300, 5, 112, 0, 0, 299, 298, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 33, 1, 0, 0, 0, 301, 305, 3, 36, 18, 0, 302, 305, 3, 40, 20, 0, 303, 305, 3, 116, 58, 0, 304, 301, 1, 0, 0, 0, 304, 302, 1, 0, 0, 0, 304, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 307, 5, 0, 0, 1, 307, 35, 1, 0, 0, 0, 308, 314, 3, 38, 19, 0, 309, 310, 5, 91, 0, 0, 310, 311, 5, 1, 0, 0, 311, 313, 3, 38, 19, 0, 312, 309, 1, 0, 0, 0, 313, 316, 1, 0, 0, 0, 314, 312, 1, 0, 0, 0, 314, 315, 1, 0, 0, 0, 315, 37, 1, 0, 0, 0, 316, 314, 1, 0, 0, 0, 317, 324, 3, 40, 20, 0, 318, 319, 5, 126, 0, 0, 319, 320, 3, 36, 18, 0, 320, 321, 5, 144, 0, 0, 321, 324, 1, 0, 0, 0, 322, 324, 3, 156, 78, 0, 323, 317, 1, 0, 0, 0, 323, 318, 1, 0, 0, 0, 323, 322, 1, 0, 0, 0, 324, 39, 1, 0, 0, 0, 325, 327, 3, 42, 21, 0, 326, 325, 1, 0, 0, 0, 326, 327, 1, 0, 0, 0, 327, 328, 1, 0, 0, 0, 328, 330, 5, 77, 0, 0, 329, 331, 5, 23, 0, 0, 330, 329, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 333, 1, 0, 0, 0, 332, 334, 3, 44, 22, 0, 333, 332, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, 335, 337, 3, 106, 53, 0, 336, 338, 3, 46, 23, 0, 337, 336, 1, 0, 0, 0, 337, 338, 1, 0, 0, 0, 338, 340, 1, 0, 0, 0, 339, 341, 3, 48, 24, 0, 340, 339, 1, 0, 0, 0, 340, 341, 1, 0, 0, 0, 341, 343, 1, 0, 0, 0, 342, 344, 3, 52, 26, 0, 343, 342, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 346, 1, 0, 0, 0, 345, 347, 3, 54, 27, 0, 346, 345, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, 347, 349, 1, 0, 0, 0, 348, 350, 3, 56, 28, 0, 349, 348, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 353, 1, 0, 0, 0, 351, 352, 5, 98, 0, 0, 352, 354, 7, 0, 0, 0, 353, 351, 1, 0, 0, 0, 353, 354, 1, 0, 0, 0, 354, 357, 1, 0, 0, 0, 355, 356, 5, 98, 0, 0, 356, 358, 5, 86, 0, 0, 357, 355, 1, 0, 0, 0, 357, 358, 1, 0, 0, 0, 358, 360, 1, 0, 0, 0, 359, 361, 3, 58, 29, 0, 360, 359, 1, 0, 0, 0, 360, 361, 1, 0, 0, 0, 361, 363, 1, 0, 0, 0, 362, 364, 3, 50, 25, 0, 363, 362, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, 366, 1, 0, 0, 0, 365, 367, 3, 60, 30, 0, 366, 365, 1, 0, 0, 0, 366, 367, 1, 0, 0, 0, 367, 370, 1, 0, 0, 0, 368, 371, 3, 64, 32, 0, 369, 371, 3, 66, 33, 0, 370, 368, 1, 0, 0, 0, 370, 369, 1, 0, 0, 0, 370, 371, 1, 0, 0, 0, 371, 373, 1, 0, 0, 0, 372, 374, 3, 68, 34, 0, 373, 372, 1, 0, 0, 0, 373, 374, 1, 0, 0, 0, 374, 41, 1, 0, 0, 0, 375, 376, 5, 98, 0, 0, 376, 377, 3, 120, 60, 0, 377, 43, 1, 0, 0, 0, 378, 379, 5, 85, 0, 0, 379, 382, 5, 104, 0, 0, 380, 381, 5, 98, 0, 0, 381, 383, 5, 82, 0, 0, 382, 380, 1, 0, 0, 0, 382, 383, 1, 0, 0, 0, 383, 45, 1, 0, 0, 0, 384, 385, 5, 32, 0, 0, 385, 386, 3, 70, 35, 0, 386, 47, 1, 0, 0, 0, 387, 389, 7, 1, 0, 0, 388, 387, 1, 0, 0, 0, 388, 389, 1, 0, 0, 0, 389, 390, 1, 0, 0, 0, 390, 391, 5, 5, 0, 0, 391, 392, 5, 45, 0, 0, 392, 393, 3, 106, 53, 0, 393, 49, 1, 0, 0, 0, 394, 395, 5, 97, 0, 0, 395, 396, 3, 152, 76, 0, 396, 397, 5, 6, 0, 0, 397, 398, 5, 126, 0, 0, 398, 399, 3, 90, 45, 0, 399, 409, 5, 144, 0, 0, 400, 401, 5, 112, 0, 0, 401, 402, 3, 152, 76, 0, 402, 403, 5, 6, 0, 0, 403, 404, 5, 126, 0, 0, 404, 405, 3, 90, 45, 0, 405, 406, 5, 144, 0, 0, 406, 408, 1, 0, 0, 0, 407, 400, 1, 0, 0, 0, 408, 411, 1, 0, 0, 0, 409, 407, 1, 0, 0, 0, 409, 410, 1, 0, 0, 0, 410, 51, 1, 0, 0, 0, 411, 409, 1, 0, 0, 0, 412, 413, 5, 67, 0, 0, 413, 414, 3, 108, 54, 0, 414, 53, 1, 0, 0, 0, 415, 416, 5, 95, 0, 0, 416, 417, 3, 108, 54, 0, 417, 55, 1, 0, 0, 0, 418, 419, 5, 34, 0, 0, 419, 426, 5, 11, 0, 0, 420, 421, 7, 0, 0, 0, 421, 422, 5, 126, 0, 0, 422, 423, 3, 106, 53, 0, 423, 424, 5, 144, 0, 0, 424, 427, 1, 0, 0, 0, 425, 427, 3, 106, 53, 0, 426, 420, 1, 0, 0, 0, 426, 425, 1, 0, 0, 0, 427, 57, 1, 0, 0, 0, 428, 429, 5, 35, 0, 0, 429, 430, 3, 108, 54, 0, 430, 59, 1, 0, 0, 0, 431, 432, 5, 62, 0, 0, 432, 433, 5, 11, 0, 0, 433, 434, 3, 80, 40, 0, 434, 61, 1, 0, 0, 0, 435, 436, 5, 62, 0, 0, 436, 437, 5, 11, 0, 0, 437, 438, 3, 106, 53, 0, 438, 63, 1, 0, 0, 0, 439, 440, 5, 52, 0, 0, 440, 443, 3, 108, 54, 0, 441, 442, 5, 112, 0, 0, 442, 444, 3, 108, 54, 0, 443, 441, 1, 0, 0, 0, 443, 444, 1, 0, 0, 0, 444, 449, 1, 0, 0, 0, 445, 446, 5, 98, 0, 0, 446, 450, 5, 82, 0, 0, 447, 448, 5, 11, 0, 0, 448, 450, 3, 106, 53, 0, 449, 445, 1, 0, 0, 0, 449, 447, 1, 0, 0, 0, 449, 450, 1, 0, 0, 0, 450, 469, 1, 0, 0, 0, 451, 452, 5, 52, 0, 0, 452, 455, 3, 108, 54, 0, 453, 454, 5, 98, 0, 0, 454, 456, 5, 82, 0, 0, 455, 453, 1, 0, 0, 0, 455, 456, 1, 0, 0, 0, 456, 457, 1, 0, 0, 0, 457, 458, 5, 59, 0, 0, 458, 459, 3, 108, 54, 0, 459, 469, 1, 0, 0, 0, 460, 461, 5, 52, 0, 0, 461, 462, 3, 108, 54, 0, 462, 463, 5, 59, 0, 0, 463, 466, 3, 108, 54, 0, 464, 465, 5, 11, 0, 0, 465, 467, 3, 106, 53, 0, 466, 464, 1, 0, 0, 0, 466, 467, 1, 0, 0, 0, 467, 469, 1, 0, 0, 0, 468, 439, 1, 0, 0, 0, 468, 451, 1, 0, 0, 0, 468, 460, 1, 0, 0, 0, 469, 65, 1, 0, 0, 0, 470, 471, 5, 59, 0, 0, 471, 472, 3, 108, 54, 0, 472, 67, 1, 0, 0, 0, 473, 474, 5, 79, 0, 0, 474, 475, 3, 86, 43, 0, 475, 69, 1, 0, 0, 0, 476, 477, 6, 35, -1, 0, 477, 479, 3, 128, 64, 0, 478, 480, 5, 27, 0, 0, 479, 478, 1, 0, 0, 0, 479, 480, 1, 0, 0, 0, 480, 482, 1, 0, 0, 0, 481, 483, 3, 78, 39, 0, 482, 481, 1, 0, 0, 0, 482, 483, 1, 0, 0, 0, 483, 489, 1, 0, 0, 0, 484, 485, 5, 126, 0, 0, 485, 486, 3, 70, 35, 0, 486, 487, 5, 144, 0, 0, 487, 489, 1, 0, 0, 0, 488, 476, 1, 0, 0, 0, 488, 484, 1, 0, 0, 0, 489, 504, 1, 0, 0, 0, 490, 491, 10, 3, 0, 0, 491, 492, 3, 74, 37, 0, 492, 493, 3, 70, 35, 4, 493, 503, 1, 0, 0, 0, 494, 496, 10, 4, 0, 0, 495, 497, 3, 72, 36, 0, 496, 495, 1, 0, 0, 0, 496, 497, 1, 0, 0, 0, 497, 498, 1, 0, 0, 0, 498, 499, 5, 45, 0, 0, 499, 500, 3, 70, 35, 0, 500, 501, 3, 76, 38, 0, 501, 503, 1, 0, 0, 0, 502, 490, 1, 0, 0, 0, 502, 494, 1, 0, 0, 0, 503, 506, 1, 0, 0, 0, 504, 502, 1, 0, 0, 0, 504, 505, 1, 0, 0, 0, 505, 71, 1, 0, 0, 0, 506, 504, 1, 0, 0, 0, 507, 509, 7, 2, 0, 0, 508, 507, 1, 0, 0, 0, 508, 509, 1, 0, 0, 0, 509, 510, 1, 0, 0, 0, 510, 517, 5, 42, 0, 0, 511, 513, 5, 42, 0, 0, 512, 514, 7, 2, 0, 0, 513, 512, 1, 0, 0, 0, 513, 514, 1, 0, 0, 0, 514, 517, 1, 0, 0, 0, 515, 517, 7, 2, 0, 0, 516, 508, 1, 0, 0, 0, 516, 511, 1, 0, 0, 0, 516, 515, 1, 0, 0, 0, 517, 551, 1, 0, 0, 0, 518, 520, 7, 3, 0, 0, 519, 518, 1, 0, 0, 0, 519, 520, 1, 0, 0, 0, 520, 521, 1, 0, 0, 0, 521, 523, 7, 4, 0, 0, 522, 524, 5, 63, 0, 0, 523, 522, 1, 0, 0, 0, 523, 524, 1, 0, 0, 0, 524, 533, 1, 0, 0, 0, 525, 527, 7, 4, 0, 0, 526, 528, 5, 63, 0, 0, 527, 526, 1, 0, 0, 0, 527, 528, 1, 0, 0, 0, 528, 530, 1, 0, 0, 0, 529, 531, 7, 3, 0, 0, 530, 529, 1, 0, 0, 0, 530, 531, 1, 0, 0, 0, 531, 533, 1, 0, 0, 0, 532, 519, 1, 0, 0, 0, 532, 525, 1, 0, 0, 0, 533, 551, 1, 0, 0, 0, 534, 536, 7, 5, 0, 0, 535, 534, 1, 0, 0, 0, 535, 536, 1, 0, 0, 0, 536, 537, 1, 0, 0, 0, 537, 539, 5, 33, 0, 0, 538, 540, 5, 63, 0, 0, 539, 538, 1, 0, 0, 0, 539, 540, 1, 0, 0, 0, 540, 549, 1, 0, 0, 0, 541, 543, 5, 33, 0, 0, 542, 544, 5, 63, 0, 0, 543, 542, 1, 0, 0, 0, 543, 544, 1, 0, 0, 0, 544, 546, 1, 0, 0, 0, 545, 547, 7, 5, 0, 0, 546, 545, 1, 0, 0, 0, 546, 547, 1, 0, 0, 0, 547, 549, 1, 0, 0, 0, 548, 535, 1, 0, 0, 0, 548, 541, 1, 0, 0, 0, 549, 551, 1, 0, 0, 0, 550, 516, 1, 0, 0, 0, 550, 532, 1, 0, 0, 0, 550, 548, 1, 0, 0, 0, 551, 73, 1, 0, 0, 0, 552, 553, 5, 16, 0, 0, 553, 556, 5, 45, 0, 0, 554, 556, 5, 112, 0, 0, 555, 552, 1, 0, 0, 0, 555, 554, 1, 0, 0, 0, 556, 75, 1, 0, 0, 0, 557, 558, 5, 60, 0, 0, 558, 567, 3, 106, 53, 0, 559, 560, 5, 92, 0, 0, 560, 561, 5, 126, 0, 0, 561, 562, 3, 106, 53, 0, 562, 563, 5, 144, 0, 0, 563, 567, 1, 0, 0, 0, 564, 565, 5, 92, 0, 0, 565, 567, 3, 106, 53, 0, 566, 557, 1, 0, 0, 0, 566, 559, 1, 0, 0, 0, 566, 564, 1, 0, 0, 0, 567, 77, 1, 0, 0, 0, 568, 569, 5, 75, 0, 0, 569, 572, 3, 84, 42, 0, 570, 571, 5, 59, 0, 0, 571, 573, 3, 84, 42, 0, 572, 570, 1, 0, 0, 0, 572, 573, 1, 0, 0, 0, 573, 79, 1, 0, 0, 0, 574, 579, 3, 82, 41, 0, 575, 576, 5, 112, 0, 0, 576, 578, 3, 82, 41, 0, 577, 575, 1, 0, 0, 0, 578, 581, 1, 0, 0, 0, 579, 577, 1, 0, 0, 0, 579, 580, 1, 0, 0, 0, 580, 81, 1, 0, 0, 0, 581, 579, 1, 0, 0, 0, 582, 584, 3, 108, 54, 0, 583, 585, 7, 6, 0, 0, 584, 583, 1, 0, 0, 0, 584, 585, 1, 0, 0, 0, 585, 588, 1, 0, 0, 0, 586, 587, 5, 58, 0, 0, 587, 589, 7, 7, 0, 0, 588, 586, 1, 0, 0, 0, 588, 589, 1, 0, 0, 0, 589, 592, 1, 0, 0, 0, 590, 591, 5, 15, 0, 0, 591, 593, 5, 106, 0, 0, 592, 590, 1, 0, 0, 0, 592, 593, 1, 0, 0, 0, 593, 83, 1, 0, 0, 0, 594, 601, 3, 156, 78, 0, 595, 598, 3, 140, 70, 0, 596, 597, 5, 146, 0, 0, 597, 599, 3, 140, 70, 0, 598, 596, 1, 0, 0, 0, 598, 599, 1, 0, 0, 0, 599, 601, 1, 0, 0, 0, 600, 594, 1, 0, 0, 0, 600, 595, 1, 0, 0, 0, 601, 85, 1, 0, 0, 0, 602, 607, 3, 88, 44, 0, 603, 604, 5, 112, 0, 0, 604, 606, 3, 88, 44, 0, 605, 603, 1, 0, 0, 0, 606, 609, 1, 0, 0, 0, 607, 605, 1, 0, 0, 0, 607, 608, 1, 0, 0, 0, 608, 87, 1, 0, 0, 0, 609, 607, 1, 0, 0, 0, 610, 611, 3, 152, 76, 0, 611, 612, 5, 118, 0, 0, 612, 613, 3, 142, 71, 0, 613, 89, 1, 0, 0, 0, 614, 616, 3, 92, 46, 0, 615, 614, 1, 0, 0, 0, 615, 616, 1, 0, 0, 0, 616, 618, 1, 0, 0, 0, 617, 619, 3, 94, 47, 0, 618, 617, 1, 0, 0, 0, 618, 619, 1, 0, 0, 0, 619, 621, 1, 0, 0, 0, 620, 622, 3, 96, 48, 0, 621, 620, 1, 0, 0, 0, 621, 622, 1, 0, 0, 0, 622, 91, 1, 0, 0, 0, 623, 624, 5, 65, 0, 0, 624, 625, 5, 11, 0, 0, 625, 626, 3, 106, 53, 0, 626, 93, 1, 0, 0, 0, 627, 628, 5, 62, 0, 0, 628, 629, 5, 11, 0, 0, 629, 630, 3, 80, 40, 0, 630, 95, 1, 0, 0, 0, 631, 632, 7, 8, 0, 0, 632, 633, 3, 98, 49, 0, 633, 97, 1, 0, 0, 0, 634, 641, 3, 100, 50, 0, 635, 636, 5, 9, 0, 0, 636, 637, 3, 100, 50, 0, 637, 638, 5, 2, 0, 0, 638, 639, 3, 100, 50, 0, 639, 641, 1, 0, 0, 0, 640, 634, 1, 0, 0, 0, 640, 635, 1, 0, 0, 0, 641, 99, 1, 0, 0, 0, 642, 643, 5, 18, 0, 0, 643, 655, 5, 73, 0, 0, 644, 645, 5, 90, 0, 0, 645, 655, 5, 66, 0, 0, 646, 647, 5, 90, 0, 0, 647, 655, 5, 30, 0, 0, 648, 649, 3, 140, 70, 0, 649, 650, 5, 66, 0, 0, 650, 655, 1, 0, 0, 0, 651, 652, 3, 140, 70, 0, 652, 653, 5, 30, 0, 0, 653, 655, 1, 0, 0, 0, 654, 642, 1, 0, 0, 0, 654, 644, 1, 0, 0, 0, 654, 646, 1, 0, 0, 0, 654, 648, 1, 0, 0, 0, 654, 651, 1, 0, 0, 0, 655, 101, 1, 0, 0, 0, 656, 657, 3, 108, 54, 0, 657, 658, 5, 0, 0, 1, 658, 103, 1, 0, 0, 0, 659, 716, 3, 152, 76, 0, 660, 661, 3, 152, 76, 0, 661, 662, 5, 126, 0, 0, 662, 663, 3, 152, 76, 0, 663, 670, 3, 104, 52, 0, 664, 665, 5, 112, 0, 0, 665, 666, 3, 152, 76, 0, 666, 667, 3, 104, 52, 0, 667, 669, 1, 0, 0, 0, 668, 664, 1, 0, 0, 0, 669, 672, 1, 0, 0, 0, 670, 668, 1, 0, 0, 0, 670, 671, 1, 0, 0, 0, 671, 674, 1, 0, 0, 0, 672, 670, 1, 0, 0, 0, 673, 675, 5, 112, 0, 0, 674, 673, 1, 0, 0, 0, 674, 675, 1, 0, 0, 0, 675, 676, 1, 0, 0, 0, 676, 677, 5, 144, 0, 0, 677, 716, 1, 0, 0, 0, 678, 679, 3, 152, 76, 0, 679, 680, 5, 126, 0, 0, 680, 685, 3, 154, 77, 0, 681, 682, 5, 112, 0, 0, 682, 684, 3, 154, 77, 0, 683, 681, 1, 0, 0, 0, 684, 687, 1, 0, 0, 0, 685, 683, 1, 0, 0, 0, 685, 686, 1, 0, 0, 0, 686, 689, 1, 0, 0, 0, 687, 685, 1, 0, 0, 0, 688, 690, 5, 112, 0, 0, 689, 688, 1, 0, 0, 0, 689, 690, 1, 0, 0, 0, 690, 691, 1, 0, 0, 0, 691, 692, 5, 144, 0, 0, 692, 716, 1, 0, 0, 0, 693, 694, 3, 152, 76, 0, 694, 695, 5, 126, 0, 0, 695, 700, 3, 104, 52, 0, 696, 697, 5, 112, 0, 0, 697, 699, 3, 104, 52, 0, 698, 696, 1, 0, 0, 0, 699, 702, 1, 0, 0, 0, 700, 698, 1, 0, 0, 0, 700, 701, 1, 0, 0, 0, 701, 704, 1, 0, 0, 0, 702, 700, 1, 0, 0, 0, 703, 705, 5, 112, 0, 0, 704, 703, 1, 0, 0, 0, 704, 705, 1, 0, 0, 0, 705, 706, 1, 0, 0, 0, 706, 707, 5, 144, 0, 0, 707, 716, 1, 0, 0, 0, 708, 709, 3, 152, 76, 0, 709, 711, 5, 126, 0, 0, 710, 712, 3, 106, 53, 0, 711, 710, 1, 0, 0, 0, 711, 712, 1, 0, 0, 0, 712, 713, 1, 0, 0, 0, 713, 714, 5, 144, 0, 0, 714, 716, 1, 0, 0, 0, 715, 659, 1, 0, 0, 0, 715, 660, 1, 0, 0, 0, 715, 678, 1, 0, 0, 0, 715, 693, 1, 0, 0, 0, 715, 708, 1, 0, 0, 0, 716, 105, 1, 0, 0, 0, 717, 722, 3, 108, 54, 0, 718, 719, 5, 112, 0, 0, 719, 721, 3, 108, 54, 0, 720, 718, 1, 0, 0, 0, 721, 724, 1, 0, 0, 0, 722, 720, 1, 0, 0, 0, 722, 723, 1, 0, 0, 0, 723, 726, 1, 0, 0, 0, 724, 722, 1, 0, 0, 0, 725, 727, 5, 112, 0, 0, 726, 725, 1, 0, 0, 0, 726, 727, 1, 0, 0, 0, 727, 107, 1, 0, 0, 0, 728, 729, 6, 54, -1, 0, 729, 731, 5, 12, 0, 0, 730, 732, 3, 108, 54, 0, 731, 730, 1, 0, 0, 0, 731, 732, 1, 0, 0, 0, 732, 738, 1, 0, 0, 0, 733, 734, 5, 94, 0, 0, 734, 735, 3, 108, 54, 0, 735, 736, 5, 81, 0, 0, 736, 737, 3, 108, 54, 0, 737, 739, 1, 0, 0, 0, 738, 733, 1, 0, 0, 0, 739, 740, 1, 0, 0, 0, 740, 738, 1, 0, 0, 0, 740, 741, 1, 0, 0, 0, 741, 744, 1, 0, 0, 0, 742, 743, 5, 24, 0, 0, 743, 745, 3, 108, 54, 0, 744, 742, 1, 0, 0, 0, 744, 745, 1, 0, 0, 0, 745, 746, 1, 0, 0, 0, 746, 747, 5, 25, 0, 0, 747, 878, 1, 0, 0, 0, 748, 749, 5, 13, 0, 0, 749, 750, 5, 126, 0, 0, 750, 751, 3, 108, 54, 0, 751, 752, 5, 6, 0, 0, 752, 753, 3, 104, 52, 0, 753, 754, 5, 144, 0, 0, 754, 878, 1, 0, 0, 0, 755, 756, 5, 19, 0, 0, 756, 878, 5, 106, 0, 0, 757, 758, 5, 43, 0, 0, 758, 759, 3, 108, 54, 0, 759, 760, 3, 144, 72, 0, 760, 878, 1, 0, 0, 0, 761, 762, 5, 80, 0, 0, 762, 763, 5, 126, 0, 0, 763, 764, 3, 108, 54, 0, 764, 765, 5, 32, 0, 0, 765, 768, 3, 108, 54, 0, 766, 767, 5, 31, 0, 0, 767, 769, 3, 108, 54, 0, 768, 766, 1, 0, 0, 0, 768, 769, 1, 0, 0, 0, 769, 770, 1, 0, 0, 0, 770, 771, 5, 144, 0, 0, 771, 878, 1, 0, 0, 0, 772, 773, 5, 83, 0, 0, 773, 878, 5, 106, 0, 0, 774, 775, 5, 88, 0, 0, 775, 776, 5, 126, 0, 0, 776, 777, 7, 9, 0, 0, 777, 778, 3, 158, 79, 0, 778, 779, 5, 32, 0, 0, 779, 780, 3, 108, 54, 0, 780, 781, 5, 144, 0, 0, 781, 878, 1, 0, 0, 0, 782, 783, 3, 152, 76, 0, 783, 785, 5, 126, 0, 0, 784, 786, 3, 106, 53, 0, 785, 784, 1, 0, 0, 0, 785, 786, 1, 0, 0, 0, 786, 787, 1, 0, 0, 0, 787, 788, 5, 144, 0, 0, 788, 797, 1, 0, 0, 0, 789, 791, 5, 126, 0, 0, 790, 792, 5, 23, 0, 0, 791, 790, 1, 0, 0, 0, 791, 792, 1, 0, 0, 0, 792, 794, 1, 0, 0, 0, 793, 795, 3, 110, 55, 0, 794, 793, 1, 0, 0, 0, 794, 795, 1, 0, 0, 0, 795, 796, 1, 0, 0, 0, 796, 798, 5, 144, 0, 0, 797, 789, 1, 0, 0, 0, 797, 798, 1, 0, 0, 0, 798, 799, 1, 0, 0, 0, 799, 800, 5, 64, 0, 0, 800, 801, 5, 126, 0, 0, 801, 802, 3, 90, 45, 0, 802, 803, 5, 144, 0, 0, 803, 878, 1, 0, 0, 0, 804, 805, 3, 152, 76, 0, 805, 807, 5, 126, 0, 0, 806, 808, 3, 106, 53, 0, 807, 806, 1, 0, 0, 0, 807, 808, 1, 0, 0, 0, 808, 809, 1, 0, 0, 0, 809, 810, 5, 144, 0, 0, 810, 819, 1, 0, 0, 0, 811, 813, 5, 126, 0, 0, 812, 814, 5, 23, 0, 0, 813, 812, 1, 0, 0, 0, 813, 814, 1, 0, 0, 0, 814, 816, 1, 0, 0, 0, 815, 817, 3, 110, 55, 0, 816, 815, 1, 0, 0, 0, 816, 817, 1, 0, 0, 0, 817, 818, 1, 0, 0, 0, 818, 820, 5, 144, 0, 0, 819, 811, 1, 0, 0, 0, 819, 820, 1, 0, 0, 0, 820, 821, 1, 0, 0, 0, 821, 822, 5, 64, 0, 0, 822, 823, 3, 152, 76, 0, 823, 878, 1, 0, 0, 0, 824, 830, 3, 152, 76, 0, 825, 827, 5, 126, 0, 0, 826, 828, 3, 106, 53, 0, 827, 826, 1, 0, 0, 0, 827, 828, 1, 0, 0, 0, 828, 829, 1, 0, 0, 0, 829, 831, 5, 144, 0, 0, 830, 825, 1, 0, 0, 0, 830, 831, 1, 0, 0, 0, 831, 832, 1, 0, 0, 0, 832, 834, 5, 126, 0, 0, 833, 835, 5, 23, 0, 0, 834, 833, 1, 0, 0, 0, 834, 835, 1, 0, 0, 0, 835, 837, 1, 0, 0, 0, 836, 838, 3, 110, 55, 0, 837, 836, 1, 0, 0, 0, 837, 838, 1, 0, 0, 0, 838, 839, 1, 0, 0, 0, 839, 840, 5, 144, 0, 0, 840, 878, 1, 0, 0, 0, 841, 878, 3, 116, 58, 0, 842, 878, 3, 160, 80, 0, 843, 878, 3, 142, 71, 0, 844, 845, 5, 114, 0, 0, 845, 878, 3, 108, 54, 19, 846, 847, 5, 56, 0, 0, 847, 878, 3, 108, 54, 13, 848, 849, 3, 132, 66, 0, 849, 850, 5, 116, 0, 0, 850, 852, 1, 0, 0, 0, 851, 848, 1, 0, 0, 0, 851, 852, 1, 0, 0, 0, 852, 853, 1, 0, 0, 0, 853, 878, 5, 108, 0, 0, 854, 855, 5, 126, 0, 0, 855, 856, 3, 36, 18, 0, 856, 857, 5, 144, 0, 0, 857, 878, 1, 0, 0, 0, 858, 859, 5, 126, 0, 0, 859, 860, 3, 108, 54, 0, 860, 861, 5, 144, 0, 0, 861, 878, 1, 0, 0, 0, 862, 863, 5, 126, 0, 0, 863, 864, 3, 106, 53, 0, 864, 865, 5, 144, 0, 0, 865, 878, 1, 0, 0, 0, 866, 868, 5, 125, 0, 0, 867, 869, 3, 106, 53, 0, 868, 867, 1, 0, 0, 0, 868, 869, 1, 0, 0, 0, 869, 870, 1, 0, 0, 0, 870, 878, 5, 143, 0, 0, 871, 873, 5, 124, 0, 0, 872, 874, 3, 32, 16, 0, 873, 872, 1, 0, 0, 0, 873, 874, 1, 0, 0, 0, 874, 875, 1, 0, 0, 0, 875, 878, 5, 142, 0, 0, 876, 878, 3, 124, 62, 0, 877, 728, 1, 0, 0, 0, 877, 748, 1, 0, 0, 0, 877, 755, 1, 0, 0, 0, 877, 757, 1, 0, 0, 0, 877, 761, 1, 0, 0, 0, 877, 772, 1, 0, 0, 0, 877, 774, 1, 0, 0, 0, 877, 782, 1, 0, 0, 0, 877, 804, 1, 0, 0, 0, 877, 824, 1, 0, 0, 0, 877, 841, 1, 0, 0, 0, 877, 842, 1, 0, 0, 0, 877, 843, 1, 0, 0, 0, 877, 844, 1, 0, 0, 0, 877, 846, 1, 0, 0, 0, 877, 851, 1, 0, 0, 0, 877, 854, 1, 0, 0, 0, 877, 858, 1, 0, 0, 0, 877, 862, 1, 0, 0, 0, 877, 866, 1, 0, 0, 0, 877, 871, 1, 0, 0, 0, 877, 876, 1, 0, 0, 0, 878, 971, 1, 0, 0, 0, 879, 883, 10, 18, 0, 0, 880, 884, 5, 108, 0, 0, 881, 884, 5, 146, 0, 0, 882, 884, 5, 133, 0, 0, 883, 880, 1, 0, 0, 0, 883, 881, 1, 0, 0, 0, 883, 882, 1, 0, 0, 0, 884, 885, 1, 0, 0, 0, 885, 970, 3, 108, 54, 19, 886, 890, 10, 17, 0, 0, 887, 891, 5, 134, 0, 0, 888, 891, 5, 114, 0, 0, 889, 891, 5, 113, 0, 0, 890, 887, 1, 0, 0, 0, 890, 888, 1, 0, 0, 0, 890, 889, 1, 0, 0, 0, 891, 892, 1, 0, 0, 0, 892, 970, 3, 108, 54, 18, 893, 918, 10, 16, 0, 0, 894, 919, 5, 117, 0, 0, 895, 919, 5, 118, 0, 0, 896, 919, 5, 129, 0, 0, 897, 919, 5, 127, 0, 0, 898, 919, 5, 128, 0, 0, 899, 919, 5, 119, 0, 0, 900, 919, 5, 120, 0, 0, 901, 903, 5, 56, 0, 0, 902, 901, 1, 0, 0, 0, 902, 903, 1, 0, 0, 0, 903, 904, 1, 0, 0, 0, 904, 906, 5, 40, 0, 0, 905, 907, 5, 14, 0, 0, 906, 905, 1, 0, 0, 0, 906, 907, 1, 0, 0, 0, 907, 919, 1, 0, 0, 0, 908, 910, 5, 56, 0, 0, 909, 908, 1, 0, 0, 0, 909, 910, 1, 0, 0, 0, 910, 911, 1, 0, 0, 0, 911, 919, 7, 10, 0, 0, 912, 919, 5, 140, 0, 0, 913, 919, 5, 141, 0, 0, 914, 919, 5, 131, 0, 0, 915, 919, 5, 122, 0, 0, 916, 919, 5, 123, 0, 0, 917, 919, 5, 130, 0, 0, 918, 894, 1, 0, 0, 0, 918, 895, 1, 0, 0, 0, 918, 896, 1, 0, 0, 0, 918, 897, 1, 0, 0, 0, 918, 898, 1, 0, 0, 0, 918, 899, 1, 0, 0, 0, 918, 900, 1, 0, 0, 0, 918, 902, 1, 0, 0, 0, 918, 909, 1, 0, 0, 0, 918, 912, 1, 0, 0, 0, 918, 913, 1, 0, 0, 0, 918, 914, 1, 0, 0, 0, 918, 915, 1, 0, 0, 0, 918, 916, 1, 0, 0, 0, 918, 917, 1, 0, 0, 0, 919, 920, 1, 0, 0, 0, 920, 970, 3, 108, 54, 17, 921, 922, 10, 14, 0, 0, 922, 923, 5, 132, 0, 0, 923, 970, 3, 108, 54, 15, 924, 925, 10, 12, 0, 0, 925, 926, 5, 2, 0, 0, 926, 970, 3, 108, 54, 13, 927, 928, 10, 11, 0, 0, 928, 929, 5, 61, 0, 0, 929, 970, 3, 108, 54, 12, 930, 932, 10, 10, 0, 0, 931, 933, 5, 56, 0, 0, 932, 931, 1, 0, 0, 0, 932, 933, 1, 0, 0, 0, 933, 934, 1, 0, 0, 0, 934, 935, 5, 9, 0, 0, 935, 936, 3, 108, 54, 0, 936, 937, 5, 2, 0, 0, 937, 938, 3, 108, 54, 11, 938, 970, 1, 0, 0, 0, 939, 940, 10, 9, 0, 0, 940, 941, 5, 135, 0, 0, 941, 942, 3, 108, 54, 0, 942, 943, 5, 111, 0, 0, 943, 944, 3, 108, 54, 9, 944, 970, 1, 0, 0, 0, 945, 946, 10, 22, 0, 0, 946, 947, 5, 125, 0, 0, 947, 948, 3, 108, 54, 0, 948, 949, 5, 143, 0, 0, 949, 970, 1, 0, 0, 0, 950, 951, 10, 21, 0, 0, 951, 952, 5, 116, 0, 0, 952, 970, 5, 104, 0, 0, 953, 954, 10, 20, 0, 0, 954, 955, 5, 116, 0, 0, 955, 970, 3, 152, 76, 0, 956, 957, 10, 15, 0, 0, 957, 959, 5, 44, 0, 0, 958, 960, 5, 56, 0, 0, 959, 958, 1, 0, 0, 0, 959, 960, 1, 0, 0, 0, 960, 961, 1, 0, 0, 0, 961, 970, 5, 57, 0, 0, 962, 967, 10, 8, 0, 0, 963, 964, 5, 6, 0, 0, 964, 968, 3, 152, 76, 0, 965, 966, 5, 6, 0, 0, 966, 968, 5, 106, 0, 0, 967, 963, 1, 0, 0, 0, 967, 965, 1, 0, 0, 0, 968, 970, 1, 0, 0, 0, 969, 879, 1, 0, 0, 0, 969, 886, 1, 0, 0, 0, 969, 893, 1, 0, 0, 0, 969, 921, 1, 0, 0, 0, 969, 924, 1, 0, 0, 0, 969, 927, 1, 0, 0, 0, 969, 930, 1, 0, 0, 0, 969, 939, 1, 0, 0, 0, 969, 945, 1, 0, 0, 0, 969, 950, 1, 0, 0, 0, 969, 953, 1, 0, 0, 0, 969, 956, 1, 0, 0, 0, 969, 962, 1, 0, 0, 0, 970, 973, 1, 0, 0, 0, 971, 969, 1, 0, 0, 0, 971, 972, 1, 0, 0, 0, 972, 109, 1, 0, 0, 0, 973, 971, 1, 0, 0, 0, 974, 979, 3, 112, 56, 0, 975, 976, 5, 112, 0, 0, 976, 978, 3, 112, 56, 0, 977, 975, 1, 0, 0, 0, 978, 981, 1, 0, 0, 0, 979, 977, 1, 0, 0, 0, 979, 980, 1, 0, 0, 0, 980, 983, 1, 0, 0, 0, 981, 979, 1, 0, 0, 0, 982, 984, 5, 112, 0, 0, 983, 982, 1, 0, 0, 0, 983, 984, 1, 0, 0, 0, 984, 111, 1, 0, 0, 0, 985, 988, 3, 114, 57, 0, 986, 988, 3, 108, 54, 0, 987, 985, 1, 0, 0, 0, 987, 986, 1, 0, 0, 0, 988, 113, 1, 0, 0, 0, 989, 990, 5, 126, 0, 0, 990, 995, 3, 152, 76, 0, 991, 992, 5, 112, 0, 0, 992, 994, 3, 152, 76, 0, 993, 991, 1, 0, 0, 0, 994, 997, 1, 0, 0, 0, 995, 993, 1, 0, 0, 0, 995, 996, 1, 0, 0, 0, 996, 999, 1, 0, 0, 0, 997, 995, 1, 0, 0, 0, 998, 1000, 5, 112, 0, 0, 999, 998, 1, 0, 0, 0, 999, 1000, 1, 0, 0, 0, 1000, 1001, 1, 0, 0, 0, 1001, 1002, 5, 144, 0, 0, 1002, 1015, 1, 0, 0, 0, 1003, 1008, 3, 152, 76, 0, 1004, 1005, 5, 112, 0, 0, 1005, 1007, 3, 152, 76, 0, 1006, 1004, 1, 0, 0, 0, 1007, 1010, 1, 0, 0, 0, 1008, 1006, 1, 0, 0, 0, 1008, 1009, 1, 0, 0, 0, 1009, 1012, 1, 0, 0, 0, 1010, 1008, 1, 0, 0, 0, 1011, 1013, 5, 112, 0, 0, 1012, 1011, 1, 0, 0, 0, 1012, 1013, 1, 0, 0, 0, 1013, 1015, 1, 0, 0, 0, 1014, 989, 1, 0, 0, 0, 1014, 1003, 1, 0, 0, 0, 1015, 1016, 1, 0, 0, 0, 1016, 1017, 5, 107, 0, 0, 1017, 1018, 3, 108, 54, 0, 1018, 115, 1, 0, 0, 0, 1019, 1020, 5, 128, 0, 0, 1020, 1024, 3, 152, 76, 0, 1021, 1023, 3, 118, 59, 0, 1022, 1021, 1, 0, 0, 0, 1023, 1026, 1, 0, 0, 0, 1024, 1022, 1, 0, 0, 0, 1024, 1025, 1, 0, 0, 0, 1025, 1027, 1, 0, 0, 0, 1026, 1024, 1, 0, 0, 0, 1027, 1028, 5, 146, 0, 0, 1028, 1029, 5, 120, 0, 0, 1029, 1048, 1, 0, 0, 0, 1030, 1031, 5, 128, 0, 0, 1031, 1035, 3, 152, 76, 0, 1032, 1034, 3, 118, 59, 0, 1033, 1032, 1, 0, 0, 0, 1034, 1037, 1, 0, 0, 0, 1035, 1033, 1, 0, 0, 0, 1035, 1036, 1, 0, 0, 0, 1036, 1038, 1, 0, 0, 0, 1037, 1035, 1, 0, 0, 0, 1038, 1040, 5, 120, 0, 0, 1039, 1041, 3, 116, 58, 0, 1040, 1039, 1, 0, 0, 0, 1040, 1041, 1, 0, 0, 0, 1041, 1042, 1, 0, 0, 0, 1042, 1043, 5, 128, 0, 0, 1043, 1044, 5, 146, 0, 0, 1044, 1045, 3, 152, 76, 0, 1045, 1046, 5, 120, 0, 0, 1046, 1048, 1, 0, 0, 0, 1047, 1019, 1, 0, 0, 0, 1047, 1030, 1, 0, 0, 0, 1048, 117, 1, 0, 0, 0, 1049, 1050, 3, 152, 76, 0, 1050, 1051, 5, 118, 0, 0, 1051, 1052, 3, 158, 79, 0, 1052, 1061, 1, 0, 0, 0, 1053, 1054, 3, 152, 76, 0, 1054, 1055, 5, 118, 0, 0, 1055, 1056, 5, 124, 0, 0, 1056, 1057, 3, 108, 54, 0, 1057, 1058, 5, 142, 0, 0, 1058, 1061, 1, 0, 0, 0, 1059, 1061, 3, 152, 76, 0, 1060, 1049, 1, 0, 0, 0, 1060, 1053, 1, 0, 0, 0, 1060, 1059, 1, 0, 0, 0, 1061, 119, 1, 0, 0, 0, 1062, 1067, 3, 122, 61, 0, 1063, 1064, 5, 112, 0, 0, 1064, 1066, 3, 122, 61, 0, 1065, 1063, 1, 0, 0, 0, 1066, 1069, 1, 0, 0, 0, 1067, 1065, 1, 0, 0, 0, 1067, 1068, 1, 0, 0, 0, 1068, 1071, 1, 0, 0, 0, 1069, 1067, 1, 0, 0, 0, 1070, 1072, 5, 112, 0, 0, 1071, 1070, 1, 0, 0, 0, 1071, 1072, 1, 0, 0, 0, 1072, 121, 1, 0, 0, 0, 1073, 1074, 3, 152, 76, 0, 1074, 1075, 5, 6, 0, 0, 1075, 1076, 5, 126, 0, 0, 1076, 1077, 3, 36, 18, 0, 1077, 1078, 5, 144, 0, 0, 1078, 1084, 1, 0, 0, 0, 1079, 1080, 3, 108, 54, 0, 1080, 1081, 5, 6, 0, 0, 1081, 1082, 3, 152, 76, 0, 1082, 1084, 1, 0, 0, 0, 1083, 1073, 1, 0, 0, 0, 1083, 1079, 1, 0, 0, 0, 1084, 123, 1, 0, 0, 0, 1085, 1093, 3, 156, 78, 0, 1086, 1087, 3, 132, 66, 0, 1087, 1088, 5, 116, 0, 0, 1088, 1090, 1, 0, 0, 0, 1089, 1086, 1, 0, 0, 0, 1089, 1090, 1, 0, 0, 0, 1090, 1091, 1, 0, 0, 0, 1091, 1093, 3, 126, 63, 0, 1092, 1085, 1, 0, 0, 0, 1092, 1089, 1, 0, 0, 0, 1093, 125, 1, 0, 0, 0, 1094, 1099, 3, 152, 76, 0, 1095, 1096, 5, 116, 0, 0, 1096, 1098, 3, 152, 76, 0, 1097, 1095, 1, 0, 0, 0, 1098, 1101, 1, 0, 0, 0, 1099, 1097, 1, 0, 0, 0, 1099, 1100, 1, 0, 0, 0, 1100, 127, 1, 0, 0, 0, 1101, 1099, 1, 0, 0, 0, 1102, 1103, 6, 64, -1, 0, 1103, 1112, 3, 132, 66, 0, 1104, 1112, 3, 130, 65, 0, 1105, 1106, 5, 126, 0, 0, 1106, 1107, 3, 36, 18, 0, 1107, 1108, 5, 144, 0, 0, 1108, 1112, 1, 0, 0, 0, 1109, 1112, 3, 116, 58, 0, 1110, 1112, 3, 156, 78, 0, 1111, 1102, 1, 0, 0, 0, 1111, 1104, 1, 0, 0, 0, 1111, 1105, 1, 0, 0, 0, 1111, 1109, 1, 0, 0, 0, 1111, 1110, 1, 0, 0, 0, 1112, 1121, 1, 0, 0, 0, 1113, 1117, 10, 3, 0, 0, 1114, 1118, 3, 150, 75, 0, 1115, 1116, 5, 6, 0, 0, 1116, 1118, 3, 152, 76, 0, 1117, 1114, 1, 0, 0, 0, 1117, 1115, 1, 0, 0, 0, 1118, 1120, 1, 0, 0, 0, 1119, 1113, 1, 0, 0, 0, 1120, 1123, 1, 0, 0, 0, 1121, 1119, 1, 0, 0, 0, 1121, 1122, 1, 0, 0, 0, 1122, 129, 1, 0, 0, 0, 1123, 1121, 1, 0, 0, 0, 1124, 1125, 3, 152, 76, 0, 1125, 1127, 5, 126, 0, 0, 1126, 1128, 3, 134, 67, 0, 1127, 1126, 1, 0, 0, 0, 1127, 1128, 1, 0, 0, 0, 1128, 1129, 1, 0, 0, 0, 1129, 1130, 5, 144, 0, 0, 1130, 131, 1, 0, 0, 0, 1131, 1132, 3, 136, 68, 0, 1132, 1133, 5, 116, 0, 0, 1133, 1135, 1, 0, 0, 0, 1134, 1131, 1, 0, 0, 0, 1134, 1135, 1, 0, 0, 0, 1135, 1136, 1, 0, 0, 0, 1136, 1137, 3, 152, 76, 0, 1137, 133, 1, 0, 0, 0, 1138, 1143, 3, 108, 54, 0, 1139, 1140, 5, 112, 0, 0, 1140, 1142, 3, 108, 54, 0, 1141, 1139, 1, 0, 0, 0, 1142, 1145, 1, 0, 0, 0, 1143, 1141, 1, 0, 0, 0, 1143, 1144, 1, 0, 0, 0, 1144, 1147, 1, 0, 0, 0, 1145, 1143, 1, 0, 0, 0, 1146, 1148, 5, 112, 0, 0, 1147, 1146, 1, 0, 0, 0, 1147, 1148, 1, 0, 0, 0, 1148, 135, 1, 0, 0, 0, 1149, 1150, 3, 152, 76, 0, 1150, 137, 1, 0, 0, 0, 1151, 1160, 5, 102, 0, 0, 1152, 1153, 5, 116, 0, 0, 1153, 1160, 7, 11, 0, 0, 1154, 1155, 5, 104, 0, 0, 1155, 1157, 5, 116, 0, 0, 1156, 1158, 7, 11, 0, 0, 1157, 1156, 1, 0, 0, 0, 1157, 1158, 1, 0, 0, 0, 1158, 1160, 1, 0, 0, 0, 1159, 1151, 1, 0, 0, 0, 1159, 1152, 1, 0, 0, 0, 1159, 1154, 1, 0, 0, 0, 1160, 139, 1, 0, 0, 0, 1161, 1163, 7, 12, 0, 0, 1162, 1161, 1, 0, 0, 0, 1162, 1163, 1, 0, 0, 0, 1163, 1170, 1, 0, 0, 0, 1164, 1171, 3, 138, 69, 0, 1165, 1171, 5, 103, 0, 0, 1166, 1171, 5, 104, 0, 0, 1167, 1171, 5, 105, 0, 0, 1168, 1171, 5, 41, 0, 0, 1169, 1171, 5, 55, 0, 0, 1170, 1164, 1, 0, 0, 0, 1170, 1165, 1, 0, 0, 0, 1170, 1166, 1, 0, 0, 0, 1170, 1167, 1, 0, 0, 0, 1170, 1168, 1, 0, 0, 0, 1170, 1169, 1, 0, 0, 0, 1171, 141, 1, 0, 0, 0, 1172, 1176, 3, 140, 70, 0, 1173, 1176, 5, 106, 0, 0, 1174, 1176, 5, 57, 0, 0, 1175, 1172, 1, 0, 0, 0, 1175, 1173, 1, 0, 0, 0, 1175, 1174, 1, 0, 0, 0, 1176, 143, 1, 0, 0, 0, 1177, 1178, 7, 13, 0, 0, 1178, 145, 1, 0, 0, 0, 1179, 1180, 7, 14, 0, 0, 1180, 147, 1, 0, 0, 0, 1181, 1182, 7, 15, 0, 0, 1182, 149, 1, 0, 0, 0, 1183, 1186, 5, 101, 0, 0, 1184, 1186, 3, 148, 74, 0, 1185, 1183, 1, 0, 0, 0, 1185, 1184, 1, 0, 0, 0, 1186, 151, 1, 0, 0, 0, 1187, 1191, 5, 101, 0, 0, 1188, 1191, 3, 144, 72, 0, 1189, 1191, 3, 146, 73, 0, 1190, 1187, 1, 0, 0, 0, 1190, 1188, 1, 0, 0, 0, 1190, 1189, 1, 0, 0, 0, 1191, 153, 1, 0, 0, 0, 1192, 1193, 3, 158, 79, 0, 1193, 1194, 5, 118, 0, 0, 1194, 1195, 3, 140, 70, 0, 1195, 155, 1, 0, 0, 0, 1196, 1197, 5, 124, 0, 0, 1197, 1198, 3, 152, 76, 0, 1198, 1199, 5, 142, 0, 0, 1199, 157, 1, 0, 0, 0, 1200, 1203, 5, 106, 0, 0, 1201, 1203, 3, 160, 80, 0, 1202, 1200, 1, 0, 0, 0, 1202, 1201, 1, 0, 0, 0, 1203, 159, 1, 0, 0, 0, 1204, 1208, 5, 137, 0, 0, 1205, 1207, 3, 162, 81, 0, 1206, 1205, 1, 0, 0, 0, 1207, 1210, 1, 0, 0, 0, 1208, 1206, 1, 0, 0, 0, 1208, 1209, 1, 0, 0, 0, 1209, 1211, 1, 0, 0, 0, 1210, 1208, 1, 0, 0, 0, 1211, 1212, 5, 139, 0, 0, 1212, 161, 1, 0, 0, 0, 1213, 1214, 5, 152, 0, 0, 1214, 1215, 3, 108, 54, 0, 1215, 1216, 5, 142, 0, 0, 1216, 1219, 1, 0, 0, 0, 1217, 1219, 5, 151, 0, 0, 1218, 1213, 1, 0, 0, 0, 1218, 1217, 1, 0, 0, 0, 1219, 163, 1, 0, 0, 0, 1220, 1224, 5, 138, 0, 0, 1221, 1223, 3, 166, 83, 0, 1222, 1221, 1, 0, 0, 0, 1223, 1226, 1, 0, 0, 0, 1224, 1222, 1, 0, 0, 0, 1224, 1225, 1, 0, 0, 0, 1225, 1227, 1, 0, 0, 0, 1226, 1224, 1, 0, 0, 0, 1227, 1228, 5, 0, 0, 1, 1228, 165, 1, 0, 0, 0, 1229, 1230, 5, 154, 0, 0, 1230, 1231, 3, 108, 54, 0, 1231, 1232, 5, 142, 0, 0, 1232, 1235, 1, 0, 0, 0, 1233, 1235, 5, 153, 0, 0, 1234, 1229, 1, 0, 0, 0, 1234, 1233, 1, 0, 0, 0, 1235, 167, 1, 0, 0, 0, 160, 171, 178, 187, 194, 198, 209, 213, 216, 225, 233, 240, 244, 250, 255, 261, 273, 281, 295, 299, 304, 314, 323, 326, 330, 333, 337, 340, 343, 346, 349, 353, 357, 360, 363, 366, 370, 373, 382, 388, 409, 426, 443, 449, 455, 466, 468, 479, 482, 488, 496, 502, 504, 508, 513, 516, 519, 523, 527, 530, 532, 535, 539, 543, 546, 548, 550, 555, 566, 572, 579, 584, 588, 592, 598, 600, 607, 615, 618, 621, 640, 654, 670, 674, 685, 689, 700, 704, 711, 715, 722, 726, 731, 740, 744, 768, 785, 791, 794, 797, 807, 813, 816, 819, 827, 830, 834, 837, 851, 868, 873, 877, 883, 890, 902, 906, 909, 918, 932, 959, 967, 969, 971, 979, 983, 987, 995, 999, 1008, 1012, 1014, 1024, 1035, 1040, 1047, 1060, 1067, 1071, 1083, 1089, 1092, 1099, 1111, 1117, 1121, 1127, 1134, 1143, 1147, 1157, 1159, 1162, 1170, 1175, 1185, 1190, 1202, 1208, 1218, 1224, 1234] \ No newline at end of file +[4, 1, 154, 1237, 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, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78, 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, 2, 83, 7, 83, 1, 0, 5, 0, 170, 8, 0, 10, 0, 12, 0, 173, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 179, 8, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 188, 8, 3, 1, 4, 1, 4, 1, 4, 5, 4, 193, 8, 4, 10, 4, 12, 4, 196, 9, 4, 1, 4, 3, 4, 199, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 210, 8, 5, 1, 6, 1, 6, 3, 6, 214, 8, 6, 1, 6, 3, 6, 217, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 226, 8, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 234, 8, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 241, 8, 9, 1, 9, 1, 9, 3, 9, 245, 8, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 251, 8, 9, 1, 9, 1, 9, 1, 9, 3, 9, 256, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 262, 8, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 3, 12, 274, 8, 12, 1, 13, 1, 13, 1, 14, 1, 14, 5, 14, 280, 8, 14, 10, 14, 12, 14, 283, 9, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 5, 16, 294, 8, 16, 10, 16, 12, 16, 297, 9, 16, 1, 16, 3, 16, 300, 8, 16, 1, 17, 1, 17, 1, 17, 3, 17, 305, 8, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 5, 18, 313, 8, 18, 10, 18, 12, 18, 316, 9, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 324, 8, 19, 1, 20, 3, 20, 327, 8, 20, 1, 20, 1, 20, 3, 20, 331, 8, 20, 1, 20, 3, 20, 334, 8, 20, 1, 20, 1, 20, 3, 20, 338, 8, 20, 1, 20, 3, 20, 341, 8, 20, 1, 20, 3, 20, 344, 8, 20, 1, 20, 3, 20, 347, 8, 20, 1, 20, 3, 20, 350, 8, 20, 1, 20, 1, 20, 3, 20, 354, 8, 20, 1, 20, 1, 20, 3, 20, 358, 8, 20, 1, 20, 3, 20, 361, 8, 20, 1, 20, 3, 20, 364, 8, 20, 1, 20, 3, 20, 367, 8, 20, 1, 20, 1, 20, 3, 20, 371, 8, 20, 1, 20, 3, 20, 374, 8, 20, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 383, 8, 22, 1, 23, 1, 23, 1, 23, 1, 24, 3, 24, 389, 8, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 5, 25, 408, 8, 25, 10, 25, 12, 25, 411, 9, 25, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 3, 28, 427, 8, 28, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 3, 32, 444, 8, 32, 1, 32, 1, 32, 1, 32, 1, 32, 3, 32, 450, 8, 32, 1, 32, 1, 32, 1, 32, 1, 32, 3, 32, 456, 8, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 3, 32, 467, 8, 32, 3, 32, 469, 8, 32, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 3, 35, 480, 8, 35, 1, 35, 3, 35, 483, 8, 35, 1, 35, 1, 35, 1, 35, 1, 35, 3, 35, 489, 8, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 3, 35, 497, 8, 35, 1, 35, 1, 35, 1, 35, 1, 35, 5, 35, 503, 8, 35, 10, 35, 12, 35, 506, 9, 35, 1, 36, 3, 36, 509, 8, 36, 1, 36, 1, 36, 1, 36, 3, 36, 514, 8, 36, 1, 36, 3, 36, 517, 8, 36, 1, 36, 3, 36, 520, 8, 36, 1, 36, 1, 36, 3, 36, 524, 8, 36, 1, 36, 1, 36, 3, 36, 528, 8, 36, 1, 36, 3, 36, 531, 8, 36, 3, 36, 533, 8, 36, 1, 36, 3, 36, 536, 8, 36, 1, 36, 1, 36, 3, 36, 540, 8, 36, 1, 36, 1, 36, 3, 36, 544, 8, 36, 1, 36, 3, 36, 547, 8, 36, 3, 36, 549, 8, 36, 3, 36, 551, 8, 36, 1, 37, 1, 37, 1, 37, 3, 37, 556, 8, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 3, 38, 567, 8, 38, 1, 39, 1, 39, 1, 39, 1, 39, 3, 39, 573, 8, 39, 1, 40, 1, 40, 1, 40, 5, 40, 578, 8, 40, 10, 40, 12, 40, 581, 9, 40, 1, 41, 1, 41, 3, 41, 585, 8, 41, 1, 41, 1, 41, 3, 41, 589, 8, 41, 1, 41, 1, 41, 3, 41, 593, 8, 41, 1, 42, 1, 42, 1, 42, 1, 42, 3, 42, 599, 8, 42, 3, 42, 601, 8, 42, 1, 43, 1, 43, 1, 43, 5, 43, 606, 8, 43, 10, 43, 12, 43, 609, 9, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 3, 45, 616, 8, 45, 1, 45, 3, 45, 619, 8, 45, 1, 45, 3, 45, 622, 8, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 641, 8, 49, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 3, 50, 655, 8, 50, 1, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 5, 52, 669, 8, 52, 10, 52, 12, 52, 672, 9, 52, 1, 52, 3, 52, 675, 8, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 5, 52, 684, 8, 52, 10, 52, 12, 52, 687, 9, 52, 1, 52, 3, 52, 690, 8, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 5, 52, 699, 8, 52, 10, 52, 12, 52, 702, 9, 52, 1, 52, 3, 52, 705, 8, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 3, 52, 712, 8, 52, 1, 52, 1, 52, 3, 52, 716, 8, 52, 1, 53, 1, 53, 1, 53, 5, 53, 721, 8, 53, 10, 53, 12, 53, 724, 9, 53, 1, 53, 3, 53, 727, 8, 53, 1, 54, 1, 54, 1, 54, 3, 54, 732, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 4, 54, 739, 8, 54, 11, 54, 12, 54, 740, 1, 54, 1, 54, 3, 54, 745, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 769, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 786, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 792, 8, 54, 1, 54, 3, 54, 795, 8, 54, 1, 54, 3, 54, 798, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 808, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 814, 8, 54, 1, 54, 3, 54, 817, 8, 54, 1, 54, 3, 54, 820, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 828, 8, 54, 1, 54, 3, 54, 831, 8, 54, 1, 54, 1, 54, 3, 54, 835, 8, 54, 1, 54, 3, 54, 838, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 852, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 869, 8, 54, 1, 54, 1, 54, 1, 54, 3, 54, 874, 8, 54, 1, 54, 1, 54, 3, 54, 878, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 884, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 891, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 903, 8, 54, 1, 54, 1, 54, 3, 54, 907, 8, 54, 1, 54, 3, 54, 910, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 919, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 933, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 960, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 968, 8, 54, 5, 54, 970, 8, 54, 10, 54, 12, 54, 973, 9, 54, 1, 55, 1, 55, 1, 55, 5, 55, 978, 8, 55, 10, 55, 12, 55, 981, 9, 55, 1, 55, 3, 55, 984, 8, 55, 1, 56, 1, 56, 3, 56, 988, 8, 56, 1, 57, 1, 57, 1, 57, 1, 57, 5, 57, 994, 8, 57, 10, 57, 12, 57, 997, 9, 57, 1, 57, 3, 57, 1000, 8, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 5, 57, 1007, 8, 57, 10, 57, 12, 57, 1010, 9, 57, 1, 57, 3, 57, 1013, 8, 57, 3, 57, 1015, 8, 57, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, 5, 58, 1023, 8, 58, 10, 58, 12, 58, 1026, 9, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 5, 58, 1034, 8, 58, 10, 58, 12, 58, 1037, 9, 58, 1, 58, 1, 58, 3, 58, 1041, 8, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 3, 58, 1048, 8, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 3, 59, 1061, 8, 59, 1, 60, 1, 60, 1, 60, 5, 60, 1066, 8, 60, 10, 60, 12, 60, 1069, 9, 60, 1, 60, 3, 60, 1072, 8, 60, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 3, 61, 1084, 8, 61, 1, 62, 1, 62, 1, 62, 1, 62, 3, 62, 1090, 8, 62, 1, 62, 3, 62, 1093, 8, 62, 1, 63, 1, 63, 1, 63, 5, 63, 1098, 8, 63, 10, 63, 12, 63, 1101, 9, 63, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 3, 64, 1112, 8, 64, 1, 64, 1, 64, 1, 64, 1, 64, 3, 64, 1118, 8, 64, 5, 64, 1120, 8, 64, 10, 64, 12, 64, 1123, 9, 64, 1, 65, 1, 65, 1, 65, 3, 65, 1128, 8, 65, 1, 65, 1, 65, 1, 66, 1, 66, 1, 66, 3, 66, 1135, 8, 66, 1, 66, 1, 66, 1, 67, 1, 67, 1, 67, 5, 67, 1142, 8, 67, 10, 67, 12, 67, 1145, 9, 67, 1, 67, 3, 67, 1148, 8, 67, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 3, 69, 1158, 8, 69, 3, 69, 1160, 8, 69, 1, 70, 3, 70, 1163, 8, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 3, 70, 1171, 8, 70, 1, 71, 1, 71, 1, 71, 3, 71, 1176, 8, 71, 1, 72, 1, 72, 1, 73, 1, 73, 1, 74, 1, 74, 1, 75, 1, 75, 3, 75, 1186, 8, 75, 1, 76, 1, 76, 1, 76, 3, 76, 1191, 8, 76, 1, 77, 1, 77, 1, 77, 1, 77, 1, 78, 1, 78, 1, 78, 1, 78, 1, 79, 1, 79, 3, 79, 1203, 8, 79, 1, 80, 1, 80, 5, 80, 1207, 8, 80, 10, 80, 12, 80, 1210, 9, 80, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 3, 81, 1219, 8, 81, 1, 82, 1, 82, 5, 82, 1223, 8, 82, 10, 82, 12, 82, 1226, 9, 82, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 3, 83, 1235, 8, 83, 1, 83, 0, 3, 70, 108, 128, 84, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 0, 16, 2, 0, 17, 17, 72, 72, 2, 0, 42, 42, 49, 49, 3, 0, 1, 1, 4, 4, 8, 8, 4, 0, 1, 1, 3, 4, 8, 8, 78, 78, 2, 0, 49, 49, 71, 71, 2, 0, 1, 1, 4, 4, 2, 0, 7, 7, 21, 22, 2, 0, 28, 28, 47, 47, 2, 0, 69, 69, 74, 74, 3, 0, 10, 10, 48, 48, 87, 87, 2, 0, 39, 39, 51, 51, 1, 0, 103, 104, 2, 0, 114, 114, 134, 134, 7, 0, 20, 20, 36, 36, 53, 54, 68, 68, 76, 76, 93, 93, 99, 99, 12, 0, 1, 19, 21, 28, 30, 35, 37, 40, 42, 49, 51, 52, 56, 56, 58, 67, 69, 75, 77, 92, 94, 95, 97, 98, 4, 0, 19, 19, 28, 28, 37, 37, 46, 46, 1394, 0, 171, 1, 0, 0, 0, 2, 178, 1, 0, 0, 0, 4, 180, 1, 0, 0, 0, 6, 182, 1, 0, 0, 0, 8, 189, 1, 0, 0, 0, 10, 209, 1, 0, 0, 0, 12, 211, 1, 0, 0, 0, 14, 218, 1, 0, 0, 0, 16, 227, 1, 0, 0, 0, 18, 235, 1, 0, 0, 0, 20, 257, 1, 0, 0, 0, 22, 266, 1, 0, 0, 0, 24, 271, 1, 0, 0, 0, 26, 275, 1, 0, 0, 0, 28, 277, 1, 0, 0, 0, 30, 286, 1, 0, 0, 0, 32, 290, 1, 0, 0, 0, 34, 304, 1, 0, 0, 0, 36, 308, 1, 0, 0, 0, 38, 323, 1, 0, 0, 0, 40, 326, 1, 0, 0, 0, 42, 375, 1, 0, 0, 0, 44, 378, 1, 0, 0, 0, 46, 384, 1, 0, 0, 0, 48, 388, 1, 0, 0, 0, 50, 394, 1, 0, 0, 0, 52, 412, 1, 0, 0, 0, 54, 415, 1, 0, 0, 0, 56, 418, 1, 0, 0, 0, 58, 428, 1, 0, 0, 0, 60, 431, 1, 0, 0, 0, 62, 435, 1, 0, 0, 0, 64, 468, 1, 0, 0, 0, 66, 470, 1, 0, 0, 0, 68, 473, 1, 0, 0, 0, 70, 488, 1, 0, 0, 0, 72, 550, 1, 0, 0, 0, 74, 555, 1, 0, 0, 0, 76, 566, 1, 0, 0, 0, 78, 568, 1, 0, 0, 0, 80, 574, 1, 0, 0, 0, 82, 582, 1, 0, 0, 0, 84, 600, 1, 0, 0, 0, 86, 602, 1, 0, 0, 0, 88, 610, 1, 0, 0, 0, 90, 615, 1, 0, 0, 0, 92, 623, 1, 0, 0, 0, 94, 627, 1, 0, 0, 0, 96, 631, 1, 0, 0, 0, 98, 640, 1, 0, 0, 0, 100, 654, 1, 0, 0, 0, 102, 656, 1, 0, 0, 0, 104, 715, 1, 0, 0, 0, 106, 717, 1, 0, 0, 0, 108, 877, 1, 0, 0, 0, 110, 974, 1, 0, 0, 0, 112, 987, 1, 0, 0, 0, 114, 1014, 1, 0, 0, 0, 116, 1047, 1, 0, 0, 0, 118, 1060, 1, 0, 0, 0, 120, 1062, 1, 0, 0, 0, 122, 1083, 1, 0, 0, 0, 124, 1092, 1, 0, 0, 0, 126, 1094, 1, 0, 0, 0, 128, 1111, 1, 0, 0, 0, 130, 1124, 1, 0, 0, 0, 132, 1134, 1, 0, 0, 0, 134, 1138, 1, 0, 0, 0, 136, 1149, 1, 0, 0, 0, 138, 1159, 1, 0, 0, 0, 140, 1162, 1, 0, 0, 0, 142, 1175, 1, 0, 0, 0, 144, 1177, 1, 0, 0, 0, 146, 1179, 1, 0, 0, 0, 148, 1181, 1, 0, 0, 0, 150, 1185, 1, 0, 0, 0, 152, 1190, 1, 0, 0, 0, 154, 1192, 1, 0, 0, 0, 156, 1196, 1, 0, 0, 0, 158, 1202, 1, 0, 0, 0, 160, 1204, 1, 0, 0, 0, 162, 1218, 1, 0, 0, 0, 164, 1220, 1, 0, 0, 0, 166, 1234, 1, 0, 0, 0, 168, 170, 3, 2, 1, 0, 169, 168, 1, 0, 0, 0, 170, 173, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, 171, 172, 1, 0, 0, 0, 172, 174, 1, 0, 0, 0, 173, 171, 1, 0, 0, 0, 174, 175, 5, 0, 0, 1, 175, 1, 1, 0, 0, 0, 176, 179, 3, 6, 3, 0, 177, 179, 3, 10, 5, 0, 178, 176, 1, 0, 0, 0, 178, 177, 1, 0, 0, 0, 179, 3, 1, 0, 0, 0, 180, 181, 3, 108, 54, 0, 181, 5, 1, 0, 0, 0, 182, 183, 5, 50, 0, 0, 183, 187, 3, 152, 76, 0, 184, 185, 5, 111, 0, 0, 185, 186, 5, 118, 0, 0, 186, 188, 3, 4, 2, 0, 187, 184, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 7, 1, 0, 0, 0, 189, 194, 3, 152, 76, 0, 190, 191, 5, 112, 0, 0, 191, 193, 3, 152, 76, 0, 192, 190, 1, 0, 0, 0, 193, 196, 1, 0, 0, 0, 194, 192, 1, 0, 0, 0, 194, 195, 1, 0, 0, 0, 195, 198, 1, 0, 0, 0, 196, 194, 1, 0, 0, 0, 197, 199, 5, 112, 0, 0, 198, 197, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, 9, 1, 0, 0, 0, 200, 210, 3, 12, 6, 0, 201, 210, 3, 14, 7, 0, 202, 210, 3, 16, 8, 0, 203, 210, 3, 18, 9, 0, 204, 210, 3, 20, 10, 0, 205, 210, 3, 22, 11, 0, 206, 210, 3, 28, 14, 0, 207, 210, 3, 24, 12, 0, 208, 210, 3, 26, 13, 0, 209, 200, 1, 0, 0, 0, 209, 201, 1, 0, 0, 0, 209, 202, 1, 0, 0, 0, 209, 203, 1, 0, 0, 0, 209, 204, 1, 0, 0, 0, 209, 205, 1, 0, 0, 0, 209, 206, 1, 0, 0, 0, 209, 207, 1, 0, 0, 0, 209, 208, 1, 0, 0, 0, 210, 11, 1, 0, 0, 0, 211, 213, 5, 70, 0, 0, 212, 214, 3, 4, 2, 0, 213, 212, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, 216, 1, 0, 0, 0, 215, 217, 5, 145, 0, 0, 216, 215, 1, 0, 0, 0, 216, 217, 1, 0, 0, 0, 217, 13, 1, 0, 0, 0, 218, 219, 5, 38, 0, 0, 219, 220, 5, 126, 0, 0, 220, 221, 3, 4, 2, 0, 221, 222, 5, 144, 0, 0, 222, 225, 3, 10, 5, 0, 223, 224, 5, 24, 0, 0, 224, 226, 3, 10, 5, 0, 225, 223, 1, 0, 0, 0, 225, 226, 1, 0, 0, 0, 226, 15, 1, 0, 0, 0, 227, 228, 5, 96, 0, 0, 228, 229, 5, 126, 0, 0, 229, 230, 3, 4, 2, 0, 230, 231, 5, 144, 0, 0, 231, 233, 3, 10, 5, 0, 232, 234, 5, 145, 0, 0, 233, 232, 1, 0, 0, 0, 233, 234, 1, 0, 0, 0, 234, 17, 1, 0, 0, 0, 235, 236, 5, 31, 0, 0, 236, 240, 5, 126, 0, 0, 237, 241, 3, 6, 3, 0, 238, 241, 3, 22, 11, 0, 239, 241, 3, 4, 2, 0, 240, 237, 1, 0, 0, 0, 240, 238, 1, 0, 0, 0, 240, 239, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 244, 5, 145, 0, 0, 243, 245, 3, 4, 2, 0, 244, 243, 1, 0, 0, 0, 244, 245, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, 246, 250, 5, 145, 0, 0, 247, 251, 3, 6, 3, 0, 248, 251, 3, 22, 11, 0, 249, 251, 3, 4, 2, 0, 250, 247, 1, 0, 0, 0, 250, 248, 1, 0, 0, 0, 250, 249, 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 252, 1, 0, 0, 0, 252, 253, 5, 144, 0, 0, 253, 255, 3, 10, 5, 0, 254, 256, 5, 145, 0, 0, 255, 254, 1, 0, 0, 0, 255, 256, 1, 0, 0, 0, 256, 19, 1, 0, 0, 0, 257, 258, 5, 29, 0, 0, 258, 259, 3, 152, 76, 0, 259, 261, 5, 126, 0, 0, 260, 262, 3, 8, 4, 0, 261, 260, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 264, 5, 144, 0, 0, 264, 265, 3, 28, 14, 0, 265, 21, 1, 0, 0, 0, 266, 267, 3, 4, 2, 0, 267, 268, 5, 111, 0, 0, 268, 269, 5, 118, 0, 0, 269, 270, 3, 4, 2, 0, 270, 23, 1, 0, 0, 0, 271, 273, 3, 4, 2, 0, 272, 274, 5, 145, 0, 0, 273, 272, 1, 0, 0, 0, 273, 274, 1, 0, 0, 0, 274, 25, 1, 0, 0, 0, 275, 276, 5, 145, 0, 0, 276, 27, 1, 0, 0, 0, 277, 281, 5, 124, 0, 0, 278, 280, 3, 2, 1, 0, 279, 278, 1, 0, 0, 0, 280, 283, 1, 0, 0, 0, 281, 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 284, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, 284, 285, 5, 142, 0, 0, 285, 29, 1, 0, 0, 0, 286, 287, 3, 4, 2, 0, 287, 288, 5, 111, 0, 0, 288, 289, 3, 4, 2, 0, 289, 31, 1, 0, 0, 0, 290, 295, 3, 30, 15, 0, 291, 292, 5, 112, 0, 0, 292, 294, 3, 30, 15, 0, 293, 291, 1, 0, 0, 0, 294, 297, 1, 0, 0, 0, 295, 293, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 299, 1, 0, 0, 0, 297, 295, 1, 0, 0, 0, 298, 300, 5, 112, 0, 0, 299, 298, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 33, 1, 0, 0, 0, 301, 305, 3, 36, 18, 0, 302, 305, 3, 40, 20, 0, 303, 305, 3, 116, 58, 0, 304, 301, 1, 0, 0, 0, 304, 302, 1, 0, 0, 0, 304, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 307, 5, 0, 0, 1, 307, 35, 1, 0, 0, 0, 308, 314, 3, 38, 19, 0, 309, 310, 5, 91, 0, 0, 310, 311, 5, 1, 0, 0, 311, 313, 3, 38, 19, 0, 312, 309, 1, 0, 0, 0, 313, 316, 1, 0, 0, 0, 314, 312, 1, 0, 0, 0, 314, 315, 1, 0, 0, 0, 315, 37, 1, 0, 0, 0, 316, 314, 1, 0, 0, 0, 317, 324, 3, 40, 20, 0, 318, 319, 5, 126, 0, 0, 319, 320, 3, 36, 18, 0, 320, 321, 5, 144, 0, 0, 321, 324, 1, 0, 0, 0, 322, 324, 3, 156, 78, 0, 323, 317, 1, 0, 0, 0, 323, 318, 1, 0, 0, 0, 323, 322, 1, 0, 0, 0, 324, 39, 1, 0, 0, 0, 325, 327, 3, 42, 21, 0, 326, 325, 1, 0, 0, 0, 326, 327, 1, 0, 0, 0, 327, 328, 1, 0, 0, 0, 328, 330, 5, 77, 0, 0, 329, 331, 5, 23, 0, 0, 330, 329, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 333, 1, 0, 0, 0, 332, 334, 3, 44, 22, 0, 333, 332, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, 335, 337, 3, 106, 53, 0, 336, 338, 3, 46, 23, 0, 337, 336, 1, 0, 0, 0, 337, 338, 1, 0, 0, 0, 338, 340, 1, 0, 0, 0, 339, 341, 3, 48, 24, 0, 340, 339, 1, 0, 0, 0, 340, 341, 1, 0, 0, 0, 341, 343, 1, 0, 0, 0, 342, 344, 3, 52, 26, 0, 343, 342, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 346, 1, 0, 0, 0, 345, 347, 3, 54, 27, 0, 346, 345, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, 347, 349, 1, 0, 0, 0, 348, 350, 3, 56, 28, 0, 349, 348, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 353, 1, 0, 0, 0, 351, 352, 5, 98, 0, 0, 352, 354, 7, 0, 0, 0, 353, 351, 1, 0, 0, 0, 353, 354, 1, 0, 0, 0, 354, 357, 1, 0, 0, 0, 355, 356, 5, 98, 0, 0, 356, 358, 5, 86, 0, 0, 357, 355, 1, 0, 0, 0, 357, 358, 1, 0, 0, 0, 358, 360, 1, 0, 0, 0, 359, 361, 3, 58, 29, 0, 360, 359, 1, 0, 0, 0, 360, 361, 1, 0, 0, 0, 361, 363, 1, 0, 0, 0, 362, 364, 3, 50, 25, 0, 363, 362, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, 366, 1, 0, 0, 0, 365, 367, 3, 60, 30, 0, 366, 365, 1, 0, 0, 0, 366, 367, 1, 0, 0, 0, 367, 370, 1, 0, 0, 0, 368, 371, 3, 64, 32, 0, 369, 371, 3, 66, 33, 0, 370, 368, 1, 0, 0, 0, 370, 369, 1, 0, 0, 0, 370, 371, 1, 0, 0, 0, 371, 373, 1, 0, 0, 0, 372, 374, 3, 68, 34, 0, 373, 372, 1, 0, 0, 0, 373, 374, 1, 0, 0, 0, 374, 41, 1, 0, 0, 0, 375, 376, 5, 98, 0, 0, 376, 377, 3, 120, 60, 0, 377, 43, 1, 0, 0, 0, 378, 379, 5, 85, 0, 0, 379, 382, 5, 104, 0, 0, 380, 381, 5, 98, 0, 0, 381, 383, 5, 82, 0, 0, 382, 380, 1, 0, 0, 0, 382, 383, 1, 0, 0, 0, 383, 45, 1, 0, 0, 0, 384, 385, 5, 32, 0, 0, 385, 386, 3, 70, 35, 0, 386, 47, 1, 0, 0, 0, 387, 389, 7, 1, 0, 0, 388, 387, 1, 0, 0, 0, 388, 389, 1, 0, 0, 0, 389, 390, 1, 0, 0, 0, 390, 391, 5, 5, 0, 0, 391, 392, 5, 45, 0, 0, 392, 393, 3, 106, 53, 0, 393, 49, 1, 0, 0, 0, 394, 395, 5, 97, 0, 0, 395, 396, 3, 152, 76, 0, 396, 397, 5, 6, 0, 0, 397, 398, 5, 126, 0, 0, 398, 399, 3, 90, 45, 0, 399, 409, 5, 144, 0, 0, 400, 401, 5, 112, 0, 0, 401, 402, 3, 152, 76, 0, 402, 403, 5, 6, 0, 0, 403, 404, 5, 126, 0, 0, 404, 405, 3, 90, 45, 0, 405, 406, 5, 144, 0, 0, 406, 408, 1, 0, 0, 0, 407, 400, 1, 0, 0, 0, 408, 411, 1, 0, 0, 0, 409, 407, 1, 0, 0, 0, 409, 410, 1, 0, 0, 0, 410, 51, 1, 0, 0, 0, 411, 409, 1, 0, 0, 0, 412, 413, 5, 67, 0, 0, 413, 414, 3, 108, 54, 0, 414, 53, 1, 0, 0, 0, 415, 416, 5, 95, 0, 0, 416, 417, 3, 108, 54, 0, 417, 55, 1, 0, 0, 0, 418, 419, 5, 34, 0, 0, 419, 426, 5, 11, 0, 0, 420, 421, 7, 0, 0, 0, 421, 422, 5, 126, 0, 0, 422, 423, 3, 106, 53, 0, 423, 424, 5, 144, 0, 0, 424, 427, 1, 0, 0, 0, 425, 427, 3, 106, 53, 0, 426, 420, 1, 0, 0, 0, 426, 425, 1, 0, 0, 0, 427, 57, 1, 0, 0, 0, 428, 429, 5, 35, 0, 0, 429, 430, 3, 108, 54, 0, 430, 59, 1, 0, 0, 0, 431, 432, 5, 62, 0, 0, 432, 433, 5, 11, 0, 0, 433, 434, 3, 80, 40, 0, 434, 61, 1, 0, 0, 0, 435, 436, 5, 62, 0, 0, 436, 437, 5, 11, 0, 0, 437, 438, 3, 106, 53, 0, 438, 63, 1, 0, 0, 0, 439, 440, 5, 52, 0, 0, 440, 443, 3, 108, 54, 0, 441, 442, 5, 112, 0, 0, 442, 444, 3, 108, 54, 0, 443, 441, 1, 0, 0, 0, 443, 444, 1, 0, 0, 0, 444, 449, 1, 0, 0, 0, 445, 446, 5, 98, 0, 0, 446, 450, 5, 82, 0, 0, 447, 448, 5, 11, 0, 0, 448, 450, 3, 106, 53, 0, 449, 445, 1, 0, 0, 0, 449, 447, 1, 0, 0, 0, 449, 450, 1, 0, 0, 0, 450, 469, 1, 0, 0, 0, 451, 452, 5, 52, 0, 0, 452, 455, 3, 108, 54, 0, 453, 454, 5, 98, 0, 0, 454, 456, 5, 82, 0, 0, 455, 453, 1, 0, 0, 0, 455, 456, 1, 0, 0, 0, 456, 457, 1, 0, 0, 0, 457, 458, 5, 59, 0, 0, 458, 459, 3, 108, 54, 0, 459, 469, 1, 0, 0, 0, 460, 461, 5, 52, 0, 0, 461, 462, 3, 108, 54, 0, 462, 463, 5, 59, 0, 0, 463, 466, 3, 108, 54, 0, 464, 465, 5, 11, 0, 0, 465, 467, 3, 106, 53, 0, 466, 464, 1, 0, 0, 0, 466, 467, 1, 0, 0, 0, 467, 469, 1, 0, 0, 0, 468, 439, 1, 0, 0, 0, 468, 451, 1, 0, 0, 0, 468, 460, 1, 0, 0, 0, 469, 65, 1, 0, 0, 0, 470, 471, 5, 59, 0, 0, 471, 472, 3, 108, 54, 0, 472, 67, 1, 0, 0, 0, 473, 474, 5, 79, 0, 0, 474, 475, 3, 86, 43, 0, 475, 69, 1, 0, 0, 0, 476, 477, 6, 35, -1, 0, 477, 479, 3, 128, 64, 0, 478, 480, 5, 27, 0, 0, 479, 478, 1, 0, 0, 0, 479, 480, 1, 0, 0, 0, 480, 482, 1, 0, 0, 0, 481, 483, 3, 78, 39, 0, 482, 481, 1, 0, 0, 0, 482, 483, 1, 0, 0, 0, 483, 489, 1, 0, 0, 0, 484, 485, 5, 126, 0, 0, 485, 486, 3, 70, 35, 0, 486, 487, 5, 144, 0, 0, 487, 489, 1, 0, 0, 0, 488, 476, 1, 0, 0, 0, 488, 484, 1, 0, 0, 0, 489, 504, 1, 0, 0, 0, 490, 491, 10, 3, 0, 0, 491, 492, 3, 74, 37, 0, 492, 493, 3, 70, 35, 4, 493, 503, 1, 0, 0, 0, 494, 496, 10, 4, 0, 0, 495, 497, 3, 72, 36, 0, 496, 495, 1, 0, 0, 0, 496, 497, 1, 0, 0, 0, 497, 498, 1, 0, 0, 0, 498, 499, 5, 45, 0, 0, 499, 500, 3, 70, 35, 0, 500, 501, 3, 76, 38, 0, 501, 503, 1, 0, 0, 0, 502, 490, 1, 0, 0, 0, 502, 494, 1, 0, 0, 0, 503, 506, 1, 0, 0, 0, 504, 502, 1, 0, 0, 0, 504, 505, 1, 0, 0, 0, 505, 71, 1, 0, 0, 0, 506, 504, 1, 0, 0, 0, 507, 509, 7, 2, 0, 0, 508, 507, 1, 0, 0, 0, 508, 509, 1, 0, 0, 0, 509, 510, 1, 0, 0, 0, 510, 517, 5, 42, 0, 0, 511, 513, 5, 42, 0, 0, 512, 514, 7, 2, 0, 0, 513, 512, 1, 0, 0, 0, 513, 514, 1, 0, 0, 0, 514, 517, 1, 0, 0, 0, 515, 517, 7, 2, 0, 0, 516, 508, 1, 0, 0, 0, 516, 511, 1, 0, 0, 0, 516, 515, 1, 0, 0, 0, 517, 551, 1, 0, 0, 0, 518, 520, 7, 3, 0, 0, 519, 518, 1, 0, 0, 0, 519, 520, 1, 0, 0, 0, 520, 521, 1, 0, 0, 0, 521, 523, 7, 4, 0, 0, 522, 524, 5, 63, 0, 0, 523, 522, 1, 0, 0, 0, 523, 524, 1, 0, 0, 0, 524, 533, 1, 0, 0, 0, 525, 527, 7, 4, 0, 0, 526, 528, 5, 63, 0, 0, 527, 526, 1, 0, 0, 0, 527, 528, 1, 0, 0, 0, 528, 530, 1, 0, 0, 0, 529, 531, 7, 3, 0, 0, 530, 529, 1, 0, 0, 0, 530, 531, 1, 0, 0, 0, 531, 533, 1, 0, 0, 0, 532, 519, 1, 0, 0, 0, 532, 525, 1, 0, 0, 0, 533, 551, 1, 0, 0, 0, 534, 536, 7, 5, 0, 0, 535, 534, 1, 0, 0, 0, 535, 536, 1, 0, 0, 0, 536, 537, 1, 0, 0, 0, 537, 539, 5, 33, 0, 0, 538, 540, 5, 63, 0, 0, 539, 538, 1, 0, 0, 0, 539, 540, 1, 0, 0, 0, 540, 549, 1, 0, 0, 0, 541, 543, 5, 33, 0, 0, 542, 544, 5, 63, 0, 0, 543, 542, 1, 0, 0, 0, 543, 544, 1, 0, 0, 0, 544, 546, 1, 0, 0, 0, 545, 547, 7, 5, 0, 0, 546, 545, 1, 0, 0, 0, 546, 547, 1, 0, 0, 0, 547, 549, 1, 0, 0, 0, 548, 535, 1, 0, 0, 0, 548, 541, 1, 0, 0, 0, 549, 551, 1, 0, 0, 0, 550, 516, 1, 0, 0, 0, 550, 532, 1, 0, 0, 0, 550, 548, 1, 0, 0, 0, 551, 73, 1, 0, 0, 0, 552, 553, 5, 16, 0, 0, 553, 556, 5, 45, 0, 0, 554, 556, 5, 112, 0, 0, 555, 552, 1, 0, 0, 0, 555, 554, 1, 0, 0, 0, 556, 75, 1, 0, 0, 0, 557, 558, 5, 60, 0, 0, 558, 567, 3, 106, 53, 0, 559, 560, 5, 92, 0, 0, 560, 561, 5, 126, 0, 0, 561, 562, 3, 106, 53, 0, 562, 563, 5, 144, 0, 0, 563, 567, 1, 0, 0, 0, 564, 565, 5, 92, 0, 0, 565, 567, 3, 106, 53, 0, 566, 557, 1, 0, 0, 0, 566, 559, 1, 0, 0, 0, 566, 564, 1, 0, 0, 0, 567, 77, 1, 0, 0, 0, 568, 569, 5, 75, 0, 0, 569, 572, 3, 84, 42, 0, 570, 571, 5, 59, 0, 0, 571, 573, 3, 84, 42, 0, 572, 570, 1, 0, 0, 0, 572, 573, 1, 0, 0, 0, 573, 79, 1, 0, 0, 0, 574, 579, 3, 82, 41, 0, 575, 576, 5, 112, 0, 0, 576, 578, 3, 82, 41, 0, 577, 575, 1, 0, 0, 0, 578, 581, 1, 0, 0, 0, 579, 577, 1, 0, 0, 0, 579, 580, 1, 0, 0, 0, 580, 81, 1, 0, 0, 0, 581, 579, 1, 0, 0, 0, 582, 584, 3, 108, 54, 0, 583, 585, 7, 6, 0, 0, 584, 583, 1, 0, 0, 0, 584, 585, 1, 0, 0, 0, 585, 588, 1, 0, 0, 0, 586, 587, 5, 58, 0, 0, 587, 589, 7, 7, 0, 0, 588, 586, 1, 0, 0, 0, 588, 589, 1, 0, 0, 0, 589, 592, 1, 0, 0, 0, 590, 591, 5, 15, 0, 0, 591, 593, 5, 106, 0, 0, 592, 590, 1, 0, 0, 0, 592, 593, 1, 0, 0, 0, 593, 83, 1, 0, 0, 0, 594, 601, 3, 156, 78, 0, 595, 598, 3, 140, 70, 0, 596, 597, 5, 146, 0, 0, 597, 599, 3, 140, 70, 0, 598, 596, 1, 0, 0, 0, 598, 599, 1, 0, 0, 0, 599, 601, 1, 0, 0, 0, 600, 594, 1, 0, 0, 0, 600, 595, 1, 0, 0, 0, 601, 85, 1, 0, 0, 0, 602, 607, 3, 88, 44, 0, 603, 604, 5, 112, 0, 0, 604, 606, 3, 88, 44, 0, 605, 603, 1, 0, 0, 0, 606, 609, 1, 0, 0, 0, 607, 605, 1, 0, 0, 0, 607, 608, 1, 0, 0, 0, 608, 87, 1, 0, 0, 0, 609, 607, 1, 0, 0, 0, 610, 611, 3, 152, 76, 0, 611, 612, 5, 118, 0, 0, 612, 613, 3, 142, 71, 0, 613, 89, 1, 0, 0, 0, 614, 616, 3, 92, 46, 0, 615, 614, 1, 0, 0, 0, 615, 616, 1, 0, 0, 0, 616, 618, 1, 0, 0, 0, 617, 619, 3, 94, 47, 0, 618, 617, 1, 0, 0, 0, 618, 619, 1, 0, 0, 0, 619, 621, 1, 0, 0, 0, 620, 622, 3, 96, 48, 0, 621, 620, 1, 0, 0, 0, 621, 622, 1, 0, 0, 0, 622, 91, 1, 0, 0, 0, 623, 624, 5, 65, 0, 0, 624, 625, 5, 11, 0, 0, 625, 626, 3, 106, 53, 0, 626, 93, 1, 0, 0, 0, 627, 628, 5, 62, 0, 0, 628, 629, 5, 11, 0, 0, 629, 630, 3, 80, 40, 0, 630, 95, 1, 0, 0, 0, 631, 632, 7, 8, 0, 0, 632, 633, 3, 98, 49, 0, 633, 97, 1, 0, 0, 0, 634, 641, 3, 100, 50, 0, 635, 636, 5, 9, 0, 0, 636, 637, 3, 100, 50, 0, 637, 638, 5, 2, 0, 0, 638, 639, 3, 100, 50, 0, 639, 641, 1, 0, 0, 0, 640, 634, 1, 0, 0, 0, 640, 635, 1, 0, 0, 0, 641, 99, 1, 0, 0, 0, 642, 643, 5, 18, 0, 0, 643, 655, 5, 73, 0, 0, 644, 645, 5, 90, 0, 0, 645, 655, 5, 66, 0, 0, 646, 647, 5, 90, 0, 0, 647, 655, 5, 30, 0, 0, 648, 649, 3, 140, 70, 0, 649, 650, 5, 66, 0, 0, 650, 655, 1, 0, 0, 0, 651, 652, 3, 140, 70, 0, 652, 653, 5, 30, 0, 0, 653, 655, 1, 0, 0, 0, 654, 642, 1, 0, 0, 0, 654, 644, 1, 0, 0, 0, 654, 646, 1, 0, 0, 0, 654, 648, 1, 0, 0, 0, 654, 651, 1, 0, 0, 0, 655, 101, 1, 0, 0, 0, 656, 657, 3, 108, 54, 0, 657, 658, 5, 0, 0, 1, 658, 103, 1, 0, 0, 0, 659, 716, 3, 152, 76, 0, 660, 661, 3, 152, 76, 0, 661, 662, 5, 126, 0, 0, 662, 663, 3, 152, 76, 0, 663, 670, 3, 104, 52, 0, 664, 665, 5, 112, 0, 0, 665, 666, 3, 152, 76, 0, 666, 667, 3, 104, 52, 0, 667, 669, 1, 0, 0, 0, 668, 664, 1, 0, 0, 0, 669, 672, 1, 0, 0, 0, 670, 668, 1, 0, 0, 0, 670, 671, 1, 0, 0, 0, 671, 674, 1, 0, 0, 0, 672, 670, 1, 0, 0, 0, 673, 675, 5, 112, 0, 0, 674, 673, 1, 0, 0, 0, 674, 675, 1, 0, 0, 0, 675, 676, 1, 0, 0, 0, 676, 677, 5, 144, 0, 0, 677, 716, 1, 0, 0, 0, 678, 679, 3, 152, 76, 0, 679, 680, 5, 126, 0, 0, 680, 685, 3, 154, 77, 0, 681, 682, 5, 112, 0, 0, 682, 684, 3, 154, 77, 0, 683, 681, 1, 0, 0, 0, 684, 687, 1, 0, 0, 0, 685, 683, 1, 0, 0, 0, 685, 686, 1, 0, 0, 0, 686, 689, 1, 0, 0, 0, 687, 685, 1, 0, 0, 0, 688, 690, 5, 112, 0, 0, 689, 688, 1, 0, 0, 0, 689, 690, 1, 0, 0, 0, 690, 691, 1, 0, 0, 0, 691, 692, 5, 144, 0, 0, 692, 716, 1, 0, 0, 0, 693, 694, 3, 152, 76, 0, 694, 695, 5, 126, 0, 0, 695, 700, 3, 104, 52, 0, 696, 697, 5, 112, 0, 0, 697, 699, 3, 104, 52, 0, 698, 696, 1, 0, 0, 0, 699, 702, 1, 0, 0, 0, 700, 698, 1, 0, 0, 0, 700, 701, 1, 0, 0, 0, 701, 704, 1, 0, 0, 0, 702, 700, 1, 0, 0, 0, 703, 705, 5, 112, 0, 0, 704, 703, 1, 0, 0, 0, 704, 705, 1, 0, 0, 0, 705, 706, 1, 0, 0, 0, 706, 707, 5, 144, 0, 0, 707, 716, 1, 0, 0, 0, 708, 709, 3, 152, 76, 0, 709, 711, 5, 126, 0, 0, 710, 712, 3, 106, 53, 0, 711, 710, 1, 0, 0, 0, 711, 712, 1, 0, 0, 0, 712, 713, 1, 0, 0, 0, 713, 714, 5, 144, 0, 0, 714, 716, 1, 0, 0, 0, 715, 659, 1, 0, 0, 0, 715, 660, 1, 0, 0, 0, 715, 678, 1, 0, 0, 0, 715, 693, 1, 0, 0, 0, 715, 708, 1, 0, 0, 0, 716, 105, 1, 0, 0, 0, 717, 722, 3, 108, 54, 0, 718, 719, 5, 112, 0, 0, 719, 721, 3, 108, 54, 0, 720, 718, 1, 0, 0, 0, 721, 724, 1, 0, 0, 0, 722, 720, 1, 0, 0, 0, 722, 723, 1, 0, 0, 0, 723, 726, 1, 0, 0, 0, 724, 722, 1, 0, 0, 0, 725, 727, 5, 112, 0, 0, 726, 725, 1, 0, 0, 0, 726, 727, 1, 0, 0, 0, 727, 107, 1, 0, 0, 0, 728, 729, 6, 54, -1, 0, 729, 731, 5, 12, 0, 0, 730, 732, 3, 108, 54, 0, 731, 730, 1, 0, 0, 0, 731, 732, 1, 0, 0, 0, 732, 738, 1, 0, 0, 0, 733, 734, 5, 94, 0, 0, 734, 735, 3, 108, 54, 0, 735, 736, 5, 81, 0, 0, 736, 737, 3, 108, 54, 0, 737, 739, 1, 0, 0, 0, 738, 733, 1, 0, 0, 0, 739, 740, 1, 0, 0, 0, 740, 738, 1, 0, 0, 0, 740, 741, 1, 0, 0, 0, 741, 744, 1, 0, 0, 0, 742, 743, 5, 24, 0, 0, 743, 745, 3, 108, 54, 0, 744, 742, 1, 0, 0, 0, 744, 745, 1, 0, 0, 0, 745, 746, 1, 0, 0, 0, 746, 747, 5, 25, 0, 0, 747, 878, 1, 0, 0, 0, 748, 749, 5, 13, 0, 0, 749, 750, 5, 126, 0, 0, 750, 751, 3, 108, 54, 0, 751, 752, 5, 6, 0, 0, 752, 753, 3, 104, 52, 0, 753, 754, 5, 144, 0, 0, 754, 878, 1, 0, 0, 0, 755, 756, 5, 19, 0, 0, 756, 878, 5, 106, 0, 0, 757, 758, 5, 43, 0, 0, 758, 759, 3, 108, 54, 0, 759, 760, 3, 144, 72, 0, 760, 878, 1, 0, 0, 0, 761, 762, 5, 80, 0, 0, 762, 763, 5, 126, 0, 0, 763, 764, 3, 108, 54, 0, 764, 765, 5, 32, 0, 0, 765, 768, 3, 108, 54, 0, 766, 767, 5, 31, 0, 0, 767, 769, 3, 108, 54, 0, 768, 766, 1, 0, 0, 0, 768, 769, 1, 0, 0, 0, 769, 770, 1, 0, 0, 0, 770, 771, 5, 144, 0, 0, 771, 878, 1, 0, 0, 0, 772, 773, 5, 83, 0, 0, 773, 878, 5, 106, 0, 0, 774, 775, 5, 88, 0, 0, 775, 776, 5, 126, 0, 0, 776, 777, 7, 9, 0, 0, 777, 778, 3, 158, 79, 0, 778, 779, 5, 32, 0, 0, 779, 780, 3, 108, 54, 0, 780, 781, 5, 144, 0, 0, 781, 878, 1, 0, 0, 0, 782, 783, 3, 152, 76, 0, 783, 785, 5, 126, 0, 0, 784, 786, 3, 106, 53, 0, 785, 784, 1, 0, 0, 0, 785, 786, 1, 0, 0, 0, 786, 787, 1, 0, 0, 0, 787, 788, 5, 144, 0, 0, 788, 797, 1, 0, 0, 0, 789, 791, 5, 126, 0, 0, 790, 792, 5, 23, 0, 0, 791, 790, 1, 0, 0, 0, 791, 792, 1, 0, 0, 0, 792, 794, 1, 0, 0, 0, 793, 795, 3, 110, 55, 0, 794, 793, 1, 0, 0, 0, 794, 795, 1, 0, 0, 0, 795, 796, 1, 0, 0, 0, 796, 798, 5, 144, 0, 0, 797, 789, 1, 0, 0, 0, 797, 798, 1, 0, 0, 0, 798, 799, 1, 0, 0, 0, 799, 800, 5, 64, 0, 0, 800, 801, 5, 126, 0, 0, 801, 802, 3, 90, 45, 0, 802, 803, 5, 144, 0, 0, 803, 878, 1, 0, 0, 0, 804, 805, 3, 152, 76, 0, 805, 807, 5, 126, 0, 0, 806, 808, 3, 106, 53, 0, 807, 806, 1, 0, 0, 0, 807, 808, 1, 0, 0, 0, 808, 809, 1, 0, 0, 0, 809, 810, 5, 144, 0, 0, 810, 819, 1, 0, 0, 0, 811, 813, 5, 126, 0, 0, 812, 814, 5, 23, 0, 0, 813, 812, 1, 0, 0, 0, 813, 814, 1, 0, 0, 0, 814, 816, 1, 0, 0, 0, 815, 817, 3, 110, 55, 0, 816, 815, 1, 0, 0, 0, 816, 817, 1, 0, 0, 0, 817, 818, 1, 0, 0, 0, 818, 820, 5, 144, 0, 0, 819, 811, 1, 0, 0, 0, 819, 820, 1, 0, 0, 0, 820, 821, 1, 0, 0, 0, 821, 822, 5, 64, 0, 0, 822, 823, 3, 152, 76, 0, 823, 878, 1, 0, 0, 0, 824, 830, 3, 152, 76, 0, 825, 827, 5, 126, 0, 0, 826, 828, 3, 106, 53, 0, 827, 826, 1, 0, 0, 0, 827, 828, 1, 0, 0, 0, 828, 829, 1, 0, 0, 0, 829, 831, 5, 144, 0, 0, 830, 825, 1, 0, 0, 0, 830, 831, 1, 0, 0, 0, 831, 832, 1, 0, 0, 0, 832, 834, 5, 126, 0, 0, 833, 835, 5, 23, 0, 0, 834, 833, 1, 0, 0, 0, 834, 835, 1, 0, 0, 0, 835, 837, 1, 0, 0, 0, 836, 838, 3, 110, 55, 0, 837, 836, 1, 0, 0, 0, 837, 838, 1, 0, 0, 0, 838, 839, 1, 0, 0, 0, 839, 840, 5, 144, 0, 0, 840, 878, 1, 0, 0, 0, 841, 878, 3, 116, 58, 0, 842, 878, 3, 160, 80, 0, 843, 878, 3, 142, 71, 0, 844, 845, 5, 114, 0, 0, 845, 878, 3, 108, 54, 19, 846, 847, 5, 56, 0, 0, 847, 878, 3, 108, 54, 13, 848, 849, 3, 132, 66, 0, 849, 850, 5, 116, 0, 0, 850, 852, 1, 0, 0, 0, 851, 848, 1, 0, 0, 0, 851, 852, 1, 0, 0, 0, 852, 853, 1, 0, 0, 0, 853, 878, 5, 108, 0, 0, 854, 855, 5, 126, 0, 0, 855, 856, 3, 36, 18, 0, 856, 857, 5, 144, 0, 0, 857, 878, 1, 0, 0, 0, 858, 859, 5, 126, 0, 0, 859, 860, 3, 108, 54, 0, 860, 861, 5, 144, 0, 0, 861, 878, 1, 0, 0, 0, 862, 863, 5, 126, 0, 0, 863, 864, 3, 106, 53, 0, 864, 865, 5, 144, 0, 0, 865, 878, 1, 0, 0, 0, 866, 868, 5, 125, 0, 0, 867, 869, 3, 106, 53, 0, 868, 867, 1, 0, 0, 0, 868, 869, 1, 0, 0, 0, 869, 870, 1, 0, 0, 0, 870, 878, 5, 143, 0, 0, 871, 873, 5, 124, 0, 0, 872, 874, 3, 32, 16, 0, 873, 872, 1, 0, 0, 0, 873, 874, 1, 0, 0, 0, 874, 875, 1, 0, 0, 0, 875, 878, 5, 142, 0, 0, 876, 878, 3, 124, 62, 0, 877, 728, 1, 0, 0, 0, 877, 748, 1, 0, 0, 0, 877, 755, 1, 0, 0, 0, 877, 757, 1, 0, 0, 0, 877, 761, 1, 0, 0, 0, 877, 772, 1, 0, 0, 0, 877, 774, 1, 0, 0, 0, 877, 782, 1, 0, 0, 0, 877, 804, 1, 0, 0, 0, 877, 824, 1, 0, 0, 0, 877, 841, 1, 0, 0, 0, 877, 842, 1, 0, 0, 0, 877, 843, 1, 0, 0, 0, 877, 844, 1, 0, 0, 0, 877, 846, 1, 0, 0, 0, 877, 851, 1, 0, 0, 0, 877, 854, 1, 0, 0, 0, 877, 858, 1, 0, 0, 0, 877, 862, 1, 0, 0, 0, 877, 866, 1, 0, 0, 0, 877, 871, 1, 0, 0, 0, 877, 876, 1, 0, 0, 0, 878, 971, 1, 0, 0, 0, 879, 883, 10, 18, 0, 0, 880, 884, 5, 108, 0, 0, 881, 884, 5, 146, 0, 0, 882, 884, 5, 133, 0, 0, 883, 880, 1, 0, 0, 0, 883, 881, 1, 0, 0, 0, 883, 882, 1, 0, 0, 0, 884, 885, 1, 0, 0, 0, 885, 970, 3, 108, 54, 19, 886, 890, 10, 17, 0, 0, 887, 891, 5, 134, 0, 0, 888, 891, 5, 114, 0, 0, 889, 891, 5, 113, 0, 0, 890, 887, 1, 0, 0, 0, 890, 888, 1, 0, 0, 0, 890, 889, 1, 0, 0, 0, 891, 892, 1, 0, 0, 0, 892, 970, 3, 108, 54, 18, 893, 918, 10, 16, 0, 0, 894, 919, 5, 117, 0, 0, 895, 919, 5, 118, 0, 0, 896, 919, 5, 129, 0, 0, 897, 919, 5, 127, 0, 0, 898, 919, 5, 128, 0, 0, 899, 919, 5, 119, 0, 0, 900, 919, 5, 120, 0, 0, 901, 903, 5, 56, 0, 0, 902, 901, 1, 0, 0, 0, 902, 903, 1, 0, 0, 0, 903, 904, 1, 0, 0, 0, 904, 906, 5, 40, 0, 0, 905, 907, 5, 14, 0, 0, 906, 905, 1, 0, 0, 0, 906, 907, 1, 0, 0, 0, 907, 919, 1, 0, 0, 0, 908, 910, 5, 56, 0, 0, 909, 908, 1, 0, 0, 0, 909, 910, 1, 0, 0, 0, 910, 911, 1, 0, 0, 0, 911, 919, 7, 10, 0, 0, 912, 919, 5, 140, 0, 0, 913, 919, 5, 141, 0, 0, 914, 919, 5, 131, 0, 0, 915, 919, 5, 122, 0, 0, 916, 919, 5, 123, 0, 0, 917, 919, 5, 130, 0, 0, 918, 894, 1, 0, 0, 0, 918, 895, 1, 0, 0, 0, 918, 896, 1, 0, 0, 0, 918, 897, 1, 0, 0, 0, 918, 898, 1, 0, 0, 0, 918, 899, 1, 0, 0, 0, 918, 900, 1, 0, 0, 0, 918, 902, 1, 0, 0, 0, 918, 909, 1, 0, 0, 0, 918, 912, 1, 0, 0, 0, 918, 913, 1, 0, 0, 0, 918, 914, 1, 0, 0, 0, 918, 915, 1, 0, 0, 0, 918, 916, 1, 0, 0, 0, 918, 917, 1, 0, 0, 0, 919, 920, 1, 0, 0, 0, 920, 970, 3, 108, 54, 17, 921, 922, 10, 14, 0, 0, 922, 923, 5, 132, 0, 0, 923, 970, 3, 108, 54, 15, 924, 925, 10, 12, 0, 0, 925, 926, 5, 2, 0, 0, 926, 970, 3, 108, 54, 13, 927, 928, 10, 11, 0, 0, 928, 929, 5, 61, 0, 0, 929, 970, 3, 108, 54, 12, 930, 932, 10, 10, 0, 0, 931, 933, 5, 56, 0, 0, 932, 931, 1, 0, 0, 0, 932, 933, 1, 0, 0, 0, 933, 934, 1, 0, 0, 0, 934, 935, 5, 9, 0, 0, 935, 936, 3, 108, 54, 0, 936, 937, 5, 2, 0, 0, 937, 938, 3, 108, 54, 11, 938, 970, 1, 0, 0, 0, 939, 940, 10, 9, 0, 0, 940, 941, 5, 135, 0, 0, 941, 942, 3, 108, 54, 0, 942, 943, 5, 111, 0, 0, 943, 944, 3, 108, 54, 9, 944, 970, 1, 0, 0, 0, 945, 946, 10, 22, 0, 0, 946, 947, 5, 125, 0, 0, 947, 948, 3, 108, 54, 0, 948, 949, 5, 143, 0, 0, 949, 970, 1, 0, 0, 0, 950, 951, 10, 21, 0, 0, 951, 952, 5, 116, 0, 0, 952, 970, 5, 104, 0, 0, 953, 954, 10, 20, 0, 0, 954, 955, 5, 116, 0, 0, 955, 970, 3, 152, 76, 0, 956, 957, 10, 15, 0, 0, 957, 959, 5, 44, 0, 0, 958, 960, 5, 56, 0, 0, 959, 958, 1, 0, 0, 0, 959, 960, 1, 0, 0, 0, 960, 961, 1, 0, 0, 0, 961, 970, 5, 57, 0, 0, 962, 967, 10, 8, 0, 0, 963, 964, 5, 6, 0, 0, 964, 968, 3, 152, 76, 0, 965, 966, 5, 6, 0, 0, 966, 968, 5, 106, 0, 0, 967, 963, 1, 0, 0, 0, 967, 965, 1, 0, 0, 0, 968, 970, 1, 0, 0, 0, 969, 879, 1, 0, 0, 0, 969, 886, 1, 0, 0, 0, 969, 893, 1, 0, 0, 0, 969, 921, 1, 0, 0, 0, 969, 924, 1, 0, 0, 0, 969, 927, 1, 0, 0, 0, 969, 930, 1, 0, 0, 0, 969, 939, 1, 0, 0, 0, 969, 945, 1, 0, 0, 0, 969, 950, 1, 0, 0, 0, 969, 953, 1, 0, 0, 0, 969, 956, 1, 0, 0, 0, 969, 962, 1, 0, 0, 0, 970, 973, 1, 0, 0, 0, 971, 969, 1, 0, 0, 0, 971, 972, 1, 0, 0, 0, 972, 109, 1, 0, 0, 0, 973, 971, 1, 0, 0, 0, 974, 979, 3, 112, 56, 0, 975, 976, 5, 112, 0, 0, 976, 978, 3, 112, 56, 0, 977, 975, 1, 0, 0, 0, 978, 981, 1, 0, 0, 0, 979, 977, 1, 0, 0, 0, 979, 980, 1, 0, 0, 0, 980, 983, 1, 0, 0, 0, 981, 979, 1, 0, 0, 0, 982, 984, 5, 112, 0, 0, 983, 982, 1, 0, 0, 0, 983, 984, 1, 0, 0, 0, 984, 111, 1, 0, 0, 0, 985, 988, 3, 114, 57, 0, 986, 988, 3, 108, 54, 0, 987, 985, 1, 0, 0, 0, 987, 986, 1, 0, 0, 0, 988, 113, 1, 0, 0, 0, 989, 990, 5, 126, 0, 0, 990, 995, 3, 152, 76, 0, 991, 992, 5, 112, 0, 0, 992, 994, 3, 152, 76, 0, 993, 991, 1, 0, 0, 0, 994, 997, 1, 0, 0, 0, 995, 993, 1, 0, 0, 0, 995, 996, 1, 0, 0, 0, 996, 999, 1, 0, 0, 0, 997, 995, 1, 0, 0, 0, 998, 1000, 5, 112, 0, 0, 999, 998, 1, 0, 0, 0, 999, 1000, 1, 0, 0, 0, 1000, 1001, 1, 0, 0, 0, 1001, 1002, 5, 144, 0, 0, 1002, 1015, 1, 0, 0, 0, 1003, 1008, 3, 152, 76, 0, 1004, 1005, 5, 112, 0, 0, 1005, 1007, 3, 152, 76, 0, 1006, 1004, 1, 0, 0, 0, 1007, 1010, 1, 0, 0, 0, 1008, 1006, 1, 0, 0, 0, 1008, 1009, 1, 0, 0, 0, 1009, 1012, 1, 0, 0, 0, 1010, 1008, 1, 0, 0, 0, 1011, 1013, 5, 112, 0, 0, 1012, 1011, 1, 0, 0, 0, 1012, 1013, 1, 0, 0, 0, 1013, 1015, 1, 0, 0, 0, 1014, 989, 1, 0, 0, 0, 1014, 1003, 1, 0, 0, 0, 1015, 1016, 1, 0, 0, 0, 1016, 1017, 5, 107, 0, 0, 1017, 1018, 3, 108, 54, 0, 1018, 115, 1, 0, 0, 0, 1019, 1020, 5, 128, 0, 0, 1020, 1024, 3, 152, 76, 0, 1021, 1023, 3, 118, 59, 0, 1022, 1021, 1, 0, 0, 0, 1023, 1026, 1, 0, 0, 0, 1024, 1022, 1, 0, 0, 0, 1024, 1025, 1, 0, 0, 0, 1025, 1027, 1, 0, 0, 0, 1026, 1024, 1, 0, 0, 0, 1027, 1028, 5, 146, 0, 0, 1028, 1029, 5, 120, 0, 0, 1029, 1048, 1, 0, 0, 0, 1030, 1031, 5, 128, 0, 0, 1031, 1035, 3, 152, 76, 0, 1032, 1034, 3, 118, 59, 0, 1033, 1032, 1, 0, 0, 0, 1034, 1037, 1, 0, 0, 0, 1035, 1033, 1, 0, 0, 0, 1035, 1036, 1, 0, 0, 0, 1036, 1038, 1, 0, 0, 0, 1037, 1035, 1, 0, 0, 0, 1038, 1040, 5, 120, 0, 0, 1039, 1041, 3, 116, 58, 0, 1040, 1039, 1, 0, 0, 0, 1040, 1041, 1, 0, 0, 0, 1041, 1042, 1, 0, 0, 0, 1042, 1043, 5, 128, 0, 0, 1043, 1044, 5, 146, 0, 0, 1044, 1045, 3, 152, 76, 0, 1045, 1046, 5, 120, 0, 0, 1046, 1048, 1, 0, 0, 0, 1047, 1019, 1, 0, 0, 0, 1047, 1030, 1, 0, 0, 0, 1048, 117, 1, 0, 0, 0, 1049, 1050, 3, 152, 76, 0, 1050, 1051, 5, 118, 0, 0, 1051, 1052, 3, 158, 79, 0, 1052, 1061, 1, 0, 0, 0, 1053, 1054, 3, 152, 76, 0, 1054, 1055, 5, 118, 0, 0, 1055, 1056, 5, 124, 0, 0, 1056, 1057, 3, 108, 54, 0, 1057, 1058, 5, 142, 0, 0, 1058, 1061, 1, 0, 0, 0, 1059, 1061, 3, 152, 76, 0, 1060, 1049, 1, 0, 0, 0, 1060, 1053, 1, 0, 0, 0, 1060, 1059, 1, 0, 0, 0, 1061, 119, 1, 0, 0, 0, 1062, 1067, 3, 122, 61, 0, 1063, 1064, 5, 112, 0, 0, 1064, 1066, 3, 122, 61, 0, 1065, 1063, 1, 0, 0, 0, 1066, 1069, 1, 0, 0, 0, 1067, 1065, 1, 0, 0, 0, 1067, 1068, 1, 0, 0, 0, 1068, 1071, 1, 0, 0, 0, 1069, 1067, 1, 0, 0, 0, 1070, 1072, 5, 112, 0, 0, 1071, 1070, 1, 0, 0, 0, 1071, 1072, 1, 0, 0, 0, 1072, 121, 1, 0, 0, 0, 1073, 1074, 3, 152, 76, 0, 1074, 1075, 5, 6, 0, 0, 1075, 1076, 5, 126, 0, 0, 1076, 1077, 3, 36, 18, 0, 1077, 1078, 5, 144, 0, 0, 1078, 1084, 1, 0, 0, 0, 1079, 1080, 3, 108, 54, 0, 1080, 1081, 5, 6, 0, 0, 1081, 1082, 3, 152, 76, 0, 1082, 1084, 1, 0, 0, 0, 1083, 1073, 1, 0, 0, 0, 1083, 1079, 1, 0, 0, 0, 1084, 123, 1, 0, 0, 0, 1085, 1093, 3, 156, 78, 0, 1086, 1087, 3, 132, 66, 0, 1087, 1088, 5, 116, 0, 0, 1088, 1090, 1, 0, 0, 0, 1089, 1086, 1, 0, 0, 0, 1089, 1090, 1, 0, 0, 0, 1090, 1091, 1, 0, 0, 0, 1091, 1093, 3, 126, 63, 0, 1092, 1085, 1, 0, 0, 0, 1092, 1089, 1, 0, 0, 0, 1093, 125, 1, 0, 0, 0, 1094, 1099, 3, 152, 76, 0, 1095, 1096, 5, 116, 0, 0, 1096, 1098, 3, 152, 76, 0, 1097, 1095, 1, 0, 0, 0, 1098, 1101, 1, 0, 0, 0, 1099, 1097, 1, 0, 0, 0, 1099, 1100, 1, 0, 0, 0, 1100, 127, 1, 0, 0, 0, 1101, 1099, 1, 0, 0, 0, 1102, 1103, 6, 64, -1, 0, 1103, 1112, 3, 132, 66, 0, 1104, 1112, 3, 130, 65, 0, 1105, 1106, 5, 126, 0, 0, 1106, 1107, 3, 36, 18, 0, 1107, 1108, 5, 144, 0, 0, 1108, 1112, 1, 0, 0, 0, 1109, 1112, 3, 116, 58, 0, 1110, 1112, 3, 156, 78, 0, 1111, 1102, 1, 0, 0, 0, 1111, 1104, 1, 0, 0, 0, 1111, 1105, 1, 0, 0, 0, 1111, 1109, 1, 0, 0, 0, 1111, 1110, 1, 0, 0, 0, 1112, 1121, 1, 0, 0, 0, 1113, 1117, 10, 3, 0, 0, 1114, 1118, 3, 150, 75, 0, 1115, 1116, 5, 6, 0, 0, 1116, 1118, 3, 152, 76, 0, 1117, 1114, 1, 0, 0, 0, 1117, 1115, 1, 0, 0, 0, 1118, 1120, 1, 0, 0, 0, 1119, 1113, 1, 0, 0, 0, 1120, 1123, 1, 0, 0, 0, 1121, 1119, 1, 0, 0, 0, 1121, 1122, 1, 0, 0, 0, 1122, 129, 1, 0, 0, 0, 1123, 1121, 1, 0, 0, 0, 1124, 1125, 3, 152, 76, 0, 1125, 1127, 5, 126, 0, 0, 1126, 1128, 3, 134, 67, 0, 1127, 1126, 1, 0, 0, 0, 1127, 1128, 1, 0, 0, 0, 1128, 1129, 1, 0, 0, 0, 1129, 1130, 5, 144, 0, 0, 1130, 131, 1, 0, 0, 0, 1131, 1132, 3, 136, 68, 0, 1132, 1133, 5, 116, 0, 0, 1133, 1135, 1, 0, 0, 0, 1134, 1131, 1, 0, 0, 0, 1134, 1135, 1, 0, 0, 0, 1135, 1136, 1, 0, 0, 0, 1136, 1137, 3, 152, 76, 0, 1137, 133, 1, 0, 0, 0, 1138, 1143, 3, 108, 54, 0, 1139, 1140, 5, 112, 0, 0, 1140, 1142, 3, 108, 54, 0, 1141, 1139, 1, 0, 0, 0, 1142, 1145, 1, 0, 0, 0, 1143, 1141, 1, 0, 0, 0, 1143, 1144, 1, 0, 0, 0, 1144, 1147, 1, 0, 0, 0, 1145, 1143, 1, 0, 0, 0, 1146, 1148, 5, 112, 0, 0, 1147, 1146, 1, 0, 0, 0, 1147, 1148, 1, 0, 0, 0, 1148, 135, 1, 0, 0, 0, 1149, 1150, 3, 152, 76, 0, 1150, 137, 1, 0, 0, 0, 1151, 1160, 5, 102, 0, 0, 1152, 1153, 5, 116, 0, 0, 1153, 1160, 7, 11, 0, 0, 1154, 1155, 5, 104, 0, 0, 1155, 1157, 5, 116, 0, 0, 1156, 1158, 7, 11, 0, 0, 1157, 1156, 1, 0, 0, 0, 1157, 1158, 1, 0, 0, 0, 1158, 1160, 1, 0, 0, 0, 1159, 1151, 1, 0, 0, 0, 1159, 1152, 1, 0, 0, 0, 1159, 1154, 1, 0, 0, 0, 1160, 139, 1, 0, 0, 0, 1161, 1163, 7, 12, 0, 0, 1162, 1161, 1, 0, 0, 0, 1162, 1163, 1, 0, 0, 0, 1163, 1170, 1, 0, 0, 0, 1164, 1171, 3, 138, 69, 0, 1165, 1171, 5, 103, 0, 0, 1166, 1171, 5, 104, 0, 0, 1167, 1171, 5, 105, 0, 0, 1168, 1171, 5, 41, 0, 0, 1169, 1171, 5, 55, 0, 0, 1170, 1164, 1, 0, 0, 0, 1170, 1165, 1, 0, 0, 0, 1170, 1166, 1, 0, 0, 0, 1170, 1167, 1, 0, 0, 0, 1170, 1168, 1, 0, 0, 0, 1170, 1169, 1, 0, 0, 0, 1171, 141, 1, 0, 0, 0, 1172, 1176, 3, 140, 70, 0, 1173, 1176, 5, 106, 0, 0, 1174, 1176, 5, 57, 0, 0, 1175, 1172, 1, 0, 0, 0, 1175, 1173, 1, 0, 0, 0, 1175, 1174, 1, 0, 0, 0, 1176, 143, 1, 0, 0, 0, 1177, 1178, 7, 13, 0, 0, 1178, 145, 1, 0, 0, 0, 1179, 1180, 7, 14, 0, 0, 1180, 147, 1, 0, 0, 0, 1181, 1182, 7, 15, 0, 0, 1182, 149, 1, 0, 0, 0, 1183, 1186, 5, 101, 0, 0, 1184, 1186, 3, 148, 74, 0, 1185, 1183, 1, 0, 0, 0, 1185, 1184, 1, 0, 0, 0, 1186, 151, 1, 0, 0, 0, 1187, 1191, 5, 101, 0, 0, 1188, 1191, 3, 144, 72, 0, 1189, 1191, 3, 146, 73, 0, 1190, 1187, 1, 0, 0, 0, 1190, 1188, 1, 0, 0, 0, 1190, 1189, 1, 0, 0, 0, 1191, 153, 1, 0, 0, 0, 1192, 1193, 3, 158, 79, 0, 1193, 1194, 5, 118, 0, 0, 1194, 1195, 3, 140, 70, 0, 1195, 155, 1, 0, 0, 0, 1196, 1197, 5, 124, 0, 0, 1197, 1198, 3, 152, 76, 0, 1198, 1199, 5, 142, 0, 0, 1199, 157, 1, 0, 0, 0, 1200, 1203, 5, 106, 0, 0, 1201, 1203, 3, 160, 80, 0, 1202, 1200, 1, 0, 0, 0, 1202, 1201, 1, 0, 0, 0, 1203, 159, 1, 0, 0, 0, 1204, 1208, 5, 137, 0, 0, 1205, 1207, 3, 162, 81, 0, 1206, 1205, 1, 0, 0, 0, 1207, 1210, 1, 0, 0, 0, 1208, 1206, 1, 0, 0, 0, 1208, 1209, 1, 0, 0, 0, 1209, 1211, 1, 0, 0, 0, 1210, 1208, 1, 0, 0, 0, 1211, 1212, 5, 139, 0, 0, 1212, 161, 1, 0, 0, 0, 1213, 1214, 5, 152, 0, 0, 1214, 1215, 3, 108, 54, 0, 1215, 1216, 5, 142, 0, 0, 1216, 1219, 1, 0, 0, 0, 1217, 1219, 5, 151, 0, 0, 1218, 1213, 1, 0, 0, 0, 1218, 1217, 1, 0, 0, 0, 1219, 163, 1, 0, 0, 0, 1220, 1224, 5, 138, 0, 0, 1221, 1223, 3, 166, 83, 0, 1222, 1221, 1, 0, 0, 0, 1223, 1226, 1, 0, 0, 0, 1224, 1222, 1, 0, 0, 0, 1224, 1225, 1, 0, 0, 0, 1225, 1227, 1, 0, 0, 0, 1226, 1224, 1, 0, 0, 0, 1227, 1228, 5, 0, 0, 1, 1228, 165, 1, 0, 0, 0, 1229, 1230, 5, 154, 0, 0, 1230, 1231, 3, 108, 54, 0, 1231, 1232, 5, 142, 0, 0, 1232, 1235, 1, 0, 0, 0, 1233, 1235, 5, 153, 0, 0, 1234, 1229, 1, 0, 0, 0, 1234, 1233, 1, 0, 0, 0, 1235, 167, 1, 0, 0, 0, 160, 171, 178, 187, 194, 198, 209, 213, 216, 225, 233, 240, 244, 250, 255, 261, 273, 281, 295, 299, 304, 314, 323, 326, 330, 333, 337, 340, 343, 346, 349, 353, 357, 360, 363, 366, 370, 373, 382, 388, 409, 426, 443, 449, 455, 466, 468, 479, 482, 488, 496, 502, 504, 508, 513, 516, 519, 523, 527, 530, 532, 535, 539, 543, 546, 548, 550, 555, 566, 572, 579, 584, 588, 592, 598, 600, 607, 615, 618, 621, 640, 654, 670, 674, 685, 689, 700, 704, 711, 715, 722, 726, 731, 740, 744, 768, 785, 791, 794, 797, 807, 813, 816, 819, 827, 830, 834, 837, 851, 868, 873, 877, 883, 890, 902, 906, 909, 918, 932, 959, 967, 969, 971, 979, 983, 987, 995, 999, 1008, 1012, 1014, 1024, 1035, 1040, 1047, 1060, 1067, 1071, 1083, 1089, 1092, 1099, 1111, 1117, 1121, 1127, 1134, 1143, 1147, 1157, 1159, 1162, 1170, 1175, 1185, 1190, 1202, 1208, 1218, 1224, 1234] \ No newline at end of file diff --git a/hogql_parser/__init__.pyi b/hogql_parser/__init__.pyi index d118808220a9f..69734c92cc41f 100644 --- a/hogql_parser/__init__.pyi +++ b/hogql_parser/__init__.pyi @@ -1,4 +1,4 @@ -from posthog.hogql.ast import SelectQuery, SelectUnionQuery +from posthog.hogql.ast import SelectQuery, SelectUnionQuery, Program from posthog.hogql.base import AST def parse_expr(expr: str, /, *, is_internal: bool = False) -> AST: @@ -35,3 +35,10 @@ def parse_string_literal_text(value: str, /) -> str: If the expr is `internal`, spans and notices won't be included in the AST. """ ... + +def parse_program(source: str, /, *, is_internal: bool = False) -> Program: + """Parse a Hog program. + + If the expr `is_internal`, spans and notices won't be included in the AST. + """ + ... diff --git a/hogql_parser/parser.cpp b/hogql_parser/parser.cpp index c1a85b8d8cfd6..3679a392e5be2 100644 --- a/hogql_parser/parser.cpp +++ b/hogql_parser/parser.cpp @@ -291,6 +291,391 @@ class HogQLParseTreeConverter : public HogQLParserBaseVisitor { return ret; } + VISIT(Program) { + PyObject* declarations = PyList_New(0); + if (!declarations) { + throw PyInternalError(); + } + auto declaration_ctxs = ctx->declaration(); + for (auto declaration_ctx : declaration_ctxs) { + if (declaration_ctx->statement() && declaration_ctx->statement()->emptyStmt()) { + continue; + } + PyObject* statement = Py_None; + try { + statement = visitAsPyObject(declaration_ctx); + int append_code = PyList_Append(declarations, statement); + Py_DECREF(statement); + if (append_code == -1) { + throw PyInternalError(); + } + } catch (...) { + Py_DECREF(declarations); + throw; + } + } + PyObject* ret = build_ast_node("Program", "{s:N}", "declarations", declarations); + if (!ret) { + Py_DECREF(declarations); + throw PyInternalError(); + } + return ret; + } + + VISIT(Declaration) { + auto var_decl_ctx = ctx->varDecl(); + if (var_decl_ctx) { + return visit(var_decl_ctx); + } + auto statement_ctx = ctx->statement(); + if (statement_ctx) { + return visit(statement_ctx); + } + throw ParsingError("Declaration must be either a varDecl or a statement"); + } + + VISIT(Expression) { + return visit(ctx->columnExpr()); + } + + VISIT(VarDecl) { + string name = visitAsString(ctx->identifier()); + PyObject* expr = visitAsPyObjectOrNone(ctx->expression()); + PyObject* ret = build_ast_node("VariableDeclaration", "{s:s#,s:N}", "name", name.data(), name.size(), "expr", expr); + if (!ret) { + Py_DECREF(expr); + throw PyInternalError(); + } + return ret; + } + + VISIT(VarAssignment) { + PyObject* left = visitAsPyObject(ctx->expression(0)); + PyObject* right; + try { + right = visitAsPyObject(ctx->expression(1)); + } catch (...) { + Py_DECREF(left); + throw; + } + PyObject* ret = build_ast_node("VariableAssignment", "{s:N,s:N}", "left", left, "right", right); + if (!ret) { + Py_DECREF(left); + Py_DECREF(right); + throw PyInternalError(); + } + return ret; + } + + VISIT(Statement) { + auto return_stmt_ctx = ctx->returnStmt(); + if (return_stmt_ctx) { + return visit(return_stmt_ctx); + } + + auto if_stmt_ctx = ctx->ifStmt(); + if (if_stmt_ctx) { + return visit(if_stmt_ctx); + } + + auto while_stmt_ctx = ctx->whileStmt(); + if (while_stmt_ctx) { + return visit(while_stmt_ctx); + } + + auto for_stmt_ctx = ctx->forStmt(); + if (for_stmt_ctx) { + return visit(for_stmt_ctx); + } + + auto func_stmt_ctx = ctx->funcStmt(); + if (func_stmt_ctx) { + return visit(func_stmt_ctx); + } + + auto var_assignment_ctx = ctx->varAssignment(); + if (var_assignment_ctx) { + return visit(var_assignment_ctx); + } + + auto block_ctx = ctx->block(); + if (block_ctx) { + return visit(block_ctx); + } + + auto expr_stmt_ctx = ctx->exprStmt(); + if (expr_stmt_ctx) { + return visit(expr_stmt_ctx); + } + + auto empty_stmt_ctx = ctx->emptyStmt(); + if (empty_stmt_ctx) { + return visit(empty_stmt_ctx); + } + + throw ParsingError("Statement must be one of returnStmt, ifStmt, whileStmt, forStmt, funcStmt, varAssignment, " + "block, exprStmt, or emptyStmt"); + } + + VISIT(ExprStmt) { + PyObject* expr; + try { + expr = visitAsPyObject(ctx->expression()); + } catch (...) { + throw; + } + PyObject* ret = build_ast_node("ExprStatement", "{s:N}", "expr", expr); + if (!ret) { + Py_DECREF(expr); + throw PyInternalError(); + } + return ret; + } + + VISIT(ReturnStmt) { + PyObject* expr; + try { + expr = visitAsPyObjectOrNone(ctx->expression()); + } catch (...) { + throw; + } + PyObject* ret = build_ast_node("ReturnStatement", "{s:N}", "expr", expr); + if (!ret) { + Py_DECREF(expr); + throw PyInternalError(); + } + return ret; + } + + VISIT(IfStmt) { + PyObject* expr; + try { + expr = visitAsPyObject(ctx->expression()); + } catch (...) { + throw; + } + PyObject* then_stmt; + try { + then_stmt = visitAsPyObject(ctx->statement(0)); + } catch (...) { + Py_DECREF(expr); + throw; + } + PyObject* else_stmt; + try { + else_stmt = visitAsPyObjectOrNone(ctx->statement(1)); + } catch (...) { + Py_DECREF(expr); + Py_DECREF(then_stmt); + throw; + } + PyObject* ret = build_ast_node("IfStatement", "{s:N,s:N,s:N}", "expr", expr, "then", then_stmt, "else_", else_stmt); + if (!ret) { + Py_DECREF(expr); + Py_DECREF(then_stmt); + Py_DECREF(else_stmt); + throw PyInternalError(); + } + return ret; + } + + VISIT(WhileStmt) { + PyObject* expr; + try { + expr = visitAsPyObject(ctx->expression()); + } catch (...) { + throw; + } + PyObject* body; + try { + body = visitAsPyObjectOrNone(ctx->statement()); + } catch (...) { + Py_DECREF(expr); + throw; + } + PyObject* ret = build_ast_node("WhileStatement", "{s:N,s:N}", "expr", expr, "body", body); + if (!ret) { + Py_DECREF(expr); + Py_DECREF(body); + throw PyInternalError(); + } + return ret; + } + + VISIT(ForStmt) { + PyObject* initializer; + if (ctx->initializerVarDeclr) { + initializer = visitAsPyObject(ctx->initializerVarDeclr); + } else if (ctx->initializerVarAssignment) { + initializer = visitAsPyObject(ctx->initializerVarAssignment); + } else if (ctx->initializerExpression) { + initializer = visitAsPyObject(ctx->initializerExpression); + } else { + initializer = Py_None; + Py_INCREF(initializer); + } + + PyObject* condition; + try { + condition = visitAsPyObjectOrNone(ctx->condition); + } catch (...) { + Py_DECREF(initializer); + throw; + } + + PyObject* increment; + auto increment_var_declr_ctx = ctx->incrementVarDeclr; + auto increment_var_assignment_ctx = ctx->incrementVarAssignment; + auto increment_expression_ctx = ctx->incrementExpression; + if (increment_var_declr_ctx) { + try { + increment = visitAsPyObject(increment_var_declr_ctx); + } catch (...) { + Py_DECREF(initializer); + Py_DECREF(condition); + throw; + } + } else if (increment_var_assignment_ctx) { + try { + increment = visitAsPyObject(increment_var_assignment_ctx); + } catch (...) { + Py_DECREF(initializer); + Py_DECREF(condition); + throw; + } + } else if (increment_expression_ctx) { + try { + increment = visitAsPyObject(increment_expression_ctx); + } catch (...) { + Py_DECREF(initializer); + Py_DECREF(condition); + throw; + } + } else { + increment = Py_None; + Py_INCREF(increment); + } + + PyObject* body; + try { + body = visitAsPyObject(ctx->statement()); + } catch (...) { + Py_DECREF(initializer); + Py_DECREF(condition); + Py_DECREF(increment); + throw; + } + + PyObject* ret = build_ast_node( + "ForStatement", "{s:N,s:N,s:N,s:N}", "initializer", initializer, "condition", condition, "increment", increment, + "body", body + ); + if (!ret) { + Py_DECREF(initializer); + Py_DECREF(condition); + Py_DECREF(increment); + Py_DECREF(body); + throw PyInternalError(); + } + return ret; + } + + VISIT(FuncStmt) { + PyObject* params; + string name = visitAsString(ctx->identifier()); + auto identifier_list_ctx = ctx->identifierList(); + if (identifier_list_ctx) { + vector paramList = any_cast>(visit(ctx->identifierList())); + params = X_PyList_FromStrings(paramList); + } else { + vector paramList; + params = PyList_New(0); + } + + if (!params) { + throw PyInternalError(); + } + + PyObject* body; + try { + body = visitAsPyObject(ctx->block()); + } catch (...) { + Py_DECREF(params); + throw; + } + + PyObject* ret = build_ast_node("Function", "{s:s#,s:N,s:N}", "name", name.data(), name.size(), "params", params, "body", body); + if (!ret) { + Py_DECREF(params); + Py_DECREF(body); + throw PyInternalError(); + } + return ret; + } + + VISIT(KvPairList) { + return visitPyListOfObjects(ctx->kvPair()); + } + + VISIT(KvPair) { + PyObject* k = visitAsPyObject(ctx->expression(0)); + PyObject* v; + try { + v = visitAsPyObject(ctx->expression(1)); + } catch (...) { + Py_DECREF(k); + throw; + } + PyObject* ret = PyTuple_Pack(2, k, v); + Py_DECREF(k); + Py_DECREF(v); + if (!ret) { + throw PyInternalError(); + } + return ret; + } + + VISIT(IdentifierList) { + return visitAsVectorOfStrings(ctx->identifier()); + } + + VISIT(EmptyStmt) { + RETURN_NEW_AST_NODE("ExprStatement", "{s:O}", "expr", Py_None); + } + + VISIT(Block) { + PyObject* declarations = PyList_New(0); + if (!declarations) { + throw PyInternalError(); + } + auto declaration_ctxs = ctx->declaration(); + for (auto declaration_ctx : declaration_ctxs) { + if (!declaration_ctx->statement() || !declaration_ctx->statement()->emptyStmt()) { + PyObject* statement; + try { + statement = visitAsPyObject(declaration_ctx); + } catch (...) { + Py_DECREF(declarations); + throw; + } + int append_code = PyList_Append(declarations, statement); + Py_DECREF(statement); + if (append_code == -1) { + Py_DECREF(declarations); + throw PyInternalError(); + } + } + } + PyObject* ret = build_ast_node("Block", "{s:N}", "declarations", declarations); + if (!ret) { + Py_DECREF(declarations); + throw PyInternalError(); + } + return ret; + } + + // HogQL rules + VISIT(Select) { auto select_union_stmt_ctx = ctx->selectUnionStmt(); if (select_union_stmt_ctx) { @@ -1103,7 +1488,9 @@ class HogQLParseTreeConverter : public HogQLParserBaseVisitor { RETURN_NEW_AST_NODE("Array", "{s:N}", "exprs", visitAsPyObjectOrEmptyList(ctx->columnExprList())); } - VISIT_UNSUPPORTED(ColumnExprDict) + VISIT(ColumnExprDict) { + RETURN_NEW_AST_NODE("Dict", "{s:N}", "items", visitAsPyObjectOrEmptyList(ctx->kvPairList())); + } VISIT_UNSUPPORTED(ColumnExprSubstring) @@ -2123,11 +2510,11 @@ class HogQLErrorListener : public antlr4::BaseErrorListener { size_t getPosition(size_t line, size_t column) { size_t linePosition = 0; for (size_t i = 0; i < line - 1; i++) { - size_t increment = input.find("\n", linePosition) + 1; - if (increment == string::npos) { + size_t endOfLine = input.find("\n", linePosition); + if (endOfLine == string::npos) { return string::npos; } - linePosition += increment; + linePosition = endOfLine + 1; } return linePosition + column; } @@ -2176,6 +2563,7 @@ METHOD_PARSE_NODE(Expr, expr, expr) METHOD_PARSE_NODE(OrderExpr, orderExpr, order_expr) METHOD_PARSE_NODE(Select, select, select) METHOD_PARSE_NODE(FullTemplateString, fullTemplateString, full_template_string) +METHOD_PARSE_NODE(Program, program, program) #undef METHOD_PARSE_NODE @@ -2211,6 +2599,10 @@ static PyMethodDef parser_methods[] = { .ml_meth = (PyCFunction)method_parse_full_template_string, .ml_flags = METH_VARARGS | METH_KEYWORDS, .ml_doc = "Parse a Hog template string into an AST"}, + {.ml_name = "parse_program", + .ml_meth = (PyCFunction)method_parse_program, + .ml_flags = METH_VARARGS | METH_KEYWORDS, + .ml_doc = "Parse a Hog program into an AST"}, {.ml_name = "parse_string_literal_text", .ml_meth = method_parse_string_literal_text, .ml_flags = METH_VARARGS, diff --git a/hogql_parser/setup.py b/hogql_parser/setup.py index ed100a7df646b..2b19360e8dac9 100644 --- a/hogql_parser/setup.py +++ b/hogql_parser/setup.py @@ -32,7 +32,7 @@ setup( name="hogql_parser", - version="1.0.16", + version="1.0.21", url="https://github.com/PostHog/posthog/tree/master/hogql_parser", author="PostHog Inc.", author_email="hey@posthog.com", diff --git a/hogvm/__tests__/__snapshots__/functions.hoge b/hogvm/__tests__/__snapshots__/functions.hoge index 99900e9fa4893..cb229ff8b81b7 100644 --- a/hogvm/__tests__/__snapshots__/functions.hoge +++ b/hogvm/__tests__/__snapshots__/functions.hoge @@ -2,12 +2,14 @@ 1, 6, 36, 2, 38, 35, 41, "mult", 2, 6, 36, 0, 36, 1, 8, 38, 41, "noArgs", 0, 12, 32, "basdfasdf", 33, 3, 33, 2, 6, 36, 1, 38, 35, 35, 41, "empty", 0, 2, 31, 38, 41, "empty2", 0, 2, 31, 38, 41, "empty3", 0, 2, 31, 38, 41, "noReturn", 0, 14, 33, 1, 33, 2, 36, 1, 36, 0, 6, 31, 38, 35, 35, 35, 41, "emptyReturn", 0, 2, 31, 38, 41, "emptyReturnBeforeOtherStuff", -0, 10, 31, 38, 33, 2, 33, 2, 6, 35, 31, 38, 41, "emptyReturnBeforeOtherStuffNoSemicolon", 0, 6, 33, 2, 33, 2, 6, 38, 33, -4, 33, 3, 2, "add", 2, 2, "print", 1, 35, 33, 1, 33, 1, 2, "add", 2, 33, 100, 33, 4, 33, 3, 2, "add", 2, 6, 6, 2, -"print", 1, 35, 33, -1, 2, "noArgs", 0, 2, "ifNull", 2, 2, "print", 1, 35, 33, -1, 2, "empty", 0, 2, "ifNull", 2, 2, -"print", 1, 35, 33, -1, 2, "empty2", 0, 2, "ifNull", 2, 2, "print", 1, 35, 33, -1, 2, "empty3", 0, 2, "ifNull", 2, 2, -"print", 1, 35, 33, -1, 2, "noReturn", 0, 2, "ifNull", 2, 2, "print", 1, 35, 33, -1, 2, "emptyReturn", 0, 2, "ifNull", -2, 2, "print", 1, 35, 33, -1, 2, "emptyReturnBeforeOtherStuff", 0, 2, "ifNull", 2, 2, "print", 1, 35, 33, -1, 2, -"emptyReturnBeforeOtherStuffNoSemicolon", 0, 2, "ifNull", 2, 2, "print", 1, 35, 33, 2, 33, 1, 33, 2, 2, "add", 2, 33, -100, 33, 4, 33, 3, 2, "add", 2, 6, 6, 2, "mult", 2, 2, "print", 1, 35, 33, 10, 33, 1, 33, 2, 2, "add2", 2, 33, 100, 33, -4, 33, 3, 2, "add2", 2, 6, 6, 2, "mult", 2, 2, "print", 1, 35] +0, 10, 31, 38, 33, 2, 33, 2, 6, 35, 31, 38, 41, "emptyReturnBeforeOtherStuffNoSemicolon", 0, 6, 33, 2, 33, 2, 6, 38, 41, +"ifThenReturn", 0, 8, 30, 40, 2, 31, 38, 33, 4, 38, 33, 4, 33, 3, 2, "add", 2, 2, "print", 1, 35, 33, 1, 33, 1, 2, +"add", 2, 33, 100, 33, 4, 33, 3, 2, "add", 2, 6, 6, 2, "print", 1, 35, 33, -1, 2, "noArgs", 0, 2, "ifNull", 2, 2, +"print", 1, 35, 33, -1, 2, "empty", 0, 2, "ifNull", 2, 2, "print", 1, 35, 33, -1, 2, "empty2", 0, 2, "ifNull", 2, 2, +"print", 1, 35, 33, -1, 2, "empty3", 0, 2, "ifNull", 2, 2, "print", 1, 35, 33, -1, 2, "noReturn", 0, 2, "ifNull", 2, 2, +"print", 1, 35, 33, -1, 2, "emptyReturn", 0, 2, "ifNull", 2, 2, "print", 1, 35, 33, -1, 2, +"emptyReturnBeforeOtherStuff", 0, 2, "ifNull", 2, 2, "print", 1, 35, 33, -1, 2, +"emptyReturnBeforeOtherStuffNoSemicolon", 0, 2, "ifNull", 2, 2, "print", 1, 35, 33, -1, 2, "ifThenReturn", 0, 2, +"ifNull", 2, 2, "print", 1, 35, 33, 2, 33, 1, 33, 2, 2, "add", 2, 33, 100, 33, 4, 33, 3, 2, "add", 2, 6, 6, 2, "mult", +2, 2, "print", 1, 35, 33, 10, 33, 1, 33, 2, 2, "add2", 2, 33, 100, 33, 4, 33, 3, 2, "add2", 2, 6, 6, 2, "mult", 2, 2, +"print", 1, 35] diff --git a/hogvm/__tests__/__snapshots__/functions.stdout b/hogvm/__tests__/__snapshots__/functions.stdout index 3de71f0119f79..bd80a6f22ca08 100644 --- a/hogvm/__tests__/__snapshots__/functions.stdout +++ b/hogvm/__tests__/__snapshots__/functions.stdout @@ -9,5 +9,6 @@ -1 -1 4 +4 220 1100 diff --git a/hogvm/__tests__/functions.hog b/hogvm/__tests__/functions.hog index db7a5c61fca86..b549e9b10705a 100644 --- a/hogvm/__tests__/functions.hog +++ b/hogvm/__tests__/functions.hog @@ -35,6 +35,13 @@ fn emptyReturnBeforeOtherStuffNoSemicolon() { return 2 + 2 } +fn ifThenReturn() { + // make sure this is not a placeholder {return} + if (false) { + return + } + return 4 +} print(add(3, 4)) print(add(3, 4) + 100 + add(1, 1)) @@ -46,6 +53,7 @@ print(noReturn() ?? -1) print(emptyReturn() ?? -1) print(emptyReturnBeforeOtherStuff() ?? -1) print(emptyReturnBeforeOtherStuffNoSemicolon() ?? -1) +print(ifThenReturn() ?? -1) print(mult(add(3, 4) + 100 + add(2, 1), 2)) print(mult(add2(3, 4) + 100 + add2(2, 1), 10)) diff --git a/hogvm/typescript/src/__tests__/execute.test.ts b/hogvm/typescript/src/__tests__/execute.test.ts index bc249162b4360..151c23f373597 100644 --- a/hogvm/typescript/src/__tests__/execute.test.ts +++ b/hogvm/typescript/src/__tests__/execute.test.ts @@ -112,21 +112,22 @@ describe('HogQL Bytecode', () => { test('error handling', async () => { const globals = { properties: { foo: 'bar' } } const options = { globals } - expect(() => execSync([], options)).toThrowError("Invalid HogQL bytecode, must start with '_h'") - await expect(execAsync([], options)).rejects.toThrowError("Invalid HogQL bytecode, must start with '_h'") - expect(() => execSync(['_h', op.INTEGER, 2, op.INTEGER, 1, 'InvalidOp'], options)).toThrowError( + expect(() => execSync([], options)).toThrow("Invalid HogQL bytecode, must start with '_h'") + await expect(execAsync([], options)).rejects.toThrow("Invalid HogQL bytecode, must start with '_h'") + expect(() => execSync(['_h', op.INTEGER, 2, op.INTEGER, 1, 'InvalidOp'], options)).toThrow( 'Unexpected node while running bytecode: InvalidOp' ) expect(() => execSync(['_h', op.STRING, 'another', op.STRING, 'arg', op.CALL, 'invalidFunc', 2], options) - ).toThrowError('Unsupported function call: invalidFunc') - expect(() => execSync(['_h', op.INTEGER], options)).toThrowError('Unexpected end of bytecode') - expect(() => execSync(['_h', op.CALL, 'match', 1], options)).toThrowError( - 'Invalid HogQL bytecode, stack is empty' - ) - expect(() => execSync(['_h', op.TRUE, op.TRUE, op.NOT], options)).toThrowError( + ).toThrow('Unsupported function call: invalidFunc') + expect(() => execSync(['_h', op.INTEGER], options)).toThrow('Unexpected end of bytecode') + expect(() => execSync(['_h', op.CALL, 'match', 1], options)).toThrow('Not enough arguments on the stack') + expect(() => execSync(['_h', op.TRUE, op.TRUE, op.NOT], options)).toThrow( 'Invalid bytecode. More than one value left on stack' ) + }) + + test('async limits', async () => { const callSleep = [ 33, 0.002, // seconds to sleep @@ -138,12 +139,24 @@ describe('HogQL Bytecode', () => { for (let i = 0; i < 200; i++) { bytecode.push(...callSleep) } - await expect(execAsync(bytecode, options)).rejects.toThrowError('Exceeded maximum number of async steps: 100') - await expect(execAsync(bytecode, { ...options, maxAsyncSteps: 55 })).rejects.toThrowError( + await expect(execAsync(bytecode)).rejects.toThrow('Exceeded maximum number of async steps: 100') + await expect(execAsync(bytecode, { maxAsyncSteps: 55 })).rejects.toThrow( 'Exceeded maximum number of async steps: 55' ) }) + test('call arg limits', async () => { + const bytecode = ['_h', 33, 0.002, 2, 'sleep', 301] + expect(() => execSync(bytecode)).toThrow('Not enough arguments on the stack') + + const bytecode2: any[] = ['_h'] + for (let i = 0; i < 301; i++) { + bytecode2.push(33, 0.002) + } + bytecode2.push(2, 'sleep', 301) + expect(() => execSync(bytecode2)).toThrow('Too many arguments') + }) + test('should execute user-defined stringify function correctly', async () => { const functions = { stringify: (arg: any) => { diff --git a/hogvm/typescript/src/execute.ts b/hogvm/typescript/src/execute.ts index 865f57408a713..a11826b50a415 100644 --- a/hogvm/typescript/src/execute.ts +++ b/hogvm/typescript/src/execute.ts @@ -43,6 +43,9 @@ export interface ExecResult { state?: VMState } +/** Maximum function arguments allowed */ +const MAX_ARGS_LENGTH = 300 + export function execSync(bytecode: any[], options?: ExecOptions): any { const response = exec(bytecode, options) if (response.finished) { @@ -334,14 +337,24 @@ export function exec(code: any[] | VMState, options?: ExecOptions): ExecResult { callStack.push([ip + 1, stack.length - argLen, argLen]) ip = funcIp } else { - const args = Array(next()) + temp = next() // args.length + if (temp > stack.length) { + throw new Error('Not enough arguments on the stack') + } + if (temp > MAX_ARGS_LENGTH) { + throw new Error('Too many arguments') + } + const args = Array(temp) .fill(null) .map(() => popStack()) - if (options?.functions && options.functions[name] && name !== 'toString') { + if (options?.functions && options.functions.hasOwnProperty(name) && options.functions[name]) { stack.push(convertJSToHog(options.functions[name](...args.map(convertHogToJS)))) } else if ( name !== 'toString' && - ((options?.asyncFunctions && options.asyncFunctions[name]) || name in ASYNC_STL) + ((options?.asyncFunctions && + options.asyncFunctions.hasOwnProperty(name) && + options.asyncFunctions[name]) || + name in ASYNC_STL) ) { if (asyncSteps >= maxAsyncSteps) { throw new Error(`Exceeded maximum number of async steps: ${maxAsyncSteps}`) diff --git a/package.json b/package.json index 862da0c27a85c..67b94b59caf90 100644 --- a/package.json +++ b/package.json @@ -146,7 +146,7 @@ "pmtiles": "^2.11.0", "postcss": "^8.4.31", "postcss-preset-env": "^9.3.0", - "posthog-js": "1.139.8", + "posthog-js": "1.140.0", "posthog-js-lite": "3.0.0", "prettier": "^2.8.8", "prop-types": "^15.7.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ecb2613366005..e0689e764b7fc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -260,8 +260,8 @@ dependencies: specifier: ^9.3.0 version: 9.3.0(postcss@8.4.31) posthog-js: - specifier: 1.139.8 - version: 1.139.8 + specifier: 1.140.0 + version: 1.140.0 posthog-js-lite: specifier: 3.0.0 version: 3.0.0 @@ -17706,8 +17706,8 @@ packages: resolution: {integrity: sha512-dyajjnfzZD1tht4N7p7iwf7nBnR1MjVaVu+MKr+7gBgA39bn28wizCIJZztZPtHy4PY0YwtSGgwfBCuG/hnHgA==} dev: false - /posthog-js@1.139.8: - resolution: {integrity: sha512-glOJK4YSseDWDFdKttBhYkrtE65oYLDSjyke18sAG0J1xBNxvaz1MCVeZiZHj4wNXtdtY92ptSmiDUK3fzD2Rg==} + /posthog-js@1.140.0: + resolution: {integrity: sha512-+Z0IdEpN4SLwkE12b3oBKHewFA4VxeRI8CebUuinz40b6TsJF2Q1jboxULoH7pDc/33sCzKsz1SLCHnKY527vQ==} dependencies: fflate: 0.4.8 preact: 10.22.0 diff --git a/posthog/hogql/grammar/HogQLParser.g4 b/posthog/hogql/grammar/HogQLParser.g4 index 82ab4c27e3a74..aec5b0b87d017 100644 --- a/posthog/hogql/grammar/HogQLParser.g4 +++ b/posthog/hogql/grammar/HogQLParser.g4 @@ -20,9 +20,10 @@ statement : returnStmt | forStmt | funcStmt | varAssignment + | block | exprStmt | emptyStmt - | block ; + ; returnStmt : RETURN expression? SEMICOLON?; ifStmt : IF LPAREN expression RPAREN statement ( ELSE statement )? ; diff --git a/posthog/hogql/grammar/HogQLParser.interp b/posthog/hogql/grammar/HogQLParser.interp index 40009f67387f5..da0b0cb00c46d 100644 --- a/posthog/hogql/grammar/HogQLParser.interp +++ b/posthog/hogql/grammar/HogQLParser.interp @@ -400,4 +400,4 @@ stringContentsFull atn: -[4, 1, 154, 1237, 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, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78, 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, 2, 83, 7, 83, 1, 0, 5, 0, 170, 8, 0, 10, 0, 12, 0, 173, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 179, 8, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 188, 8, 3, 1, 4, 1, 4, 1, 4, 5, 4, 193, 8, 4, 10, 4, 12, 4, 196, 9, 4, 1, 4, 3, 4, 199, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 210, 8, 5, 1, 6, 1, 6, 3, 6, 214, 8, 6, 1, 6, 3, 6, 217, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 226, 8, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 234, 8, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 241, 8, 9, 1, 9, 1, 9, 3, 9, 245, 8, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 251, 8, 9, 1, 9, 1, 9, 1, 9, 3, 9, 256, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 262, 8, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 3, 12, 274, 8, 12, 1, 13, 1, 13, 1, 14, 1, 14, 5, 14, 280, 8, 14, 10, 14, 12, 14, 283, 9, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 5, 16, 294, 8, 16, 10, 16, 12, 16, 297, 9, 16, 1, 16, 3, 16, 300, 8, 16, 1, 17, 1, 17, 1, 17, 3, 17, 305, 8, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 5, 18, 313, 8, 18, 10, 18, 12, 18, 316, 9, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 324, 8, 19, 1, 20, 3, 20, 327, 8, 20, 1, 20, 1, 20, 3, 20, 331, 8, 20, 1, 20, 3, 20, 334, 8, 20, 1, 20, 1, 20, 3, 20, 338, 8, 20, 1, 20, 3, 20, 341, 8, 20, 1, 20, 3, 20, 344, 8, 20, 1, 20, 3, 20, 347, 8, 20, 1, 20, 3, 20, 350, 8, 20, 1, 20, 1, 20, 3, 20, 354, 8, 20, 1, 20, 1, 20, 3, 20, 358, 8, 20, 1, 20, 3, 20, 361, 8, 20, 1, 20, 3, 20, 364, 8, 20, 1, 20, 3, 20, 367, 8, 20, 1, 20, 1, 20, 3, 20, 371, 8, 20, 1, 20, 3, 20, 374, 8, 20, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 383, 8, 22, 1, 23, 1, 23, 1, 23, 1, 24, 3, 24, 389, 8, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 5, 25, 408, 8, 25, 10, 25, 12, 25, 411, 9, 25, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 3, 28, 427, 8, 28, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 3, 32, 444, 8, 32, 1, 32, 1, 32, 1, 32, 1, 32, 3, 32, 450, 8, 32, 1, 32, 1, 32, 1, 32, 1, 32, 3, 32, 456, 8, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 3, 32, 467, 8, 32, 3, 32, 469, 8, 32, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 3, 35, 480, 8, 35, 1, 35, 3, 35, 483, 8, 35, 1, 35, 1, 35, 1, 35, 1, 35, 3, 35, 489, 8, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 3, 35, 497, 8, 35, 1, 35, 1, 35, 1, 35, 1, 35, 5, 35, 503, 8, 35, 10, 35, 12, 35, 506, 9, 35, 1, 36, 3, 36, 509, 8, 36, 1, 36, 1, 36, 1, 36, 3, 36, 514, 8, 36, 1, 36, 3, 36, 517, 8, 36, 1, 36, 3, 36, 520, 8, 36, 1, 36, 1, 36, 3, 36, 524, 8, 36, 1, 36, 1, 36, 3, 36, 528, 8, 36, 1, 36, 3, 36, 531, 8, 36, 3, 36, 533, 8, 36, 1, 36, 3, 36, 536, 8, 36, 1, 36, 1, 36, 3, 36, 540, 8, 36, 1, 36, 1, 36, 3, 36, 544, 8, 36, 1, 36, 3, 36, 547, 8, 36, 3, 36, 549, 8, 36, 3, 36, 551, 8, 36, 1, 37, 1, 37, 1, 37, 3, 37, 556, 8, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 3, 38, 567, 8, 38, 1, 39, 1, 39, 1, 39, 1, 39, 3, 39, 573, 8, 39, 1, 40, 1, 40, 1, 40, 5, 40, 578, 8, 40, 10, 40, 12, 40, 581, 9, 40, 1, 41, 1, 41, 3, 41, 585, 8, 41, 1, 41, 1, 41, 3, 41, 589, 8, 41, 1, 41, 1, 41, 3, 41, 593, 8, 41, 1, 42, 1, 42, 1, 42, 1, 42, 3, 42, 599, 8, 42, 3, 42, 601, 8, 42, 1, 43, 1, 43, 1, 43, 5, 43, 606, 8, 43, 10, 43, 12, 43, 609, 9, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 3, 45, 616, 8, 45, 1, 45, 3, 45, 619, 8, 45, 1, 45, 3, 45, 622, 8, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 641, 8, 49, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 3, 50, 655, 8, 50, 1, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 5, 52, 669, 8, 52, 10, 52, 12, 52, 672, 9, 52, 1, 52, 3, 52, 675, 8, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 5, 52, 684, 8, 52, 10, 52, 12, 52, 687, 9, 52, 1, 52, 3, 52, 690, 8, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 5, 52, 699, 8, 52, 10, 52, 12, 52, 702, 9, 52, 1, 52, 3, 52, 705, 8, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 3, 52, 712, 8, 52, 1, 52, 1, 52, 3, 52, 716, 8, 52, 1, 53, 1, 53, 1, 53, 5, 53, 721, 8, 53, 10, 53, 12, 53, 724, 9, 53, 1, 53, 3, 53, 727, 8, 53, 1, 54, 1, 54, 1, 54, 3, 54, 732, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 4, 54, 739, 8, 54, 11, 54, 12, 54, 740, 1, 54, 1, 54, 3, 54, 745, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 769, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 786, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 792, 8, 54, 1, 54, 3, 54, 795, 8, 54, 1, 54, 3, 54, 798, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 808, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 814, 8, 54, 1, 54, 3, 54, 817, 8, 54, 1, 54, 3, 54, 820, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 828, 8, 54, 1, 54, 3, 54, 831, 8, 54, 1, 54, 1, 54, 3, 54, 835, 8, 54, 1, 54, 3, 54, 838, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 852, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 869, 8, 54, 1, 54, 1, 54, 1, 54, 3, 54, 874, 8, 54, 1, 54, 1, 54, 3, 54, 878, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 884, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 891, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 903, 8, 54, 1, 54, 1, 54, 3, 54, 907, 8, 54, 1, 54, 3, 54, 910, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 919, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 933, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 960, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 968, 8, 54, 5, 54, 970, 8, 54, 10, 54, 12, 54, 973, 9, 54, 1, 55, 1, 55, 1, 55, 5, 55, 978, 8, 55, 10, 55, 12, 55, 981, 9, 55, 1, 55, 3, 55, 984, 8, 55, 1, 56, 1, 56, 3, 56, 988, 8, 56, 1, 57, 1, 57, 1, 57, 1, 57, 5, 57, 994, 8, 57, 10, 57, 12, 57, 997, 9, 57, 1, 57, 3, 57, 1000, 8, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 5, 57, 1007, 8, 57, 10, 57, 12, 57, 1010, 9, 57, 1, 57, 3, 57, 1013, 8, 57, 3, 57, 1015, 8, 57, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, 5, 58, 1023, 8, 58, 10, 58, 12, 58, 1026, 9, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 5, 58, 1034, 8, 58, 10, 58, 12, 58, 1037, 9, 58, 1, 58, 1, 58, 3, 58, 1041, 8, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 3, 58, 1048, 8, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 3, 59, 1061, 8, 59, 1, 60, 1, 60, 1, 60, 5, 60, 1066, 8, 60, 10, 60, 12, 60, 1069, 9, 60, 1, 60, 3, 60, 1072, 8, 60, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 3, 61, 1084, 8, 61, 1, 62, 1, 62, 1, 62, 1, 62, 3, 62, 1090, 8, 62, 1, 62, 3, 62, 1093, 8, 62, 1, 63, 1, 63, 1, 63, 5, 63, 1098, 8, 63, 10, 63, 12, 63, 1101, 9, 63, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 3, 64, 1112, 8, 64, 1, 64, 1, 64, 1, 64, 1, 64, 3, 64, 1118, 8, 64, 5, 64, 1120, 8, 64, 10, 64, 12, 64, 1123, 9, 64, 1, 65, 1, 65, 1, 65, 3, 65, 1128, 8, 65, 1, 65, 1, 65, 1, 66, 1, 66, 1, 66, 3, 66, 1135, 8, 66, 1, 66, 1, 66, 1, 67, 1, 67, 1, 67, 5, 67, 1142, 8, 67, 10, 67, 12, 67, 1145, 9, 67, 1, 67, 3, 67, 1148, 8, 67, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 3, 69, 1158, 8, 69, 3, 69, 1160, 8, 69, 1, 70, 3, 70, 1163, 8, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 3, 70, 1171, 8, 70, 1, 71, 1, 71, 1, 71, 3, 71, 1176, 8, 71, 1, 72, 1, 72, 1, 73, 1, 73, 1, 74, 1, 74, 1, 75, 1, 75, 3, 75, 1186, 8, 75, 1, 76, 1, 76, 1, 76, 3, 76, 1191, 8, 76, 1, 77, 1, 77, 1, 77, 1, 77, 1, 78, 1, 78, 1, 78, 1, 78, 1, 79, 1, 79, 3, 79, 1203, 8, 79, 1, 80, 1, 80, 5, 80, 1207, 8, 80, 10, 80, 12, 80, 1210, 9, 80, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 3, 81, 1219, 8, 81, 1, 82, 1, 82, 5, 82, 1223, 8, 82, 10, 82, 12, 82, 1226, 9, 82, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 3, 83, 1235, 8, 83, 1, 83, 0, 3, 70, 108, 128, 84, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 0, 16, 2, 0, 17, 17, 72, 72, 2, 0, 42, 42, 49, 49, 3, 0, 1, 1, 4, 4, 8, 8, 4, 0, 1, 1, 3, 4, 8, 8, 78, 78, 2, 0, 49, 49, 71, 71, 2, 0, 1, 1, 4, 4, 2, 0, 7, 7, 21, 22, 2, 0, 28, 28, 47, 47, 2, 0, 69, 69, 74, 74, 3, 0, 10, 10, 48, 48, 87, 87, 2, 0, 39, 39, 51, 51, 1, 0, 103, 104, 2, 0, 114, 114, 134, 134, 7, 0, 20, 20, 36, 36, 53, 54, 68, 68, 76, 76, 93, 93, 99, 99, 12, 0, 1, 19, 21, 28, 30, 35, 37, 40, 42, 49, 51, 52, 56, 56, 58, 67, 69, 75, 77, 92, 94, 95, 97, 98, 4, 0, 19, 19, 28, 28, 37, 37, 46, 46, 1394, 0, 171, 1, 0, 0, 0, 2, 178, 1, 0, 0, 0, 4, 180, 1, 0, 0, 0, 6, 182, 1, 0, 0, 0, 8, 189, 1, 0, 0, 0, 10, 209, 1, 0, 0, 0, 12, 211, 1, 0, 0, 0, 14, 218, 1, 0, 0, 0, 16, 227, 1, 0, 0, 0, 18, 235, 1, 0, 0, 0, 20, 257, 1, 0, 0, 0, 22, 266, 1, 0, 0, 0, 24, 271, 1, 0, 0, 0, 26, 275, 1, 0, 0, 0, 28, 277, 1, 0, 0, 0, 30, 286, 1, 0, 0, 0, 32, 290, 1, 0, 0, 0, 34, 304, 1, 0, 0, 0, 36, 308, 1, 0, 0, 0, 38, 323, 1, 0, 0, 0, 40, 326, 1, 0, 0, 0, 42, 375, 1, 0, 0, 0, 44, 378, 1, 0, 0, 0, 46, 384, 1, 0, 0, 0, 48, 388, 1, 0, 0, 0, 50, 394, 1, 0, 0, 0, 52, 412, 1, 0, 0, 0, 54, 415, 1, 0, 0, 0, 56, 418, 1, 0, 0, 0, 58, 428, 1, 0, 0, 0, 60, 431, 1, 0, 0, 0, 62, 435, 1, 0, 0, 0, 64, 468, 1, 0, 0, 0, 66, 470, 1, 0, 0, 0, 68, 473, 1, 0, 0, 0, 70, 488, 1, 0, 0, 0, 72, 550, 1, 0, 0, 0, 74, 555, 1, 0, 0, 0, 76, 566, 1, 0, 0, 0, 78, 568, 1, 0, 0, 0, 80, 574, 1, 0, 0, 0, 82, 582, 1, 0, 0, 0, 84, 600, 1, 0, 0, 0, 86, 602, 1, 0, 0, 0, 88, 610, 1, 0, 0, 0, 90, 615, 1, 0, 0, 0, 92, 623, 1, 0, 0, 0, 94, 627, 1, 0, 0, 0, 96, 631, 1, 0, 0, 0, 98, 640, 1, 0, 0, 0, 100, 654, 1, 0, 0, 0, 102, 656, 1, 0, 0, 0, 104, 715, 1, 0, 0, 0, 106, 717, 1, 0, 0, 0, 108, 877, 1, 0, 0, 0, 110, 974, 1, 0, 0, 0, 112, 987, 1, 0, 0, 0, 114, 1014, 1, 0, 0, 0, 116, 1047, 1, 0, 0, 0, 118, 1060, 1, 0, 0, 0, 120, 1062, 1, 0, 0, 0, 122, 1083, 1, 0, 0, 0, 124, 1092, 1, 0, 0, 0, 126, 1094, 1, 0, 0, 0, 128, 1111, 1, 0, 0, 0, 130, 1124, 1, 0, 0, 0, 132, 1134, 1, 0, 0, 0, 134, 1138, 1, 0, 0, 0, 136, 1149, 1, 0, 0, 0, 138, 1159, 1, 0, 0, 0, 140, 1162, 1, 0, 0, 0, 142, 1175, 1, 0, 0, 0, 144, 1177, 1, 0, 0, 0, 146, 1179, 1, 0, 0, 0, 148, 1181, 1, 0, 0, 0, 150, 1185, 1, 0, 0, 0, 152, 1190, 1, 0, 0, 0, 154, 1192, 1, 0, 0, 0, 156, 1196, 1, 0, 0, 0, 158, 1202, 1, 0, 0, 0, 160, 1204, 1, 0, 0, 0, 162, 1218, 1, 0, 0, 0, 164, 1220, 1, 0, 0, 0, 166, 1234, 1, 0, 0, 0, 168, 170, 3, 2, 1, 0, 169, 168, 1, 0, 0, 0, 170, 173, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, 171, 172, 1, 0, 0, 0, 172, 174, 1, 0, 0, 0, 173, 171, 1, 0, 0, 0, 174, 175, 5, 0, 0, 1, 175, 1, 1, 0, 0, 0, 176, 179, 3, 6, 3, 0, 177, 179, 3, 10, 5, 0, 178, 176, 1, 0, 0, 0, 178, 177, 1, 0, 0, 0, 179, 3, 1, 0, 0, 0, 180, 181, 3, 108, 54, 0, 181, 5, 1, 0, 0, 0, 182, 183, 5, 50, 0, 0, 183, 187, 3, 152, 76, 0, 184, 185, 5, 111, 0, 0, 185, 186, 5, 118, 0, 0, 186, 188, 3, 4, 2, 0, 187, 184, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 7, 1, 0, 0, 0, 189, 194, 3, 152, 76, 0, 190, 191, 5, 112, 0, 0, 191, 193, 3, 152, 76, 0, 192, 190, 1, 0, 0, 0, 193, 196, 1, 0, 0, 0, 194, 192, 1, 0, 0, 0, 194, 195, 1, 0, 0, 0, 195, 198, 1, 0, 0, 0, 196, 194, 1, 0, 0, 0, 197, 199, 5, 112, 0, 0, 198, 197, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, 9, 1, 0, 0, 0, 200, 210, 3, 12, 6, 0, 201, 210, 3, 14, 7, 0, 202, 210, 3, 16, 8, 0, 203, 210, 3, 18, 9, 0, 204, 210, 3, 20, 10, 0, 205, 210, 3, 22, 11, 0, 206, 210, 3, 24, 12, 0, 207, 210, 3, 26, 13, 0, 208, 210, 3, 28, 14, 0, 209, 200, 1, 0, 0, 0, 209, 201, 1, 0, 0, 0, 209, 202, 1, 0, 0, 0, 209, 203, 1, 0, 0, 0, 209, 204, 1, 0, 0, 0, 209, 205, 1, 0, 0, 0, 209, 206, 1, 0, 0, 0, 209, 207, 1, 0, 0, 0, 209, 208, 1, 0, 0, 0, 210, 11, 1, 0, 0, 0, 211, 213, 5, 70, 0, 0, 212, 214, 3, 4, 2, 0, 213, 212, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, 216, 1, 0, 0, 0, 215, 217, 5, 145, 0, 0, 216, 215, 1, 0, 0, 0, 216, 217, 1, 0, 0, 0, 217, 13, 1, 0, 0, 0, 218, 219, 5, 38, 0, 0, 219, 220, 5, 126, 0, 0, 220, 221, 3, 4, 2, 0, 221, 222, 5, 144, 0, 0, 222, 225, 3, 10, 5, 0, 223, 224, 5, 24, 0, 0, 224, 226, 3, 10, 5, 0, 225, 223, 1, 0, 0, 0, 225, 226, 1, 0, 0, 0, 226, 15, 1, 0, 0, 0, 227, 228, 5, 96, 0, 0, 228, 229, 5, 126, 0, 0, 229, 230, 3, 4, 2, 0, 230, 231, 5, 144, 0, 0, 231, 233, 3, 10, 5, 0, 232, 234, 5, 145, 0, 0, 233, 232, 1, 0, 0, 0, 233, 234, 1, 0, 0, 0, 234, 17, 1, 0, 0, 0, 235, 236, 5, 31, 0, 0, 236, 240, 5, 126, 0, 0, 237, 241, 3, 6, 3, 0, 238, 241, 3, 22, 11, 0, 239, 241, 3, 4, 2, 0, 240, 237, 1, 0, 0, 0, 240, 238, 1, 0, 0, 0, 240, 239, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 244, 5, 145, 0, 0, 243, 245, 3, 4, 2, 0, 244, 243, 1, 0, 0, 0, 244, 245, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, 246, 250, 5, 145, 0, 0, 247, 251, 3, 6, 3, 0, 248, 251, 3, 22, 11, 0, 249, 251, 3, 4, 2, 0, 250, 247, 1, 0, 0, 0, 250, 248, 1, 0, 0, 0, 250, 249, 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 252, 1, 0, 0, 0, 252, 253, 5, 144, 0, 0, 253, 255, 3, 10, 5, 0, 254, 256, 5, 145, 0, 0, 255, 254, 1, 0, 0, 0, 255, 256, 1, 0, 0, 0, 256, 19, 1, 0, 0, 0, 257, 258, 5, 29, 0, 0, 258, 259, 3, 152, 76, 0, 259, 261, 5, 126, 0, 0, 260, 262, 3, 8, 4, 0, 261, 260, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 264, 5, 144, 0, 0, 264, 265, 3, 28, 14, 0, 265, 21, 1, 0, 0, 0, 266, 267, 3, 4, 2, 0, 267, 268, 5, 111, 0, 0, 268, 269, 5, 118, 0, 0, 269, 270, 3, 4, 2, 0, 270, 23, 1, 0, 0, 0, 271, 273, 3, 4, 2, 0, 272, 274, 5, 145, 0, 0, 273, 272, 1, 0, 0, 0, 273, 274, 1, 0, 0, 0, 274, 25, 1, 0, 0, 0, 275, 276, 5, 145, 0, 0, 276, 27, 1, 0, 0, 0, 277, 281, 5, 124, 0, 0, 278, 280, 3, 2, 1, 0, 279, 278, 1, 0, 0, 0, 280, 283, 1, 0, 0, 0, 281, 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 284, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, 284, 285, 5, 142, 0, 0, 285, 29, 1, 0, 0, 0, 286, 287, 3, 4, 2, 0, 287, 288, 5, 111, 0, 0, 288, 289, 3, 4, 2, 0, 289, 31, 1, 0, 0, 0, 290, 295, 3, 30, 15, 0, 291, 292, 5, 112, 0, 0, 292, 294, 3, 30, 15, 0, 293, 291, 1, 0, 0, 0, 294, 297, 1, 0, 0, 0, 295, 293, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 299, 1, 0, 0, 0, 297, 295, 1, 0, 0, 0, 298, 300, 5, 112, 0, 0, 299, 298, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 33, 1, 0, 0, 0, 301, 305, 3, 36, 18, 0, 302, 305, 3, 40, 20, 0, 303, 305, 3, 116, 58, 0, 304, 301, 1, 0, 0, 0, 304, 302, 1, 0, 0, 0, 304, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 307, 5, 0, 0, 1, 307, 35, 1, 0, 0, 0, 308, 314, 3, 38, 19, 0, 309, 310, 5, 91, 0, 0, 310, 311, 5, 1, 0, 0, 311, 313, 3, 38, 19, 0, 312, 309, 1, 0, 0, 0, 313, 316, 1, 0, 0, 0, 314, 312, 1, 0, 0, 0, 314, 315, 1, 0, 0, 0, 315, 37, 1, 0, 0, 0, 316, 314, 1, 0, 0, 0, 317, 324, 3, 40, 20, 0, 318, 319, 5, 126, 0, 0, 319, 320, 3, 36, 18, 0, 320, 321, 5, 144, 0, 0, 321, 324, 1, 0, 0, 0, 322, 324, 3, 156, 78, 0, 323, 317, 1, 0, 0, 0, 323, 318, 1, 0, 0, 0, 323, 322, 1, 0, 0, 0, 324, 39, 1, 0, 0, 0, 325, 327, 3, 42, 21, 0, 326, 325, 1, 0, 0, 0, 326, 327, 1, 0, 0, 0, 327, 328, 1, 0, 0, 0, 328, 330, 5, 77, 0, 0, 329, 331, 5, 23, 0, 0, 330, 329, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 333, 1, 0, 0, 0, 332, 334, 3, 44, 22, 0, 333, 332, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, 335, 337, 3, 106, 53, 0, 336, 338, 3, 46, 23, 0, 337, 336, 1, 0, 0, 0, 337, 338, 1, 0, 0, 0, 338, 340, 1, 0, 0, 0, 339, 341, 3, 48, 24, 0, 340, 339, 1, 0, 0, 0, 340, 341, 1, 0, 0, 0, 341, 343, 1, 0, 0, 0, 342, 344, 3, 52, 26, 0, 343, 342, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 346, 1, 0, 0, 0, 345, 347, 3, 54, 27, 0, 346, 345, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, 347, 349, 1, 0, 0, 0, 348, 350, 3, 56, 28, 0, 349, 348, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 353, 1, 0, 0, 0, 351, 352, 5, 98, 0, 0, 352, 354, 7, 0, 0, 0, 353, 351, 1, 0, 0, 0, 353, 354, 1, 0, 0, 0, 354, 357, 1, 0, 0, 0, 355, 356, 5, 98, 0, 0, 356, 358, 5, 86, 0, 0, 357, 355, 1, 0, 0, 0, 357, 358, 1, 0, 0, 0, 358, 360, 1, 0, 0, 0, 359, 361, 3, 58, 29, 0, 360, 359, 1, 0, 0, 0, 360, 361, 1, 0, 0, 0, 361, 363, 1, 0, 0, 0, 362, 364, 3, 50, 25, 0, 363, 362, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, 366, 1, 0, 0, 0, 365, 367, 3, 60, 30, 0, 366, 365, 1, 0, 0, 0, 366, 367, 1, 0, 0, 0, 367, 370, 1, 0, 0, 0, 368, 371, 3, 64, 32, 0, 369, 371, 3, 66, 33, 0, 370, 368, 1, 0, 0, 0, 370, 369, 1, 0, 0, 0, 370, 371, 1, 0, 0, 0, 371, 373, 1, 0, 0, 0, 372, 374, 3, 68, 34, 0, 373, 372, 1, 0, 0, 0, 373, 374, 1, 0, 0, 0, 374, 41, 1, 0, 0, 0, 375, 376, 5, 98, 0, 0, 376, 377, 3, 120, 60, 0, 377, 43, 1, 0, 0, 0, 378, 379, 5, 85, 0, 0, 379, 382, 5, 104, 0, 0, 380, 381, 5, 98, 0, 0, 381, 383, 5, 82, 0, 0, 382, 380, 1, 0, 0, 0, 382, 383, 1, 0, 0, 0, 383, 45, 1, 0, 0, 0, 384, 385, 5, 32, 0, 0, 385, 386, 3, 70, 35, 0, 386, 47, 1, 0, 0, 0, 387, 389, 7, 1, 0, 0, 388, 387, 1, 0, 0, 0, 388, 389, 1, 0, 0, 0, 389, 390, 1, 0, 0, 0, 390, 391, 5, 5, 0, 0, 391, 392, 5, 45, 0, 0, 392, 393, 3, 106, 53, 0, 393, 49, 1, 0, 0, 0, 394, 395, 5, 97, 0, 0, 395, 396, 3, 152, 76, 0, 396, 397, 5, 6, 0, 0, 397, 398, 5, 126, 0, 0, 398, 399, 3, 90, 45, 0, 399, 409, 5, 144, 0, 0, 400, 401, 5, 112, 0, 0, 401, 402, 3, 152, 76, 0, 402, 403, 5, 6, 0, 0, 403, 404, 5, 126, 0, 0, 404, 405, 3, 90, 45, 0, 405, 406, 5, 144, 0, 0, 406, 408, 1, 0, 0, 0, 407, 400, 1, 0, 0, 0, 408, 411, 1, 0, 0, 0, 409, 407, 1, 0, 0, 0, 409, 410, 1, 0, 0, 0, 410, 51, 1, 0, 0, 0, 411, 409, 1, 0, 0, 0, 412, 413, 5, 67, 0, 0, 413, 414, 3, 108, 54, 0, 414, 53, 1, 0, 0, 0, 415, 416, 5, 95, 0, 0, 416, 417, 3, 108, 54, 0, 417, 55, 1, 0, 0, 0, 418, 419, 5, 34, 0, 0, 419, 426, 5, 11, 0, 0, 420, 421, 7, 0, 0, 0, 421, 422, 5, 126, 0, 0, 422, 423, 3, 106, 53, 0, 423, 424, 5, 144, 0, 0, 424, 427, 1, 0, 0, 0, 425, 427, 3, 106, 53, 0, 426, 420, 1, 0, 0, 0, 426, 425, 1, 0, 0, 0, 427, 57, 1, 0, 0, 0, 428, 429, 5, 35, 0, 0, 429, 430, 3, 108, 54, 0, 430, 59, 1, 0, 0, 0, 431, 432, 5, 62, 0, 0, 432, 433, 5, 11, 0, 0, 433, 434, 3, 80, 40, 0, 434, 61, 1, 0, 0, 0, 435, 436, 5, 62, 0, 0, 436, 437, 5, 11, 0, 0, 437, 438, 3, 106, 53, 0, 438, 63, 1, 0, 0, 0, 439, 440, 5, 52, 0, 0, 440, 443, 3, 108, 54, 0, 441, 442, 5, 112, 0, 0, 442, 444, 3, 108, 54, 0, 443, 441, 1, 0, 0, 0, 443, 444, 1, 0, 0, 0, 444, 449, 1, 0, 0, 0, 445, 446, 5, 98, 0, 0, 446, 450, 5, 82, 0, 0, 447, 448, 5, 11, 0, 0, 448, 450, 3, 106, 53, 0, 449, 445, 1, 0, 0, 0, 449, 447, 1, 0, 0, 0, 449, 450, 1, 0, 0, 0, 450, 469, 1, 0, 0, 0, 451, 452, 5, 52, 0, 0, 452, 455, 3, 108, 54, 0, 453, 454, 5, 98, 0, 0, 454, 456, 5, 82, 0, 0, 455, 453, 1, 0, 0, 0, 455, 456, 1, 0, 0, 0, 456, 457, 1, 0, 0, 0, 457, 458, 5, 59, 0, 0, 458, 459, 3, 108, 54, 0, 459, 469, 1, 0, 0, 0, 460, 461, 5, 52, 0, 0, 461, 462, 3, 108, 54, 0, 462, 463, 5, 59, 0, 0, 463, 466, 3, 108, 54, 0, 464, 465, 5, 11, 0, 0, 465, 467, 3, 106, 53, 0, 466, 464, 1, 0, 0, 0, 466, 467, 1, 0, 0, 0, 467, 469, 1, 0, 0, 0, 468, 439, 1, 0, 0, 0, 468, 451, 1, 0, 0, 0, 468, 460, 1, 0, 0, 0, 469, 65, 1, 0, 0, 0, 470, 471, 5, 59, 0, 0, 471, 472, 3, 108, 54, 0, 472, 67, 1, 0, 0, 0, 473, 474, 5, 79, 0, 0, 474, 475, 3, 86, 43, 0, 475, 69, 1, 0, 0, 0, 476, 477, 6, 35, -1, 0, 477, 479, 3, 128, 64, 0, 478, 480, 5, 27, 0, 0, 479, 478, 1, 0, 0, 0, 479, 480, 1, 0, 0, 0, 480, 482, 1, 0, 0, 0, 481, 483, 3, 78, 39, 0, 482, 481, 1, 0, 0, 0, 482, 483, 1, 0, 0, 0, 483, 489, 1, 0, 0, 0, 484, 485, 5, 126, 0, 0, 485, 486, 3, 70, 35, 0, 486, 487, 5, 144, 0, 0, 487, 489, 1, 0, 0, 0, 488, 476, 1, 0, 0, 0, 488, 484, 1, 0, 0, 0, 489, 504, 1, 0, 0, 0, 490, 491, 10, 3, 0, 0, 491, 492, 3, 74, 37, 0, 492, 493, 3, 70, 35, 4, 493, 503, 1, 0, 0, 0, 494, 496, 10, 4, 0, 0, 495, 497, 3, 72, 36, 0, 496, 495, 1, 0, 0, 0, 496, 497, 1, 0, 0, 0, 497, 498, 1, 0, 0, 0, 498, 499, 5, 45, 0, 0, 499, 500, 3, 70, 35, 0, 500, 501, 3, 76, 38, 0, 501, 503, 1, 0, 0, 0, 502, 490, 1, 0, 0, 0, 502, 494, 1, 0, 0, 0, 503, 506, 1, 0, 0, 0, 504, 502, 1, 0, 0, 0, 504, 505, 1, 0, 0, 0, 505, 71, 1, 0, 0, 0, 506, 504, 1, 0, 0, 0, 507, 509, 7, 2, 0, 0, 508, 507, 1, 0, 0, 0, 508, 509, 1, 0, 0, 0, 509, 510, 1, 0, 0, 0, 510, 517, 5, 42, 0, 0, 511, 513, 5, 42, 0, 0, 512, 514, 7, 2, 0, 0, 513, 512, 1, 0, 0, 0, 513, 514, 1, 0, 0, 0, 514, 517, 1, 0, 0, 0, 515, 517, 7, 2, 0, 0, 516, 508, 1, 0, 0, 0, 516, 511, 1, 0, 0, 0, 516, 515, 1, 0, 0, 0, 517, 551, 1, 0, 0, 0, 518, 520, 7, 3, 0, 0, 519, 518, 1, 0, 0, 0, 519, 520, 1, 0, 0, 0, 520, 521, 1, 0, 0, 0, 521, 523, 7, 4, 0, 0, 522, 524, 5, 63, 0, 0, 523, 522, 1, 0, 0, 0, 523, 524, 1, 0, 0, 0, 524, 533, 1, 0, 0, 0, 525, 527, 7, 4, 0, 0, 526, 528, 5, 63, 0, 0, 527, 526, 1, 0, 0, 0, 527, 528, 1, 0, 0, 0, 528, 530, 1, 0, 0, 0, 529, 531, 7, 3, 0, 0, 530, 529, 1, 0, 0, 0, 530, 531, 1, 0, 0, 0, 531, 533, 1, 0, 0, 0, 532, 519, 1, 0, 0, 0, 532, 525, 1, 0, 0, 0, 533, 551, 1, 0, 0, 0, 534, 536, 7, 5, 0, 0, 535, 534, 1, 0, 0, 0, 535, 536, 1, 0, 0, 0, 536, 537, 1, 0, 0, 0, 537, 539, 5, 33, 0, 0, 538, 540, 5, 63, 0, 0, 539, 538, 1, 0, 0, 0, 539, 540, 1, 0, 0, 0, 540, 549, 1, 0, 0, 0, 541, 543, 5, 33, 0, 0, 542, 544, 5, 63, 0, 0, 543, 542, 1, 0, 0, 0, 543, 544, 1, 0, 0, 0, 544, 546, 1, 0, 0, 0, 545, 547, 7, 5, 0, 0, 546, 545, 1, 0, 0, 0, 546, 547, 1, 0, 0, 0, 547, 549, 1, 0, 0, 0, 548, 535, 1, 0, 0, 0, 548, 541, 1, 0, 0, 0, 549, 551, 1, 0, 0, 0, 550, 516, 1, 0, 0, 0, 550, 532, 1, 0, 0, 0, 550, 548, 1, 0, 0, 0, 551, 73, 1, 0, 0, 0, 552, 553, 5, 16, 0, 0, 553, 556, 5, 45, 0, 0, 554, 556, 5, 112, 0, 0, 555, 552, 1, 0, 0, 0, 555, 554, 1, 0, 0, 0, 556, 75, 1, 0, 0, 0, 557, 558, 5, 60, 0, 0, 558, 567, 3, 106, 53, 0, 559, 560, 5, 92, 0, 0, 560, 561, 5, 126, 0, 0, 561, 562, 3, 106, 53, 0, 562, 563, 5, 144, 0, 0, 563, 567, 1, 0, 0, 0, 564, 565, 5, 92, 0, 0, 565, 567, 3, 106, 53, 0, 566, 557, 1, 0, 0, 0, 566, 559, 1, 0, 0, 0, 566, 564, 1, 0, 0, 0, 567, 77, 1, 0, 0, 0, 568, 569, 5, 75, 0, 0, 569, 572, 3, 84, 42, 0, 570, 571, 5, 59, 0, 0, 571, 573, 3, 84, 42, 0, 572, 570, 1, 0, 0, 0, 572, 573, 1, 0, 0, 0, 573, 79, 1, 0, 0, 0, 574, 579, 3, 82, 41, 0, 575, 576, 5, 112, 0, 0, 576, 578, 3, 82, 41, 0, 577, 575, 1, 0, 0, 0, 578, 581, 1, 0, 0, 0, 579, 577, 1, 0, 0, 0, 579, 580, 1, 0, 0, 0, 580, 81, 1, 0, 0, 0, 581, 579, 1, 0, 0, 0, 582, 584, 3, 108, 54, 0, 583, 585, 7, 6, 0, 0, 584, 583, 1, 0, 0, 0, 584, 585, 1, 0, 0, 0, 585, 588, 1, 0, 0, 0, 586, 587, 5, 58, 0, 0, 587, 589, 7, 7, 0, 0, 588, 586, 1, 0, 0, 0, 588, 589, 1, 0, 0, 0, 589, 592, 1, 0, 0, 0, 590, 591, 5, 15, 0, 0, 591, 593, 5, 106, 0, 0, 592, 590, 1, 0, 0, 0, 592, 593, 1, 0, 0, 0, 593, 83, 1, 0, 0, 0, 594, 601, 3, 156, 78, 0, 595, 598, 3, 140, 70, 0, 596, 597, 5, 146, 0, 0, 597, 599, 3, 140, 70, 0, 598, 596, 1, 0, 0, 0, 598, 599, 1, 0, 0, 0, 599, 601, 1, 0, 0, 0, 600, 594, 1, 0, 0, 0, 600, 595, 1, 0, 0, 0, 601, 85, 1, 0, 0, 0, 602, 607, 3, 88, 44, 0, 603, 604, 5, 112, 0, 0, 604, 606, 3, 88, 44, 0, 605, 603, 1, 0, 0, 0, 606, 609, 1, 0, 0, 0, 607, 605, 1, 0, 0, 0, 607, 608, 1, 0, 0, 0, 608, 87, 1, 0, 0, 0, 609, 607, 1, 0, 0, 0, 610, 611, 3, 152, 76, 0, 611, 612, 5, 118, 0, 0, 612, 613, 3, 142, 71, 0, 613, 89, 1, 0, 0, 0, 614, 616, 3, 92, 46, 0, 615, 614, 1, 0, 0, 0, 615, 616, 1, 0, 0, 0, 616, 618, 1, 0, 0, 0, 617, 619, 3, 94, 47, 0, 618, 617, 1, 0, 0, 0, 618, 619, 1, 0, 0, 0, 619, 621, 1, 0, 0, 0, 620, 622, 3, 96, 48, 0, 621, 620, 1, 0, 0, 0, 621, 622, 1, 0, 0, 0, 622, 91, 1, 0, 0, 0, 623, 624, 5, 65, 0, 0, 624, 625, 5, 11, 0, 0, 625, 626, 3, 106, 53, 0, 626, 93, 1, 0, 0, 0, 627, 628, 5, 62, 0, 0, 628, 629, 5, 11, 0, 0, 629, 630, 3, 80, 40, 0, 630, 95, 1, 0, 0, 0, 631, 632, 7, 8, 0, 0, 632, 633, 3, 98, 49, 0, 633, 97, 1, 0, 0, 0, 634, 641, 3, 100, 50, 0, 635, 636, 5, 9, 0, 0, 636, 637, 3, 100, 50, 0, 637, 638, 5, 2, 0, 0, 638, 639, 3, 100, 50, 0, 639, 641, 1, 0, 0, 0, 640, 634, 1, 0, 0, 0, 640, 635, 1, 0, 0, 0, 641, 99, 1, 0, 0, 0, 642, 643, 5, 18, 0, 0, 643, 655, 5, 73, 0, 0, 644, 645, 5, 90, 0, 0, 645, 655, 5, 66, 0, 0, 646, 647, 5, 90, 0, 0, 647, 655, 5, 30, 0, 0, 648, 649, 3, 140, 70, 0, 649, 650, 5, 66, 0, 0, 650, 655, 1, 0, 0, 0, 651, 652, 3, 140, 70, 0, 652, 653, 5, 30, 0, 0, 653, 655, 1, 0, 0, 0, 654, 642, 1, 0, 0, 0, 654, 644, 1, 0, 0, 0, 654, 646, 1, 0, 0, 0, 654, 648, 1, 0, 0, 0, 654, 651, 1, 0, 0, 0, 655, 101, 1, 0, 0, 0, 656, 657, 3, 108, 54, 0, 657, 658, 5, 0, 0, 1, 658, 103, 1, 0, 0, 0, 659, 716, 3, 152, 76, 0, 660, 661, 3, 152, 76, 0, 661, 662, 5, 126, 0, 0, 662, 663, 3, 152, 76, 0, 663, 670, 3, 104, 52, 0, 664, 665, 5, 112, 0, 0, 665, 666, 3, 152, 76, 0, 666, 667, 3, 104, 52, 0, 667, 669, 1, 0, 0, 0, 668, 664, 1, 0, 0, 0, 669, 672, 1, 0, 0, 0, 670, 668, 1, 0, 0, 0, 670, 671, 1, 0, 0, 0, 671, 674, 1, 0, 0, 0, 672, 670, 1, 0, 0, 0, 673, 675, 5, 112, 0, 0, 674, 673, 1, 0, 0, 0, 674, 675, 1, 0, 0, 0, 675, 676, 1, 0, 0, 0, 676, 677, 5, 144, 0, 0, 677, 716, 1, 0, 0, 0, 678, 679, 3, 152, 76, 0, 679, 680, 5, 126, 0, 0, 680, 685, 3, 154, 77, 0, 681, 682, 5, 112, 0, 0, 682, 684, 3, 154, 77, 0, 683, 681, 1, 0, 0, 0, 684, 687, 1, 0, 0, 0, 685, 683, 1, 0, 0, 0, 685, 686, 1, 0, 0, 0, 686, 689, 1, 0, 0, 0, 687, 685, 1, 0, 0, 0, 688, 690, 5, 112, 0, 0, 689, 688, 1, 0, 0, 0, 689, 690, 1, 0, 0, 0, 690, 691, 1, 0, 0, 0, 691, 692, 5, 144, 0, 0, 692, 716, 1, 0, 0, 0, 693, 694, 3, 152, 76, 0, 694, 695, 5, 126, 0, 0, 695, 700, 3, 104, 52, 0, 696, 697, 5, 112, 0, 0, 697, 699, 3, 104, 52, 0, 698, 696, 1, 0, 0, 0, 699, 702, 1, 0, 0, 0, 700, 698, 1, 0, 0, 0, 700, 701, 1, 0, 0, 0, 701, 704, 1, 0, 0, 0, 702, 700, 1, 0, 0, 0, 703, 705, 5, 112, 0, 0, 704, 703, 1, 0, 0, 0, 704, 705, 1, 0, 0, 0, 705, 706, 1, 0, 0, 0, 706, 707, 5, 144, 0, 0, 707, 716, 1, 0, 0, 0, 708, 709, 3, 152, 76, 0, 709, 711, 5, 126, 0, 0, 710, 712, 3, 106, 53, 0, 711, 710, 1, 0, 0, 0, 711, 712, 1, 0, 0, 0, 712, 713, 1, 0, 0, 0, 713, 714, 5, 144, 0, 0, 714, 716, 1, 0, 0, 0, 715, 659, 1, 0, 0, 0, 715, 660, 1, 0, 0, 0, 715, 678, 1, 0, 0, 0, 715, 693, 1, 0, 0, 0, 715, 708, 1, 0, 0, 0, 716, 105, 1, 0, 0, 0, 717, 722, 3, 108, 54, 0, 718, 719, 5, 112, 0, 0, 719, 721, 3, 108, 54, 0, 720, 718, 1, 0, 0, 0, 721, 724, 1, 0, 0, 0, 722, 720, 1, 0, 0, 0, 722, 723, 1, 0, 0, 0, 723, 726, 1, 0, 0, 0, 724, 722, 1, 0, 0, 0, 725, 727, 5, 112, 0, 0, 726, 725, 1, 0, 0, 0, 726, 727, 1, 0, 0, 0, 727, 107, 1, 0, 0, 0, 728, 729, 6, 54, -1, 0, 729, 731, 5, 12, 0, 0, 730, 732, 3, 108, 54, 0, 731, 730, 1, 0, 0, 0, 731, 732, 1, 0, 0, 0, 732, 738, 1, 0, 0, 0, 733, 734, 5, 94, 0, 0, 734, 735, 3, 108, 54, 0, 735, 736, 5, 81, 0, 0, 736, 737, 3, 108, 54, 0, 737, 739, 1, 0, 0, 0, 738, 733, 1, 0, 0, 0, 739, 740, 1, 0, 0, 0, 740, 738, 1, 0, 0, 0, 740, 741, 1, 0, 0, 0, 741, 744, 1, 0, 0, 0, 742, 743, 5, 24, 0, 0, 743, 745, 3, 108, 54, 0, 744, 742, 1, 0, 0, 0, 744, 745, 1, 0, 0, 0, 745, 746, 1, 0, 0, 0, 746, 747, 5, 25, 0, 0, 747, 878, 1, 0, 0, 0, 748, 749, 5, 13, 0, 0, 749, 750, 5, 126, 0, 0, 750, 751, 3, 108, 54, 0, 751, 752, 5, 6, 0, 0, 752, 753, 3, 104, 52, 0, 753, 754, 5, 144, 0, 0, 754, 878, 1, 0, 0, 0, 755, 756, 5, 19, 0, 0, 756, 878, 5, 106, 0, 0, 757, 758, 5, 43, 0, 0, 758, 759, 3, 108, 54, 0, 759, 760, 3, 144, 72, 0, 760, 878, 1, 0, 0, 0, 761, 762, 5, 80, 0, 0, 762, 763, 5, 126, 0, 0, 763, 764, 3, 108, 54, 0, 764, 765, 5, 32, 0, 0, 765, 768, 3, 108, 54, 0, 766, 767, 5, 31, 0, 0, 767, 769, 3, 108, 54, 0, 768, 766, 1, 0, 0, 0, 768, 769, 1, 0, 0, 0, 769, 770, 1, 0, 0, 0, 770, 771, 5, 144, 0, 0, 771, 878, 1, 0, 0, 0, 772, 773, 5, 83, 0, 0, 773, 878, 5, 106, 0, 0, 774, 775, 5, 88, 0, 0, 775, 776, 5, 126, 0, 0, 776, 777, 7, 9, 0, 0, 777, 778, 3, 158, 79, 0, 778, 779, 5, 32, 0, 0, 779, 780, 3, 108, 54, 0, 780, 781, 5, 144, 0, 0, 781, 878, 1, 0, 0, 0, 782, 783, 3, 152, 76, 0, 783, 785, 5, 126, 0, 0, 784, 786, 3, 106, 53, 0, 785, 784, 1, 0, 0, 0, 785, 786, 1, 0, 0, 0, 786, 787, 1, 0, 0, 0, 787, 788, 5, 144, 0, 0, 788, 797, 1, 0, 0, 0, 789, 791, 5, 126, 0, 0, 790, 792, 5, 23, 0, 0, 791, 790, 1, 0, 0, 0, 791, 792, 1, 0, 0, 0, 792, 794, 1, 0, 0, 0, 793, 795, 3, 110, 55, 0, 794, 793, 1, 0, 0, 0, 794, 795, 1, 0, 0, 0, 795, 796, 1, 0, 0, 0, 796, 798, 5, 144, 0, 0, 797, 789, 1, 0, 0, 0, 797, 798, 1, 0, 0, 0, 798, 799, 1, 0, 0, 0, 799, 800, 5, 64, 0, 0, 800, 801, 5, 126, 0, 0, 801, 802, 3, 90, 45, 0, 802, 803, 5, 144, 0, 0, 803, 878, 1, 0, 0, 0, 804, 805, 3, 152, 76, 0, 805, 807, 5, 126, 0, 0, 806, 808, 3, 106, 53, 0, 807, 806, 1, 0, 0, 0, 807, 808, 1, 0, 0, 0, 808, 809, 1, 0, 0, 0, 809, 810, 5, 144, 0, 0, 810, 819, 1, 0, 0, 0, 811, 813, 5, 126, 0, 0, 812, 814, 5, 23, 0, 0, 813, 812, 1, 0, 0, 0, 813, 814, 1, 0, 0, 0, 814, 816, 1, 0, 0, 0, 815, 817, 3, 110, 55, 0, 816, 815, 1, 0, 0, 0, 816, 817, 1, 0, 0, 0, 817, 818, 1, 0, 0, 0, 818, 820, 5, 144, 0, 0, 819, 811, 1, 0, 0, 0, 819, 820, 1, 0, 0, 0, 820, 821, 1, 0, 0, 0, 821, 822, 5, 64, 0, 0, 822, 823, 3, 152, 76, 0, 823, 878, 1, 0, 0, 0, 824, 830, 3, 152, 76, 0, 825, 827, 5, 126, 0, 0, 826, 828, 3, 106, 53, 0, 827, 826, 1, 0, 0, 0, 827, 828, 1, 0, 0, 0, 828, 829, 1, 0, 0, 0, 829, 831, 5, 144, 0, 0, 830, 825, 1, 0, 0, 0, 830, 831, 1, 0, 0, 0, 831, 832, 1, 0, 0, 0, 832, 834, 5, 126, 0, 0, 833, 835, 5, 23, 0, 0, 834, 833, 1, 0, 0, 0, 834, 835, 1, 0, 0, 0, 835, 837, 1, 0, 0, 0, 836, 838, 3, 110, 55, 0, 837, 836, 1, 0, 0, 0, 837, 838, 1, 0, 0, 0, 838, 839, 1, 0, 0, 0, 839, 840, 5, 144, 0, 0, 840, 878, 1, 0, 0, 0, 841, 878, 3, 116, 58, 0, 842, 878, 3, 160, 80, 0, 843, 878, 3, 142, 71, 0, 844, 845, 5, 114, 0, 0, 845, 878, 3, 108, 54, 19, 846, 847, 5, 56, 0, 0, 847, 878, 3, 108, 54, 13, 848, 849, 3, 132, 66, 0, 849, 850, 5, 116, 0, 0, 850, 852, 1, 0, 0, 0, 851, 848, 1, 0, 0, 0, 851, 852, 1, 0, 0, 0, 852, 853, 1, 0, 0, 0, 853, 878, 5, 108, 0, 0, 854, 855, 5, 126, 0, 0, 855, 856, 3, 36, 18, 0, 856, 857, 5, 144, 0, 0, 857, 878, 1, 0, 0, 0, 858, 859, 5, 126, 0, 0, 859, 860, 3, 108, 54, 0, 860, 861, 5, 144, 0, 0, 861, 878, 1, 0, 0, 0, 862, 863, 5, 126, 0, 0, 863, 864, 3, 106, 53, 0, 864, 865, 5, 144, 0, 0, 865, 878, 1, 0, 0, 0, 866, 868, 5, 125, 0, 0, 867, 869, 3, 106, 53, 0, 868, 867, 1, 0, 0, 0, 868, 869, 1, 0, 0, 0, 869, 870, 1, 0, 0, 0, 870, 878, 5, 143, 0, 0, 871, 873, 5, 124, 0, 0, 872, 874, 3, 32, 16, 0, 873, 872, 1, 0, 0, 0, 873, 874, 1, 0, 0, 0, 874, 875, 1, 0, 0, 0, 875, 878, 5, 142, 0, 0, 876, 878, 3, 124, 62, 0, 877, 728, 1, 0, 0, 0, 877, 748, 1, 0, 0, 0, 877, 755, 1, 0, 0, 0, 877, 757, 1, 0, 0, 0, 877, 761, 1, 0, 0, 0, 877, 772, 1, 0, 0, 0, 877, 774, 1, 0, 0, 0, 877, 782, 1, 0, 0, 0, 877, 804, 1, 0, 0, 0, 877, 824, 1, 0, 0, 0, 877, 841, 1, 0, 0, 0, 877, 842, 1, 0, 0, 0, 877, 843, 1, 0, 0, 0, 877, 844, 1, 0, 0, 0, 877, 846, 1, 0, 0, 0, 877, 851, 1, 0, 0, 0, 877, 854, 1, 0, 0, 0, 877, 858, 1, 0, 0, 0, 877, 862, 1, 0, 0, 0, 877, 866, 1, 0, 0, 0, 877, 871, 1, 0, 0, 0, 877, 876, 1, 0, 0, 0, 878, 971, 1, 0, 0, 0, 879, 883, 10, 18, 0, 0, 880, 884, 5, 108, 0, 0, 881, 884, 5, 146, 0, 0, 882, 884, 5, 133, 0, 0, 883, 880, 1, 0, 0, 0, 883, 881, 1, 0, 0, 0, 883, 882, 1, 0, 0, 0, 884, 885, 1, 0, 0, 0, 885, 970, 3, 108, 54, 19, 886, 890, 10, 17, 0, 0, 887, 891, 5, 134, 0, 0, 888, 891, 5, 114, 0, 0, 889, 891, 5, 113, 0, 0, 890, 887, 1, 0, 0, 0, 890, 888, 1, 0, 0, 0, 890, 889, 1, 0, 0, 0, 891, 892, 1, 0, 0, 0, 892, 970, 3, 108, 54, 18, 893, 918, 10, 16, 0, 0, 894, 919, 5, 117, 0, 0, 895, 919, 5, 118, 0, 0, 896, 919, 5, 129, 0, 0, 897, 919, 5, 127, 0, 0, 898, 919, 5, 128, 0, 0, 899, 919, 5, 119, 0, 0, 900, 919, 5, 120, 0, 0, 901, 903, 5, 56, 0, 0, 902, 901, 1, 0, 0, 0, 902, 903, 1, 0, 0, 0, 903, 904, 1, 0, 0, 0, 904, 906, 5, 40, 0, 0, 905, 907, 5, 14, 0, 0, 906, 905, 1, 0, 0, 0, 906, 907, 1, 0, 0, 0, 907, 919, 1, 0, 0, 0, 908, 910, 5, 56, 0, 0, 909, 908, 1, 0, 0, 0, 909, 910, 1, 0, 0, 0, 910, 911, 1, 0, 0, 0, 911, 919, 7, 10, 0, 0, 912, 919, 5, 140, 0, 0, 913, 919, 5, 141, 0, 0, 914, 919, 5, 131, 0, 0, 915, 919, 5, 122, 0, 0, 916, 919, 5, 123, 0, 0, 917, 919, 5, 130, 0, 0, 918, 894, 1, 0, 0, 0, 918, 895, 1, 0, 0, 0, 918, 896, 1, 0, 0, 0, 918, 897, 1, 0, 0, 0, 918, 898, 1, 0, 0, 0, 918, 899, 1, 0, 0, 0, 918, 900, 1, 0, 0, 0, 918, 902, 1, 0, 0, 0, 918, 909, 1, 0, 0, 0, 918, 912, 1, 0, 0, 0, 918, 913, 1, 0, 0, 0, 918, 914, 1, 0, 0, 0, 918, 915, 1, 0, 0, 0, 918, 916, 1, 0, 0, 0, 918, 917, 1, 0, 0, 0, 919, 920, 1, 0, 0, 0, 920, 970, 3, 108, 54, 17, 921, 922, 10, 14, 0, 0, 922, 923, 5, 132, 0, 0, 923, 970, 3, 108, 54, 15, 924, 925, 10, 12, 0, 0, 925, 926, 5, 2, 0, 0, 926, 970, 3, 108, 54, 13, 927, 928, 10, 11, 0, 0, 928, 929, 5, 61, 0, 0, 929, 970, 3, 108, 54, 12, 930, 932, 10, 10, 0, 0, 931, 933, 5, 56, 0, 0, 932, 931, 1, 0, 0, 0, 932, 933, 1, 0, 0, 0, 933, 934, 1, 0, 0, 0, 934, 935, 5, 9, 0, 0, 935, 936, 3, 108, 54, 0, 936, 937, 5, 2, 0, 0, 937, 938, 3, 108, 54, 11, 938, 970, 1, 0, 0, 0, 939, 940, 10, 9, 0, 0, 940, 941, 5, 135, 0, 0, 941, 942, 3, 108, 54, 0, 942, 943, 5, 111, 0, 0, 943, 944, 3, 108, 54, 9, 944, 970, 1, 0, 0, 0, 945, 946, 10, 22, 0, 0, 946, 947, 5, 125, 0, 0, 947, 948, 3, 108, 54, 0, 948, 949, 5, 143, 0, 0, 949, 970, 1, 0, 0, 0, 950, 951, 10, 21, 0, 0, 951, 952, 5, 116, 0, 0, 952, 970, 5, 104, 0, 0, 953, 954, 10, 20, 0, 0, 954, 955, 5, 116, 0, 0, 955, 970, 3, 152, 76, 0, 956, 957, 10, 15, 0, 0, 957, 959, 5, 44, 0, 0, 958, 960, 5, 56, 0, 0, 959, 958, 1, 0, 0, 0, 959, 960, 1, 0, 0, 0, 960, 961, 1, 0, 0, 0, 961, 970, 5, 57, 0, 0, 962, 967, 10, 8, 0, 0, 963, 964, 5, 6, 0, 0, 964, 968, 3, 152, 76, 0, 965, 966, 5, 6, 0, 0, 966, 968, 5, 106, 0, 0, 967, 963, 1, 0, 0, 0, 967, 965, 1, 0, 0, 0, 968, 970, 1, 0, 0, 0, 969, 879, 1, 0, 0, 0, 969, 886, 1, 0, 0, 0, 969, 893, 1, 0, 0, 0, 969, 921, 1, 0, 0, 0, 969, 924, 1, 0, 0, 0, 969, 927, 1, 0, 0, 0, 969, 930, 1, 0, 0, 0, 969, 939, 1, 0, 0, 0, 969, 945, 1, 0, 0, 0, 969, 950, 1, 0, 0, 0, 969, 953, 1, 0, 0, 0, 969, 956, 1, 0, 0, 0, 969, 962, 1, 0, 0, 0, 970, 973, 1, 0, 0, 0, 971, 969, 1, 0, 0, 0, 971, 972, 1, 0, 0, 0, 972, 109, 1, 0, 0, 0, 973, 971, 1, 0, 0, 0, 974, 979, 3, 112, 56, 0, 975, 976, 5, 112, 0, 0, 976, 978, 3, 112, 56, 0, 977, 975, 1, 0, 0, 0, 978, 981, 1, 0, 0, 0, 979, 977, 1, 0, 0, 0, 979, 980, 1, 0, 0, 0, 980, 983, 1, 0, 0, 0, 981, 979, 1, 0, 0, 0, 982, 984, 5, 112, 0, 0, 983, 982, 1, 0, 0, 0, 983, 984, 1, 0, 0, 0, 984, 111, 1, 0, 0, 0, 985, 988, 3, 114, 57, 0, 986, 988, 3, 108, 54, 0, 987, 985, 1, 0, 0, 0, 987, 986, 1, 0, 0, 0, 988, 113, 1, 0, 0, 0, 989, 990, 5, 126, 0, 0, 990, 995, 3, 152, 76, 0, 991, 992, 5, 112, 0, 0, 992, 994, 3, 152, 76, 0, 993, 991, 1, 0, 0, 0, 994, 997, 1, 0, 0, 0, 995, 993, 1, 0, 0, 0, 995, 996, 1, 0, 0, 0, 996, 999, 1, 0, 0, 0, 997, 995, 1, 0, 0, 0, 998, 1000, 5, 112, 0, 0, 999, 998, 1, 0, 0, 0, 999, 1000, 1, 0, 0, 0, 1000, 1001, 1, 0, 0, 0, 1001, 1002, 5, 144, 0, 0, 1002, 1015, 1, 0, 0, 0, 1003, 1008, 3, 152, 76, 0, 1004, 1005, 5, 112, 0, 0, 1005, 1007, 3, 152, 76, 0, 1006, 1004, 1, 0, 0, 0, 1007, 1010, 1, 0, 0, 0, 1008, 1006, 1, 0, 0, 0, 1008, 1009, 1, 0, 0, 0, 1009, 1012, 1, 0, 0, 0, 1010, 1008, 1, 0, 0, 0, 1011, 1013, 5, 112, 0, 0, 1012, 1011, 1, 0, 0, 0, 1012, 1013, 1, 0, 0, 0, 1013, 1015, 1, 0, 0, 0, 1014, 989, 1, 0, 0, 0, 1014, 1003, 1, 0, 0, 0, 1015, 1016, 1, 0, 0, 0, 1016, 1017, 5, 107, 0, 0, 1017, 1018, 3, 108, 54, 0, 1018, 115, 1, 0, 0, 0, 1019, 1020, 5, 128, 0, 0, 1020, 1024, 3, 152, 76, 0, 1021, 1023, 3, 118, 59, 0, 1022, 1021, 1, 0, 0, 0, 1023, 1026, 1, 0, 0, 0, 1024, 1022, 1, 0, 0, 0, 1024, 1025, 1, 0, 0, 0, 1025, 1027, 1, 0, 0, 0, 1026, 1024, 1, 0, 0, 0, 1027, 1028, 5, 146, 0, 0, 1028, 1029, 5, 120, 0, 0, 1029, 1048, 1, 0, 0, 0, 1030, 1031, 5, 128, 0, 0, 1031, 1035, 3, 152, 76, 0, 1032, 1034, 3, 118, 59, 0, 1033, 1032, 1, 0, 0, 0, 1034, 1037, 1, 0, 0, 0, 1035, 1033, 1, 0, 0, 0, 1035, 1036, 1, 0, 0, 0, 1036, 1038, 1, 0, 0, 0, 1037, 1035, 1, 0, 0, 0, 1038, 1040, 5, 120, 0, 0, 1039, 1041, 3, 116, 58, 0, 1040, 1039, 1, 0, 0, 0, 1040, 1041, 1, 0, 0, 0, 1041, 1042, 1, 0, 0, 0, 1042, 1043, 5, 128, 0, 0, 1043, 1044, 5, 146, 0, 0, 1044, 1045, 3, 152, 76, 0, 1045, 1046, 5, 120, 0, 0, 1046, 1048, 1, 0, 0, 0, 1047, 1019, 1, 0, 0, 0, 1047, 1030, 1, 0, 0, 0, 1048, 117, 1, 0, 0, 0, 1049, 1050, 3, 152, 76, 0, 1050, 1051, 5, 118, 0, 0, 1051, 1052, 3, 158, 79, 0, 1052, 1061, 1, 0, 0, 0, 1053, 1054, 3, 152, 76, 0, 1054, 1055, 5, 118, 0, 0, 1055, 1056, 5, 124, 0, 0, 1056, 1057, 3, 108, 54, 0, 1057, 1058, 5, 142, 0, 0, 1058, 1061, 1, 0, 0, 0, 1059, 1061, 3, 152, 76, 0, 1060, 1049, 1, 0, 0, 0, 1060, 1053, 1, 0, 0, 0, 1060, 1059, 1, 0, 0, 0, 1061, 119, 1, 0, 0, 0, 1062, 1067, 3, 122, 61, 0, 1063, 1064, 5, 112, 0, 0, 1064, 1066, 3, 122, 61, 0, 1065, 1063, 1, 0, 0, 0, 1066, 1069, 1, 0, 0, 0, 1067, 1065, 1, 0, 0, 0, 1067, 1068, 1, 0, 0, 0, 1068, 1071, 1, 0, 0, 0, 1069, 1067, 1, 0, 0, 0, 1070, 1072, 5, 112, 0, 0, 1071, 1070, 1, 0, 0, 0, 1071, 1072, 1, 0, 0, 0, 1072, 121, 1, 0, 0, 0, 1073, 1074, 3, 152, 76, 0, 1074, 1075, 5, 6, 0, 0, 1075, 1076, 5, 126, 0, 0, 1076, 1077, 3, 36, 18, 0, 1077, 1078, 5, 144, 0, 0, 1078, 1084, 1, 0, 0, 0, 1079, 1080, 3, 108, 54, 0, 1080, 1081, 5, 6, 0, 0, 1081, 1082, 3, 152, 76, 0, 1082, 1084, 1, 0, 0, 0, 1083, 1073, 1, 0, 0, 0, 1083, 1079, 1, 0, 0, 0, 1084, 123, 1, 0, 0, 0, 1085, 1093, 3, 156, 78, 0, 1086, 1087, 3, 132, 66, 0, 1087, 1088, 5, 116, 0, 0, 1088, 1090, 1, 0, 0, 0, 1089, 1086, 1, 0, 0, 0, 1089, 1090, 1, 0, 0, 0, 1090, 1091, 1, 0, 0, 0, 1091, 1093, 3, 126, 63, 0, 1092, 1085, 1, 0, 0, 0, 1092, 1089, 1, 0, 0, 0, 1093, 125, 1, 0, 0, 0, 1094, 1099, 3, 152, 76, 0, 1095, 1096, 5, 116, 0, 0, 1096, 1098, 3, 152, 76, 0, 1097, 1095, 1, 0, 0, 0, 1098, 1101, 1, 0, 0, 0, 1099, 1097, 1, 0, 0, 0, 1099, 1100, 1, 0, 0, 0, 1100, 127, 1, 0, 0, 0, 1101, 1099, 1, 0, 0, 0, 1102, 1103, 6, 64, -1, 0, 1103, 1112, 3, 132, 66, 0, 1104, 1112, 3, 130, 65, 0, 1105, 1106, 5, 126, 0, 0, 1106, 1107, 3, 36, 18, 0, 1107, 1108, 5, 144, 0, 0, 1108, 1112, 1, 0, 0, 0, 1109, 1112, 3, 116, 58, 0, 1110, 1112, 3, 156, 78, 0, 1111, 1102, 1, 0, 0, 0, 1111, 1104, 1, 0, 0, 0, 1111, 1105, 1, 0, 0, 0, 1111, 1109, 1, 0, 0, 0, 1111, 1110, 1, 0, 0, 0, 1112, 1121, 1, 0, 0, 0, 1113, 1117, 10, 3, 0, 0, 1114, 1118, 3, 150, 75, 0, 1115, 1116, 5, 6, 0, 0, 1116, 1118, 3, 152, 76, 0, 1117, 1114, 1, 0, 0, 0, 1117, 1115, 1, 0, 0, 0, 1118, 1120, 1, 0, 0, 0, 1119, 1113, 1, 0, 0, 0, 1120, 1123, 1, 0, 0, 0, 1121, 1119, 1, 0, 0, 0, 1121, 1122, 1, 0, 0, 0, 1122, 129, 1, 0, 0, 0, 1123, 1121, 1, 0, 0, 0, 1124, 1125, 3, 152, 76, 0, 1125, 1127, 5, 126, 0, 0, 1126, 1128, 3, 134, 67, 0, 1127, 1126, 1, 0, 0, 0, 1127, 1128, 1, 0, 0, 0, 1128, 1129, 1, 0, 0, 0, 1129, 1130, 5, 144, 0, 0, 1130, 131, 1, 0, 0, 0, 1131, 1132, 3, 136, 68, 0, 1132, 1133, 5, 116, 0, 0, 1133, 1135, 1, 0, 0, 0, 1134, 1131, 1, 0, 0, 0, 1134, 1135, 1, 0, 0, 0, 1135, 1136, 1, 0, 0, 0, 1136, 1137, 3, 152, 76, 0, 1137, 133, 1, 0, 0, 0, 1138, 1143, 3, 108, 54, 0, 1139, 1140, 5, 112, 0, 0, 1140, 1142, 3, 108, 54, 0, 1141, 1139, 1, 0, 0, 0, 1142, 1145, 1, 0, 0, 0, 1143, 1141, 1, 0, 0, 0, 1143, 1144, 1, 0, 0, 0, 1144, 1147, 1, 0, 0, 0, 1145, 1143, 1, 0, 0, 0, 1146, 1148, 5, 112, 0, 0, 1147, 1146, 1, 0, 0, 0, 1147, 1148, 1, 0, 0, 0, 1148, 135, 1, 0, 0, 0, 1149, 1150, 3, 152, 76, 0, 1150, 137, 1, 0, 0, 0, 1151, 1160, 5, 102, 0, 0, 1152, 1153, 5, 116, 0, 0, 1153, 1160, 7, 11, 0, 0, 1154, 1155, 5, 104, 0, 0, 1155, 1157, 5, 116, 0, 0, 1156, 1158, 7, 11, 0, 0, 1157, 1156, 1, 0, 0, 0, 1157, 1158, 1, 0, 0, 0, 1158, 1160, 1, 0, 0, 0, 1159, 1151, 1, 0, 0, 0, 1159, 1152, 1, 0, 0, 0, 1159, 1154, 1, 0, 0, 0, 1160, 139, 1, 0, 0, 0, 1161, 1163, 7, 12, 0, 0, 1162, 1161, 1, 0, 0, 0, 1162, 1163, 1, 0, 0, 0, 1163, 1170, 1, 0, 0, 0, 1164, 1171, 3, 138, 69, 0, 1165, 1171, 5, 103, 0, 0, 1166, 1171, 5, 104, 0, 0, 1167, 1171, 5, 105, 0, 0, 1168, 1171, 5, 41, 0, 0, 1169, 1171, 5, 55, 0, 0, 1170, 1164, 1, 0, 0, 0, 1170, 1165, 1, 0, 0, 0, 1170, 1166, 1, 0, 0, 0, 1170, 1167, 1, 0, 0, 0, 1170, 1168, 1, 0, 0, 0, 1170, 1169, 1, 0, 0, 0, 1171, 141, 1, 0, 0, 0, 1172, 1176, 3, 140, 70, 0, 1173, 1176, 5, 106, 0, 0, 1174, 1176, 5, 57, 0, 0, 1175, 1172, 1, 0, 0, 0, 1175, 1173, 1, 0, 0, 0, 1175, 1174, 1, 0, 0, 0, 1176, 143, 1, 0, 0, 0, 1177, 1178, 7, 13, 0, 0, 1178, 145, 1, 0, 0, 0, 1179, 1180, 7, 14, 0, 0, 1180, 147, 1, 0, 0, 0, 1181, 1182, 7, 15, 0, 0, 1182, 149, 1, 0, 0, 0, 1183, 1186, 5, 101, 0, 0, 1184, 1186, 3, 148, 74, 0, 1185, 1183, 1, 0, 0, 0, 1185, 1184, 1, 0, 0, 0, 1186, 151, 1, 0, 0, 0, 1187, 1191, 5, 101, 0, 0, 1188, 1191, 3, 144, 72, 0, 1189, 1191, 3, 146, 73, 0, 1190, 1187, 1, 0, 0, 0, 1190, 1188, 1, 0, 0, 0, 1190, 1189, 1, 0, 0, 0, 1191, 153, 1, 0, 0, 0, 1192, 1193, 3, 158, 79, 0, 1193, 1194, 5, 118, 0, 0, 1194, 1195, 3, 140, 70, 0, 1195, 155, 1, 0, 0, 0, 1196, 1197, 5, 124, 0, 0, 1197, 1198, 3, 152, 76, 0, 1198, 1199, 5, 142, 0, 0, 1199, 157, 1, 0, 0, 0, 1200, 1203, 5, 106, 0, 0, 1201, 1203, 3, 160, 80, 0, 1202, 1200, 1, 0, 0, 0, 1202, 1201, 1, 0, 0, 0, 1203, 159, 1, 0, 0, 0, 1204, 1208, 5, 137, 0, 0, 1205, 1207, 3, 162, 81, 0, 1206, 1205, 1, 0, 0, 0, 1207, 1210, 1, 0, 0, 0, 1208, 1206, 1, 0, 0, 0, 1208, 1209, 1, 0, 0, 0, 1209, 1211, 1, 0, 0, 0, 1210, 1208, 1, 0, 0, 0, 1211, 1212, 5, 139, 0, 0, 1212, 161, 1, 0, 0, 0, 1213, 1214, 5, 152, 0, 0, 1214, 1215, 3, 108, 54, 0, 1215, 1216, 5, 142, 0, 0, 1216, 1219, 1, 0, 0, 0, 1217, 1219, 5, 151, 0, 0, 1218, 1213, 1, 0, 0, 0, 1218, 1217, 1, 0, 0, 0, 1219, 163, 1, 0, 0, 0, 1220, 1224, 5, 138, 0, 0, 1221, 1223, 3, 166, 83, 0, 1222, 1221, 1, 0, 0, 0, 1223, 1226, 1, 0, 0, 0, 1224, 1222, 1, 0, 0, 0, 1224, 1225, 1, 0, 0, 0, 1225, 1227, 1, 0, 0, 0, 1226, 1224, 1, 0, 0, 0, 1227, 1228, 5, 0, 0, 1, 1228, 165, 1, 0, 0, 0, 1229, 1230, 5, 154, 0, 0, 1230, 1231, 3, 108, 54, 0, 1231, 1232, 5, 142, 0, 0, 1232, 1235, 1, 0, 0, 0, 1233, 1235, 5, 153, 0, 0, 1234, 1229, 1, 0, 0, 0, 1234, 1233, 1, 0, 0, 0, 1235, 167, 1, 0, 0, 0, 160, 171, 178, 187, 194, 198, 209, 213, 216, 225, 233, 240, 244, 250, 255, 261, 273, 281, 295, 299, 304, 314, 323, 326, 330, 333, 337, 340, 343, 346, 349, 353, 357, 360, 363, 366, 370, 373, 382, 388, 409, 426, 443, 449, 455, 466, 468, 479, 482, 488, 496, 502, 504, 508, 513, 516, 519, 523, 527, 530, 532, 535, 539, 543, 546, 548, 550, 555, 566, 572, 579, 584, 588, 592, 598, 600, 607, 615, 618, 621, 640, 654, 670, 674, 685, 689, 700, 704, 711, 715, 722, 726, 731, 740, 744, 768, 785, 791, 794, 797, 807, 813, 816, 819, 827, 830, 834, 837, 851, 868, 873, 877, 883, 890, 902, 906, 909, 918, 932, 959, 967, 969, 971, 979, 983, 987, 995, 999, 1008, 1012, 1014, 1024, 1035, 1040, 1047, 1060, 1067, 1071, 1083, 1089, 1092, 1099, 1111, 1117, 1121, 1127, 1134, 1143, 1147, 1157, 1159, 1162, 1170, 1175, 1185, 1190, 1202, 1208, 1218, 1224, 1234] \ No newline at end of file +[4, 1, 154, 1237, 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, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78, 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, 2, 83, 7, 83, 1, 0, 5, 0, 170, 8, 0, 10, 0, 12, 0, 173, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 179, 8, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 188, 8, 3, 1, 4, 1, 4, 1, 4, 5, 4, 193, 8, 4, 10, 4, 12, 4, 196, 9, 4, 1, 4, 3, 4, 199, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 210, 8, 5, 1, 6, 1, 6, 3, 6, 214, 8, 6, 1, 6, 3, 6, 217, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 226, 8, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 234, 8, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 241, 8, 9, 1, 9, 1, 9, 3, 9, 245, 8, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 251, 8, 9, 1, 9, 1, 9, 1, 9, 3, 9, 256, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 262, 8, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 3, 12, 274, 8, 12, 1, 13, 1, 13, 1, 14, 1, 14, 5, 14, 280, 8, 14, 10, 14, 12, 14, 283, 9, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 5, 16, 294, 8, 16, 10, 16, 12, 16, 297, 9, 16, 1, 16, 3, 16, 300, 8, 16, 1, 17, 1, 17, 1, 17, 3, 17, 305, 8, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 5, 18, 313, 8, 18, 10, 18, 12, 18, 316, 9, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 324, 8, 19, 1, 20, 3, 20, 327, 8, 20, 1, 20, 1, 20, 3, 20, 331, 8, 20, 1, 20, 3, 20, 334, 8, 20, 1, 20, 1, 20, 3, 20, 338, 8, 20, 1, 20, 3, 20, 341, 8, 20, 1, 20, 3, 20, 344, 8, 20, 1, 20, 3, 20, 347, 8, 20, 1, 20, 3, 20, 350, 8, 20, 1, 20, 1, 20, 3, 20, 354, 8, 20, 1, 20, 1, 20, 3, 20, 358, 8, 20, 1, 20, 3, 20, 361, 8, 20, 1, 20, 3, 20, 364, 8, 20, 1, 20, 3, 20, 367, 8, 20, 1, 20, 1, 20, 3, 20, 371, 8, 20, 1, 20, 3, 20, 374, 8, 20, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 383, 8, 22, 1, 23, 1, 23, 1, 23, 1, 24, 3, 24, 389, 8, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 5, 25, 408, 8, 25, 10, 25, 12, 25, 411, 9, 25, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 3, 28, 427, 8, 28, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 3, 32, 444, 8, 32, 1, 32, 1, 32, 1, 32, 1, 32, 3, 32, 450, 8, 32, 1, 32, 1, 32, 1, 32, 1, 32, 3, 32, 456, 8, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 3, 32, 467, 8, 32, 3, 32, 469, 8, 32, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 3, 35, 480, 8, 35, 1, 35, 3, 35, 483, 8, 35, 1, 35, 1, 35, 1, 35, 1, 35, 3, 35, 489, 8, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 3, 35, 497, 8, 35, 1, 35, 1, 35, 1, 35, 1, 35, 5, 35, 503, 8, 35, 10, 35, 12, 35, 506, 9, 35, 1, 36, 3, 36, 509, 8, 36, 1, 36, 1, 36, 1, 36, 3, 36, 514, 8, 36, 1, 36, 3, 36, 517, 8, 36, 1, 36, 3, 36, 520, 8, 36, 1, 36, 1, 36, 3, 36, 524, 8, 36, 1, 36, 1, 36, 3, 36, 528, 8, 36, 1, 36, 3, 36, 531, 8, 36, 3, 36, 533, 8, 36, 1, 36, 3, 36, 536, 8, 36, 1, 36, 1, 36, 3, 36, 540, 8, 36, 1, 36, 1, 36, 3, 36, 544, 8, 36, 1, 36, 3, 36, 547, 8, 36, 3, 36, 549, 8, 36, 3, 36, 551, 8, 36, 1, 37, 1, 37, 1, 37, 3, 37, 556, 8, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 3, 38, 567, 8, 38, 1, 39, 1, 39, 1, 39, 1, 39, 3, 39, 573, 8, 39, 1, 40, 1, 40, 1, 40, 5, 40, 578, 8, 40, 10, 40, 12, 40, 581, 9, 40, 1, 41, 1, 41, 3, 41, 585, 8, 41, 1, 41, 1, 41, 3, 41, 589, 8, 41, 1, 41, 1, 41, 3, 41, 593, 8, 41, 1, 42, 1, 42, 1, 42, 1, 42, 3, 42, 599, 8, 42, 3, 42, 601, 8, 42, 1, 43, 1, 43, 1, 43, 5, 43, 606, 8, 43, 10, 43, 12, 43, 609, 9, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 3, 45, 616, 8, 45, 1, 45, 3, 45, 619, 8, 45, 1, 45, 3, 45, 622, 8, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 641, 8, 49, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 3, 50, 655, 8, 50, 1, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 5, 52, 669, 8, 52, 10, 52, 12, 52, 672, 9, 52, 1, 52, 3, 52, 675, 8, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 5, 52, 684, 8, 52, 10, 52, 12, 52, 687, 9, 52, 1, 52, 3, 52, 690, 8, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 5, 52, 699, 8, 52, 10, 52, 12, 52, 702, 9, 52, 1, 52, 3, 52, 705, 8, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 3, 52, 712, 8, 52, 1, 52, 1, 52, 3, 52, 716, 8, 52, 1, 53, 1, 53, 1, 53, 5, 53, 721, 8, 53, 10, 53, 12, 53, 724, 9, 53, 1, 53, 3, 53, 727, 8, 53, 1, 54, 1, 54, 1, 54, 3, 54, 732, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 4, 54, 739, 8, 54, 11, 54, 12, 54, 740, 1, 54, 1, 54, 3, 54, 745, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 769, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 786, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 792, 8, 54, 1, 54, 3, 54, 795, 8, 54, 1, 54, 3, 54, 798, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 808, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 814, 8, 54, 1, 54, 3, 54, 817, 8, 54, 1, 54, 3, 54, 820, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 828, 8, 54, 1, 54, 3, 54, 831, 8, 54, 1, 54, 1, 54, 3, 54, 835, 8, 54, 1, 54, 3, 54, 838, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 852, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 869, 8, 54, 1, 54, 1, 54, 1, 54, 3, 54, 874, 8, 54, 1, 54, 1, 54, 3, 54, 878, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 884, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 891, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 903, 8, 54, 1, 54, 1, 54, 3, 54, 907, 8, 54, 1, 54, 3, 54, 910, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 919, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 933, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 960, 8, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 3, 54, 968, 8, 54, 5, 54, 970, 8, 54, 10, 54, 12, 54, 973, 9, 54, 1, 55, 1, 55, 1, 55, 5, 55, 978, 8, 55, 10, 55, 12, 55, 981, 9, 55, 1, 55, 3, 55, 984, 8, 55, 1, 56, 1, 56, 3, 56, 988, 8, 56, 1, 57, 1, 57, 1, 57, 1, 57, 5, 57, 994, 8, 57, 10, 57, 12, 57, 997, 9, 57, 1, 57, 3, 57, 1000, 8, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 5, 57, 1007, 8, 57, 10, 57, 12, 57, 1010, 9, 57, 1, 57, 3, 57, 1013, 8, 57, 3, 57, 1015, 8, 57, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, 5, 58, 1023, 8, 58, 10, 58, 12, 58, 1026, 9, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 5, 58, 1034, 8, 58, 10, 58, 12, 58, 1037, 9, 58, 1, 58, 1, 58, 3, 58, 1041, 8, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 3, 58, 1048, 8, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 3, 59, 1061, 8, 59, 1, 60, 1, 60, 1, 60, 5, 60, 1066, 8, 60, 10, 60, 12, 60, 1069, 9, 60, 1, 60, 3, 60, 1072, 8, 60, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 3, 61, 1084, 8, 61, 1, 62, 1, 62, 1, 62, 1, 62, 3, 62, 1090, 8, 62, 1, 62, 3, 62, 1093, 8, 62, 1, 63, 1, 63, 1, 63, 5, 63, 1098, 8, 63, 10, 63, 12, 63, 1101, 9, 63, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 3, 64, 1112, 8, 64, 1, 64, 1, 64, 1, 64, 1, 64, 3, 64, 1118, 8, 64, 5, 64, 1120, 8, 64, 10, 64, 12, 64, 1123, 9, 64, 1, 65, 1, 65, 1, 65, 3, 65, 1128, 8, 65, 1, 65, 1, 65, 1, 66, 1, 66, 1, 66, 3, 66, 1135, 8, 66, 1, 66, 1, 66, 1, 67, 1, 67, 1, 67, 5, 67, 1142, 8, 67, 10, 67, 12, 67, 1145, 9, 67, 1, 67, 3, 67, 1148, 8, 67, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 3, 69, 1158, 8, 69, 3, 69, 1160, 8, 69, 1, 70, 3, 70, 1163, 8, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 3, 70, 1171, 8, 70, 1, 71, 1, 71, 1, 71, 3, 71, 1176, 8, 71, 1, 72, 1, 72, 1, 73, 1, 73, 1, 74, 1, 74, 1, 75, 1, 75, 3, 75, 1186, 8, 75, 1, 76, 1, 76, 1, 76, 3, 76, 1191, 8, 76, 1, 77, 1, 77, 1, 77, 1, 77, 1, 78, 1, 78, 1, 78, 1, 78, 1, 79, 1, 79, 3, 79, 1203, 8, 79, 1, 80, 1, 80, 5, 80, 1207, 8, 80, 10, 80, 12, 80, 1210, 9, 80, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 3, 81, 1219, 8, 81, 1, 82, 1, 82, 5, 82, 1223, 8, 82, 10, 82, 12, 82, 1226, 9, 82, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 3, 83, 1235, 8, 83, 1, 83, 0, 3, 70, 108, 128, 84, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 0, 16, 2, 0, 17, 17, 72, 72, 2, 0, 42, 42, 49, 49, 3, 0, 1, 1, 4, 4, 8, 8, 4, 0, 1, 1, 3, 4, 8, 8, 78, 78, 2, 0, 49, 49, 71, 71, 2, 0, 1, 1, 4, 4, 2, 0, 7, 7, 21, 22, 2, 0, 28, 28, 47, 47, 2, 0, 69, 69, 74, 74, 3, 0, 10, 10, 48, 48, 87, 87, 2, 0, 39, 39, 51, 51, 1, 0, 103, 104, 2, 0, 114, 114, 134, 134, 7, 0, 20, 20, 36, 36, 53, 54, 68, 68, 76, 76, 93, 93, 99, 99, 12, 0, 1, 19, 21, 28, 30, 35, 37, 40, 42, 49, 51, 52, 56, 56, 58, 67, 69, 75, 77, 92, 94, 95, 97, 98, 4, 0, 19, 19, 28, 28, 37, 37, 46, 46, 1394, 0, 171, 1, 0, 0, 0, 2, 178, 1, 0, 0, 0, 4, 180, 1, 0, 0, 0, 6, 182, 1, 0, 0, 0, 8, 189, 1, 0, 0, 0, 10, 209, 1, 0, 0, 0, 12, 211, 1, 0, 0, 0, 14, 218, 1, 0, 0, 0, 16, 227, 1, 0, 0, 0, 18, 235, 1, 0, 0, 0, 20, 257, 1, 0, 0, 0, 22, 266, 1, 0, 0, 0, 24, 271, 1, 0, 0, 0, 26, 275, 1, 0, 0, 0, 28, 277, 1, 0, 0, 0, 30, 286, 1, 0, 0, 0, 32, 290, 1, 0, 0, 0, 34, 304, 1, 0, 0, 0, 36, 308, 1, 0, 0, 0, 38, 323, 1, 0, 0, 0, 40, 326, 1, 0, 0, 0, 42, 375, 1, 0, 0, 0, 44, 378, 1, 0, 0, 0, 46, 384, 1, 0, 0, 0, 48, 388, 1, 0, 0, 0, 50, 394, 1, 0, 0, 0, 52, 412, 1, 0, 0, 0, 54, 415, 1, 0, 0, 0, 56, 418, 1, 0, 0, 0, 58, 428, 1, 0, 0, 0, 60, 431, 1, 0, 0, 0, 62, 435, 1, 0, 0, 0, 64, 468, 1, 0, 0, 0, 66, 470, 1, 0, 0, 0, 68, 473, 1, 0, 0, 0, 70, 488, 1, 0, 0, 0, 72, 550, 1, 0, 0, 0, 74, 555, 1, 0, 0, 0, 76, 566, 1, 0, 0, 0, 78, 568, 1, 0, 0, 0, 80, 574, 1, 0, 0, 0, 82, 582, 1, 0, 0, 0, 84, 600, 1, 0, 0, 0, 86, 602, 1, 0, 0, 0, 88, 610, 1, 0, 0, 0, 90, 615, 1, 0, 0, 0, 92, 623, 1, 0, 0, 0, 94, 627, 1, 0, 0, 0, 96, 631, 1, 0, 0, 0, 98, 640, 1, 0, 0, 0, 100, 654, 1, 0, 0, 0, 102, 656, 1, 0, 0, 0, 104, 715, 1, 0, 0, 0, 106, 717, 1, 0, 0, 0, 108, 877, 1, 0, 0, 0, 110, 974, 1, 0, 0, 0, 112, 987, 1, 0, 0, 0, 114, 1014, 1, 0, 0, 0, 116, 1047, 1, 0, 0, 0, 118, 1060, 1, 0, 0, 0, 120, 1062, 1, 0, 0, 0, 122, 1083, 1, 0, 0, 0, 124, 1092, 1, 0, 0, 0, 126, 1094, 1, 0, 0, 0, 128, 1111, 1, 0, 0, 0, 130, 1124, 1, 0, 0, 0, 132, 1134, 1, 0, 0, 0, 134, 1138, 1, 0, 0, 0, 136, 1149, 1, 0, 0, 0, 138, 1159, 1, 0, 0, 0, 140, 1162, 1, 0, 0, 0, 142, 1175, 1, 0, 0, 0, 144, 1177, 1, 0, 0, 0, 146, 1179, 1, 0, 0, 0, 148, 1181, 1, 0, 0, 0, 150, 1185, 1, 0, 0, 0, 152, 1190, 1, 0, 0, 0, 154, 1192, 1, 0, 0, 0, 156, 1196, 1, 0, 0, 0, 158, 1202, 1, 0, 0, 0, 160, 1204, 1, 0, 0, 0, 162, 1218, 1, 0, 0, 0, 164, 1220, 1, 0, 0, 0, 166, 1234, 1, 0, 0, 0, 168, 170, 3, 2, 1, 0, 169, 168, 1, 0, 0, 0, 170, 173, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, 171, 172, 1, 0, 0, 0, 172, 174, 1, 0, 0, 0, 173, 171, 1, 0, 0, 0, 174, 175, 5, 0, 0, 1, 175, 1, 1, 0, 0, 0, 176, 179, 3, 6, 3, 0, 177, 179, 3, 10, 5, 0, 178, 176, 1, 0, 0, 0, 178, 177, 1, 0, 0, 0, 179, 3, 1, 0, 0, 0, 180, 181, 3, 108, 54, 0, 181, 5, 1, 0, 0, 0, 182, 183, 5, 50, 0, 0, 183, 187, 3, 152, 76, 0, 184, 185, 5, 111, 0, 0, 185, 186, 5, 118, 0, 0, 186, 188, 3, 4, 2, 0, 187, 184, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 7, 1, 0, 0, 0, 189, 194, 3, 152, 76, 0, 190, 191, 5, 112, 0, 0, 191, 193, 3, 152, 76, 0, 192, 190, 1, 0, 0, 0, 193, 196, 1, 0, 0, 0, 194, 192, 1, 0, 0, 0, 194, 195, 1, 0, 0, 0, 195, 198, 1, 0, 0, 0, 196, 194, 1, 0, 0, 0, 197, 199, 5, 112, 0, 0, 198, 197, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, 9, 1, 0, 0, 0, 200, 210, 3, 12, 6, 0, 201, 210, 3, 14, 7, 0, 202, 210, 3, 16, 8, 0, 203, 210, 3, 18, 9, 0, 204, 210, 3, 20, 10, 0, 205, 210, 3, 22, 11, 0, 206, 210, 3, 28, 14, 0, 207, 210, 3, 24, 12, 0, 208, 210, 3, 26, 13, 0, 209, 200, 1, 0, 0, 0, 209, 201, 1, 0, 0, 0, 209, 202, 1, 0, 0, 0, 209, 203, 1, 0, 0, 0, 209, 204, 1, 0, 0, 0, 209, 205, 1, 0, 0, 0, 209, 206, 1, 0, 0, 0, 209, 207, 1, 0, 0, 0, 209, 208, 1, 0, 0, 0, 210, 11, 1, 0, 0, 0, 211, 213, 5, 70, 0, 0, 212, 214, 3, 4, 2, 0, 213, 212, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, 216, 1, 0, 0, 0, 215, 217, 5, 145, 0, 0, 216, 215, 1, 0, 0, 0, 216, 217, 1, 0, 0, 0, 217, 13, 1, 0, 0, 0, 218, 219, 5, 38, 0, 0, 219, 220, 5, 126, 0, 0, 220, 221, 3, 4, 2, 0, 221, 222, 5, 144, 0, 0, 222, 225, 3, 10, 5, 0, 223, 224, 5, 24, 0, 0, 224, 226, 3, 10, 5, 0, 225, 223, 1, 0, 0, 0, 225, 226, 1, 0, 0, 0, 226, 15, 1, 0, 0, 0, 227, 228, 5, 96, 0, 0, 228, 229, 5, 126, 0, 0, 229, 230, 3, 4, 2, 0, 230, 231, 5, 144, 0, 0, 231, 233, 3, 10, 5, 0, 232, 234, 5, 145, 0, 0, 233, 232, 1, 0, 0, 0, 233, 234, 1, 0, 0, 0, 234, 17, 1, 0, 0, 0, 235, 236, 5, 31, 0, 0, 236, 240, 5, 126, 0, 0, 237, 241, 3, 6, 3, 0, 238, 241, 3, 22, 11, 0, 239, 241, 3, 4, 2, 0, 240, 237, 1, 0, 0, 0, 240, 238, 1, 0, 0, 0, 240, 239, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 244, 5, 145, 0, 0, 243, 245, 3, 4, 2, 0, 244, 243, 1, 0, 0, 0, 244, 245, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, 246, 250, 5, 145, 0, 0, 247, 251, 3, 6, 3, 0, 248, 251, 3, 22, 11, 0, 249, 251, 3, 4, 2, 0, 250, 247, 1, 0, 0, 0, 250, 248, 1, 0, 0, 0, 250, 249, 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 252, 1, 0, 0, 0, 252, 253, 5, 144, 0, 0, 253, 255, 3, 10, 5, 0, 254, 256, 5, 145, 0, 0, 255, 254, 1, 0, 0, 0, 255, 256, 1, 0, 0, 0, 256, 19, 1, 0, 0, 0, 257, 258, 5, 29, 0, 0, 258, 259, 3, 152, 76, 0, 259, 261, 5, 126, 0, 0, 260, 262, 3, 8, 4, 0, 261, 260, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 264, 5, 144, 0, 0, 264, 265, 3, 28, 14, 0, 265, 21, 1, 0, 0, 0, 266, 267, 3, 4, 2, 0, 267, 268, 5, 111, 0, 0, 268, 269, 5, 118, 0, 0, 269, 270, 3, 4, 2, 0, 270, 23, 1, 0, 0, 0, 271, 273, 3, 4, 2, 0, 272, 274, 5, 145, 0, 0, 273, 272, 1, 0, 0, 0, 273, 274, 1, 0, 0, 0, 274, 25, 1, 0, 0, 0, 275, 276, 5, 145, 0, 0, 276, 27, 1, 0, 0, 0, 277, 281, 5, 124, 0, 0, 278, 280, 3, 2, 1, 0, 279, 278, 1, 0, 0, 0, 280, 283, 1, 0, 0, 0, 281, 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 284, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, 284, 285, 5, 142, 0, 0, 285, 29, 1, 0, 0, 0, 286, 287, 3, 4, 2, 0, 287, 288, 5, 111, 0, 0, 288, 289, 3, 4, 2, 0, 289, 31, 1, 0, 0, 0, 290, 295, 3, 30, 15, 0, 291, 292, 5, 112, 0, 0, 292, 294, 3, 30, 15, 0, 293, 291, 1, 0, 0, 0, 294, 297, 1, 0, 0, 0, 295, 293, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 299, 1, 0, 0, 0, 297, 295, 1, 0, 0, 0, 298, 300, 5, 112, 0, 0, 299, 298, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 33, 1, 0, 0, 0, 301, 305, 3, 36, 18, 0, 302, 305, 3, 40, 20, 0, 303, 305, 3, 116, 58, 0, 304, 301, 1, 0, 0, 0, 304, 302, 1, 0, 0, 0, 304, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 307, 5, 0, 0, 1, 307, 35, 1, 0, 0, 0, 308, 314, 3, 38, 19, 0, 309, 310, 5, 91, 0, 0, 310, 311, 5, 1, 0, 0, 311, 313, 3, 38, 19, 0, 312, 309, 1, 0, 0, 0, 313, 316, 1, 0, 0, 0, 314, 312, 1, 0, 0, 0, 314, 315, 1, 0, 0, 0, 315, 37, 1, 0, 0, 0, 316, 314, 1, 0, 0, 0, 317, 324, 3, 40, 20, 0, 318, 319, 5, 126, 0, 0, 319, 320, 3, 36, 18, 0, 320, 321, 5, 144, 0, 0, 321, 324, 1, 0, 0, 0, 322, 324, 3, 156, 78, 0, 323, 317, 1, 0, 0, 0, 323, 318, 1, 0, 0, 0, 323, 322, 1, 0, 0, 0, 324, 39, 1, 0, 0, 0, 325, 327, 3, 42, 21, 0, 326, 325, 1, 0, 0, 0, 326, 327, 1, 0, 0, 0, 327, 328, 1, 0, 0, 0, 328, 330, 5, 77, 0, 0, 329, 331, 5, 23, 0, 0, 330, 329, 1, 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 333, 1, 0, 0, 0, 332, 334, 3, 44, 22, 0, 333, 332, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, 335, 337, 3, 106, 53, 0, 336, 338, 3, 46, 23, 0, 337, 336, 1, 0, 0, 0, 337, 338, 1, 0, 0, 0, 338, 340, 1, 0, 0, 0, 339, 341, 3, 48, 24, 0, 340, 339, 1, 0, 0, 0, 340, 341, 1, 0, 0, 0, 341, 343, 1, 0, 0, 0, 342, 344, 3, 52, 26, 0, 343, 342, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 346, 1, 0, 0, 0, 345, 347, 3, 54, 27, 0, 346, 345, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, 347, 349, 1, 0, 0, 0, 348, 350, 3, 56, 28, 0, 349, 348, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 353, 1, 0, 0, 0, 351, 352, 5, 98, 0, 0, 352, 354, 7, 0, 0, 0, 353, 351, 1, 0, 0, 0, 353, 354, 1, 0, 0, 0, 354, 357, 1, 0, 0, 0, 355, 356, 5, 98, 0, 0, 356, 358, 5, 86, 0, 0, 357, 355, 1, 0, 0, 0, 357, 358, 1, 0, 0, 0, 358, 360, 1, 0, 0, 0, 359, 361, 3, 58, 29, 0, 360, 359, 1, 0, 0, 0, 360, 361, 1, 0, 0, 0, 361, 363, 1, 0, 0, 0, 362, 364, 3, 50, 25, 0, 363, 362, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, 366, 1, 0, 0, 0, 365, 367, 3, 60, 30, 0, 366, 365, 1, 0, 0, 0, 366, 367, 1, 0, 0, 0, 367, 370, 1, 0, 0, 0, 368, 371, 3, 64, 32, 0, 369, 371, 3, 66, 33, 0, 370, 368, 1, 0, 0, 0, 370, 369, 1, 0, 0, 0, 370, 371, 1, 0, 0, 0, 371, 373, 1, 0, 0, 0, 372, 374, 3, 68, 34, 0, 373, 372, 1, 0, 0, 0, 373, 374, 1, 0, 0, 0, 374, 41, 1, 0, 0, 0, 375, 376, 5, 98, 0, 0, 376, 377, 3, 120, 60, 0, 377, 43, 1, 0, 0, 0, 378, 379, 5, 85, 0, 0, 379, 382, 5, 104, 0, 0, 380, 381, 5, 98, 0, 0, 381, 383, 5, 82, 0, 0, 382, 380, 1, 0, 0, 0, 382, 383, 1, 0, 0, 0, 383, 45, 1, 0, 0, 0, 384, 385, 5, 32, 0, 0, 385, 386, 3, 70, 35, 0, 386, 47, 1, 0, 0, 0, 387, 389, 7, 1, 0, 0, 388, 387, 1, 0, 0, 0, 388, 389, 1, 0, 0, 0, 389, 390, 1, 0, 0, 0, 390, 391, 5, 5, 0, 0, 391, 392, 5, 45, 0, 0, 392, 393, 3, 106, 53, 0, 393, 49, 1, 0, 0, 0, 394, 395, 5, 97, 0, 0, 395, 396, 3, 152, 76, 0, 396, 397, 5, 6, 0, 0, 397, 398, 5, 126, 0, 0, 398, 399, 3, 90, 45, 0, 399, 409, 5, 144, 0, 0, 400, 401, 5, 112, 0, 0, 401, 402, 3, 152, 76, 0, 402, 403, 5, 6, 0, 0, 403, 404, 5, 126, 0, 0, 404, 405, 3, 90, 45, 0, 405, 406, 5, 144, 0, 0, 406, 408, 1, 0, 0, 0, 407, 400, 1, 0, 0, 0, 408, 411, 1, 0, 0, 0, 409, 407, 1, 0, 0, 0, 409, 410, 1, 0, 0, 0, 410, 51, 1, 0, 0, 0, 411, 409, 1, 0, 0, 0, 412, 413, 5, 67, 0, 0, 413, 414, 3, 108, 54, 0, 414, 53, 1, 0, 0, 0, 415, 416, 5, 95, 0, 0, 416, 417, 3, 108, 54, 0, 417, 55, 1, 0, 0, 0, 418, 419, 5, 34, 0, 0, 419, 426, 5, 11, 0, 0, 420, 421, 7, 0, 0, 0, 421, 422, 5, 126, 0, 0, 422, 423, 3, 106, 53, 0, 423, 424, 5, 144, 0, 0, 424, 427, 1, 0, 0, 0, 425, 427, 3, 106, 53, 0, 426, 420, 1, 0, 0, 0, 426, 425, 1, 0, 0, 0, 427, 57, 1, 0, 0, 0, 428, 429, 5, 35, 0, 0, 429, 430, 3, 108, 54, 0, 430, 59, 1, 0, 0, 0, 431, 432, 5, 62, 0, 0, 432, 433, 5, 11, 0, 0, 433, 434, 3, 80, 40, 0, 434, 61, 1, 0, 0, 0, 435, 436, 5, 62, 0, 0, 436, 437, 5, 11, 0, 0, 437, 438, 3, 106, 53, 0, 438, 63, 1, 0, 0, 0, 439, 440, 5, 52, 0, 0, 440, 443, 3, 108, 54, 0, 441, 442, 5, 112, 0, 0, 442, 444, 3, 108, 54, 0, 443, 441, 1, 0, 0, 0, 443, 444, 1, 0, 0, 0, 444, 449, 1, 0, 0, 0, 445, 446, 5, 98, 0, 0, 446, 450, 5, 82, 0, 0, 447, 448, 5, 11, 0, 0, 448, 450, 3, 106, 53, 0, 449, 445, 1, 0, 0, 0, 449, 447, 1, 0, 0, 0, 449, 450, 1, 0, 0, 0, 450, 469, 1, 0, 0, 0, 451, 452, 5, 52, 0, 0, 452, 455, 3, 108, 54, 0, 453, 454, 5, 98, 0, 0, 454, 456, 5, 82, 0, 0, 455, 453, 1, 0, 0, 0, 455, 456, 1, 0, 0, 0, 456, 457, 1, 0, 0, 0, 457, 458, 5, 59, 0, 0, 458, 459, 3, 108, 54, 0, 459, 469, 1, 0, 0, 0, 460, 461, 5, 52, 0, 0, 461, 462, 3, 108, 54, 0, 462, 463, 5, 59, 0, 0, 463, 466, 3, 108, 54, 0, 464, 465, 5, 11, 0, 0, 465, 467, 3, 106, 53, 0, 466, 464, 1, 0, 0, 0, 466, 467, 1, 0, 0, 0, 467, 469, 1, 0, 0, 0, 468, 439, 1, 0, 0, 0, 468, 451, 1, 0, 0, 0, 468, 460, 1, 0, 0, 0, 469, 65, 1, 0, 0, 0, 470, 471, 5, 59, 0, 0, 471, 472, 3, 108, 54, 0, 472, 67, 1, 0, 0, 0, 473, 474, 5, 79, 0, 0, 474, 475, 3, 86, 43, 0, 475, 69, 1, 0, 0, 0, 476, 477, 6, 35, -1, 0, 477, 479, 3, 128, 64, 0, 478, 480, 5, 27, 0, 0, 479, 478, 1, 0, 0, 0, 479, 480, 1, 0, 0, 0, 480, 482, 1, 0, 0, 0, 481, 483, 3, 78, 39, 0, 482, 481, 1, 0, 0, 0, 482, 483, 1, 0, 0, 0, 483, 489, 1, 0, 0, 0, 484, 485, 5, 126, 0, 0, 485, 486, 3, 70, 35, 0, 486, 487, 5, 144, 0, 0, 487, 489, 1, 0, 0, 0, 488, 476, 1, 0, 0, 0, 488, 484, 1, 0, 0, 0, 489, 504, 1, 0, 0, 0, 490, 491, 10, 3, 0, 0, 491, 492, 3, 74, 37, 0, 492, 493, 3, 70, 35, 4, 493, 503, 1, 0, 0, 0, 494, 496, 10, 4, 0, 0, 495, 497, 3, 72, 36, 0, 496, 495, 1, 0, 0, 0, 496, 497, 1, 0, 0, 0, 497, 498, 1, 0, 0, 0, 498, 499, 5, 45, 0, 0, 499, 500, 3, 70, 35, 0, 500, 501, 3, 76, 38, 0, 501, 503, 1, 0, 0, 0, 502, 490, 1, 0, 0, 0, 502, 494, 1, 0, 0, 0, 503, 506, 1, 0, 0, 0, 504, 502, 1, 0, 0, 0, 504, 505, 1, 0, 0, 0, 505, 71, 1, 0, 0, 0, 506, 504, 1, 0, 0, 0, 507, 509, 7, 2, 0, 0, 508, 507, 1, 0, 0, 0, 508, 509, 1, 0, 0, 0, 509, 510, 1, 0, 0, 0, 510, 517, 5, 42, 0, 0, 511, 513, 5, 42, 0, 0, 512, 514, 7, 2, 0, 0, 513, 512, 1, 0, 0, 0, 513, 514, 1, 0, 0, 0, 514, 517, 1, 0, 0, 0, 515, 517, 7, 2, 0, 0, 516, 508, 1, 0, 0, 0, 516, 511, 1, 0, 0, 0, 516, 515, 1, 0, 0, 0, 517, 551, 1, 0, 0, 0, 518, 520, 7, 3, 0, 0, 519, 518, 1, 0, 0, 0, 519, 520, 1, 0, 0, 0, 520, 521, 1, 0, 0, 0, 521, 523, 7, 4, 0, 0, 522, 524, 5, 63, 0, 0, 523, 522, 1, 0, 0, 0, 523, 524, 1, 0, 0, 0, 524, 533, 1, 0, 0, 0, 525, 527, 7, 4, 0, 0, 526, 528, 5, 63, 0, 0, 527, 526, 1, 0, 0, 0, 527, 528, 1, 0, 0, 0, 528, 530, 1, 0, 0, 0, 529, 531, 7, 3, 0, 0, 530, 529, 1, 0, 0, 0, 530, 531, 1, 0, 0, 0, 531, 533, 1, 0, 0, 0, 532, 519, 1, 0, 0, 0, 532, 525, 1, 0, 0, 0, 533, 551, 1, 0, 0, 0, 534, 536, 7, 5, 0, 0, 535, 534, 1, 0, 0, 0, 535, 536, 1, 0, 0, 0, 536, 537, 1, 0, 0, 0, 537, 539, 5, 33, 0, 0, 538, 540, 5, 63, 0, 0, 539, 538, 1, 0, 0, 0, 539, 540, 1, 0, 0, 0, 540, 549, 1, 0, 0, 0, 541, 543, 5, 33, 0, 0, 542, 544, 5, 63, 0, 0, 543, 542, 1, 0, 0, 0, 543, 544, 1, 0, 0, 0, 544, 546, 1, 0, 0, 0, 545, 547, 7, 5, 0, 0, 546, 545, 1, 0, 0, 0, 546, 547, 1, 0, 0, 0, 547, 549, 1, 0, 0, 0, 548, 535, 1, 0, 0, 0, 548, 541, 1, 0, 0, 0, 549, 551, 1, 0, 0, 0, 550, 516, 1, 0, 0, 0, 550, 532, 1, 0, 0, 0, 550, 548, 1, 0, 0, 0, 551, 73, 1, 0, 0, 0, 552, 553, 5, 16, 0, 0, 553, 556, 5, 45, 0, 0, 554, 556, 5, 112, 0, 0, 555, 552, 1, 0, 0, 0, 555, 554, 1, 0, 0, 0, 556, 75, 1, 0, 0, 0, 557, 558, 5, 60, 0, 0, 558, 567, 3, 106, 53, 0, 559, 560, 5, 92, 0, 0, 560, 561, 5, 126, 0, 0, 561, 562, 3, 106, 53, 0, 562, 563, 5, 144, 0, 0, 563, 567, 1, 0, 0, 0, 564, 565, 5, 92, 0, 0, 565, 567, 3, 106, 53, 0, 566, 557, 1, 0, 0, 0, 566, 559, 1, 0, 0, 0, 566, 564, 1, 0, 0, 0, 567, 77, 1, 0, 0, 0, 568, 569, 5, 75, 0, 0, 569, 572, 3, 84, 42, 0, 570, 571, 5, 59, 0, 0, 571, 573, 3, 84, 42, 0, 572, 570, 1, 0, 0, 0, 572, 573, 1, 0, 0, 0, 573, 79, 1, 0, 0, 0, 574, 579, 3, 82, 41, 0, 575, 576, 5, 112, 0, 0, 576, 578, 3, 82, 41, 0, 577, 575, 1, 0, 0, 0, 578, 581, 1, 0, 0, 0, 579, 577, 1, 0, 0, 0, 579, 580, 1, 0, 0, 0, 580, 81, 1, 0, 0, 0, 581, 579, 1, 0, 0, 0, 582, 584, 3, 108, 54, 0, 583, 585, 7, 6, 0, 0, 584, 583, 1, 0, 0, 0, 584, 585, 1, 0, 0, 0, 585, 588, 1, 0, 0, 0, 586, 587, 5, 58, 0, 0, 587, 589, 7, 7, 0, 0, 588, 586, 1, 0, 0, 0, 588, 589, 1, 0, 0, 0, 589, 592, 1, 0, 0, 0, 590, 591, 5, 15, 0, 0, 591, 593, 5, 106, 0, 0, 592, 590, 1, 0, 0, 0, 592, 593, 1, 0, 0, 0, 593, 83, 1, 0, 0, 0, 594, 601, 3, 156, 78, 0, 595, 598, 3, 140, 70, 0, 596, 597, 5, 146, 0, 0, 597, 599, 3, 140, 70, 0, 598, 596, 1, 0, 0, 0, 598, 599, 1, 0, 0, 0, 599, 601, 1, 0, 0, 0, 600, 594, 1, 0, 0, 0, 600, 595, 1, 0, 0, 0, 601, 85, 1, 0, 0, 0, 602, 607, 3, 88, 44, 0, 603, 604, 5, 112, 0, 0, 604, 606, 3, 88, 44, 0, 605, 603, 1, 0, 0, 0, 606, 609, 1, 0, 0, 0, 607, 605, 1, 0, 0, 0, 607, 608, 1, 0, 0, 0, 608, 87, 1, 0, 0, 0, 609, 607, 1, 0, 0, 0, 610, 611, 3, 152, 76, 0, 611, 612, 5, 118, 0, 0, 612, 613, 3, 142, 71, 0, 613, 89, 1, 0, 0, 0, 614, 616, 3, 92, 46, 0, 615, 614, 1, 0, 0, 0, 615, 616, 1, 0, 0, 0, 616, 618, 1, 0, 0, 0, 617, 619, 3, 94, 47, 0, 618, 617, 1, 0, 0, 0, 618, 619, 1, 0, 0, 0, 619, 621, 1, 0, 0, 0, 620, 622, 3, 96, 48, 0, 621, 620, 1, 0, 0, 0, 621, 622, 1, 0, 0, 0, 622, 91, 1, 0, 0, 0, 623, 624, 5, 65, 0, 0, 624, 625, 5, 11, 0, 0, 625, 626, 3, 106, 53, 0, 626, 93, 1, 0, 0, 0, 627, 628, 5, 62, 0, 0, 628, 629, 5, 11, 0, 0, 629, 630, 3, 80, 40, 0, 630, 95, 1, 0, 0, 0, 631, 632, 7, 8, 0, 0, 632, 633, 3, 98, 49, 0, 633, 97, 1, 0, 0, 0, 634, 641, 3, 100, 50, 0, 635, 636, 5, 9, 0, 0, 636, 637, 3, 100, 50, 0, 637, 638, 5, 2, 0, 0, 638, 639, 3, 100, 50, 0, 639, 641, 1, 0, 0, 0, 640, 634, 1, 0, 0, 0, 640, 635, 1, 0, 0, 0, 641, 99, 1, 0, 0, 0, 642, 643, 5, 18, 0, 0, 643, 655, 5, 73, 0, 0, 644, 645, 5, 90, 0, 0, 645, 655, 5, 66, 0, 0, 646, 647, 5, 90, 0, 0, 647, 655, 5, 30, 0, 0, 648, 649, 3, 140, 70, 0, 649, 650, 5, 66, 0, 0, 650, 655, 1, 0, 0, 0, 651, 652, 3, 140, 70, 0, 652, 653, 5, 30, 0, 0, 653, 655, 1, 0, 0, 0, 654, 642, 1, 0, 0, 0, 654, 644, 1, 0, 0, 0, 654, 646, 1, 0, 0, 0, 654, 648, 1, 0, 0, 0, 654, 651, 1, 0, 0, 0, 655, 101, 1, 0, 0, 0, 656, 657, 3, 108, 54, 0, 657, 658, 5, 0, 0, 1, 658, 103, 1, 0, 0, 0, 659, 716, 3, 152, 76, 0, 660, 661, 3, 152, 76, 0, 661, 662, 5, 126, 0, 0, 662, 663, 3, 152, 76, 0, 663, 670, 3, 104, 52, 0, 664, 665, 5, 112, 0, 0, 665, 666, 3, 152, 76, 0, 666, 667, 3, 104, 52, 0, 667, 669, 1, 0, 0, 0, 668, 664, 1, 0, 0, 0, 669, 672, 1, 0, 0, 0, 670, 668, 1, 0, 0, 0, 670, 671, 1, 0, 0, 0, 671, 674, 1, 0, 0, 0, 672, 670, 1, 0, 0, 0, 673, 675, 5, 112, 0, 0, 674, 673, 1, 0, 0, 0, 674, 675, 1, 0, 0, 0, 675, 676, 1, 0, 0, 0, 676, 677, 5, 144, 0, 0, 677, 716, 1, 0, 0, 0, 678, 679, 3, 152, 76, 0, 679, 680, 5, 126, 0, 0, 680, 685, 3, 154, 77, 0, 681, 682, 5, 112, 0, 0, 682, 684, 3, 154, 77, 0, 683, 681, 1, 0, 0, 0, 684, 687, 1, 0, 0, 0, 685, 683, 1, 0, 0, 0, 685, 686, 1, 0, 0, 0, 686, 689, 1, 0, 0, 0, 687, 685, 1, 0, 0, 0, 688, 690, 5, 112, 0, 0, 689, 688, 1, 0, 0, 0, 689, 690, 1, 0, 0, 0, 690, 691, 1, 0, 0, 0, 691, 692, 5, 144, 0, 0, 692, 716, 1, 0, 0, 0, 693, 694, 3, 152, 76, 0, 694, 695, 5, 126, 0, 0, 695, 700, 3, 104, 52, 0, 696, 697, 5, 112, 0, 0, 697, 699, 3, 104, 52, 0, 698, 696, 1, 0, 0, 0, 699, 702, 1, 0, 0, 0, 700, 698, 1, 0, 0, 0, 700, 701, 1, 0, 0, 0, 701, 704, 1, 0, 0, 0, 702, 700, 1, 0, 0, 0, 703, 705, 5, 112, 0, 0, 704, 703, 1, 0, 0, 0, 704, 705, 1, 0, 0, 0, 705, 706, 1, 0, 0, 0, 706, 707, 5, 144, 0, 0, 707, 716, 1, 0, 0, 0, 708, 709, 3, 152, 76, 0, 709, 711, 5, 126, 0, 0, 710, 712, 3, 106, 53, 0, 711, 710, 1, 0, 0, 0, 711, 712, 1, 0, 0, 0, 712, 713, 1, 0, 0, 0, 713, 714, 5, 144, 0, 0, 714, 716, 1, 0, 0, 0, 715, 659, 1, 0, 0, 0, 715, 660, 1, 0, 0, 0, 715, 678, 1, 0, 0, 0, 715, 693, 1, 0, 0, 0, 715, 708, 1, 0, 0, 0, 716, 105, 1, 0, 0, 0, 717, 722, 3, 108, 54, 0, 718, 719, 5, 112, 0, 0, 719, 721, 3, 108, 54, 0, 720, 718, 1, 0, 0, 0, 721, 724, 1, 0, 0, 0, 722, 720, 1, 0, 0, 0, 722, 723, 1, 0, 0, 0, 723, 726, 1, 0, 0, 0, 724, 722, 1, 0, 0, 0, 725, 727, 5, 112, 0, 0, 726, 725, 1, 0, 0, 0, 726, 727, 1, 0, 0, 0, 727, 107, 1, 0, 0, 0, 728, 729, 6, 54, -1, 0, 729, 731, 5, 12, 0, 0, 730, 732, 3, 108, 54, 0, 731, 730, 1, 0, 0, 0, 731, 732, 1, 0, 0, 0, 732, 738, 1, 0, 0, 0, 733, 734, 5, 94, 0, 0, 734, 735, 3, 108, 54, 0, 735, 736, 5, 81, 0, 0, 736, 737, 3, 108, 54, 0, 737, 739, 1, 0, 0, 0, 738, 733, 1, 0, 0, 0, 739, 740, 1, 0, 0, 0, 740, 738, 1, 0, 0, 0, 740, 741, 1, 0, 0, 0, 741, 744, 1, 0, 0, 0, 742, 743, 5, 24, 0, 0, 743, 745, 3, 108, 54, 0, 744, 742, 1, 0, 0, 0, 744, 745, 1, 0, 0, 0, 745, 746, 1, 0, 0, 0, 746, 747, 5, 25, 0, 0, 747, 878, 1, 0, 0, 0, 748, 749, 5, 13, 0, 0, 749, 750, 5, 126, 0, 0, 750, 751, 3, 108, 54, 0, 751, 752, 5, 6, 0, 0, 752, 753, 3, 104, 52, 0, 753, 754, 5, 144, 0, 0, 754, 878, 1, 0, 0, 0, 755, 756, 5, 19, 0, 0, 756, 878, 5, 106, 0, 0, 757, 758, 5, 43, 0, 0, 758, 759, 3, 108, 54, 0, 759, 760, 3, 144, 72, 0, 760, 878, 1, 0, 0, 0, 761, 762, 5, 80, 0, 0, 762, 763, 5, 126, 0, 0, 763, 764, 3, 108, 54, 0, 764, 765, 5, 32, 0, 0, 765, 768, 3, 108, 54, 0, 766, 767, 5, 31, 0, 0, 767, 769, 3, 108, 54, 0, 768, 766, 1, 0, 0, 0, 768, 769, 1, 0, 0, 0, 769, 770, 1, 0, 0, 0, 770, 771, 5, 144, 0, 0, 771, 878, 1, 0, 0, 0, 772, 773, 5, 83, 0, 0, 773, 878, 5, 106, 0, 0, 774, 775, 5, 88, 0, 0, 775, 776, 5, 126, 0, 0, 776, 777, 7, 9, 0, 0, 777, 778, 3, 158, 79, 0, 778, 779, 5, 32, 0, 0, 779, 780, 3, 108, 54, 0, 780, 781, 5, 144, 0, 0, 781, 878, 1, 0, 0, 0, 782, 783, 3, 152, 76, 0, 783, 785, 5, 126, 0, 0, 784, 786, 3, 106, 53, 0, 785, 784, 1, 0, 0, 0, 785, 786, 1, 0, 0, 0, 786, 787, 1, 0, 0, 0, 787, 788, 5, 144, 0, 0, 788, 797, 1, 0, 0, 0, 789, 791, 5, 126, 0, 0, 790, 792, 5, 23, 0, 0, 791, 790, 1, 0, 0, 0, 791, 792, 1, 0, 0, 0, 792, 794, 1, 0, 0, 0, 793, 795, 3, 110, 55, 0, 794, 793, 1, 0, 0, 0, 794, 795, 1, 0, 0, 0, 795, 796, 1, 0, 0, 0, 796, 798, 5, 144, 0, 0, 797, 789, 1, 0, 0, 0, 797, 798, 1, 0, 0, 0, 798, 799, 1, 0, 0, 0, 799, 800, 5, 64, 0, 0, 800, 801, 5, 126, 0, 0, 801, 802, 3, 90, 45, 0, 802, 803, 5, 144, 0, 0, 803, 878, 1, 0, 0, 0, 804, 805, 3, 152, 76, 0, 805, 807, 5, 126, 0, 0, 806, 808, 3, 106, 53, 0, 807, 806, 1, 0, 0, 0, 807, 808, 1, 0, 0, 0, 808, 809, 1, 0, 0, 0, 809, 810, 5, 144, 0, 0, 810, 819, 1, 0, 0, 0, 811, 813, 5, 126, 0, 0, 812, 814, 5, 23, 0, 0, 813, 812, 1, 0, 0, 0, 813, 814, 1, 0, 0, 0, 814, 816, 1, 0, 0, 0, 815, 817, 3, 110, 55, 0, 816, 815, 1, 0, 0, 0, 816, 817, 1, 0, 0, 0, 817, 818, 1, 0, 0, 0, 818, 820, 5, 144, 0, 0, 819, 811, 1, 0, 0, 0, 819, 820, 1, 0, 0, 0, 820, 821, 1, 0, 0, 0, 821, 822, 5, 64, 0, 0, 822, 823, 3, 152, 76, 0, 823, 878, 1, 0, 0, 0, 824, 830, 3, 152, 76, 0, 825, 827, 5, 126, 0, 0, 826, 828, 3, 106, 53, 0, 827, 826, 1, 0, 0, 0, 827, 828, 1, 0, 0, 0, 828, 829, 1, 0, 0, 0, 829, 831, 5, 144, 0, 0, 830, 825, 1, 0, 0, 0, 830, 831, 1, 0, 0, 0, 831, 832, 1, 0, 0, 0, 832, 834, 5, 126, 0, 0, 833, 835, 5, 23, 0, 0, 834, 833, 1, 0, 0, 0, 834, 835, 1, 0, 0, 0, 835, 837, 1, 0, 0, 0, 836, 838, 3, 110, 55, 0, 837, 836, 1, 0, 0, 0, 837, 838, 1, 0, 0, 0, 838, 839, 1, 0, 0, 0, 839, 840, 5, 144, 0, 0, 840, 878, 1, 0, 0, 0, 841, 878, 3, 116, 58, 0, 842, 878, 3, 160, 80, 0, 843, 878, 3, 142, 71, 0, 844, 845, 5, 114, 0, 0, 845, 878, 3, 108, 54, 19, 846, 847, 5, 56, 0, 0, 847, 878, 3, 108, 54, 13, 848, 849, 3, 132, 66, 0, 849, 850, 5, 116, 0, 0, 850, 852, 1, 0, 0, 0, 851, 848, 1, 0, 0, 0, 851, 852, 1, 0, 0, 0, 852, 853, 1, 0, 0, 0, 853, 878, 5, 108, 0, 0, 854, 855, 5, 126, 0, 0, 855, 856, 3, 36, 18, 0, 856, 857, 5, 144, 0, 0, 857, 878, 1, 0, 0, 0, 858, 859, 5, 126, 0, 0, 859, 860, 3, 108, 54, 0, 860, 861, 5, 144, 0, 0, 861, 878, 1, 0, 0, 0, 862, 863, 5, 126, 0, 0, 863, 864, 3, 106, 53, 0, 864, 865, 5, 144, 0, 0, 865, 878, 1, 0, 0, 0, 866, 868, 5, 125, 0, 0, 867, 869, 3, 106, 53, 0, 868, 867, 1, 0, 0, 0, 868, 869, 1, 0, 0, 0, 869, 870, 1, 0, 0, 0, 870, 878, 5, 143, 0, 0, 871, 873, 5, 124, 0, 0, 872, 874, 3, 32, 16, 0, 873, 872, 1, 0, 0, 0, 873, 874, 1, 0, 0, 0, 874, 875, 1, 0, 0, 0, 875, 878, 5, 142, 0, 0, 876, 878, 3, 124, 62, 0, 877, 728, 1, 0, 0, 0, 877, 748, 1, 0, 0, 0, 877, 755, 1, 0, 0, 0, 877, 757, 1, 0, 0, 0, 877, 761, 1, 0, 0, 0, 877, 772, 1, 0, 0, 0, 877, 774, 1, 0, 0, 0, 877, 782, 1, 0, 0, 0, 877, 804, 1, 0, 0, 0, 877, 824, 1, 0, 0, 0, 877, 841, 1, 0, 0, 0, 877, 842, 1, 0, 0, 0, 877, 843, 1, 0, 0, 0, 877, 844, 1, 0, 0, 0, 877, 846, 1, 0, 0, 0, 877, 851, 1, 0, 0, 0, 877, 854, 1, 0, 0, 0, 877, 858, 1, 0, 0, 0, 877, 862, 1, 0, 0, 0, 877, 866, 1, 0, 0, 0, 877, 871, 1, 0, 0, 0, 877, 876, 1, 0, 0, 0, 878, 971, 1, 0, 0, 0, 879, 883, 10, 18, 0, 0, 880, 884, 5, 108, 0, 0, 881, 884, 5, 146, 0, 0, 882, 884, 5, 133, 0, 0, 883, 880, 1, 0, 0, 0, 883, 881, 1, 0, 0, 0, 883, 882, 1, 0, 0, 0, 884, 885, 1, 0, 0, 0, 885, 970, 3, 108, 54, 19, 886, 890, 10, 17, 0, 0, 887, 891, 5, 134, 0, 0, 888, 891, 5, 114, 0, 0, 889, 891, 5, 113, 0, 0, 890, 887, 1, 0, 0, 0, 890, 888, 1, 0, 0, 0, 890, 889, 1, 0, 0, 0, 891, 892, 1, 0, 0, 0, 892, 970, 3, 108, 54, 18, 893, 918, 10, 16, 0, 0, 894, 919, 5, 117, 0, 0, 895, 919, 5, 118, 0, 0, 896, 919, 5, 129, 0, 0, 897, 919, 5, 127, 0, 0, 898, 919, 5, 128, 0, 0, 899, 919, 5, 119, 0, 0, 900, 919, 5, 120, 0, 0, 901, 903, 5, 56, 0, 0, 902, 901, 1, 0, 0, 0, 902, 903, 1, 0, 0, 0, 903, 904, 1, 0, 0, 0, 904, 906, 5, 40, 0, 0, 905, 907, 5, 14, 0, 0, 906, 905, 1, 0, 0, 0, 906, 907, 1, 0, 0, 0, 907, 919, 1, 0, 0, 0, 908, 910, 5, 56, 0, 0, 909, 908, 1, 0, 0, 0, 909, 910, 1, 0, 0, 0, 910, 911, 1, 0, 0, 0, 911, 919, 7, 10, 0, 0, 912, 919, 5, 140, 0, 0, 913, 919, 5, 141, 0, 0, 914, 919, 5, 131, 0, 0, 915, 919, 5, 122, 0, 0, 916, 919, 5, 123, 0, 0, 917, 919, 5, 130, 0, 0, 918, 894, 1, 0, 0, 0, 918, 895, 1, 0, 0, 0, 918, 896, 1, 0, 0, 0, 918, 897, 1, 0, 0, 0, 918, 898, 1, 0, 0, 0, 918, 899, 1, 0, 0, 0, 918, 900, 1, 0, 0, 0, 918, 902, 1, 0, 0, 0, 918, 909, 1, 0, 0, 0, 918, 912, 1, 0, 0, 0, 918, 913, 1, 0, 0, 0, 918, 914, 1, 0, 0, 0, 918, 915, 1, 0, 0, 0, 918, 916, 1, 0, 0, 0, 918, 917, 1, 0, 0, 0, 919, 920, 1, 0, 0, 0, 920, 970, 3, 108, 54, 17, 921, 922, 10, 14, 0, 0, 922, 923, 5, 132, 0, 0, 923, 970, 3, 108, 54, 15, 924, 925, 10, 12, 0, 0, 925, 926, 5, 2, 0, 0, 926, 970, 3, 108, 54, 13, 927, 928, 10, 11, 0, 0, 928, 929, 5, 61, 0, 0, 929, 970, 3, 108, 54, 12, 930, 932, 10, 10, 0, 0, 931, 933, 5, 56, 0, 0, 932, 931, 1, 0, 0, 0, 932, 933, 1, 0, 0, 0, 933, 934, 1, 0, 0, 0, 934, 935, 5, 9, 0, 0, 935, 936, 3, 108, 54, 0, 936, 937, 5, 2, 0, 0, 937, 938, 3, 108, 54, 11, 938, 970, 1, 0, 0, 0, 939, 940, 10, 9, 0, 0, 940, 941, 5, 135, 0, 0, 941, 942, 3, 108, 54, 0, 942, 943, 5, 111, 0, 0, 943, 944, 3, 108, 54, 9, 944, 970, 1, 0, 0, 0, 945, 946, 10, 22, 0, 0, 946, 947, 5, 125, 0, 0, 947, 948, 3, 108, 54, 0, 948, 949, 5, 143, 0, 0, 949, 970, 1, 0, 0, 0, 950, 951, 10, 21, 0, 0, 951, 952, 5, 116, 0, 0, 952, 970, 5, 104, 0, 0, 953, 954, 10, 20, 0, 0, 954, 955, 5, 116, 0, 0, 955, 970, 3, 152, 76, 0, 956, 957, 10, 15, 0, 0, 957, 959, 5, 44, 0, 0, 958, 960, 5, 56, 0, 0, 959, 958, 1, 0, 0, 0, 959, 960, 1, 0, 0, 0, 960, 961, 1, 0, 0, 0, 961, 970, 5, 57, 0, 0, 962, 967, 10, 8, 0, 0, 963, 964, 5, 6, 0, 0, 964, 968, 3, 152, 76, 0, 965, 966, 5, 6, 0, 0, 966, 968, 5, 106, 0, 0, 967, 963, 1, 0, 0, 0, 967, 965, 1, 0, 0, 0, 968, 970, 1, 0, 0, 0, 969, 879, 1, 0, 0, 0, 969, 886, 1, 0, 0, 0, 969, 893, 1, 0, 0, 0, 969, 921, 1, 0, 0, 0, 969, 924, 1, 0, 0, 0, 969, 927, 1, 0, 0, 0, 969, 930, 1, 0, 0, 0, 969, 939, 1, 0, 0, 0, 969, 945, 1, 0, 0, 0, 969, 950, 1, 0, 0, 0, 969, 953, 1, 0, 0, 0, 969, 956, 1, 0, 0, 0, 969, 962, 1, 0, 0, 0, 970, 973, 1, 0, 0, 0, 971, 969, 1, 0, 0, 0, 971, 972, 1, 0, 0, 0, 972, 109, 1, 0, 0, 0, 973, 971, 1, 0, 0, 0, 974, 979, 3, 112, 56, 0, 975, 976, 5, 112, 0, 0, 976, 978, 3, 112, 56, 0, 977, 975, 1, 0, 0, 0, 978, 981, 1, 0, 0, 0, 979, 977, 1, 0, 0, 0, 979, 980, 1, 0, 0, 0, 980, 983, 1, 0, 0, 0, 981, 979, 1, 0, 0, 0, 982, 984, 5, 112, 0, 0, 983, 982, 1, 0, 0, 0, 983, 984, 1, 0, 0, 0, 984, 111, 1, 0, 0, 0, 985, 988, 3, 114, 57, 0, 986, 988, 3, 108, 54, 0, 987, 985, 1, 0, 0, 0, 987, 986, 1, 0, 0, 0, 988, 113, 1, 0, 0, 0, 989, 990, 5, 126, 0, 0, 990, 995, 3, 152, 76, 0, 991, 992, 5, 112, 0, 0, 992, 994, 3, 152, 76, 0, 993, 991, 1, 0, 0, 0, 994, 997, 1, 0, 0, 0, 995, 993, 1, 0, 0, 0, 995, 996, 1, 0, 0, 0, 996, 999, 1, 0, 0, 0, 997, 995, 1, 0, 0, 0, 998, 1000, 5, 112, 0, 0, 999, 998, 1, 0, 0, 0, 999, 1000, 1, 0, 0, 0, 1000, 1001, 1, 0, 0, 0, 1001, 1002, 5, 144, 0, 0, 1002, 1015, 1, 0, 0, 0, 1003, 1008, 3, 152, 76, 0, 1004, 1005, 5, 112, 0, 0, 1005, 1007, 3, 152, 76, 0, 1006, 1004, 1, 0, 0, 0, 1007, 1010, 1, 0, 0, 0, 1008, 1006, 1, 0, 0, 0, 1008, 1009, 1, 0, 0, 0, 1009, 1012, 1, 0, 0, 0, 1010, 1008, 1, 0, 0, 0, 1011, 1013, 5, 112, 0, 0, 1012, 1011, 1, 0, 0, 0, 1012, 1013, 1, 0, 0, 0, 1013, 1015, 1, 0, 0, 0, 1014, 989, 1, 0, 0, 0, 1014, 1003, 1, 0, 0, 0, 1015, 1016, 1, 0, 0, 0, 1016, 1017, 5, 107, 0, 0, 1017, 1018, 3, 108, 54, 0, 1018, 115, 1, 0, 0, 0, 1019, 1020, 5, 128, 0, 0, 1020, 1024, 3, 152, 76, 0, 1021, 1023, 3, 118, 59, 0, 1022, 1021, 1, 0, 0, 0, 1023, 1026, 1, 0, 0, 0, 1024, 1022, 1, 0, 0, 0, 1024, 1025, 1, 0, 0, 0, 1025, 1027, 1, 0, 0, 0, 1026, 1024, 1, 0, 0, 0, 1027, 1028, 5, 146, 0, 0, 1028, 1029, 5, 120, 0, 0, 1029, 1048, 1, 0, 0, 0, 1030, 1031, 5, 128, 0, 0, 1031, 1035, 3, 152, 76, 0, 1032, 1034, 3, 118, 59, 0, 1033, 1032, 1, 0, 0, 0, 1034, 1037, 1, 0, 0, 0, 1035, 1033, 1, 0, 0, 0, 1035, 1036, 1, 0, 0, 0, 1036, 1038, 1, 0, 0, 0, 1037, 1035, 1, 0, 0, 0, 1038, 1040, 5, 120, 0, 0, 1039, 1041, 3, 116, 58, 0, 1040, 1039, 1, 0, 0, 0, 1040, 1041, 1, 0, 0, 0, 1041, 1042, 1, 0, 0, 0, 1042, 1043, 5, 128, 0, 0, 1043, 1044, 5, 146, 0, 0, 1044, 1045, 3, 152, 76, 0, 1045, 1046, 5, 120, 0, 0, 1046, 1048, 1, 0, 0, 0, 1047, 1019, 1, 0, 0, 0, 1047, 1030, 1, 0, 0, 0, 1048, 117, 1, 0, 0, 0, 1049, 1050, 3, 152, 76, 0, 1050, 1051, 5, 118, 0, 0, 1051, 1052, 3, 158, 79, 0, 1052, 1061, 1, 0, 0, 0, 1053, 1054, 3, 152, 76, 0, 1054, 1055, 5, 118, 0, 0, 1055, 1056, 5, 124, 0, 0, 1056, 1057, 3, 108, 54, 0, 1057, 1058, 5, 142, 0, 0, 1058, 1061, 1, 0, 0, 0, 1059, 1061, 3, 152, 76, 0, 1060, 1049, 1, 0, 0, 0, 1060, 1053, 1, 0, 0, 0, 1060, 1059, 1, 0, 0, 0, 1061, 119, 1, 0, 0, 0, 1062, 1067, 3, 122, 61, 0, 1063, 1064, 5, 112, 0, 0, 1064, 1066, 3, 122, 61, 0, 1065, 1063, 1, 0, 0, 0, 1066, 1069, 1, 0, 0, 0, 1067, 1065, 1, 0, 0, 0, 1067, 1068, 1, 0, 0, 0, 1068, 1071, 1, 0, 0, 0, 1069, 1067, 1, 0, 0, 0, 1070, 1072, 5, 112, 0, 0, 1071, 1070, 1, 0, 0, 0, 1071, 1072, 1, 0, 0, 0, 1072, 121, 1, 0, 0, 0, 1073, 1074, 3, 152, 76, 0, 1074, 1075, 5, 6, 0, 0, 1075, 1076, 5, 126, 0, 0, 1076, 1077, 3, 36, 18, 0, 1077, 1078, 5, 144, 0, 0, 1078, 1084, 1, 0, 0, 0, 1079, 1080, 3, 108, 54, 0, 1080, 1081, 5, 6, 0, 0, 1081, 1082, 3, 152, 76, 0, 1082, 1084, 1, 0, 0, 0, 1083, 1073, 1, 0, 0, 0, 1083, 1079, 1, 0, 0, 0, 1084, 123, 1, 0, 0, 0, 1085, 1093, 3, 156, 78, 0, 1086, 1087, 3, 132, 66, 0, 1087, 1088, 5, 116, 0, 0, 1088, 1090, 1, 0, 0, 0, 1089, 1086, 1, 0, 0, 0, 1089, 1090, 1, 0, 0, 0, 1090, 1091, 1, 0, 0, 0, 1091, 1093, 3, 126, 63, 0, 1092, 1085, 1, 0, 0, 0, 1092, 1089, 1, 0, 0, 0, 1093, 125, 1, 0, 0, 0, 1094, 1099, 3, 152, 76, 0, 1095, 1096, 5, 116, 0, 0, 1096, 1098, 3, 152, 76, 0, 1097, 1095, 1, 0, 0, 0, 1098, 1101, 1, 0, 0, 0, 1099, 1097, 1, 0, 0, 0, 1099, 1100, 1, 0, 0, 0, 1100, 127, 1, 0, 0, 0, 1101, 1099, 1, 0, 0, 0, 1102, 1103, 6, 64, -1, 0, 1103, 1112, 3, 132, 66, 0, 1104, 1112, 3, 130, 65, 0, 1105, 1106, 5, 126, 0, 0, 1106, 1107, 3, 36, 18, 0, 1107, 1108, 5, 144, 0, 0, 1108, 1112, 1, 0, 0, 0, 1109, 1112, 3, 116, 58, 0, 1110, 1112, 3, 156, 78, 0, 1111, 1102, 1, 0, 0, 0, 1111, 1104, 1, 0, 0, 0, 1111, 1105, 1, 0, 0, 0, 1111, 1109, 1, 0, 0, 0, 1111, 1110, 1, 0, 0, 0, 1112, 1121, 1, 0, 0, 0, 1113, 1117, 10, 3, 0, 0, 1114, 1118, 3, 150, 75, 0, 1115, 1116, 5, 6, 0, 0, 1116, 1118, 3, 152, 76, 0, 1117, 1114, 1, 0, 0, 0, 1117, 1115, 1, 0, 0, 0, 1118, 1120, 1, 0, 0, 0, 1119, 1113, 1, 0, 0, 0, 1120, 1123, 1, 0, 0, 0, 1121, 1119, 1, 0, 0, 0, 1121, 1122, 1, 0, 0, 0, 1122, 129, 1, 0, 0, 0, 1123, 1121, 1, 0, 0, 0, 1124, 1125, 3, 152, 76, 0, 1125, 1127, 5, 126, 0, 0, 1126, 1128, 3, 134, 67, 0, 1127, 1126, 1, 0, 0, 0, 1127, 1128, 1, 0, 0, 0, 1128, 1129, 1, 0, 0, 0, 1129, 1130, 5, 144, 0, 0, 1130, 131, 1, 0, 0, 0, 1131, 1132, 3, 136, 68, 0, 1132, 1133, 5, 116, 0, 0, 1133, 1135, 1, 0, 0, 0, 1134, 1131, 1, 0, 0, 0, 1134, 1135, 1, 0, 0, 0, 1135, 1136, 1, 0, 0, 0, 1136, 1137, 3, 152, 76, 0, 1137, 133, 1, 0, 0, 0, 1138, 1143, 3, 108, 54, 0, 1139, 1140, 5, 112, 0, 0, 1140, 1142, 3, 108, 54, 0, 1141, 1139, 1, 0, 0, 0, 1142, 1145, 1, 0, 0, 0, 1143, 1141, 1, 0, 0, 0, 1143, 1144, 1, 0, 0, 0, 1144, 1147, 1, 0, 0, 0, 1145, 1143, 1, 0, 0, 0, 1146, 1148, 5, 112, 0, 0, 1147, 1146, 1, 0, 0, 0, 1147, 1148, 1, 0, 0, 0, 1148, 135, 1, 0, 0, 0, 1149, 1150, 3, 152, 76, 0, 1150, 137, 1, 0, 0, 0, 1151, 1160, 5, 102, 0, 0, 1152, 1153, 5, 116, 0, 0, 1153, 1160, 7, 11, 0, 0, 1154, 1155, 5, 104, 0, 0, 1155, 1157, 5, 116, 0, 0, 1156, 1158, 7, 11, 0, 0, 1157, 1156, 1, 0, 0, 0, 1157, 1158, 1, 0, 0, 0, 1158, 1160, 1, 0, 0, 0, 1159, 1151, 1, 0, 0, 0, 1159, 1152, 1, 0, 0, 0, 1159, 1154, 1, 0, 0, 0, 1160, 139, 1, 0, 0, 0, 1161, 1163, 7, 12, 0, 0, 1162, 1161, 1, 0, 0, 0, 1162, 1163, 1, 0, 0, 0, 1163, 1170, 1, 0, 0, 0, 1164, 1171, 3, 138, 69, 0, 1165, 1171, 5, 103, 0, 0, 1166, 1171, 5, 104, 0, 0, 1167, 1171, 5, 105, 0, 0, 1168, 1171, 5, 41, 0, 0, 1169, 1171, 5, 55, 0, 0, 1170, 1164, 1, 0, 0, 0, 1170, 1165, 1, 0, 0, 0, 1170, 1166, 1, 0, 0, 0, 1170, 1167, 1, 0, 0, 0, 1170, 1168, 1, 0, 0, 0, 1170, 1169, 1, 0, 0, 0, 1171, 141, 1, 0, 0, 0, 1172, 1176, 3, 140, 70, 0, 1173, 1176, 5, 106, 0, 0, 1174, 1176, 5, 57, 0, 0, 1175, 1172, 1, 0, 0, 0, 1175, 1173, 1, 0, 0, 0, 1175, 1174, 1, 0, 0, 0, 1176, 143, 1, 0, 0, 0, 1177, 1178, 7, 13, 0, 0, 1178, 145, 1, 0, 0, 0, 1179, 1180, 7, 14, 0, 0, 1180, 147, 1, 0, 0, 0, 1181, 1182, 7, 15, 0, 0, 1182, 149, 1, 0, 0, 0, 1183, 1186, 5, 101, 0, 0, 1184, 1186, 3, 148, 74, 0, 1185, 1183, 1, 0, 0, 0, 1185, 1184, 1, 0, 0, 0, 1186, 151, 1, 0, 0, 0, 1187, 1191, 5, 101, 0, 0, 1188, 1191, 3, 144, 72, 0, 1189, 1191, 3, 146, 73, 0, 1190, 1187, 1, 0, 0, 0, 1190, 1188, 1, 0, 0, 0, 1190, 1189, 1, 0, 0, 0, 1191, 153, 1, 0, 0, 0, 1192, 1193, 3, 158, 79, 0, 1193, 1194, 5, 118, 0, 0, 1194, 1195, 3, 140, 70, 0, 1195, 155, 1, 0, 0, 0, 1196, 1197, 5, 124, 0, 0, 1197, 1198, 3, 152, 76, 0, 1198, 1199, 5, 142, 0, 0, 1199, 157, 1, 0, 0, 0, 1200, 1203, 5, 106, 0, 0, 1201, 1203, 3, 160, 80, 0, 1202, 1200, 1, 0, 0, 0, 1202, 1201, 1, 0, 0, 0, 1203, 159, 1, 0, 0, 0, 1204, 1208, 5, 137, 0, 0, 1205, 1207, 3, 162, 81, 0, 1206, 1205, 1, 0, 0, 0, 1207, 1210, 1, 0, 0, 0, 1208, 1206, 1, 0, 0, 0, 1208, 1209, 1, 0, 0, 0, 1209, 1211, 1, 0, 0, 0, 1210, 1208, 1, 0, 0, 0, 1211, 1212, 5, 139, 0, 0, 1212, 161, 1, 0, 0, 0, 1213, 1214, 5, 152, 0, 0, 1214, 1215, 3, 108, 54, 0, 1215, 1216, 5, 142, 0, 0, 1216, 1219, 1, 0, 0, 0, 1217, 1219, 5, 151, 0, 0, 1218, 1213, 1, 0, 0, 0, 1218, 1217, 1, 0, 0, 0, 1219, 163, 1, 0, 0, 0, 1220, 1224, 5, 138, 0, 0, 1221, 1223, 3, 166, 83, 0, 1222, 1221, 1, 0, 0, 0, 1223, 1226, 1, 0, 0, 0, 1224, 1222, 1, 0, 0, 0, 1224, 1225, 1, 0, 0, 0, 1225, 1227, 1, 0, 0, 0, 1226, 1224, 1, 0, 0, 0, 1227, 1228, 5, 0, 0, 1, 1228, 165, 1, 0, 0, 0, 1229, 1230, 5, 154, 0, 0, 1230, 1231, 3, 108, 54, 0, 1231, 1232, 5, 142, 0, 0, 1232, 1235, 1, 0, 0, 0, 1233, 1235, 5, 153, 0, 0, 1234, 1229, 1, 0, 0, 0, 1234, 1233, 1, 0, 0, 0, 1235, 167, 1, 0, 0, 0, 160, 171, 178, 187, 194, 198, 209, 213, 216, 225, 233, 240, 244, 250, 255, 261, 273, 281, 295, 299, 304, 314, 323, 326, 330, 333, 337, 340, 343, 346, 349, 353, 357, 360, 363, 366, 370, 373, 382, 388, 409, 426, 443, 449, 455, 466, 468, 479, 482, 488, 496, 502, 504, 508, 513, 516, 519, 523, 527, 530, 532, 535, 539, 543, 546, 548, 550, 555, 566, 572, 579, 584, 588, 592, 598, 600, 607, 615, 618, 621, 640, 654, 670, 674, 685, 689, 700, 704, 711, 715, 722, 726, 731, 740, 744, 768, 785, 791, 794, 797, 807, 813, 816, 819, 827, 830, 834, 837, 851, 868, 873, 877, 883, 890, 902, 906, 909, 918, 932, 959, 967, 969, 971, 979, 983, 987, 995, 999, 1008, 1012, 1014, 1024, 1035, 1040, 1047, 1060, 1067, 1071, 1083, 1089, 1092, 1099, 1111, 1117, 1121, 1127, 1134, 1143, 1147, 1157, 1159, 1162, 1170, 1175, 1185, 1190, 1202, 1208, 1218, 1224, 1234] \ No newline at end of file diff --git a/posthog/hogql/grammar/HogQLParser.py b/posthog/hogql/grammar/HogQLParser.py index 2c66aafba7fed..f625e77440088 100644 --- a/posthog/hogql/grammar/HogQLParser.py +++ b/posthog/hogql/grammar/HogQLParser.py @@ -158,7 +158,7 @@ def serializedATN(): 1,0,0,0,195,198,1,0,0,0,196,194,1,0,0,0,197,199,5,112,0,0,198,197, 1,0,0,0,198,199,1,0,0,0,199,9,1,0,0,0,200,210,3,12,6,0,201,210,3, 14,7,0,202,210,3,16,8,0,203,210,3,18,9,0,204,210,3,20,10,0,205,210, - 3,22,11,0,206,210,3,24,12,0,207,210,3,26,13,0,208,210,3,28,14,0, + 3,22,11,0,206,210,3,28,14,0,207,210,3,24,12,0,208,210,3,26,13,0, 209,200,1,0,0,0,209,201,1,0,0,0,209,202,1,0,0,0,209,203,1,0,0,0, 209,204,1,0,0,0,209,205,1,0,0,0,209,206,1,0,0,0,209,207,1,0,0,0, 209,208,1,0,0,0,210,11,1,0,0,0,211,213,5,70,0,0,212,214,3,4,2,0, @@ -1179,6 +1179,10 @@ def varAssignment(self): return self.getTypedRuleContext(HogQLParser.VarAssignmentContext,0) + def block(self): + return self.getTypedRuleContext(HogQLParser.BlockContext,0) + + def exprStmt(self): return self.getTypedRuleContext(HogQLParser.ExprStmtContext,0) @@ -1187,10 +1191,6 @@ def emptyStmt(self): return self.getTypedRuleContext(HogQLParser.EmptyStmtContext,0) - def block(self): - return self.getTypedRuleContext(HogQLParser.BlockContext,0) - - def getRuleIndex(self): return HogQLParser.RULE_statement @@ -1250,19 +1250,19 @@ def statement(self): elif la_ == 7: self.enterOuterAlt(localctx, 7) self.state = 206 - self.exprStmt() + self.block() pass elif la_ == 8: self.enterOuterAlt(localctx, 8) self.state = 207 - self.emptyStmt() + self.exprStmt() pass elif la_ == 9: self.enterOuterAlt(localctx, 9) self.state = 208 - self.block() + self.emptyStmt() pass diff --git a/posthog/hogql/parser.py b/posthog/hogql/parser.py index cce0e70a9d22b..702088eaddd2a 100644 --- a/posthog/hogql/parser.py +++ b/posthog/hogql/parser.py @@ -19,22 +19,25 @@ parse_order_expr as _parse_order_expr_cpp, parse_select as _parse_select_cpp, parse_full_template_string as _parse_full_template_string_cpp, + parse_program as _parse_program_cpp, ) RULE_TO_PARSE_FUNCTION: dict[ - Literal["python", "cpp"], dict[Literal["expr", "order_expr", "select", "full_template_string"], Callable] + Literal["python", "cpp"], dict[Literal["expr", "order_expr", "select", "full_template_string", "program"], Callable] ] = { "python": { "expr": lambda string, start: HogQLParseTreeConverter(start=start).visit(get_parser(string).expr()), "order_expr": lambda string: HogQLParseTreeConverter().visit(get_parser(string).orderExpr()), "select": lambda string: HogQLParseTreeConverter().visit(get_parser(string).select()), "full_template_string": lambda string: HogQLParseTreeConverter().visit(get_parser(string).fullTemplateString()), + "program": lambda string: HogQLParseTreeConverter().visit(get_parser(string).program()), }, "cpp": { "expr": lambda string, start: _parse_expr_cpp(string, is_internal=start is None), "order_expr": lambda string: _parse_order_expr_cpp(string), "select": lambda string: _parse_select_cpp(string), "full_template_string": lambda string: _parse_full_template_string_cpp(string), + "program": lambda string: _parse_program_cpp(string), }, } @@ -48,16 +51,6 @@ } -def parse_program( - program: str, placeholders: Optional[dict[str, ast.Expr]] = None, start: Optional[int] = 0 -) -> ast.Program: - parse_tree = get_parser(program).program() - node = HogQLParseTreeConverter(start=start).visit(parse_tree) - if placeholders: - return cast(ast.Program, replace_placeholders(node, placeholders)) - return node - - def parse_string_template( string: str, placeholders: Optional[dict[str, ast.Expr]] = None, @@ -132,6 +125,20 @@ def parse_select( return node +def parse_program( + source: str, + timings: Optional[HogQLTimings] = None, + *, + backend: Literal["python", "cpp"] = "cpp", +) -> ast.Program: + if timings is None: + timings = HogQLTimings() + with timings.measure(f"parse_expr_{backend}"): + with RULE_TO_HISTOGRAM["expr"].labels(backend=backend).time(): + node = RULE_TO_PARSE_FUNCTION[backend]["program"](source) + return node + + def get_parser(query: str) -> HogQLParser: input_stream = InputStream(data=query) lexer = HogQLLexer(input_stream) @@ -271,6 +278,8 @@ def visitBlock(self, ctx: HogQLParser.BlockContext): declarations.append(cast(ast.Declaration, statement)) return ast.Block(declarations=declarations) + ##### HogQL rules + def visitSelect(self, ctx: HogQLParser.SelectContext): return self.visit(ctx.selectUnionStmt() or ctx.selectStmt() or ctx.hogqlxTagElement()) diff --git a/posthog/hogql/test/_test_parser.py b/posthog/hogql/test/_test_parser.py index b38b0096cb864..025ef5a7024b6 100644 --- a/posthog/hogql/test/_test_parser.py +++ b/posthog/hogql/test/_test_parser.py @@ -1,7 +1,29 @@ from typing import Literal, cast, Optional import math - +from posthog.hogql.ast import ( + VariableAssignment, + Constant, + ArithmeticOperation, + Field, + ExprStatement, + Call, + ArithmeticOperationOp, + CompareOperationOp, + CompareOperation, + JoinExpr, + SelectQuery, + Program, + IfStatement, + Block, + WhileStatement, + Function, + Array, + Dict, + VariableDeclaration, +) + +from posthog.hogql.parser import parse_program from posthog.hogql import ast from posthog.hogql.errors import ExposedHogQLError, SyntaxError from posthog.hogql.parser import parse_expr, parse_order_expr, parse_select, parse_string_template @@ -34,6 +56,9 @@ def _select( clear_locations(parse_select(query, placeholders=placeholders, backend=backend)), ) + def _program(self, program: str) -> ast.Program: + return cast(ast.Program, clear_locations(cast(ast.Expr, parse_program(program, backend=backend)))) + def test_numbers(self): self.assertEqual(self._expr("1"), ast.Constant(value=1)) self.assertEqual(self._expr("1.2"), ast.Constant(value=1.2)) @@ -1796,4 +1821,390 @@ def test_template_strings_full_multiline(self): ], ) + def test_program_variable_declarations(self): + code = "let a := '123'; let b := a - 2; print(b);" + program = self._program(code) + + expected = Program( + declarations=[ + VariableDeclaration(name="a", expr=Constant(type=None, value="123")), + VariableDeclaration( + name="b", + expr=ArithmeticOperation( + type=None, + left=Field(type=None, chain=["a"]), + right=Constant(type=None, value=2), + op=ArithmeticOperationOp.Sub, + ), + ), + ExprStatement( + expr=Call( + type=None, + name="print", + args=[Field(type=None, chain=["b"])], + params=None, + distinct=False, + ), + ), + ] + ) + self.assertEqual(program, expected) + + def test_program_variable_reassignment(self): + code = "let a := 3; a := 4;" + program = self._program(code) + expected = Program( + start=None, + end=None, + declarations=[ + VariableDeclaration( + start=None, + end=None, + name="a", + expr=Constant(start=None, end=None, type=None, value=3), + ), + VariableAssignment( + start=None, + end=None, + left=Field(chain=["a"]), + right=Constant(start=None, end=None, type=None, value=4), + ), + ], + ) + self.assertEqual(program, expected) + + def test_program_variable_declarations_with_sql_expr(self): + code = """ + let query := (select id, properties.email from events where timestamp > now() - interval 1 day); + let results := run(query); + """ + program = self._program(code) + expected = Program( + declarations=[ + VariableDeclaration( + name="query", + expr=SelectQuery( + type=None, + ctes=None, + select=[ + Field(type=None, chain=["id"]), + Field(type=None, chain=["properties", "email"]), + ], + distinct=None, + select_from=JoinExpr( + type=None, + join_type=None, + table=Field(type=None, chain=["events"]), + table_args=None, + alias=None, + table_final=None, + constraint=None, + next_join=None, + sample=None, + ), + array_join_op=None, + array_join_list=None, + window_exprs=None, + where=CompareOperation( + type=None, + left=Field(type=None, chain=["timestamp"]), + right=ArithmeticOperation( + type=None, + left=Call(type=None, name="now", args=[], params=None, distinct=False), + right=Call( + type=None, + name="toIntervalDay", + args=[Constant(type=None, value=1)], + params=None, + distinct=False, + ), + op=ArithmeticOperationOp.Sub, + ), + op=CompareOperationOp.Gt, + ), + prewhere=None, + having=None, + group_by=None, + order_by=None, + limit=None, + limit_by=None, + limit_with_ties=None, + offset=None, + settings=None, + view_name=None, + ), + ), + VariableDeclaration( + name="results", + expr=Call( + name="run", + args=[Field(type=None, chain=["query"])], + params=None, + distinct=False, + ), + ), + ] + ) + self.assertEqual(program, expected) + + def test_program_if(self): + code = """ + if (a) { + let c := 3; + } + else + print(d); + """ + + program = self._program(code) + expected = Program( + declarations=[ + IfStatement( + expr=Field(type=None, chain=["a"]), + then=Block( + declarations=[ + VariableDeclaration( + name="c", + expr=Constant(type=None, value=3), + ) + ], + ), + else_=ExprStatement( + expr=Call( + type=None, + name="print", + args=[Field(type=None, chain=["d"])], + params=None, + distinct=False, + ), + ), + ) + ], + ) + + self.assertEqual(program, expected) + + def test_program_while(self): + code = """ + while (a < 5) { + let c := 3; + } + """ + + program = self._program(code) + expected = Program( + declarations=[ + WhileStatement( + expr=CompareOperation( + type=None, + left=Field(type=None, chain=["a"]), + right=Constant(type=None, value=5), + op=CompareOperationOp.Lt, + ), + body=Block( + declarations=[VariableDeclaration(name="c", expr=Constant(type=None, value=3))], + ), + ) + ], + ) + + self.assertEqual(program, expected) + + def test_program_function(self): + code = """ + fn query(a, b) { + let c := 3; + } + """ + + program = self._program(code) + expected = Program( + declarations=[ + Function( + name="query", + params=["a", "b"], + body=Block( + declarations=[VariableDeclaration(name="c", expr=Constant(type=None, value=3))], + ), + ) + ], + ) + self.assertEqual(program, expected) + + def test_program_functions(self): + code = """ + fn query(a, b) { + let c := 3; + } + + fn read(a, b) { + print(3); + let b := 4; + } + """ + + program = self._program(code) + + expected = Program( + start=None, + end=None, + declarations=[ + Function( + start=None, + end=None, + name="query", + params=["a", "b"], + body=Block( + start=None, + end=None, + declarations=[ + VariableDeclaration( + start=None, + end=None, + name="c", + expr=Constant(start=None, end=None, type=None, value=3), + ) + ], + ), + ), + Function( + start=None, + end=None, + name="read", + params=["a", "b"], + body=Block( + start=None, + end=None, + declarations=[ + ExprStatement( + start=None, + end=None, + expr=Call( + start=None, + end=None, + type=None, + name="print", + args=[Constant(start=None, end=None, type=None, value=3)], + params=None, + distinct=False, + ), + ), + VariableDeclaration( + start=None, + end=None, + name="b", + expr=Constant(start=None, end=None, type=None, value=4), + ), + ], + ), + ), + ], + ) + self.assertEqual(program, expected) + + def test_program_array(self): + code = "let a := [1, 2, 3];" + program = self._program(code) + + expected = Program( + start=None, + end=None, + declarations=[ + VariableDeclaration( + start=None, + end=None, + name="a", + expr=Array( + start=None, + end=None, + type=None, + exprs=[ + Constant(start=None, end=None, type=None, value=1), + Constant(start=None, end=None, type=None, value=2), + Constant(start=None, end=None, type=None, value=3), + ], + ), + ) + ], + ) + self.assertEqual(program, expected) + + def test_program_dict(self): + code = "let a := {};" + program = self._program(code) + + expected = Program( + start=None, + end=None, + declarations=[ + VariableDeclaration( + start=None, + end=None, + name="a", + expr=Dict(start=None, end=None, type=None, items=[]), + ) + ], + ) + + self.assertEqual(program, expected) + + code = "let a := {1: 2, 'a': [3, 4], g: true};" + program = self._program(code) + + expected = Program( + start=None, + end=None, + declarations=[ + VariableDeclaration( + start=None, + end=None, + name="a", + expr=Dict( + start=None, + end=None, + type=None, + items=[ + ( + Constant(start=None, end=None, type=None, value=1), + Constant(start=None, end=None, type=None, value=2), + ), + ( + Constant(start=None, end=None, type=None, value="a"), + Array( + start=None, + end=None, + type=None, + exprs=[ + Constant(start=None, end=None, type=None, value=3), + Constant(start=None, end=None, type=None, value=4), + ], + ), + ), + ( + Field(start=None, end=None, type=None, chain=["g"]), + Constant(start=None, end=None, type=None, value=True), + ), + ], + ), + ) + ], + ) + self.assertEqual(program, expected) + + def test_program_simple_return(self): + code = "return" + program = self._program(code) + expected = Program( + declarations=[ast.ReturnStatement(expr=None)], + ) + self.assertEqual(program, expected) + + def test_program_simple_return_twice(self): + code = "return;return" + program = self._program(code) + expected = Program( + declarations=[ast.ReturnStatement(expr=None), ast.ReturnStatement(expr=None)], + ) + self.assertEqual(program, expected) + return TestParser diff --git a/posthog/hogql/test/test_parser_python.py b/posthog/hogql/test/test_parser_python.py index 72f00cff6bc62..ca713640add0b 100644 --- a/posthog/hogql/test/test_parser_python.py +++ b/posthog/hogql/test/test_parser_python.py @@ -1,400 +1,5 @@ from ._test_parser import parser_test_factory -from posthog.hogql.ast import ( - VariableAssignment, - Constant, - ArithmeticOperation, - Field, - ExprStatement, - Call, - ArithmeticOperationOp, - CompareOperationOp, - CompareOperation, - JoinExpr, - SelectQuery, - Program, - IfStatement, - Block, - WhileStatement, - Function, - Array, - Dict, - VariableDeclaration, -) - -from posthog.hogql.parser import parse_program -from posthog.hogql import ast class TestParserPython(parser_test_factory("python")): - def _program(self, program: str, placeholders: dict[str, ast.Expr] | None = None) -> ast.Program: - return parse_program(program, placeholders=placeholders, start=None) - - def test_program_variable_declarations(self): - code = "let a := '123'; let b := a - 2; print(b);" - program = self._program(code) - - expected = Program( - declarations=[ - VariableDeclaration(name="a", expr=Constant(type=None, value="123")), - VariableDeclaration( - name="b", - expr=ArithmeticOperation( - type=None, - left=Field(type=None, chain=["a"]), - right=Constant(type=None, value=2), - op=ArithmeticOperationOp.Sub, - ), - ), - ExprStatement( - expr=Call( - type=None, - name="print", - args=[Field(type=None, chain=["b"])], - params=None, - distinct=False, - ), - ), - ] - ) - self.assertEqual(program, expected) - - def test_program_variable_reassignment(self): - code = "let a := 3; a := 4;" - program = self._program(code) - expected = Program( - start=None, - end=None, - declarations=[ - VariableDeclaration( - start=None, - end=None, - name="a", - expr=Constant(start=None, end=None, type=None, value=3), - ), - VariableAssignment( - start=None, - end=None, - left=Field(chain=["a"]), - right=Constant(start=None, end=None, type=None, value=4), - ), - ], - ) - self.assertEqual(program, expected) - - def test_program_variable_declarations_with_sql_expr(self): - code = """ - let query := (select id, properties.email from events where timestamp > now() - interval 1 day); - let results := run(query); - """ - program = self._program(code) - expected = Program( - declarations=[ - VariableDeclaration( - name="query", - expr=SelectQuery( - type=None, - ctes=None, - select=[ - Field(type=None, chain=["id"]), - Field(type=None, chain=["properties", "email"]), - ], - distinct=None, - select_from=JoinExpr( - type=None, - join_type=None, - table=Field(type=None, chain=["events"]), - table_args=None, - alias=None, - table_final=None, - constraint=None, - next_join=None, - sample=None, - ), - array_join_op=None, - array_join_list=None, - window_exprs=None, - where=CompareOperation( - type=None, - left=Field(type=None, chain=["timestamp"]), - right=ArithmeticOperation( - type=None, - left=Call(type=None, name="now", args=[], params=None, distinct=False), - right=Call( - type=None, - name="toIntervalDay", - args=[Constant(type=None, value=1)], - params=None, - distinct=False, - ), - op=ArithmeticOperationOp.Sub, - ), - op=CompareOperationOp.Gt, - ), - prewhere=None, - having=None, - group_by=None, - order_by=None, - limit=None, - limit_by=None, - limit_with_ties=None, - offset=None, - settings=None, - view_name=None, - ), - ), - VariableDeclaration( - name="results", - expr=Call( - name="run", - args=[Field(type=None, chain=["query"])], - params=None, - distinct=False, - ), - ), - ] - ) - self.assertEqual(program, expected) - - def test_program_if(self): - code = """ - if (a) { - let c := 3; - } - else - print(d); - """ - - program = self._program(code) - expected = Program( - declarations=[ - IfStatement( - expr=Field(type=None, chain=["a"]), - then=Block( - declarations=[ - VariableDeclaration( - name="c", - expr=Constant(type=None, value=3), - ) - ], - ), - else_=ExprStatement( - expr=Call( - type=None, - name="print", - args=[Field(type=None, chain=["d"])], - params=None, - distinct=False, - ), - ), - ) - ], - ) - - self.assertEqual(program, expected) - - def test_program_while(self): - code = """ - while (a < 5) { - let c := 3; - } - """ - - program = self._program(code) - expected = Program( - declarations=[ - WhileStatement( - expr=CompareOperation( - type=None, - left=Field(type=None, chain=["a"]), - right=Constant(type=None, value=5), - op=CompareOperationOp.Lt, - ), - body=Block( - declarations=[VariableDeclaration(name="c", expr=Constant(type=None, value=3))], - ), - ) - ], - ) - - self.assertEqual(program, expected) - - def test_program_function(self): - code = """ - fn query(a, b) { - let c := 3; - } - """ - - program = self._program(code) - expected = Program( - declarations=[ - Function( - name="query", - params=["a", "b"], - body=Block( - declarations=[VariableDeclaration(name="c", expr=Constant(type=None, value=3))], - ), - ) - ], - ) - self.assertEqual(program, expected) - - def test_program_functions(self): - code = """ - fn query(a, b) { - let c := 3; - } - - fn read(a, b) { - print(3); - let b := 4; - } - """ - - program = self._program(code) - - expected = Program( - start=None, - end=None, - declarations=[ - Function( - start=None, - end=None, - name="query", - params=["a", "b"], - body=Block( - start=None, - end=None, - declarations=[ - VariableDeclaration( - start=None, - end=None, - name="c", - expr=Constant(start=None, end=None, type=None, value=3), - ) - ], - ), - ), - Function( - start=None, - end=None, - name="read", - params=["a", "b"], - body=Block( - start=None, - end=None, - declarations=[ - ExprStatement( - start=None, - end=None, - expr=Call( - start=None, - end=None, - type=None, - name="print", - args=[Constant(start=None, end=None, type=None, value=3)], - params=None, - distinct=False, - ), - ), - VariableDeclaration( - start=None, - end=None, - name="b", - expr=Constant(start=None, end=None, type=None, value=4), - ), - ], - ), - ), - ], - ) - self.assertEqual(program, expected) - - def test_program_array(self): - code = "let a := [1, 2, 3];" - program = self._program(code) - - expected = Program( - start=None, - end=None, - declarations=[ - VariableDeclaration( - start=None, - end=None, - name="a", - expr=Array( - start=None, - end=None, - type=None, - exprs=[ - Constant(start=None, end=None, type=None, value=1), - Constant(start=None, end=None, type=None, value=2), - Constant(start=None, end=None, type=None, value=3), - ], - ), - ) - ], - ) - self.assertEqual(program, expected) - - def test_program_dict(self): - code = "let a := {};" - program = self._program(code) - - expected = Program( - start=None, - end=None, - declarations=[ - VariableDeclaration( - start=None, - end=None, - name="a", - expr=Dict(start=None, end=None, type=None, items=[]), - ) - ], - ) - - self.assertEqual(program, expected) - - code = "let a := {1: 2, 'a': [3, 4], g: true};" - program = self._program(code) - - expected = Program( - start=None, - end=None, - declarations=[ - VariableDeclaration( - start=None, - end=None, - name="a", - expr=Dict( - start=None, - end=None, - type=None, - items=[ - ( - Constant(start=None, end=None, type=None, value=1), - Constant(start=None, end=None, type=None, value=2), - ), - ( - Constant(start=None, end=None, type=None, value="a"), - Array( - start=None, - end=None, - type=None, - exprs=[ - Constant(start=None, end=None, type=None, value=3), - Constant(start=None, end=None, type=None, value=4), - ], - ), - ), - ( - Field(start=None, end=None, type=None, chain=["g"]), - Constant(start=None, end=None, type=None, value=True), - ), - ], - ), - ) - ], - ) - self.assertEqual(program, expected) + pass diff --git a/posthog/hogql/visitor.py b/posthog/hogql/visitor.py index d03e691b640ec..947e07921f50b 100644 --- a/posthog/hogql/visitor.py +++ b/posthog/hogql/visitor.py @@ -1,3 +1,4 @@ +from copy import deepcopy from typing import Optional, TypeVar, Generic, Any from posthog.hogql import ast @@ -80,6 +81,11 @@ def visit_array(self, node: ast.Array): for expr in node.exprs: self.visit(expr) + def visit_dict(self, node: ast.Dict): + for key, value in node.items: + self.visit(key) + self.visit(value) + def visit_constant(self, node: ast.Constant): self.visit(node.type) @@ -286,6 +292,13 @@ def visit_while_statement(self, node: ast.WhileStatement): self.visit(node.expr) self.visit(node.body) + def visit_for_statement(self, node: ast.ForStatement): + if node.initializer: + self.visit(node.initializer) + self.visit(node.condition) + self.visit(node.increment) + self.visit(node.body) + def visit_expr_statement(self, node: ast.ExprStatement): self.visit(node.expr) @@ -293,6 +306,9 @@ def visit_return_statement(self, node: ast.ReturnStatement): if node.expr: self.visit(node.expr) + def visit_function(self, node: ast.Function): + self.visit(node.body) + def visit_declaration(self, node: ast.Declaration): raise NotImplementedError("Abstract 'visit_declaration' not implemented") @@ -432,6 +448,14 @@ def visit_array(self, node: ast.Array): exprs=[self.visit(expr) for expr in node.exprs], ) + def visit_dict(self, node: ast.Dict): + return ast.Dict( + start=None if self.clear_locations else node.start, + end=None if self.clear_locations else node.end, + type=None if self.clear_types else node.type, + items=[(self.visit(key), self.visit(value)) for key, value in node.items], + ) + def visit_constant(self, node: ast.Constant): return ast.Constant( start=None if self.clear_locations else node.start, @@ -613,6 +637,16 @@ def visit_while_statement(self, node: ast.WhileStatement): body=self.visit(node.body), ) + def visit_for_statement(self, node: ast.ForStatement): + return ast.ForStatement( + start=None if self.clear_locations else node.start, + end=None if self.clear_locations else node.end, + initializer=self.visit(node.initializer) if node.initializer else None, + condition=self.visit(node.condition), + increment=self.visit(node.increment), + body=self.visit(node.body), + ) + def visit_expr_statement(self, node: ast.ExprStatement): return ast.ExprStatement( start=None if self.clear_locations else node.start, @@ -627,6 +661,15 @@ def visit_return_statement(self, node: ast.ReturnStatement): expr=self.visit(node.expr) if node.expr else None, ) + def visit_function(self, node: ast.Function): + return ast.Function( + start=None if self.clear_locations else node.start, + end=None if self.clear_locations else node.end, + name=node.name, + params=deepcopy(node.params), + body=self.visit(node.body), + ) + def visit_declaration(self, node: ast.Declaration): raise NotImplementedError("Abstract 'visit_declaration' not implemented") diff --git a/requirements.in b/requirements.in index 9184cdadde7ae..6b59c0ad8f13a 100644 --- a/requirements.in +++ b/requirements.in @@ -93,7 +93,7 @@ phonenumberslite==8.13.6 openai==1.10.0 tiktoken==0.6.0 nh3==0.2.14 -hogql-parser==1.0.14 +hogql-parser==1.0.21 zxcvbn==4.4.28 zstd==1.5.5.1 xmlsec==1.3.14 diff --git a/requirements.txt b/requirements.txt index 04caf723c366c..13796a6133fd7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -276,7 +276,7 @@ h11==0.13.0 # wsproto hexbytes==1.0.0 # via dlt -hogql-parser==1.0.14 +hogql-parser==1.0.21 # via -r requirements.in httpcore==1.0.2 # via httpx