Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(hogql): add native Rust HogQL parser (rust-json backend) (#58949)

Robbiec824f65be0b7
diff --git a/.github/workflows/build-hogql-parser-rs.yml b/.github/workflows/build-hogql-parser-rs.yml
new file mode 100644
index 000000000000..1bcfb02e50f3
--- /dev/null
+++ b/.github/workflows/build-hogql-parser-rs.yml
@@ -0,0 +1,254 @@
+name: Release hogql-parser-rs
+
+on:
+ pull_request:
+ paths:
+ - rust/hogql/parser/**
+ - .github/workflows/build-hogql-parser-rs.yml
+
+permissions:
+ contents: read
+ pull-requests: write
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ check-version:
+ name: Check version legitimacy
+ runs-on: ubuntu-22.04
+ timeout-minutes: 5
+ outputs:
+ parser-release-needed: ${{ steps.version.outputs.parser-release-needed }}
+ local-version: ${{ steps.version.outputs.local-version }}
+ steps:
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
+ with:
+ fetch-depth: 0
+ filter: blob:none
+
+ - name: Check if rust/hogql/parser/ has changed
+ id: changed-files
+ uses: step-security/changed-files@2e07db73e5ccdb319b9a6c7766bd46d39d304bad # v47.0.5
+ with:
+ files_yaml: |
+ parser:
+ - rust/hogql/parser/**
+
+ - name: Check if version was bumped
+ shell: bash
+ id: version
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ PARSER_CHANGED: ${{ steps.changed-files.outputs.parser_any_changed }}
+ IS_FORK: ${{ github.event.pull_request.head.repo.full_name != 'PostHog/posthog' }}
+ PR_NUMBER: ${{ github.event.pull_request.number }}
+ run: |
+ parser_release_needed='false'
+ # Local version from the pyproject.toml — single source of truth, matches Cargo.toml.
+ local=$(grep -m1 '^version = ' rust/hogql/parser/pyproject.toml | sed -E 's/version = "(.*)"/\1/')
+ echo "local-version=$local" >> $GITHUB_OUTPUT
+ if [[ "$PARSER_CHANGED" == 'true' ]]; then
+ # PyPI returns 404 until the first publish — treat as "needs release".
+ published=$(curl -fSsl https://pypi.org/pypi/hogql-parser-rs/json 2>/dev/null | jq -r '.info.version' || echo '')
+ if [[ "$published" != "$local" ]]; then
+ parser_release_needed='true'
+ else
+ message_body="It looks like the code of \`hogql-parser-rs\` changed in this PR, but its version stayed the same at $local. 👀"
+ message_body+=$'\n'"Bump the version in \`rust/hogql/parser/Cargo.toml\` AND \`rust/hogql/parser/pyproject.toml\` (the two must match) before merging."
+ if [[ "$IS_FORK" == 'true' ]]; then
+ message_body+=$'\n'"This needs to be performed on a branch created on the PostHog/posthog repo itself. A PostHog team member can assist with this."
+ fi
+ existing=$(gh api "repos/${{ github.repository }}/issues/$PR_NUMBER/comments" --jq '.[] | select(.user.login == "github-actions[bot]") | select(.body | test("hogql-parser-rs.*version stayed the same.*👀")) | .id' | tail -1)
+ if [[ -n "$existing" ]]; then
+ gh api "repos/${{ github.repository }}/issues/comments/$existing" -X PATCH -f body="$message_body"
+ else
+ gh pr comment "$PR_NUMBER" --body "$message_body"
+ fi
+ fi
+ fi
+ echo "parser-release-needed=$parser_release_needed" >> $GITHUB_OUTPUT
+
+ - name: Sanity check Cargo.toml and pyproject.toml versions match
+ shell: bash
+ run: |
+ pyproject_v=$(grep -m1 '^version = ' rust/hogql/parser/pyproject.toml | sed -E 's/version = "(.*)"/\1/')
+ cargo_v=$(grep -m1 '^version = ' rust/hogql/parser/Cargo.toml | sed -E 's/version = "(.*)"/\1/')
+ if [[ "$pyproject_v" != "$cargo_v" ]]; then
+ echo "::error::pyproject.toml version ($pyproject_v) does not match Cargo.toml version ($cargo_v) — they must match."
+ exit 1
+ fi
+
+ build-wheels:
+ name: Build wheels on ${{ matrix.os }} (${{ matrix.target }})
+ needs: check-version
+ runs-on: ${{ matrix.os }}
+ timeout-minutes: 30
+ if: needs.check-version.outputs.parser-release-needed == 'true' &&
+ github.event.pull_request.head.repo.full_name == 'PostHog/posthog'
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - os: ubuntu-22.04
+ target: x86_64
+ manylinux: 2_28
+ - os: ubuntu-22.04-arm
+ target: aarch64
+ manylinux: 2_28
+ # musllinux: alpine docker users (e.g. distroless setups).
+ - os: ubuntu-22.04
+ target: x86_64
+ manylinux: musllinux_1_2
+ - os: ubuntu-22.04-arm
+ target: aarch64
+ manylinux: musllinux_1_2
+ - os: macos-14
+ target: aarch64
+ - os: macos-15-intel
+ target: x86_64
+
+ steps:
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
+
+ - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
+ with:
+ python-version: '3.12.10' # 3.12.11/.12 binaries lag on macOS
+
+ - name: Build wheel via maturin
+ uses: PyO3/maturin-action@aef21716ff3dcae8a1c301d23ec3e4446972a6e3 # v1.49.3
+ with:
+ command: build
+ target: ${{ matrix.target }}
+ manylinux: ${{ matrix.manylinux || 'auto' }}
+ args: --release --out dist --manifest-path rust/hogql/parser/Cargo.toml
+ env:
+ # Override `rust/.cargo/config.toml`'s `-fuse-ld=lld` (a flox-dev
+ # optimization that assumes lld is on PATH — GitHub Actions runners
+ # don't ship it). Empty RUSTFLAGS overrides the file-level config
+ # per Cargo's precedence rules; the workspace's `tokio_unstable`
+ # cfg isn't reachable from this crate's dep graph.
+ RUSTFLAGS: ''
+
+ - name: Build sdist (linux x86_64 manylinux only)
+ if: matrix.os == 'ubuntu-22.04' && matrix.target == 'x86_64' && matrix.manylinux == '2_28'
+ uses: PyO3/maturin-action@aef21716ff3dcae8a1c301d23ec3e4446972a6e3 # v1.49.3
+ with:
+ command: sdist
+ args: --out dist --manifest-path rust/hogql/parser/Cargo.toml
+ env:
+ RUSTFLAGS: ''
+
+ - name: Upload artifact
+ uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
+ with:
+ # `manylinux` is included to disambiguate the two linux runs per
+ # arch (glibc 2_28 vs musllinux_1_2); macOS rows leave it unset.
+ name: wheels-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.manylinux || 'native' }}
+ path: dist/*
+ if-no-files-found: error
+
+ publish:
+ name: Publish on PyPI
+ needs: [check-version, build-wheels]
+ environment: pypi-hogql-parser-rs
+ permissions:
+ id-token: write # PyPI trusted publishing + provenance OIDC handshake
+ attestations: write # actions/attest-build-provenance writes here
+ runs-on: ubuntu-22.04
+ timeout-minutes: 10
+ steps:
+ - name: Download all wheel artifacts
+ uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
+ with:
+ pattern: wheels-*
+ merge-multiple: true
+ path: dist
+
+ - name: Generate artifact attestations
+ uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0
+ with:
+ subject-path: 'dist/*'
+
+ - name: Publish package to PyPI
+ uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
+ with:
+ # Attaches the attestations generated above to the PyPI release.
+ attestations: true
+
+ - name: Get app token
+ id: app-token
+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
+ with:
+ client-id: ${{ secrets.GH_APP_POSTHOG_TESTS_APP_ID }}
+ private-key: ${{ secrets.GH_APP_POSTHOG_TESTS_PRIVATE_KEY }}
+
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
+ with:
+ ref: ${{ github.event.pull_request.head.ref }}
+ token: ${{ steps.app-token.outputs.token }}
+
+ - name: Set up Python
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
+ with:
+ python-version: 3.12.12
+
+ - name: Install uv
+ id: setup-uv
+ uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
+ with:
+ version: '0.10.2'
+ enable-cache: true
+ cache-dependency-glob: uv.lock
+ save-cache: ${{ github.ref == 'refs/heads/master' }}
+
+ - name: Update hogql-parser-rs in requirements
+ shell: bash
+ env:
+ RETRIES: 20
+ VERSION: ${{ needs.check-version.outputs.local-version }}
+ run: |
+ # `--refresh-package` bypasses the restored uv index cache, which
+ # otherwise won't have the version we just published. Retry anyway
+ # in case PyPI propagation lags the publish step.
+ for i in $(seq 1 "$RETRIES"); do
+ if uv add --refresh-package hogql-parser-rs "hogql-parser-rs==$VERSION"; then
+ break
+ fi
+ if [[ $i -eq $RETRIES ]]; then
+ echo "Failed to update hogql-parser-rs in requirements"
+ exit 1
+ fi
+ sleep 0.5
+ done
+
+ - uses: EndBug/add-and-commit@290ea2c423ad77ca9c62ae0f5b224379612c0321 # v10.0.0
+ id: commit-pin
+ with:
+ add: |
+ pyproject.toml
+ uv.lock
+ message: 'Use new hogql-parser-rs version'
+ default_author: github_actions
+ github_token: ${{ steps.app-token.outputs.token }}
+
+ - name: Verify pin is consistent with the published version
+ shell: bash
+ env:
+ PUSHED: ${{ steps.commit-pin.outputs.pushed }}
+ VERSION: ${{ needs.check-version.outputs.local-version }}
+ run: |
+ # The commit step is a no-op when pyproject.toml + uv.lock were already
+ # pre-bumped on the branch to the version we just published — fine.
+ # Verify the pin is consistent with the published version (i.e. the
+ # branch is in a deployable state) before declaring success.
+ if [[ "$PUSHED" != "true" ]]; then
+ pinned=$(grep -m1 'hogql-parser-rs==' pyproject.toml | sed -E 's/.*hogql-parser-rs==([^"]*).*/\1/')
+ if [[ "$pinned" != "$VERSION" ]]; then
+ echo "::error::hogql-parser-rs published to PyPI as $VERSION but pyproject.toml pin says $pinned."
+ echo "Check the 'Update hogql-parser-rs in requirements' step above for why uv add did not produce a diff."
+ exit 1
+ fi
+ echo "pyproject.toml already pinned to $VERSION; commit-pin no-op is expected."
+ fi
diff --git a/.github/workflows/build-hogql-parser.yml b/.github/workflows/build-hogql-parser.yml
index 576434d04433..bd93c29a2ca4 100644
--- a/.github/workflows/build-hogql-parser.yml
+++ b/.github/workflows/build-hogql-parser.yml
@@ -54,7 +54,7 @@ jobs:
message_body="It looks like the code of \`hogql-parser\` changed in this PR, but its version stayed the same at $local. 👀"
message_body+=$'\n'"Make sure to resolve this in \`common/hogql_parser/setup.py\` before merging!"
if [[ "$IS_FORK" == 'true' ]]; then
- message_body+=$'\n'"This needs to be performed on a branch created on the PostHog/posthog repo itself. A PostHog team member will assist with this."
+ message_body+=$'\n'"This needs to be performed on a branch created on the PostHog/posthog repo itself. A PostHog team member can assist with this."
fi
# Post once, then edit in place on subsequent pushes
existing=$(gh api "repos/${{ github.repository }}/issues/$PR_NUMBER/comments" --jq '.[] | select(.user.login == "github-actions[bot]") | select(.body | test("hogql-parser.*version stayed the same.*👀")) | .id' | tail -1)
diff --git a/common/hogql_parser/HogQLLexer.cpp b/common/hogql_parser/HogQLLexer.cpp
index 9f9c35d3786e..1729a3c72d07 100644
--- a/common/hogql_parser/HogQLLexer.cpp
+++ b/common/hogql_parser/HogQLLexer.cpp
@@ -96,8 +96,10 @@ void hogqllexerLexerInitialize() {
"SINGLE_LINE_COMMENT", "WHITESPACE", "UNEXPECTED_CHARACTER", "STRING_TEXT",
"STRING_ESCAPE_TRIGGER", "STRING_QUOTE_SINGLE", "FULL_STRING_TEXT",
"FULL_STRING_ESCAPE_TRIGGER", "TAG_SELF_CLOSE_GT", "TAG_OPEN_GT",
- "TAG_IDENT", "TAG_EQ", "TAG_STRING", "TAG_WS", "TAG_LBRACE", "TAGC_GT",
- "TAGC_IDENT", "TAGC_WS", "HOGQLX_TEXT_TEXT", "HOGQLX_TEXT_LBRACE",
+ "TAG_MULTI_LINE_COMMENT", "TAG_SINGLE_LINE_COMMENT", "TAG_IDENT",
+ "TAG_EQ", "TAG_STRING", "TAG_WS", "TAG_LBRACE", "TAG_UNEXPECTED",
+ "TAGC_GT", "TAGC_MULTI_LINE_COMMENT", "TAGC_SINGLE_LINE_COMMENT",
+ "TAGC_IDENT", "TAGC_WS", "TAGC_UNEXPECTED", "HOGQLX_TEXT_TEXT", "HOGQLX_TEXT_LBRACE",
"HOGQLX_TEXT_LT_SLASH", "HOGQLX_TEXT_LT", "HOGQLX_TEXT_WS"
},
std::vector<std::string>{
@@ -154,12 +156,13 @@ void hogqllexerLexerInitialize() {
"REGEX_SINGLE", "REGEX_DOUBLE", "RBRACE", "RBRACKET", "RPAREN", "SEMICOLON",
"SLASH", "SLASH_GT", "UNDERSCORE", "MULTI_LINE_COMMENT", "SINGLE_LINE_COMMENT",
"WHITESPACE", "UNEXPECTED_CHARACTER", "STRING_TEXT", "STRING_ESCAPE_TRIGGER",
- "FULL_STRING_TEXT", "FULL_STRING_ESCAPE_TRIGGER", "TAG_WS", "TAGC_WS",
- "HOGQLX_TEXT_TEXT", "HOGQLX_TEXT_WS"
+ "FULL_STRING_TEXT", "FULL_STRING_ESCAPE_TRIGGER", "TAG_MULTI_LINE_COMMENT",
+ "TAG_SINGLE_LINE_COMMENT", "TAG_WS", "TAGC_MULTI_LINE_COMMENT", "TAGC_SINGLE_LINE_COMMENT",
+ "TAGC_WS", "HOGQLX_TEXT_TEXT", "HOGQLX_TEXT_WS"
}
);
static const int32_t serializedATNSegment[] = {
- 4,0,201,1927,6,-1,6,-1,6,-1,6,-1,6,-1,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,
+ 4,0,205,2003,6,-1,6,-1,6,-1,6,-1,6,-1,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,
3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,
7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,
7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,
@@ -198,9 +201,10 @@ void hogqllexerLexerInitialize() {
2,228,7,228,2,229,7,229,2,230,7,230,2,231,7,231,2,232,7,232,2,233,7,233,
2,234,7,234,2,235,7,235,2,236,7,236,2,237,7,237,2,238,7,238,2,239,7,239,
2,240,7,240,2,241,7,241,2,242,7,242,2,243,7,243,2,244,7,244,2,245,7,245,
+ 2,246,7,246,2,247,7,247,2,248,7,248,2,249,7,249,2,250,7,250,2,251,7,251,
1,0,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,2,1,2,1,2,1,2,1,2,1,3,1,3,1,3,1,3,1,
4,1,4,1,4,1,4,1,4,1,4,1,5,1,5,1,5,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,
- 1,6,1,6,1,6,1,6,1,6,3,6,539,8,6,1,7,1,7,1,7,1,7,1,7,1,8,1,8,1,8,1,8,1,
+ 1,6,1,6,1,6,1,6,1,6,3,6,551,8,6,1,7,1,7,1,7,1,7,1,7,1,8,1,8,1,8,1,8,1,
8,1,8,1,8,1,8,1,9,1,9,1,9,1,9,1,9,1,10,1,10,1,10,1,11,1,11,1,11,1,11,
1,11,1,12,1,12,1,12,1,12,1,12,1,13,1,13,1,13,1,13,1,13,1,13,1,14,1,14,
1,14,1,14,1,14,1,14,1,14,1,15,1,15,1,15,1,15,1,15,1,15,1,15,1,15,1,16,
@@ -220,7 +224,7 @@ void hogqllexerLexerInitialize() {
1,45,1,45,1,45,1,46,1,46,1,46,1,47,1,47,1,47,1,47,1,47,1,47,1,48,1,48,
1,48,1,48,1,48,1,48,1,48,1,49,1,49,1,49,1,49,1,49,1,49,1,49,1,49,1,50,
1,50,1,50,1,51,1,51,1,51,1,51,1,51,1,51,1,51,1,51,1,51,1,51,1,51,1,51,
- 1,51,3,51,819,8,51,1,52,1,52,1,52,1,52,1,52,1,52,1,53,1,53,1,53,1,53,
+ 1,51,3,51,831,8,51,1,52,1,52,1,52,1,52,1,52,1,52,1,53,1,53,1,53,1,53,
1,53,1,53,1,53,1,53,1,53,1,53,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,55,1,55,1,55,1,55,1,55,1,55,1,55,1,55,1,55,1,56,
1,56,1,56,1,57,1,57,1,57,1,57,1,57,1,58,1,58,1,58,1,58,1,59,1,59,1,59,
@@ -260,86 +264,93 @@ void hogqllexerLexerInitialize() {
1,126,1,126,1,126,1,126,1,126,1,126,1,127,1,127,1,127,1,127,1,127,1,127,
1,128,1,128,1,128,1,128,1,128,1,128,1,128,1,129,1,129,1,129,1,129,1,129,
1,130,1,130,1,130,1,130,1,130,1,130,1,130,1,131,1,131,1,131,1,131,1,131,
- 1,131,1,131,1,131,1,131,1,131,3,131,1348,8,131,1,132,1,132,1,132,1,132,
+ 1,131,1,131,1,131,1,131,1,131,3,131,1360,8,131,1,132,1,132,1,132,1,132,
1,132,1,132,1,132,1,132,1,132,1,132,1,132,1,132,1,132,1,132,1,132,1,132,
1,132,1,132,1,132,1,132,1,132,1,132,1,132,1,132,1,132,1,132,1,132,1,132,
- 1,132,1,132,1,132,1,132,3,132,1382,8,132,1,133,1,133,1,133,3,133,1387,
- 8,133,1,133,1,133,1,133,1,133,5,133,1393,8,133,10,133,12,133,1396,9,133,
- 1,134,1,134,1,134,1,134,1,134,1,134,1,134,1,134,1,134,5,134,1407,8,134,
- 10,134,12,134,1410,9,134,1,134,1,134,1,134,1,134,1,134,1,134,1,134,1,
- 134,1,134,1,134,1,134,5,134,1423,8,134,10,134,12,134,1426,9,134,1,134,
- 1,134,3,134,1430,8,134,1,135,1,135,1,135,5,135,1435,8,135,10,135,12,135,
- 1438,9,135,1,135,1,135,3,135,1442,8,135,1,135,1,135,3,135,1446,8,135,
- 1,135,4,135,1449,8,135,11,135,12,135,1450,1,135,1,135,1,135,3,135,1456,
- 8,135,1,135,1,135,3,135,1460,8,135,1,135,4,135,1463,8,135,11,135,12,135,
- 1464,1,135,1,135,1,135,5,135,1470,8,135,10,135,12,135,1473,9,135,1,135,
- 1,135,1,135,3,135,1478,8,135,1,135,4,135,1481,8,135,11,135,12,135,1482,
- 1,135,1,135,1,135,1,135,1,135,3,135,1490,8,135,1,135,4,135,1493,8,135,
- 11,135,12,135,1494,1,135,1,135,1,135,1,135,3,135,1501,8,135,1,135,4,135,
- 1504,8,135,11,135,12,135,1505,3,135,1508,8,135,1,136,1,136,1,136,4,136,
- 1513,8,136,11,136,12,136,1514,1,137,1,137,4,137,1519,8,137,11,137,12,
- 137,1520,1,138,4,138,1524,8,138,11,138,12,138,1525,1,139,1,139,1,139,
- 4,139,1531,8,139,11,139,12,139,1532,1,140,1,140,1,140,4,140,1538,8,140,
- 11,140,12,140,1539,1,141,1,141,1,141,4,141,1545,8,141,11,141,12,141,1546,
- 1,142,1,142,1,142,1,142,1,142,1,142,1,142,1,142,1,142,5,142,1558,8,142,
- 10,142,12,142,1561,9,142,1,142,1,142,1,143,1,143,1,144,1,144,1,145,1,
- 145,1,146,1,146,1,147,1,147,1,148,1,148,1,149,1,149,1,150,1,150,1,151,
- 1,151,1,152,1,152,1,153,1,153,1,154,1,154,1,155,1,155,1,156,1,156,1,157,
- 1,157,1,158,1,158,1,159,1,159,1,160,1,160,1,161,1,161,1,162,1,162,1,163,
- 1,163,1,164,1,164,1,165,1,165,1,166,1,166,1,167,1,167,1,168,1,168,1,169,
- 1,169,1,170,1,170,1,171,1,171,1,172,1,172,1,173,1,173,1,174,1,174,1,174,
- 1,175,1,175,1,176,1,176,1,177,1,177,1,178,1,178,1,178,1,179,1,179,1,179,
- 1,180,1,180,1,181,1,181,1,182,1,182,1,182,1,183,1,183,1,184,1,184,1,185,
- 1,185,1,186,1,186,1,186,1,187,1,187,1,188,1,188,1,188,1,189,1,189,1,190,
- 1,190,1,191,1,191,1,191,1,192,1,192,1,192,1,192,1,193,1,193,1,193,1,193,
- 1,194,1,194,1,195,1,195,1,196,1,196,1,196,1,197,1,197,1,197,1,197,1,197,
- 1,197,1,198,1,198,1,198,1,198,1,198,1,198,1,199,1,199,1,200,1,200,1,200,
- 1,201,1,201,1,201,1,201,3,201,1706,8,201,1,202,1,202,1,202,1,202,1,203,
- 1,203,1,203,1,204,1,204,1,204,1,205,1,205,1,205,1,206,1,206,1,207,1,207,
- 1,208,1,208,1,209,1,209,1,210,1,210,1,210,1,210,1,210,1,211,1,211,1,211,
- 1,211,1,211,1,212,1,212,1,213,1,213,1,214,1,214,1,214,1,215,1,215,1,215,
- 1,215,1,216,1,216,1,217,1,217,1,218,1,218,1,219,1,219,1,220,1,220,1,220,
- 1,221,1,221,1,222,1,222,1,222,1,222,5,222,1767,8,222,10,222,12,222,1770,
- 9,222,1,222,1,222,1,222,1,222,1,222,1,223,1,223,1,223,1,223,3,223,1781,
- 8,223,1,223,5,223,1784,8,223,10,223,12,223,1787,9,223,1,223,3,223,1790,
- 8,223,1,223,1,223,1,224,1,224,1,224,1,224,1,225,1,225,1,226,1,226,1,226,
- 1,226,1,226,1,226,1,226,1,226,1,226,1,226,1,226,4,226,1811,8,226,11,226,
- 12,226,1812,1,227,1,227,1,227,1,227,1,228,1,228,1,228,1,228,1,228,1,229,
- 1,229,1,229,1,229,1,229,4,229,1829,8,229,11,229,12,229,1830,1,230,1,230,
- 1,230,1,230,1,231,1,231,1,231,1,231,1,231,1,231,1,232,1,232,1,232,1,232,
- 1,232,1,232,1,233,1,233,5,233,1851,8,233,10,233,12,233,1854,9,233,1,233,
- 1,233,1,234,1,234,1,234,1,234,1,235,1,235,1,235,1,235,1,236,4,236,1867,
- 8,236,11,236,12,236,1868,1,236,1,236,1,237,1,237,1,237,1,237,1,237,1,
- 238,1,238,1,238,1,238,1,238,1,239,1,239,5,239,1885,8,239,10,239,12,239,
- 1888,9,239,1,239,1,239,1,240,4,240,1893,8,240,11,240,12,240,1894,1,240,
- 1,240,1,241,4,241,1900,8,241,11,241,12,241,1901,1,242,1,242,1,242,1,242,
- 1,242,1,243,1,243,1,243,1,243,1,243,1,243,1,243,1,244,1,244,1,244,1,244,
- 1,244,1,245,4,245,1922,8,245,11,245,12,245,1923,1,245,1,245,1,1768,0,
- 246,6,1,8,2,10,3,12,4,14,5,16,6,18,7,20,8,22,9,24,10,26,11,28,12,30,13,
- 32,14,34,15,36,16,38,17,40,18,42,19,44,20,46,21,48,22,50,23,52,24,54,
- 25,56,26,58,27,60,28,62,29,64,30,66,31,68,32,70,33,72,34,74,35,76,36,
- 78,37,80,38,82,39,84,40,86,41,88,42,90,43,92,44,94,45,96,46,98,47,100,
- 48,102,49,104,50,106,51,108,52,110,53,112,54,114,55,116,56,118,57,120,
- 58,122,59,124,60,126,61,128,62,130,63,132,64,134,65,136,66,138,67,140,
- 68,142,69,144,70,146,71,148,72,150,73,152,74,154,75,156,76,158,77,160,
- 78,162,79,164,80,166,81,168,82,170,83,172,84,174,85,176,86,178,87,180,
- 88,182,89,184,90,186,91,188,92,190,93,192,94,194,95,196,96,198,97,200,
- 98,202,99,204,100,206,101,208,102,210,103,212,104,214,105,216,106,218,
- 107,220,108,222,109,224,110,226,111,228,112,230,113,232,114,234,115,236,
- 116,238,117,240,118,242,119,244,120,246,121,248,122,250,123,252,124,254,
- 125,256,126,258,127,260,128,262,129,264,130,266,131,268,132,270,133,272,
- 134,274,135,276,136,278,137,280,138,282,139,284,140,286,141,288,142,290,
- 143,292,0,294,0,296,0,298,0,300,0,302,0,304,0,306,0,308,0,310,0,312,0,
- 314,0,316,0,318,0,320,0,322,0,324,0,326,0,328,0,330,0,332,0,334,0,336,
- 0,338,0,340,0,342,0,344,0,346,0,348,0,350,0,352,0,354,144,356,145,358,
- 146,360,147,362,148,364,149,366,150,368,151,370,152,372,153,374,154,376,
- 155,378,156,380,157,382,158,384,159,386,160,388,161,390,162,392,163,394,
- 164,396,165,398,166,400,0,402,0,404,167,406,168,408,169,410,170,412,171,
- 414,172,416,173,418,174,420,175,422,176,424,177,426,178,428,179,430,180,
- 432,181,434,182,436,183,438,184,440,185,442,186,444,187,446,188,448,189,
- 450,190,452,191,454,192,456,193,458,194,460,195,462,0,464,196,466,197,
- 468,0,470,0,472,0,474,0,476,0,478,198,480,0,482,0,484,0,486,199,488,200,
- 490,0,492,0,494,0,496,201,6,0,1,2,3,4,5,43,2,0,92,92,96,96,2,0,34,34,
+ 1,132,1,132,1,132,1,132,3,132,1394,8,132,1,133,1,133,1,133,3,133,1399,
+ 8,133,1,133,1,133,1,133,1,133,5,133,1405,8,133,10,133,12,133,1408,9,133,
+ 1,134,1,134,1,134,1,134,1,134,1,134,1,134,1,134,1,134,5,134,1419,8,134,
+ 10,134,12,134,1422,9,134,1,134,1,134,1,134,1,134,1,134,1,134,1,134,1,
+ 134,1,134,1,134,1,134,5,134,1435,8,134,10,134,12,134,1438,9,134,1,134,
+ 1,134,3,134,1442,8,134,1,135,1,135,1,135,5,135,1447,8,135,10,135,12,135,
+ 1450,9,135,1,135,1,135,1,135,3,135,1455,8,135,1,135,4,135,1458,8,135,
+ 11,135,12,135,1459,1,135,1,135,1,135,1,135,3,135,1466,8,135,1,135,4,135,
+ 1469,8,135,11,135,12,135,1470,1,135,1,135,1,135,5,135,1476,8,135,10,135,
+ 12,135,1479,9,135,1,135,1,135,1,135,3,135,1484,8,135,1,135,4,135,1487,
+ 8,135,11,135,12,135,1488,1,135,1,135,1,135,1,135,1,135,3,135,1496,8,135,
+ 1,135,4,135,1499,8,135,11,135,12,135,1500,1,135,1,135,1,135,1,135,3,135,
+ 1507,8,135,1,135,4,135,1510,8,135,11,135,12,135,1511,3,135,1514,8,135,
+ 1,136,1,136,1,136,4,136,1519,8,136,11,136,12,136,1520,1,137,1,137,4,137,
+ 1525,8,137,11,137,12,137,1526,1,138,4,138,1530,8,138,11,138,12,138,1531,
+ 1,139,1,139,1,139,4,139,1537,8,139,11,139,12,139,1538,1,140,1,140,1,140,
+ 4,140,1544,8,140,11,140,12,140,1545,1,141,1,141,1,141,4,141,1551,8,141,
+ 11,141,12,141,1552,1,142,1,142,1,142,1,142,1,142,1,142,1,142,1,142,1,
+ 142,5,142,1564,8,142,10,142,12,142,1567,9,142,1,142,1,142,1,143,1,143,
+ 1,144,1,144,1,145,1,145,1,146,1,146,1,147,1,147,1,148,1,148,1,149,1,149,
+ 1,150,1,150,1,151,1,151,1,152,1,152,1,153,1,153,1,154,1,154,1,155,1,155,
+ 1,156,1,156,1,157,1,157,1,158,1,158,1,159,1,159,1,160,1,160,1,161,1,161,
+ 1,162,1,162,1,163,1,163,1,164,1,164,1,165,1,165,1,166,1,166,1,167,1,167,
+ 1,168,1,168,1,169,1,169,1,170,1,170,1,171,1,171,1,172,1,172,1,173,1,173,
+ 1,174,1,174,1,174,1,175,1,175,1,176,1,176,1,177,1,177,1,178,1,178,1,178,
+ 1,179,1,179,1,179,1,180,1,180,1,181,1,181,1,182,1,182,1,182,1,183,1,183,
+ 1,184,1,184,1,185,1,185,1,186,1,186,1,186,1,187,1,187,1,188,1,188,1,188,
+ 1,189,1,189,1,190,1,190,1,191,1,191,1,191,1,192,1,192,1,192,1,192,1,193,
+ 1,193,1,193,1,193,1,194,1,194,1,195,1,195,1,196,1,196,1,196,1,197,1,197,
+ 1,197,1,197,1,197,1,197,1,198,1,198,1,198,1,198,1,198,1,198,1,199,1,199,
+ 1,200,1,200,1,200,1,201,1,201,1,201,1,201,3,201,1712,8,201,1,202,1,202,
+ 1,202,1,202,1,203,1,203,1,203,1,204,1,204,1,204,1,205,1,205,1,205,1,206,
+ 1,206,1,207,1,207,1,208,1,208,1,209,1,209,1,210,1,210,1,210,1,210,1,210,
+ 1,211,1,211,1,211,1,211,1,211,1,212,1,212,1,213,1,213,1,214,1,214,1,214,
+ 1,215,1,215,1,215,1,215,1,216,1,216,1,217,1,217,1,218,1,218,1,219,1,219,
+ 1,220,1,220,1,220,1,221,1,221,1,222,1,222,1,222,1,222,5,222,1773,8,222,
+ 10,222,12,222,1776,9,222,1,222,1,222,1,222,1,222,1,222,1,223,1,223,1,
+ 223,1,223,3,223,1787,8,223,1,223,5,223,1790,8,223,10,223,12,223,1793,
+ 9,223,1,223,3,223,1796,8,223,1,223,1,223,1,224,1,224,1,224,1,224,1,225,
+ 1,225,1,226,1,226,1,226,1,226,1,226,1,226,1,226,1,226,1,226,1,226,1,226,
+ 4,226,1817,8,226,11,226,12,226,1818,1,227,1,227,1,227,1,227,1,228,1,228,
+ 1,228,1,228,1,228,1,229,1,229,1,229,1,229,1,229,4,229,1835,8,229,11,229,
+ 12,229,1836,1,230,1,230,1,230,1,230,1,231,1,231,1,231,1,231,1,231,1,231,
+ 1,232,1,232,1,232,1,232,1,232,1,232,1,233,1,233,1,233,1,233,5,233,1859,
+ 8,233,10,233,12,233,1862,9,233,1,233,1,233,1,233,1,233,1,233,1,234,1,
+ 234,1,234,1,234,3,234,1873,8,234,1,234,5,234,1876,8,234,10,234,12,234,
+ 1879,9,234,1,234,3,234,1882,8,234,1,234,1,234,1,235,1,235,5,235,1888,
+ 8,235,10,235,12,235,1891,9,235,1,235,1,235,1,236,1,236,1,236,1,236,1,
+ 237,1,237,1,237,1,237,1,238,4,238,1904,8,238,11,238,12,238,1905,1,238,
+ 1,238,1,239,1,239,1,239,1,239,1,239,1,240,1,240,1,240,1,240,1,241,1,241,
+ 1,241,1,241,1,241,1,242,1,242,1,242,1,242,5,242,1928,8,242,10,242,12,
+ 242,1931,9,242,1,242,1,242,1,242,1,242,1,242,1,243,1,243,1,243,1,243,
+ 3,243,1942,8,243,1,243,5,243,1945,8,243,10,243,12,243,1948,9,243,1,243,
+ 3,243,1951,8,243,1,243,1,243,1,244,1,244,5,244,1957,8,244,10,244,12,244,
+ 1960,9,244,1,244,1,244,1,245,4,245,1965,8,245,11,245,12,245,1966,1,245,
+ 1,245,1,246,1,246,1,246,1,246,1,247,4,247,1976,8,247,11,247,12,247,1977,
+ 1,248,1,248,1,248,1,248,1,248,1,249,1,249,1,249,1,249,1,249,1,249,1,249,
+ 1,250,1,250,1,250,1,250,1,250,1,251,4,251,1998,8,251,11,251,12,251,1999,
+ 1,251,1,251,3,1774,1860,1929,0,252,6,1,8,2,10,3,12,4,14,5,16,6,18,7,20,
+ 8,22,9,24,10,26,11,28,12,30,13,32,14,34,15,36,16,38,17,40,18,42,19,44,
+ 20,46,21,48,22,50,23,52,24,54,25,56,26,58,27,60,28,62,29,64,30,66,31,
+ 68,32,70,33,72,34,74,35,76,36,78,37,80,38,82,39,84,40,86,41,88,42,90,
+ 43,92,44,94,45,96,46,98,47,100,48,102,49,104,50,106,51,108,52,110,53,
+ 112,54,114,55,116,56,118,57,120,58,122,59,124,60,126,61,128,62,130,63,
+ 132,64,134,65,136,66,138,67,140,68,142,69,144,70,146,71,148,72,150,73,
+ 152,74,154,75,156,76,158,77,160,78,162,79,164,80,166,81,168,82,170,83,
+ 172,84,174,85,176,86,178,87,180,88,182,89,184,90,186,91,188,92,190,93,
+ 192,94,194,95,196,96,198,97,200,98,202,99,204,100,206,101,208,102,210,
+ 103,212,104,214,105,216,106,218,107,220,108,222,109,224,110,226,111,228,
+ 112,230,113,232,114,234,115,236,116,238,117,240,118,242,119,244,120,246,
+ 121,248,122,250,123,252,124,254,125,256,126,258,127,260,128,262,129,264,
+ 130,266,131,268,132,270,133,272,134,274,135,276,136,278,137,280,138,282,
+ 139,284,140,286,141,288,142,290,143,292,0,294,0,296,0,298,0,300,0,302,
+ 0,304,0,306,0,308,0,310,0,312,0,314,0,316,0,318,0,320,0,322,0,324,0,326,
+ 0,328,0,330,0,332,0,334,0,336,0,338,0,340,0,342,0,344,0,346,0,348,0,350,
+ 0,352,0,354,144,356,145,358,146,360,147,362,148,364,149,366,150,368,151,
+ 370,152,372,153,374,154,376,155,378,156,380,157,382,158,384,159,386,160,
+ 388,161,390,162,392,163,394,164,396,165,398,166,400,0,402,0,404,167,406,
+ 168,408,169,410,170,412,171,414,172,416,173,418,174,420,175,422,176,424,
+ 177,426,178,428,179,430,180,432,181,434,182,436,183,438,184,440,185,442,
+ 186,444,187,446,188,448,189,450,190,452,191,454,192,456,193,458,194,460,
+ 195,462,0,464,196,466,197,468,0,470,0,472,198,474,199,476,0,478,0,480,
+ 0,482,200,484,0,486,0,488,0,490,201,492,202,494,0,496,203,498,0,500,204,
+ 502,0,504,0,506,0,508,205,6,0,1,2,3,4,5,43,2,0,92,92,96,96,2,0,34,34,
92,92,2,0,79,79,111,111,2,0,66,66,98,98,2,0,39,39,92,92,2,0,65,65,97,
97,2,0,67,67,99,99,2,0,68,68,100,100,2,0,69,69,101,101,2,0,70,70,102,
102,2,0,71,71,103,103,2,0,72,72,104,104,2,0,73,73,105,105,2,0,74,74,106,
@@ -351,7 +362,7 @@ void hogqllexerLexerInitialize() {
13,2,1,10,10,13,13,11,0,9,13,32,32,133,133,160,160,5760,5760,8192,8202,
8232,8233,8239,8239,8287,8287,12288,12288,65279,65279,3,0,39,39,92,92,
123,123,1,0,123,123,3,0,65,90,95,95,97,122,5,0,45,45,48,57,65,90,95,95,
- 97,122,3,0,9,10,13,13,32,32,2,0,60,60,123,123,1968,0,6,1,0,0,0,0,8,1,
+ 97,122,3,0,9,10,13,13,32,32,2,0,60,60,123,123,2048,0,6,1,0,0,0,0,8,1,
0,0,0,0,10,1,0,0,0,0,12,1,0,0,0,0,14,1,0,0,0,0,16,1,0,0,0,0,18,1,0,0,
0,0,20,1,0,0,0,0,22,1,0,0,0,0,24,1,0,0,0,0,26,1,0,0,0,0,28,1,0,0,0,0,
30,1,0,0,0,0,32,1,0,0,0,0,34,1,0,0,0,0,36,1,0,0,0,0,38,1,0,0,0,0,40,1,
@@ -392,488 +403,508 @@ void hogqllexerLexerInitialize() {
1,0,0,0,0,448,1,0,0,0,0,450,1,0,0,0,0,452,1,0,0,0,0,454,1,0,0,0,0,456,
1,0,0,0,1,458,1,0,0,0,1,460,1,0,0,0,1,462,1,0,0,0,2,464,1,0,0,0,2,466,
1,0,0,0,3,468,1,0,0,0,3,470,1,0,0,0,3,472,1,0,0,0,3,474,1,0,0,0,3,476,
- 1,0,0,0,3,478,1,0,0,0,3,480,1,0,0,0,4,482,1,0,0,0,4,484,1,0,0,0,4,486,
- 1,0,0,0,5,488,1,0,0,0,5,490,1,0,0,0,5,492,1,0,0,0,5,494,1,0,0,0,5,496,
- 1,0,0,0,6,498,1,0,0,0,8,502,1,0,0,0,10,506,1,0,0,0,12,511,1,0,0,0,14,
- 515,1,0,0,0,16,521,1,0,0,0,18,538,1,0,0,0,20,540,1,0,0,0,22,545,1,0,0,
- 0,24,553,1,0,0,0,26,558,1,0,0,0,28,561,1,0,0,0,30,566,1,0,0,0,32,571,
- 1,0,0,0,34,577,1,0,0,0,36,584,1,0,0,0,38,592,1,0,0,0,40,600,1,0,0,0,42,
- 606,1,0,0,0,44,611,1,0,0,0,46,619,1,0,0,0,48,624,1,0,0,0,50,628,1,0,0,
- 0,52,633,1,0,0,0,54,644,1,0,0,0,56,653,1,0,0,0,58,658,1,0,0,0,60,662,
- 1,0,0,0,62,669,1,0,0,0,64,677,1,0,0,0,66,685,1,0,0,0,68,691,1,0,0,0,70,
- 696,1,0,0,0,72,703,1,0,0,0,74,711,1,0,0,0,76,717,1,0,0,0,78,720,1,0,0,
- 0,80,730,1,0,0,0,82,734,1,0,0,0,84,739,1,0,0,0,86,744,1,0,0,0,88,748,
- 1,0,0,0,90,754,1,0,0,0,92,763,1,0,0,0,94,770,1,0,0,0,96,775,1,0,0,0,98,
- 778,1,0,0,0,100,781,1,0,0,0,102,787,1,0,0,0,104,794,1,0,0,0,106,802,1,
- 0,0,0,108,818,1,0,0,0,110,820,1,0,0,0,112,826,1,0,0,0,114,836,1,0,0,0,
- 116,848,1,0,0,0,118,857,1,0,0,0,120,860,1,0,0,0,122,865,1,0,0,0,124,869,
- 1,0,0,0,126,876,1,0,0,0,128,881,1,0,0,0,130,889,1,0,0,0,132,894,1,0,0,
- 0,134,898,1,0,0,0,136,903,1,0,0,0,138,909,1,0,0,0,140,922,1,0,0,0,142,
- 929,1,0,0,0,144,935,1,0,0,0,146,940,1,0,0,0,148,948,1,0,0,0,150,952,1,
- 0,0,0,152,956,1,0,0,0,154,961,1,0,0,0,156,967,1,0,0,0,158,974,1,0,0,0,
- 160,977,1,0,0,0,162,980,1,0,0,0,164,986,1,0,0,0,166,992,1,0,0,0,168,997,
- 1,0,0,0,170,1007,1,0,0,0,172,1013,1,0,0,0,174,1024,1,0,0,0,176,1034,1,
- 0,0,0,178,1043,1,0,0,0,180,1051,1,0,0,0,182,1059,1,0,0,0,184,1065,1,0,
- 0,0,186,1075,1,0,0,0,188,1083,1,0,0,0,190,1090,1,0,0,0,192,1096,1,0,0,
- 0,194,1103,1,0,0,0,196,1107,1,0,0,0,198,1112,1,0,0,0,200,1119,1,0,0,0,
- 202,1126,1,0,0,0,204,1133,1,0,0,0,206,1138,1,0,0,0,208,1143,1,0,0,0,210,
- 1152,1,0,0,0,212,1157,1,0,0,0,214,1167,1,0,0,0,216,1172,1,0,0,0,218,1178,
- 1,0,0,0,220,1183,1,0,0,0,222,1193,1,0,0,0,224,1198,1,0,0,0,226,1204,1,
- 0,0,0,228,1209,1,0,0,0,230,1212,1,0,0,0,232,1216,1,0,0,0,234,1223,1,0,
- 0,0,236,1232,1,0,0,0,238,1237,1,0,0,0,240,1246,1,0,0,0,242,1250,1,0,0,
- 0,244,1259,1,0,0,0,246,1269,1,0,0,0,248,1275,1,0,0,0,250,1283,1,0,0,0,
- 252,1289,1,0,0,0,254,1296,1,0,0,0,256,1301,1,0,0,0,258,1306,1,0,0,0,260,
- 1312,1,0,0,0,262,1318,1,0,0,0,264,1325,1,0,0,0,266,1330,1,0,0,0,268,1347,
- 1,0,0,0,270,1381,1,0,0,0,272,1386,1,0,0,0,274,1429,1,0,0,0,276,1507,1,
- 0,0,0,278,1509,1,0,0,0,280,1516,1,0,0,0,282,1523,1,0,0,0,284,1527,1,0,
- 0,0,286,1534,1,0,0,0,288,1541,1,0,0,0,290,1548,1,0,0,0,292,1564,1,0,0,
- 0,294,1566,1,0,0,0,296,1568,1,0,0,0,298,1570,1,0,0,0,300,1572,1,0,0,0,
- 302,1574,1,0,0,0,304,1576,1,0,0,0,306,1578,1,0,0,0,308,1580,1,0,0,0,310,
- 1582,1,0,0,0,312,1584,1,0,0,0,314,1586,1,0,0,0,316,1588,1,0,0,0,318,1590,
- 1,0,0,0,320,1592,1,0,0,0,322,1594,1,0,0,0,324,1596,1,0,0,0,326,1598,1,
- 0,0,0,328,1600,1,0,0,0,330,1602,1,0,0,0,332,1604,1,0,0,0,334,1606,1,0,
- 0,0,336,1608,1,0,0,0,338,1610,1,0,0,0,340,1612,1,0,0,0,342,1614,1,0,0,
- 0,344,1616,1,0,0,0,346,1618,1,0,0,0,348,1620,1,0,0,0,350,1622,1,0,0,0,
- 352,1624,1,0,0,0,354,1626,1,0,0,0,356,1629,1,0,0,0,358,1631,1,0,0,0,360,
- 1633,1,0,0,0,362,1635,1,0,0,0,364,1638,1,0,0,0,366,1641,1,0,0,0,368,1643,
- 1,0,0,0,370,1645,1,0,0,0,372,1648,1,0,0,0,374,1650,1,0,0,0,376,1652,1,
- 0,0,0,378,1654,1,0,0,0,380,1657,1,0,0,0,382,1659,1,0,0,0,384,1662,1,0,
- 0,0,386,1664,1,0,0,0,388,1666,1,0,0,0,390,1669,1,0,0,0,392,1673,1,0,0,
- 0,394,1677,1,0,0,0,396,1679,1,0,0,0,398,1681,1,0,0,0,400,1684,1,0,0,0,
- 402,1690,1,0,0,0,404,1696,1,0,0,0,406,1698,1,0,0,0,408,1705,1,0,0,0,410,
- 1707,1,0,0,0,412,1711,1,0,0,0,414,1714,1,0,0,0,416,1717,1,0,0,0,418,1720,
- 1,0,0,0,420,1722,1,0,0,0,422,1724,1,0,0,0,424,1726,1,0,0,0,426,1728,1,
- 0,0,0,428,1733,1,0,0,0,430,1738,1,0,0,0,432,1740,1,0,0,0,434,1742,1,0,
- 0,0,436,1745,1,0,0,0,438,1749,1,0,0,0,440,1751,1,0,0,0,442,1753,1,0,0,
- 0,444,1755,1,0,0,0,446,1757,1,0,0,0,448,1760,1,0,0,0,450,1762,1,0,0,0,
- 452,1780,1,0,0,0,454,1793,1,0,0,0,456,1797,1,0,0,0,458,1810,1,0,0,0,460,
- 1814,1,0,0,0,462,1818,1,0,0,0,464,1828,1,0,0,0,466,1832,1,0,0,0,468,1836,
- 1,0,0,0,470,1842,1,0,0,0,472,1848,1,0,0,0,474,1857,1,0,0,0,476,1861,1,
- 0,0,0,478,1866,1,0,0,0,480,1872,1,0,0,0,482,1877,1,0,0,0,484,1882,1,0,
- 0,0,486,1892,1,0,0,0,488,1899,1,0,0,0,490,1903,1,0,0,0,492,1908,1,0,0,
- 0,494,1915,1,0,0,0,496,1921,1,0,0,0,498,499,3,292,143,0,499,500,3,314,
- 154,0,500,501,3,314,154,0,501,7,1,0,0,0,502,503,3,292,143,0,503,504,3,
- 318,156,0,504,505,3,298,146,0,505,9,1,0,0,0,506,507,3,292,143,0,507,508,
- 3,318,156,0,508,509,3,330,162,0,509,510,3,308,151,0,510,11,1,0,0,0,511,
- 512,3,292,143,0,512,513,3,318,156,0,513,514,3,340,167,0,514,13,1,0,0,
- 0,515,516,3,292,143,0,516,517,3,326,160,0,517,518,3,326,160,0,518,519,
- 3,292,143,0,519,520,3,340,167,0,520,15,1,0,0,0,521,522,3,292,143,0,522,
- 523,3,328,161,0,523,17,1,0,0,0,524,525,3,292,143,0,525,526,3,328,161,
- 0,526,527,3,296,145,0,527,539,1,0,0,0,528,529,3,292,143,0,529,530,3,328,
- 161,0,530,531,3,296,145,0,531,532,3,300,147,0,532,533,3,318,156,0,533,
- 534,3,298,146,0,534,535,3,308,151,0,535,536,3,318,156,0,536,537,3,304,
- 149,0,537,539,1,0,0,0,538,524,1,0,0,0,538,528,1,0,0,0,539,19,1,0,0,0,
- 540,541,3,292,143,0,541,542,3,328,161,0,542,543,3,320,157,0,543,544,3,
- 302,148,0,544,21,1,0,0,0,545,546,3,294,144,0,546,547,3,300,147,0,547,
- 548,3,330,162,0,548,549,3,336,165,0,549,550,3,300,147,0,550,551,3,300,
- 147,0,551,552,3,318,156,0,552,23,1,0,0,0,553,554,3,294,144,0,554,555,
- 3,320,157,0,555,556,3,330,162,0,556,557,3,306,150,0,557,25,1,0,0,0,558,
- 559,3,294,144,0,559,560,3,340,167,0,560,27,1,0,0,0,561,562,3,296,145,
- 0,562,563,3,292,143,0,563,564,3,328,161,0,564,565,3,300,147,0,565,29,
- 1,0,0,0,566,567,3,296,145,0,567,568,3,292,143,0,568,569,3,328,161,0,569,
- 570,3,330,162,0,570,31,1,0,0,0,571,572,3,296,145,0,572,573,3,292,143,
- 0,573,574,3,330,162,0,574,575,3,296,145,0,575,576,3,306,150,0,576,33,
- 1,0,0,0,577,578,3,296,145,0,578,579,3,320,157,0,579,580,3,306,150,0,580,
- 581,3,320,157,0,581,582,3,326,160,0,582,583,3,330,162,0,583,35,1,0,0,
- 0,584,585,3,296,145,0,585,586,3,320,157,0,586,587,3,314,154,0,587,588,
- 3,314,154,0,588,589,3,292,143,0,589,590,3,330,162,0,590,591,3,300,147,
- 0,591,37,1,0,0,0,592,593,3,296,145,0,593,594,3,320,157,0,594,595,3,314,
- 154,0,595,596,3,332,163,0,596,597,3,316,155,0,597,598,3,318,156,0,598,
- 599,3,328,161,0,599,39,1,0,0,0,600,601,3,296,145,0,601,602,3,326,160,
- 0,602,603,3,320,157,0,603,604,3,328,161,0,604,605,3,328,161,0,605,41,
- 1,0,0,0,606,607,3,296,145,0,607,608,3,332,163,0,608,609,3,294,144,0,609,
- 610,3,300,147,0,610,43,1,0,0,0,611,612,3,296,145,0,612,613,3,332,163,
- 0,613,614,3,326,160,0,614,615,3,326,160,0,615,616,3,300,147,0,616,617,
- 3,318,156,0,617,618,3,330,162,0,618,45,1,0,0,0,619,620,3,298,146,0,620,
- 621,3,292,143,0,621,622,3,330,162,0,622,623,3,300,147,0,623,47,1,0,0,
- 0,624,625,3,298,146,0,625,626,3,292,143,0,626,627,3,340,167,0,627,49,
- 1,0,0,0,628,629,3,298,146,0,629,630,3,300,147,0,630,631,3,328,161,0,631,
- 632,3,296,145,0,632,51,1,0,0,0,633,634,3,298,146,0,634,635,3,300,147,
- 0,635,636,3,328,161,0,636,637,3,296,145,0,637,638,3,300,147,0,638,639,
- 3,318,156,0,639,640,3,298,146,0,640,641,3,308,151,0,641,642,3,318,156,
- 0,642,643,3,304,149,0,643,53,1,0,0,0,644,645,3,298,146,0,645,646,3,308,
- 151,0,646,647,3,328,161,0,647,648,3,330,162,0,648,649,3,308,151,0,649,
- 650,3,318,156,0,650,651,3,296,145,0,651,652,3,330,162,0,652,55,1,0,0,
- 0,653,654,3,300,147,0,654,655,3,314,154,0,655,656,3,328,161,0,656,657,
- 3,300,147,0,657,57,1,0,0,0,658,659,3,300,147,0,659,660,3,318,156,0,660,
- 661,3,298,146,0,661,59,1,0,0,0,662,663,3,300,147,0,663,664,3,338,166,
- 0,664,665,3,296,145,0,665,666,3,300,147,0,666,667,3,322,158,0,667,668,
- 3,330,162,0,668,61,1,0,0,0,669,670,3,300,147,0,670,671,3,338,166,0,671,
- 672,3,296,145,0,672,673,3,314,154,0,673,674,3,332,163,0,674,675,3,298,
- 146,0,675,676,3,300,147,0,676,63,1,0,0,0,677,678,3,300,147,0,678,679,
- 3,338,166,0,679,680,3,330,162,0,680,681,3,326,160,0,681,682,3,292,143,
- 0,682,683,3,296,145,0,683,684,3,330,162,0,684,65,1,0,0,0,685,686,3,302,
- 148,0,686,687,3,308,151,0,687,688,3,318,156,0,688,689,3,292,143,0,689,
- 690,3,314,154,0,690,67,1,0,0,0,691,692,3,302,148,0,692,693,3,308,151,
- 0,693,694,3,314,154,0,694,695,3,314,154,0,695,69,1,0,0,0,696,697,3,302,
- 148,0,697,698,3,308,151,0,698,699,3,314,154,0,699,700,3,330,162,0,700,
- 701,3,300,147,0,701,702,3,326,160,0,702,71,1,0,0,0,703,704,3,302,148,
- 0,704,705,3,308,151,0,705,706,3,318,156,0,706,707,3,292,143,0,707,708,
- 3,314,154,0,708,709,3,314,154,0,709,710,3,340,167,0,710,73,1,0,0,0,711,
- 712,3,302,148,0,712,713,3,308,151,0,713,714,3,326,160,0,714,715,3,328,
- 161,0,715,716,3,330,162,0,716,75,1,0,0,0,717,718,3,302,148,0,718,719,
- 3,318,156,0,719,77,1,0,0,0,720,721,3,302,148,0,721,722,3,320,157,0,722,
- 723,3,314,154,0,723,724,3,314,154,0,724,725,3,320,157,0,725,726,3,336,
- 165,0,726,727,3,308,151,0,727,728,3,318,156,0,728,729,3,304,149,0,729,
- 79,1,0,0,0,730,731,3,302,148,0,731,732,3,320,157,0,732,733,3,326,160,
- 0,733,81,1,0,0,0,734,735,3,302,148,0,735,736,3,326,160,0,736,737,3,320,
- 157,0,737,738,3,316,155,0,738,83,1,0,0,0,739,740,3,302,148,0,740,741,
- 3,332,163,0,741,742,3,314,154,0,742,743,3,314,154,0,743,85,1,0,0,0,744,
- 745,3,302,148,0,745,746,3,332,163,0,746,747,3,318,156,0,747,87,1,0,0,
- 0,748,749,3,304,149,0,749,750,3,326,160,0,750,751,3,320,157,0,751,752,
- 3,332,163,0,752,753,3,322,158,0,753,89,1,0,0,0,754,755,3,304,149,0,755,
- 756,3,326,160,0,756,757,3,320,157,0,757,758,3,332,163,0,758,759,3,322,
- 158,0,759,760,3,308,151,0,760,761,3,318,156,0,761,762,3,304,149,0,762,
- 91,1,0,0,0,763,764,3,306,150,0,764,765,3,292,143,0,765,766,3,334,164,
- 0,766,767,3,308,151,0,767,768,3,318,156,0,768,769,3,304,149,0,769,93,
- 1,0,0,0,770,771,3,306,150,0,771,772,3,320,157,0,772,773,3,332,163,0,773,
- 774,3,326,160,0,774,95,1,0,0,0,775,776,3,308,151,0,776,777,3,298,146,
- 0,777,97,1,0,0,0,778,779,3,308,151,0,779,780,3,302,148,0,780,99,1,0,0,
- 0,781,782,3,308,151,0,782,783,3,314,154,0,783,784,3,308,151,0,784,785,
- 3,312,153,0,785,786,3,300,147,0,786,101,1,0,0,0,787,788,3,308,151,0,788,
- 789,3,304,149,0,789,790,3,318,156,0,790,791,3,320,157,0,791,792,3,326,
- 160,0,792,793,3,300,147,0,793,103,1,0,0,0,794,795,3,308,151,0,795,796,
- 3,318,156,0,796,797,3,296,145,0,797,798,3,314,154,0,798,799,3,332,163,
- 0,799,800,3,298,146,0,800,801,3,300,147,0,801,105,1,0,0,0,802,803,3,308,
- 151,0,803,804,3,318,156,0,804,107,1,0,0,0,805,806,3,308,151,0,806,807,
- 3,318,156,0,807,808,3,302,148,0,808,819,1,0,0,0,809,810,3,308,151,0,810,
- 811,3,318,156,0,811,812,3,302,148,0,812,813,3,308,151,0,813,814,3,318,
- 156,0,814,815,3,308,151,0,815,816,3,330,162,0,816,817,3,340,167,0,817,
- 819,1,0,0,0,818,805,1,0,0,0,818,809,1,0,0,0,819,109,1,0,0,0,820,821,3,
- 308,151,0,821,822,3,318,156,0,822,823,3,318,156,0,823,824,3,300,147,0,
- 824,825,3,326,160,0,825,111,1,0,0,0,826,827,3,308,151,0,827,828,3,318,
- 156,0,828,829,3,330,162,0,829,830,3,300,147,0,830,831,3,326,160,0,831,
- 832,3,328,161,0,832,833,3,300,147,0,833,834,3,296,145,0,834,835,3,330,
- 162,0,835,113,1,0,0,0,836,837,3,308,151,0,837,838,3,318,156,0,838,839,
- 3,330,162,0,839,840,3,300,147,0,840,841,3,326,160,0,841,842,3,322,158,
- 0,842,843,3,320,157,0,843,844,3,314,154,0,844,845,3,292,143,0,845,846,
- 3,330,162,0,846,847,3,300,147,0,847,115,1,0,0,0,848,849,3,308,151,0,849,
- 850,3,318,156,0,850,851,3,330,162,0,851,852,3,300,147,0,852,853,3,326,
- 160,0,853,854,3,334,164,0,854,855,3,292,143,0,855,856,3,314,154,0,856,
- 117,1,0,0,0,857,858,3,308,151,0,858,859,3,328,161,0,859,119,1,0,0,0,860,
- 861,3,310,152,0,861,862,3,320,157,0,862,863,3,308,151,0,863,864,3,318,
- 156,0,864,121,1,0,0,0,865,866,3,312,153,0,866,867,3,300,147,0,867,868,
- 3,340,167,0,868,123,1,0,0,0,869,870,3,314,154,0,870,871,3,292,143,0,871,
- 872,3,316,155,0,872,873,3,294,144,0,873,874,3,298,146,0,874,875,3,292,
- 143,0,875,125,1,0,0,0,876,877,3,314,154,0,877,878,3,292,143,0,878,879,
- 3,328,161,0,879,880,3,330,162,0,880,127,1,0,0,0,881,882,3,314,154,0,882,
- 883,3,300,147,0,883,884,3,292,143,0,884,885,3,298,146,0,885,886,3,308,
- 151,0,886,887,3,318,156,0,887,888,3,304,149,0,888,129,1,0,0,0,889,890,
- 3,314,154,0,890,891,3,300,147,0,891,892,3,302,148,0,892,893,3,330,162,
- 0,893,131,1,0,0,0,894,895,3,314,154,0,895,896,3,300,147,0,896,897,3,330,
- 162,0,897,133,1,0,0,0,898,899,3,314,154,0,899,900,3,308,151,0,900,901,
- 3,312,153,0,901,902,3,300,147,0,902,135,1,0,0,0,903,904,3,314,154,0,904,
- 905,3,308,151,0,905,906,3,316,155,0,906,907,3,308,151,0,907,908,3,330,
- 162,0,908,137,1,0,0,0,909,910,3,316,155,0,910,911,3,292,143,0,911,912,
- 3,330,162,0,912,913,3,300,147,0,913,914,3,326,160,0,914,915,3,308,151,
- 0,915,916,3,292,143,0,916,917,3,314,154,0,917,918,3,308,151,0,918,919,
- 3,342,168,0,919,920,3,300,147,0,920,921,3,298,146,0,921,139,1,0,0,0,922,
- 923,3,316,155,0,923,924,3,308,151,0,924,925,3,318,156,0,925,926,3,332,
- 163,0,926,927,3,330,162,0,927,928,3,300,147,0,928,141,1,0,0,0,929,930,
- 3,316,155,0,930,931,3,320,157,0,931,932,3,318,156,0,932,933,3,330,162,
- 0,933,934,3,306,150,0,934,143,1,0,0,0,935,936,3,318,156,0,936,937,3,292,
- 143,0,937,938,3,316,155,0,938,939,3,300,147,0,939,145,1,0,0,0,940,941,
- 3,318,156,0,941,942,3,292,143,0,942,943,3,330,162,0,943,944,3,332,163,
- 0,944,945,3,326,160,0,945,946,3,292,143,0,946,947,3,314,154,0,947,147,
- 1,0,0,0,948,949,3,318,156,0,949,950,3,292,143,0,950,951,3,318,156,0,951,
- 149,1,0,0,0,952,953,3,318,156,0,953,954,3,320,157,0,954,955,3,330,162,
- 0,955,151,1,0,0,0,956,957,3,318,156,0,957,958,3,332,163,0,958,959,3,314,
- 154,0,959,960,3,314,154,0,960,153,1,0,0,0,961,962,3,318,156,0,962,963,
- 3,332,163,0,963,964,3,314,154,0,964,965,3,314,154,0,965,966,3,328,161,
- 0,966,155,1,0,0,0,967,968,3,320,157,0,968,969,3,302,148,0,969,970,3,302,
- 148,0,970,971,3,328,161,0,971,972,3,300,147,0,972,973,3,330,162,0,973,
- 157,1,0,0,0,974,975,3,320,157,0,975,976,3,318,156,0,976,159,1,0,0,0,977,
- 978,3,320,157,0,978,979,3,326,160,0,979,161,1,0,0,0,980,981,3,320,157,
- 0,981,982,3,326,160,0,982,983,3,298,146,0,983,984,3,300,147,0,984,985,
- 3,326,160,0,985,163,1,0,0,0,986,987,3,320,157,0,987,988,3,332,163,0,988,
- 989,3,330,162,0,989,990,3,300,147,0,990,991,3,326,160,0,991,165,1,0,0,
- 0,992,993,3,320,157,0,993,994,3,334,164,0,994,995,3,300,147,0,995,996,
- 3,326,160,0,996,167,1,0,0,0,997,998,3,322,158,0,998,999,3,292,143,0,999,
- 1000,3,326,160,0,1000,1001,3,330,162,0,1001,1002,3,308,151,0,1002,1003,
- 3,330,162,0,1003,1004,3,308,151,0,1004,1005,3,320,157,0,1005,1006,3,318,
- 156,0,1006,169,1,0,0,0,1007,1008,3,322,158,0,1008,1009,3,308,151,0,1009,
- 1010,3,334,164,0,1010,1011,3,320,157,0,1011,1012,3,330,162,0,1012,171,
- 1,0,0,0,1013,1014,3,322,158,0,1014,1015,3,320,157,0,1015,1016,3,328,161,
- 0,1016,1017,3,308,151,0,1017,1018,3,330,162,0,1018,1019,3,308,151,0,1019,
- 1020,3,320,157,0,1020,1021,3,318,156,0,1021,1022,3,292,143,0,1022,1023,
- 3,314,154,0,1023,173,1,0,0,0,1024,1025,3,322,158,0,1025,1026,3,326,160,
- 0,1026,1027,3,300,147,0,1027,1028,3,296,145,0,1028,1029,3,300,147,0,1029,
- 1030,3,298,146,0,1030,1031,3,308,151,0,1031,1032,3,318,156,0,1032,1033,
- 3,304,149,0,1033,175,1,0,0,0,1034,1035,3,322,158,0,1035,1036,3,326,160,
- 0,1036,1037,3,300,147,0,1037,1038,3,336,165,0,1038,1039,3,306,150,0,1039,
- 1040,3,300,147,0,1040,1041,3,326,160,0,1041,1042,3,300,147,0,1042,177,
- 1,0,0,0,1043,1044,3,324,159,0,1044,1045,3,332,163,0,1045,1046,3,292,143,
- 0,1046,1047,3,314,154,0,1047,1048,3,308,151,0,1048,1049,3,302,148,0,1049,
- 1050,3,340,167,0,1050,179,1,0,0,0,1051,1052,3,324,159,0,1052,1053,3,332,
- 163,0,1053,1054,3,292,143,0,1054,1055,3,326,160,0,1055,1056,3,330,162,
- 0,1056,1057,3,300,147,0,1057,1058,3,326,160,0,1058,181,1,0,0,0,1059,1060,
- 3,326,160,0,1060,1061,3,292,143,0,1061,1062,3,318,156,0,1062,1063,3,304,
- 149,0,1063,1064,3,300,147,0,1064,183,1,0,0,0,1065,1066,3,326,160,0,1066,
- 1067,3,300,147,0,1067,1068,3,296,145,0,1068,1069,3,332,163,0,1069,1070,
- 3,326,160,0,1070,1071,3,328,161,0,1071,1072,3,308,151,0,1072,1073,3,334,
- 164,0,1073,1074,3,300,147,0,1074,185,1,0,0,0,1075,1076,3,326,160,0,1076,
- 1077,3,300,147,0,1077,1078,3,322,158,0,1078,1079,3,314,154,0,1079,1080,
- 3,292,143,0,1080,1081,3,296,145,0,1081,1082,3,300,147,0,1082,187,1,0,
- 0,0,1083,1084,3,326,160,0,1084,1085,3,300,147,0,1085,1086,3,330,162,0,
- 1086,1087,3,332,163,0,1087,1088,3,326,160,0,1088,1089,3,318,156,0,1089,
- 189,1,0,0,0,1090,1091,3,326,160,0,1091,1092,3,308,151,0,1092,1093,3,304,
- 149,0,1093,1094,3,306,150,0,1094,1095,3,330,162,0,1095,191,1,0,0,0,1096,
- 1097,3,326,160,0,1097,1098,3,320,157,0,1098,1099,3,314,154,0,1099,1100,
- 3,314,154,0,1100,1101,3,332,163,0,1101,1102,3,322,158,0,1102,193,1,0,
- 0,0,1103,1104,3,326,160,0,1104,1105,3,320,157,0,1105,1106,3,336,165,0,
- 1106,195,1,0,0,0,1107,1108,3,326,160,0,1108,1109,3,320,157,0,1109,1110,
- 3,336,165,0,1110,1111,3,328,161,0,1111,197,1,0,0,0,1112,1113,3,328,161,
- 0,1113,1114,3,292,143,0,1114,1115,3,316,155,0,1115,1116,3,322,158,0,1116,
- 1117,3,314,154,0,1117,1118,3,300,147,0,1118,199,1,0,0,0,1119,1120,3,328,
- 161,0,1120,1121,3,300,147,0,1121,1122,3,296,145,0,1122,1123,3,320,157,
- 0,1123,1124,3,318,156,0,1124,1125,3,298,146,0,1125,201,1,0,0,0,1126,1127,
- 3,328,161,0,1127,1128,3,300,147,0,1128,1129,3,314,154,0,1129,1130,3,300,
- 147,0,1130,1131,3,296,145,0,1131,1132,3,330,162,0,1132,203,1,0,0,0,1133,
- 1134,3,328,161,0,1134,1135,3,300,147,0,1135,1136,3,316,155,0,1136,1137,
- 3,308,151,0,1137,205,1,0,0,0,1138,1139,3,328,161,0,1139,1140,3,300,147,
- 0,1140,1141,3,330,162,0,1141,1142,3,328,161,0,1142,207,1,0,0,0,1143,1144,
- 3,328,161,0,1144,1145,3,300,147,0,1145,1146,3,330,162,0,1146,1147,3,330,
- 162,0,1147,1148,3,308,151,0,1148,1149,3,318,156,0,1149,1150,3,304,149,
- 0,1150,1151,3,328,161,0,1151,209,1,0,0,0,1152,1153,3,328,161,0,1153,1154,
- 3,330,162,0,1154,1155,3,300,147,0,1155,1156,3,322,158,0,1156,211,1,0,
- 0,0,1157,1158,3,328,161,0,1158,1159,3,332,163,0,1159,1160,3,294,144,0,
- 1160,1161,3,328,161,0,1161,1162,3,330,162,0,1162,1163,3,326,160,0,1163,
- 1164,3,308,151,0,1164,1165,3,318,156,0,1165,1166,3,304,149,0,1166,213,
- 1,0,0,0,1167,1168,3,330,162,0,1168,1169,3,306,150,0,1169,1170,3,300,147,
- 0,1170,1171,3,318,156,0,1171,215,1,0,0,0,1172,1173,3,330,162,0,1173,1174,
- 3,306,150,0,1174,1175,3,326,160,0,1175,1176,3,320,157,0,1176,1177,3,336,
- 165,0,1177,217,1,0,0,0,1178,1179,3,330,162,0,1179,1180,3,308,151,0,1180,
- 1181,3,300,147,0,1181,1182,3,328,161,0,1182,219,1,0,0,0,1183,1184,3,330,
- 162,0,1184,1185,3,308,151,0,1185,1186,3,316,155,0,1186,1187,3,300,147,
- 0,1187,1188,3,328,161,0,1188,1189,3,330,162,0,1189,1190,3,292,143,0,1190,
- 1191,3,316,155,0,1191,1192,3,322,158,0,1192,221,1,0,0,0,1193,1194,3,330,
- 162,0,1194,1195,3,308,151,0,1195,1196,3,316,155,0,1196,1197,3,300,147,
- 0,1197,223,1,0,0,0,1198,1199,3,314,154,0,1199,1200,3,320,157,0,1200,1201,
- 3,296,145,0,1201,1202,3,292,143,0,1202,1203,3,314,154,0,1203,225,1,0,
- 0,0,1204,1205,3,342,168,0,1205,1206,3,320,157,0,1206,1207,3,318,156,0,
- 1207,1208,3,300,147,0,1208,227,1,0,0,0,1209,1210,3,330,162,0,1210,1211,
- 3,320,157,0,1211,229,1,0,0,0,1212,1213,3,330,162,0,1213,1214,3,320,157,
- 0,1214,1215,3,322,158,0,1215,231,1,0,0,0,1216,1217,3,330,162,0,1217,1218,
- 3,320,157,0,1218,1219,3,330,162,0,1219,1220,3,292,143,0,1220,1221,3,314,
- 154,0,1221,1222,3,328,161,0,1222,233,1,0,0,0,1223,1224,3,330,162,0,1224,
- 1225,3,326,160,0,1225,1226,3,292,143,0,1226,1227,3,308,151,0,1227,1228,
- 3,314,154,0,1228,1229,3,308,151,0,1229,1230,3,318,156,0,1230,1231,3,304,
- 149,0,1231,235,1,0,0,0,1232,1233,3,330,162,0,1233,1234,3,326,160,0,1234,
- 1235,3,308,151,0,1235,1236,3,316,155,0,1236,237,1,0,0,0,1237,1238,3,330,
- 162,0,1238,1239,3,326,160,0,1239,1240,3,332,163,0,1240,1241,3,318,156,
- 0,1241,1242,3,296,145,0,1242,1243,3,292,143,0,1243,1244,3,330,162,0,1244,
- 1245,3,300,147,0,1245,239,1,0,0,0,1246,1247,3,330,162,0,1247,1248,3,326,
- 160,0,1248,1249,3,340,167,0,1249,241,1,0,0,0,1250,1251,3,330,162,0,1251,
- 1252,3,326,160,0,1252,1253,3,340,167,0,1253,1254,5,95,0,0,1254,1255,3,
- 296,145,0,1255,1256,3,292,143,0,1256,1257,3,328,161,0,1257,1258,3,330,
- 162,0,1258,243,1,0,0,0,1259,1260,3,332,163,0,1260,1261,3,318,156,0,1261,
- 1262,3,294,144,0,1262,1263,3,320,157,0,1263,1264,3,332,163,0,1264,1265,
- 3,318,156,0,1265,1266,3,298,146,0,1266,1267,3,300,147,0,1267,1268,3,298,
- 146,0,1268,245,1,0,0,0,1269,1270,3,332,163,0,1270,1271,3,318,156,0,1271,
- 1272,3,308,151,0,1272,1273,3,320,157,0,1273,1274,3,318,156,0,1274,247,
- 1,0,0,0,1275,1276,3,332,163,0,1276,1277,3,318,156,0,1277,1278,3,322,158,
- 0,1278,1279,3,308,151,0,1279,1280,3,334,164,0,1280,1281,3,320,157,0,1281,
- 1282,3,330,162,0,1282,249,1,0,0,0,1283,1284,3,332,163,0,1284,1285,3,328,
- 161,0,1285,1286,3,308,151,0,1286,1287,3,318,156,0,1287,1288,3,304,149,
- 0,1288,251,1,0,0,0,1289,1290,3,334,164,0,1290,1291,3,292,143,0,1291,1292,
- 3,314,154,0,1292,1293,3,332,163,0,1293,1294,3,300,147,0,1294,1295,3,328,
- 161,0,1295,253,1,0,0,0,1296,1297,3,336,165,0,1297,1298,3,300,147,0,1298,
- 1299,3,300,147,0,1299,1300,3,312,153,0,1300,255,1,0,0,0,1301,1302,3,336,
- 165,0,1302,1303,3,306,150,0,1303,1304,3,300,147,0,1304,1305,3,318,156,
- 0,1305,257,1,0,0,0,1306,1307,3,336,165,0,1307,1308,3,306,150,0,1308,1309,
- 3,300,147,0,1309,1310,3,326,160,0,1310,1311,3,300,147,0,1311,259,1,0,
- 0,0,1312,1313,3,336,165,0,1313,1314,3,306,150,0,1314,1315,3,308,151,0,
- 1315,1316,3,314,154,0,1316,1317,3,300,147,0,1317,261,1,0,0,0,1318,1319,
- 3,336,165,0,1319,1320,3,308,151,0,1320,1321,3,318,156,0,1321,1322,3,298,
- 146,0,1322,1323,3,320,157,0,1323,1324,3,336,165,0,1324,263,1,0,0,0,1325,
- 1326,3,336,165,0,1326,1327,3,308,151,0,1327,1328,3,330,162,0,1328,1329,
- 3,306,150,0,1329,265,1,0,0,0,1330,1331,3,336,165,0,1331,1332,3,308,151,
- 0,1332,1333,3,330,162,0,1333,1334,3,306,150,0,1334,1335,3,308,151,0,1335,
- 1336,3,318,156,0,1336,267,1,0,0,0,1337,1338,3,340,167,0,1338,1339,3,300,
- 147,0,1339,1340,3,292,143,0,1340,1341,3,326,160,0,1341,1348,1,0,0,0,1342,
- 1343,3,340,167,0,1343,1344,3,340,167,0,1344,1345,3,340,167,0,1345,1346,
- 3,340,167,0,1346,1348,1,0,0,0,1347,1337,1,0,0,0,1347,1342,1,0,0,0,1348,
- 269,1,0,0,0,1349,1350,3,360,177,0,1350,1351,3,294,144,0,1351,1382,1,0,
- 0,0,1352,1353,3,360,177,0,1353,1354,3,302,148,0,1354,1382,1,0,0,0,1355,
- 1356,3,360,177,0,1356,1357,3,326,160,0,1357,1382,1,0,0,0,1358,1359,3,
- 360,177,0,1359,1360,3,318,156,0,1360,1382,1,0,0,0,1361,1362,3,360,177,
- 0,1362,1363,3,330,162,0,1363,1382,1,0,0,0,1364,1365,3,360,177,0,1365,
- 1366,5,48,0,0,1366,1382,1,0,0,0,1367,1368,3,360,177,0,1368,1369,3,292,
- 143,0,1369,1382,1,0,0,0,1370,1371,3,360,177,0,1371,1372,3,334,164,0,1372,
- 1382,1,0,0,0,1373,1374,3,360,177,0,1374,1375,3,360,177,0,1375,1382,1,
- 0,0,0,1376,1377,3,360,177,0,1377,1378,3,338,166,0,1378,1379,3,352,173,
- 0,1379,1380,3,352,173,0,1380,1382,1,0,0,0,1381,1349,1,0,0,0,1381,1352,
- 1,0,0,0,1381,1355,1,0,0,0,1381,1358,1,0,0,0,1381,1361,1,0,0,0,1381,1364,
- 1,0,0,0,1381,1367,1,0,0,0,1381,1370,1,0,0,0,1381,1373,1,0,0,0,1381,1376,
- 1,0,0,0,1382,271,1,0,0,0,1383,1387,3,344,169,0,1384,1387,3,448,221,0,
- 1385,1387,3,374,184,0,1386,1383,1,0,0,0,1386,1384,1,0,0,0,1386,1385,1,
- 0,0,0,1387,1394,1,0,0,0,1388,1393,3,344,169,0,1389,1393,3,448,221,0,1390,
- 1393,3,350,172,0,1391,1393,3,374,184,0,1392,1388,1,0,0,0,1392,1389,1,
- 0,0,0,1392,1390,1,0,0,0,1392,1391,1,0,0,0,1393,1396,1,0,0,0,1394,1392,
- 1,0,0,0,1394,1395,1,0,0,0,1395,273,1,0,0,0,1396,1394,1,0,0,0,1397,1408,
- 3,358,176,0,1398,1407,8,0,0,0,1399,1407,3,270,132,0,1400,1401,3,360,177,
- 0,1401,1402,3,430,212,0,1402,1407,1,0,0,0,1403,1404,3,358,176,0,1404,
- 1405,3,358,176,0,1405,1407,1,0,0,0,1406,1398,1,0,0,0,1406,1399,1,0,0,
- 0,1406,1400,1,0,0,0,1406,1403,1,0,0,0,1407,1410,1,0,0,0,1408,1406,1,0,
- 0,0,1408,1409,1,0,0,0,1409,1411,1,0,0,0,1410,1408,1,0,0,0,1411,1412,3,
- 358,176,0,1412,1430,1,0,0,0,1413,1424,3,424,209,0,1414,1423,8,1,0,0,1415,
- 1423,3,270,132,0,1416,1417,3,360,177,0,1417,1418,3,424,209,0,1418,1423,
- 1,0,0,0,1419,1420,3,424,209,0,1420,1421,3,424,209,0,1421,1423,1,0,0,0,
- 1422,1414,1,0,0,0,1422,1415,1,0,0,0,1422,1416,1,0,0,0,1422,1419,1,0,0,
- 0,1423,1426,1,0,0,0,1424,1422,1,0,0,0,1424,1425,1,0,0,0,1425,1427,1,0,
- 0,0,1426,1424,1,0,0,0,1427,1428,3,424,209,0,1428,1430,1,0,0,0,1429,1397,
- 1,0,0,0,1429,1413,1,0,0,0,1430,275,1,0,0,0,1431,1432,3,284,139,0,1432,
- 1436,3,376,185,0,1433,1435,3,352,173,0,1434,1433,1,0,0,0,1435,1438,1,
- 0,0,0,1436,1434,1,0,0,0,1436,1437,1,0,0,0,1437,1441,1,0,0,0,1438,1436,
- 1,0,0,0,1439,1442,3,322,158,0,1440,1442,3,300,147,0,1441,1439,1,0,0,0,
- 1441,1440,1,0,0,0,1442,1445,1,0,0,0,1443,1446,3,420,207,0,1444,1446,3,
- 372,183,0,1445,1443,1,0,0,0,1445,1444,1,0,0,0,1445,1446,1,0,0,0,1446,
- 1448,1,0,0,0,1447,1449,3,350,172,0,1448,1447,1,0,0,0,1449,1450,1,0,0,
- 0,1450,1448,1,0,0,0,1450,1451,1,0,0,0,1451,1508,1,0,0,0,1452,1455,3,284,
- 139,0,1453,1456,3,322,158,0,1454,1456,3,300,147,0,1455,1453,1,0,0,0,1455,
- 1454,1,0,0,0,1456,1459,1,0,0,0,1457,1460,3,420,207,0,1458,1460,3,372,
- 183,0,1459,1457,1,0,0,0,1459,1458,1,0,0,0,1459,1460,1,0,0,0,1460,1462,
- 1,0,0,0,1461,1463,3,350,172,0,1462,1461,1,0,0,0,1463,1464,1,0,0,0,1464,
- 1462,1,0,0,0,1464,1465,1,0,0,0,1465,1508,1,0,0,0,1466,1467,3,282,138,
- 0,1467,1471,3,376,185,0,1468,1470,3,350,172,0,1469,1468,1,0,0,0,1470,
- 1473,1,0,0,0,1471,1469,1,0,0,0,1471,1472,1,0,0,0,1472,1474,1,0,0,0,1473,
- 1471,1,0,0,0,1474,1477,3,300,147,0,1475,1478,3,420,207,0,1476,1478,3,
- 372,183,0,1477,1475,1,0,0,0,1477,1476,1,0,0,0,1477,1478,1,0,0,0,1478,
- 1480,1,0,0,0,1479,1481,3,350,172,0,1480,1479,1,0,0,0,1481,1482,1,0,0,
- 0,1482,1480,1,0,0,0,1482,1483,1,0,0,0,1483,1508,1,0,0,0,1484,1485,3,376,
- 185,0,1485,1486,3,282,138,0,1486,1489,3,300,147,0,1487,1490,3,420,207,
- 0,1488,1490,3,372,183,0,1489,1487,1,0,0,0,1489,1488,1,0,0,0,1489,1490,
- 1,0,0,0,1490,1492,1,0,0,0,1491,1493,3,350,172,0,1492,1491,1,0,0,0,1493,
- 1494,1,0,0,0,1494,1492,1,0,0,0,1494,1495,1,0,0,0,1495,1508,1,0,0,0,1496,
- 1497,3,282,138,0,1497,1500,3,300,147,0,1498,1501,3,420,207,0,1499,1501,
- 3,372,183,0,1500,1498,1,0,0,0,1500,1499,1,0,0,0,1500,1501,1,0,0,0,1501,
- 1503,1,0,0,0,1502,1504,3,350,172,0,1503,1502,1,0,0,0,1504,1505,1,0,0,
- 0,1505,1503,1,0,0,0,1505,1506,1,0,0,0,1506,1508,1,0,0,0,1507,1431,1,0,
- 0,0,1507,1452,1,0,0,0,1507,1466,1,0,0,0,1507,1484,1,0,0,0,1507,1496,1,
- 0,0,0,1508,277,1,0,0,0,1509,1510,5,48,0,0,1510,1512,3,294,144,0,1511,
- 1513,3,346,170,0,1512,1511,1,0,0,0,1513,1514,1,0,0,0,1514,1512,1,0,0,
- 0,1514,1515,1,0,0,0,1515,279,1,0,0,0,1516,1518,5,48,0,0,1517,1519,3,348,
- 171,0,1518,1517,1,0,0,0,1519,1520,1,0,0,0,1520,1518,1,0,0,0,1520,1521,
- 1,0,0,0,1521,281,1,0,0,0,1522,1524,3,350,172,0,1523,1522,1,0,0,0,1524,
- 1525,1,0,0,0,1525,1523,1,0,0,0,1525,1526,1,0,0,0,1526,283,1,0,0,0,1527,
- 1528,5,48,0,0,1528,1530,3,338,166,0,1529,1531,3,352,173,0,1530,1529,1,
- 0,0,0,1531,1532,1,0,0,0,1532,1530,1,0,0,0,1532,1533,1,0,0,0,1533,285,
- 1,0,0,0,1534,1535,5,48,0,0,1535,1537,7,2,0,0,1536,1538,3,350,172,0,1537,
- 1536,1,0,0,0,1538,1539,1,0,0,0,1539,1537,1,0,0,0,1539,1540,1,0,0,0,1540,
- 287,1,0,0,0,1541,1542,5,48,0,0,1542,1544,7,3,0,0,1543,1545,3,350,172,
- 0,1544,1543,1,0,0,0,1545,1546,1,0,0,0,1546,1544,1,0,0,0,1546,1547,1,0,
- 0,0,1547,289,1,0,0,0,1548,1559,3,430,212,0,1549,1558,8,4,0,0,1550,1558,
- 3,270,132,0,1551,1552,3,360,177,0,1552,1553,3,430,212,0,1553,1558,1,0,
- 0,0,1554,1555,3,430,212,0,1555,1556,3,430,212,0,1556,1558,1,0,0,0,1557,
- 1549,1,0,0,0,1557,1550,1,0,0,0,1557,1551,1,0,0,0,1557,1554,1,0,0,0,1558,
- 1561,1,0,0,0,1559,1557,1,0,0,0,1559,1560,1,0,0,0,1560,1562,1,0,0,0,1561,
- 1559,1,0,0,0,1562,1563,3,430,212,0,1563,291,1,0,0,0,1564,1565,7,5,0,0,
- 1565,293,1,0,0,0,1566,1567,7,3,0,0,1567,295,1,0,0,0,1568,1569,7,6,0,0,
- 1569,297,1,0,0,0,1570,1571,7,7,0,0,1571,299,1,0,0,0,1572,1573,7,8,0,0,
- 1573,301,1,0,0,0,1574,1575,7,9,0,0,1575,303,1,0,0,0,1576,1577,7,10,0,
- 0,1577,305,1,0,0,0,1578,1579,7,11,0,0,1579,307,1,0,0,0,1580,1581,7,12,
- 0,0,1581,309,1,0,0,0,1582,1583,7,13,0,0,1583,311,1,0,0,0,1584,1585,7,
- 14,0,0,1585,313,1,0,0,0,1586,1587,7,15,0,0,1587,315,1,0,0,0,1588,1589,
- 7,16,0,0,1589,317,1,0,0,0,1590,1591,7,17,0,0,1591,319,1,0,0,0,1592,1593,
- 7,2,0,0,1593,321,1,0,0,0,1594,1595,7,18,0,0,1595,323,1,0,0,0,1596,1597,
- 7,19,0,0,1597,325,1,0,0,0,1598,1599,7,20,0,0,1599,327,1,0,0,0,1600,1601,
- 7,21,0,0,1601,329,1,0,0,0,1602,1603,7,22,0,0,1603,331,1,0,0,0,1604,1605,
- 7,23,0,0,1605,333,1,0,0,0,1606,1607,7,24,0,0,1607,335,1,0,0,0,1608,1609,
- 7,25,0,0,1609,337,1,0,0,0,1610,1611,7,26,0,0,1611,339,1,0,0,0,1612,1613,
- 7,27,0,0,1613,341,1,0,0,0,1614,1615,7,28,0,0,1615,343,1,0,0,0,1616,1617,
- 7,29,0,0,1617,345,1,0,0,0,1618,1619,7,30,0,0,1619,347,1,0,0,0,1620,1621,
- 7,31,0,0,1621,349,1,0,0,0,1622,1623,7,32,0,0,1623,351,1,0,0,0,1624,1625,
- 7,33,0,0,1625,353,1,0,0,0,1626,1627,5,45,0,0,1627,1628,5,62,0,0,1628,
- 355,1,0,0,0,1629,1630,5,42,0,0,1630,357,1,0,0,0,1631,1632,5,96,0,0,1632,
- 359,1,0,0,0,1633,1634,5,92,0,0,1634,361,1,0,0,0,1635,1636,5,58,0,0,1636,
- 1637,5,58,0,0,1637,363,1,0,0,0,1638,1639,5,58,0,0,1639,1640,5,61,0,0,
- 1640,365,1,0,0,0,1641,1642,5,58,0,0,1642,367,1,0,0,0,1643,1644,5,44,0,
- 0,1644,369,1,0,0,0,1645,1646,5,124,0,0,1646,1647,5,124,0,0,1647,371,1,
- 0,0,0,1648,1649,5,45,0,0,1649,373,1,0,0,0,1650,1651,5,36,0,0,1651,375,
- 1,0,0,0,1652,1653,5,46,0,0,1653,377,1,0,0,0,1654,1655,5,61,0,0,1655,1656,
- 5,61,0,0,1656,379,1,0,0,0,1657,1658,5,61,0,0,1658,381,1,0,0,0,1659,1660,
- 5,62,0,0,1660,1661,5,61,0,0,1661,383,1,0,0,0,1662,1663,5,62,0,0,1663,
- 385,1,0,0,0,1664,1665,5,35,0,0,1665,387,1,0,0,0,1666,1667,5,126,0,0,1667,
- 1668,5,42,0,0,1668,389,1,0,0,0,1669,1670,5,61,0,0,1670,1671,5,126,0,0,
- 1671,1672,5,42,0,0,1672,391,1,0,0,0,1673,1674,5,123,0,0,1674,1675,1,0,
- 0,0,1675,1676,6,193,0,0,1676,393,1,0,0,0,1677,1678,5,91,0,0,1678,395,
- 1,0,0,0,1679,1680,5,40,0,0,1680,397,1,0,0,0,1681,1682,5,60,0,0,1682,1683,
- 5,61,0,0,1683,399,1,0,0,0,1684,1685,5,60,0,0,1685,1686,5,47,0,0,1686,
- 1687,1,0,0,0,1687,1688,6,197,1,0,1688,1689,6,197,2,0,1689,401,1,0,0,0,
- 1690,1691,5,60,0,0,1691,1692,4,198,0,0,1692,1693,1,0,0,0,1693,1694,6,
- 198,3,0,1694,1695,6,198,4,0,1695,403,1,0,0,0,1696,1697,5,60,0,0,1697,
- 405,1,0,0,0,1698,1699,5,60,0,0,1699,1700,5,47,0,0,1700,407,1,0,0,0,1701,
- 1702,5,33,0,0,1702,1706,5,61,0,0,1703,1704,5,60,0,0,1704,1706,5,62,0,
- 0,1705,1701,1,0,0,0,1705,1703,1,0,0,0,1706,409,1,0,0,0,1707,1708,5,33,
- 0,0,1708,1709,5,126,0,0,1709,1710,5,42,0,0,1710,411,1,0,0,0,1711,1712,
- 5,33,0,0,1712,1713,5,126,0,0,1713,413,1,0,0,0,1714,1715,5,63,0,0,1715,
- 1716,5,46,0,0,1716,415,1,0,0,0,1717,1718,5,63,0,0,1718,1719,5,63,0,0,
- 1719,417,1,0,0,0,1720,1721,5,37,0,0,1721,419,1,0,0,0,1722,1723,5,43,0,
- 0,1723,421,1,0,0,0,1724,1725,5,63,0,0,1725,423,1,0,0,0,1726,1727,5,34,
- 0,0,1727,425,1,0,0,0,1728,1729,5,102,0,0,1729,1730,5,39,0,0,1730,1731,
- 1,0,0,0,1731,1732,6,210,5,0,1732,427,1,0,0,0,1733,1734,5,70,0,0,1734,
- 1735,5,39,0,0,1735,1736,1,0,0,0,1736,1737,6,211,6,0,1737,429,1,0,0,0,
- 1738,1739,5,39,0,0,1739,431,1,0,0,0,1740,1741,5,126,0,0,1741,433,1,0,
- 0,0,1742,1743,5,61,0,0,1743,1744,5,126,0,0,1744,435,1,0,0,0,1745,1746,
- 5,125,0,0,1746,1747,1,0,0,0,1747,1748,6,215,7,0,1748,437,1,0,0,0,1749,
- 1750,5,93,0,0,1750,439,1,0,0,0,1751,1752,5,41,0,0,1752,441,1,0,0,0,1753,
- 1754,5,59,0,0,1754,443,1,0,0,0,1755,1756,5,47,0,0,1756,445,1,0,0,0,1757,
- 1758,5,47,0,0,1758,1759,5,62,0,0,1759,447,1,0,0,0,1760,1761,5,95,0,0,
- 1761,449,1,0,0,0,1762,1763,5,47,0,0,1763,1764,5,42,0,0,1764,1768,1,0,
- 0,0,1765,1767,9,0,0,0,1766,1765,1,0,0,0,1767,1770,1,0,0,0,1768,1769,1,
- 0,0,0,1768,1766,1,0,0,0,1769,1771,1,0,0,0,1770,1768,1,0,0,0,1771,1772,
- 5,42,0,0,1772,1773,5,47,0,0,1773,1774,1,0,0,0,1774,1775,6,222,8,0,1775,
- 451,1,0,0,0,1776,1777,5,45,0,0,1777,1781,5,45,0,0,1778,1779,5,47,0,0,
- 1779,1781,5,47,0,0,1780,1776,1,0,0,0,1780,1778,1,0,0,0,1781,1785,1,0,
- 0,0,1782,1784,8,34,0,0,1783,1782,1,0,0,0,1784,1787,1,0,0,0,1785,1783,
- 1,0,0,0,1785,1786,1,0,0,0,1786,1789,1,0,0,0,1787,1785,1,0,0,0,1788,1790,
- 7,35,0,0,1789,1788,1,0,0,0,1790,1791,1,0,0,0,1791,1792,6,223,8,0,1792,
- 453,1,0,0,0,1793,1794,7,36,0,0,1794,1795,1,0,0,0,1795,1796,6,224,9,0,
- 1796,455,1,0,0,0,1797,1798,9,0,0,0,1798,457,1,0,0,0,1799,1811,8,37,0,
- 0,1800,1811,3,270,132,0,1801,1802,3,360,177,0,1802,1803,3,430,212,0,1803,
- 1811,1,0,0,0,1804,1805,3,360,177,0,1805,1806,3,392,193,0,1806,1811,1,
- 0,0,0,1807,1808,3,430,212,0,1808,1809,3,430,212,0,1809,1811,1,0,0,0,1810,
- 1799,1,0,0,0,1810,1800,1,0,0,0,1810,1801,1,0,0,0,1810,1804,1,0,0,0,1810,
- 1807,1,0,0,0,1811,1812,1,0,0,0,1812,1810,1,0,0,0,1812,1813,1,0,0,0,1813,
- 459,1,0,0,0,1814,1815,3,392,193,0,1815,1816,1,0,0,0,1816,1817,6,227,0,
- 0,1817,461,1,0,0,0,1818,1819,3,430,212,0,1819,1820,1,0,0,0,1820,1821,
- 6,228,10,0,1821,1822,6,228,7,0,1822,463,1,0,0,0,1823,1829,8,38,0,0,1824,
- 1829,3,270,132,0,1825,1826,3,360,177,0,1826,1827,3,392,193,0,1827,1829,
- 1,0,0,0,1828,1823,1,0,0,0,1828,1824,1,0,0,0,1828,1825,1,0,0,0,1829,1830,
- 1,0,0,0,1830,1828,1,0,0,0,1830,1831,1,0,0,0,1831,465,1,0,0,0,1832,1833,
- 3,392,193,0,1833,1834,1,0,0,0,1834,1835,6,230,0,0,1835,467,1,0,0,0,1836,
- 1837,5,47,0,0,1837,1838,5,62,0,0,1838,1839,1,0,0,0,1839,1840,6,231,11,
- 0,1840,1841,6,231,7,0,1841,469,1,0,0,0,1842,1843,5,62,0,0,1843,1844,1,
- 0,0,0,1844,1845,6,232,12,0,1845,1846,6,232,7,0,1846,1847,6,232,13,0,1847,
- 471,1,0,0,0,1848,1852,7,39,0,0,1849,1851,7,40,0,0,1850,1849,1,0,0,0,1851,
- 1854,1,0,0,0,1852,1850,1,0,0,0,1852,1853,1,0,0,0,1853,1855,1,0,0,0,1854,
- 1852,1,0,0,0,1855,1856,6,233,14,0,1856,473,1,0,0,0,1857,1858,5,61,0,0,
- 1858,1859,1,0,0,0,1859,1860,6,234,15,0,1860,475,1,0,0,0,1861,1862,3,290,
- 142,0,1862,1863,1,0,0,0,1863,1864,6,235,16,0,1864,477,1,0,0,0,1865,1867,
- 7,41,0,0,1866,1865,1,0,0,0,1867,1868,1,0,0,0,1868,1866,1,0,0,0,1868,1869,
- 1,0,0,0,1869,1870,1,0,0,0,1870,1871,6,236,9,0,1871,479,1,0,0,0,1872,1873,
- 5,123,0,0,1873,1874,1,0,0,0,1874,1875,6,237,17,0,1875,1876,6,237,0,0,
- 1876,481,1,0,0,0,1877,1878,5,62,0,0,1878,1879,1,0,0,0,1879,1880,6,238,
- 12,0,1880,1881,6,238,7,0,1881,483,1,0,0,0,1882,1886,7,39,0,0,1883,1885,
- 7,40,0,0,1884,1883,1,0,0,0,1885,1888,1,0,0,0,1886,1884,1,0,0,0,1886,1887,
- 1,0,0,0,1887,1889,1,0,0,0,1888,1886,1,0,0,0,1889,1890,6,239,14,0,1890,
- 485,1,0,0,0,1891,1893,7,41,0,0,1892,1891,1,0,0,0,1893,1894,1,0,0,0,1894,
- 1892,1,0,0,0,1894,1895,1,0,0,0,1895,1896,1,0,0,0,1896,1897,6,240,9,0,
- 1897,487,1,0,0,0,1898,1900,8,42,0,0,1899,1898,1,0,0,0,1900,1901,1,0,0,
- 0,1901,1899,1,0,0,0,1901,1902,1,0,0,0,1902,489,1,0,0,0,1903,1904,5,123,
- 0,0,1904,1905,1,0,0,0,1905,1906,6,242,17,0,1906,1907,6,242,0,0,1907,491,
- 1,0,0,0,1908,1909,5,60,0,0,1909,1910,5,47,0,0,1910,1911,1,0,0,0,1911,
- 1912,6,243,1,0,1912,1913,6,243,7,0,1913,1914,6,243,2,0,1914,493,1,0,0,
- 0,1915,1916,5,60,0,0,1916,1917,1,0,0,0,1917,1918,6,244,3,0,1918,1919,
- 6,244,4,0,1919,495,1,0,0,0,1920,1922,7,41,0,0,1921,1920,1,0,0,0,1922,
- 1923,1,0,0,0,1923,1921,1,0,0,0,1923,1924,1,0,0,0,1924,1925,1,0,0,0,1925,
- 1926,6,245,9,0,1926,497,1,0,0,0,56,0,1,2,3,4,5,538,818,1347,1381,1386,
- 1392,1394,1406,1408,1422,1424,1429,1436,1441,1445,1450,1455,1459,1464,
- 1471,1477,1482,1489,1494,1500,1505,1507,1514,1520,1525,1532,1539,1546,
- 1557,1559,1705,1768,1780,1785,1789,1810,1812,1828,1830,1852,1868,1886,
- 1894,1901,1923,18,5,0,0,7,168,0,5,4,0,7,167,0,5,3,0,5,1,0,5,2,0,4,0,0,
- 6,0,0,0,1,0,7,180,0,7,188,0,7,159,0,5,5,0,7,134,0,7,157,0,7,143,0,7,163,
- 0
+ 1,0,0,0,3,478,1,0,0,0,3,480,1,0,0,0,3,482,1,0,0,0,3,484,1,0,0,0,3,486,
+ 1,0,0,0,4,488,1,0,0,0,4,490,1,0,0,0,4,492,1,0,0,0,4,494,1,0,0,0,4,496,
+ 1,0,0,0,4,498,1,0,0,0,5,500,1,0,0,0,5,502,1,0,0,0,5,504,1,0,0,0,5,506,
+ 1,0,0,0,5,508,1,0,0,0,6,510,1,0,0,0,8,514,1,0,0,0,10,518,1,0,0,0,12,523,
+ 1,0,0,0,14,527,1,0,0,0,16,533,1,0,0,0,18,550,1,0,0,0,20,552,1,0,0,0,22,
+ 557,1,0,0,0,24,565,1,0,0,0,26,570,1,0,0,0,28,573,1,0,0,0,30,578,1,0,0,
+ 0,32,583,1,0,0,0,34,589,1,0,0,0,36,596,1,0,0,0,38,604,1,0,0,0,40,612,
+ 1,0,0,0,42,618,1,0,0,0,44,623,1,0,0,0,46,631,1,0,0,0,48,636,1,0,0,0,50,
+ 640,1,0,0,0,52,645,1,0,0,0,54,656,1,0,0,0,56,665,1,0,0,0,58,670,1,0,0,
+ 0,60,674,1,0,0,0,62,681,1,0,0,0,64,689,1,0,0,0,66,697,1,0,0,0,68,703,
+ 1,0,0,0,70,708,1,0,0,0,72,715,1,0,0,0,74,723,1,0,0,0,76,729,1,0,0,0,78,
+ 732,1,0,0,0,80,742,1,0,0,0,82,746,1,0,0,0,84,751,1,0,0,0,86,756,1,0,0,
+ 0,88,760,1,0,0,0,90,766,1,0,0,0,92,775,1,0,0,0,94,782,1,0,0,0,96,787,
+ 1,0,0,0,98,790,1,0,0,0,100,793,1,0,0,0,102,799,1,0,0,0,104,806,1,0,0,
+ 0,106,814,1,0,0,0,108,830,1,0,0,0,110,832,1,0,0,0,112,838,1,0,0,0,114,
+ 848,1,0,0,0,116,860,1,0,0,0,118,869,1,0,0,0,120,872,1,0,0,0,122,877,1,
+ 0,0,0,124,881,1,0,0,0,126,888,1,0,0,0,128,893,1,0,0,0,130,901,1,0,0,0,
+ 132,906,1,0,0,0,134,910,1,0,0,0,136,915,1,0,0,0,138,921,1,0,0,0,140,934,
+ 1,0,0,0,142,941,1,0,0,0,144,947,1,0,0,0,146,952,1,0,0,0,148,960,1,0,0,
+ 0,150,964,1,0,0,0,152,968,1,0,0,0,154,973,1,0,0,0,156,979,1,0,0,0,158,
+ 986,1,0,0,0,160,989,1,0,0,0,162,992,1,0,0,0,164,998,1,0,0,0,166,1004,
+ 1,0,0,0,168,1009,1,0,0,0,170,1019,1,0,0,0,172,1025,1,0,0,0,174,1036,1,
+ 0,0,0,176,1046,1,0,0,0,178,1055,1,0,0,0,180,1063,1,0,0,0,182,1071,1,0,
+ 0,0,184,1077,1,0,0,0,186,1087,1,0,0,0,188,1095,1,0,0,0,190,1102,1,0,0,
+ 0,192,1108,1,0,0,0,194,1115,1,0,0,0,196,1119,1,0,0,0,198,1124,1,0,0,0,
+ 200,1131,1,0,0,0,202,1138,1,0,0,0,204,1145,1,0,0,0,206,1150,1,0,0,0,208,
+ 1155,1,0,0,0,210,1164,1,0,0,0,212,1169,1,0,0,0,214,1179,1,0,0,0,216,1184,
+ 1,0,0,0,218,1190,1,0,0,0,220,1195,1,0,0,0,222,1205,1,0,0,0,224,1210,1,
+ 0,0,0,226,1216,1,0,0,0,228,1221,1,0,0,0,230,1224,1,0,0,0,232,1228,1,0,
+ 0,0,234,1235,1,0,0,0,236,1244,1,0,0,0,238,1249,1,0,0,0,240,1258,1,0,0,
+ 0,242,1262,1,0,0,0,244,1271,1,0,0,0,246,1281,1,0,0,0,248,1287,1,0,0,0,
+ 250,1295,1,0,0,0,252,1301,1,0,0,0,254,1308,1,0,0,0,256,1313,1,0,0,0,258,
+ 1318,1,0,0,0,260,1324,1,0,0,0,262,1330,1,0,0,0,264,1337,1,0,0,0,266,1342,
+ 1,0,0,0,268,1359,1,0,0,0,270,1393,1,0,0,0,272,1398,1,0,0,0,274,1441,1,
+ 0,0,0,276,1513,1,0,0,0,278,1515,1,0,0,0,280,1522,1,0,0,0,282,1529,1,0,
+ 0,0,284,1533,1,0,0,0,286,1540,1,0,0,0,288,1547,1,0,0,0,290,1554,1,0,0,
+ 0,292,1570,1,0,0,0,294,1572,1,0,0,0,296,1574,1,0,0,0,298,1576,1,0,0,0,
+ 300,1578,1,0,0,0,302,1580,1,0,0,0,304,1582,1,0,0,0,306,1584,1,0,0,0,308,
+ 1586,1,0,0,0,310,1588,1,0,0,0,312,1590,1,0,0,0,314,1592,1,0,0,0,316,1594,
+ 1,0,0,0,318,1596,1,0,0,0,320,1598,1,0,0,0,322,1600,1,0,0,0,324,1602,1,
+ 0,0,0,326,1604,1,0,0,0,328,1606,1,0,0,0,330,1608,1,0,0,0,332,1610,1,0,
+ 0,0,334,1612,1,0,0,0,336,1614,1,0,0,0,338,1616,1,0,0,0,340,1618,1,0,0,
+ 0,342,1620,1,0,0,0,344,1622,1,0,0,0,346,1624,1,0,0,0,348,1626,1,0,0,0,
+ 350,1628,1,0,0,0,352,1630,1,0,0,0,354,1632,1,0,0,0,356,1635,1,0,0,0,358,
+ 1637,1,0,0,0,360,1639,1,0,0,0,362,1641,1,0,0,0,364,1644,1,0,0,0,366,1647,
+ 1,0,0,0,368,1649,1,0,0,0,370,1651,1,0,0,0,372,1654,1,0,0,0,374,1656,1,
+ 0,0,0,376,1658,1,0,0,0,378,1660,1,0,0,0,380,1663,1,0,0,0,382,1665,1,0,
+ 0,0,384,1668,1,0,0,0,386,1670,1,0,0,0,388,1672,1,0,0,0,390,1675,1,0,0,
+ 0,392,1679,1,0,0,0,394,1683,1,0,0,0,396,1685,1,0,0,0,398,1687,1,0,0,0,
+ 400,1690,1,0,0,0,402,1696,1,0,0,0,404,1702,1,0,0,0,406,1704,1,0,0,0,408,
+ 1711,1,0,0,0,410,1713,1,0,0,0,412,1717,1,0,0,0,414,1720,1,0,0,0,416,1723,
+ 1,0,0,0,418,1726,1,0,0,0,420,1728,1,0,0,0,422,1730,1,0,0,0,424,1732,1,
+ 0,0,0,426,1734,1,0,0,0,428,1739,1,0,0,0,430,1744,1,0,0,0,432,1746,1,0,
+ 0,0,434,1748,1,0,0,0,436,1751,1,0,0,0,438,1755,1,0,0,0,440,1757,1,0,0,
+ 0,442,1759,1,0,0,0,444,1761,1,0,0,0,446,1763,1,0,0,0,448,1766,1,0,0,0,
+ 450,1768,1,0,0,0,452,1786,1,0,0,0,454,1799,1,0,0,0,456,1803,1,0,0,0,458,
+ 1816,1,0,0,0,460,1820,1,0,0,0,462,1824,1,0,0,0,464,1834,1,0,0,0,466,1838,
+ 1,0,0,0,468,1842,1,0,0,0,470,1848,1,0,0,0,472,1854,1,0,0,0,474,1872,1,
+ 0,0,0,476,1885,1,0,0,0,478,1894,1,0,0,0,480,1898,1,0,0,0,482,1903,1,0,
+ 0,0,484,1909,1,0,0,0,486,1914,1,0,0,0,488,1918,1,0,0,0,490,1923,1,0,0,
+ 0,492,1941,1,0,0,0,494,1954,1,0,0,0,496,1964,1,0,0,0,498,1970,1,0,0,0,
+ 500,1975,1,0,0,0,502,1979,1,0,0,0,504,1984,1,0,0,0,506,1991,1,0,0,0,508,
+ 1997,1,0,0,0,510,511,3,292,143,0,511,512,3,314,154,0,512,513,3,314,154,
+ 0,513,7,1,0,0,0,514,515,3,292,143,0,515,516,3,318,156,0,516,517,3,298,
+ 146,0,517,9,1,0,0,0,518,519,3,292,143,0,519,520,3,318,156,0,520,521,3,
+ 330,162,0,521,522,3,308,151,0,522,11,1,0,0,0,523,524,3,292,143,0,524,
+ 525,3,318,156,0,525,526,3,340,167,0,526,13,1,0,0,0,527,528,3,292,143,
+ 0,528,529,3,326,160,0,529,530,3,326,160,0,530,531,3,292,143,0,531,532,
+ 3,340,167,0,532,15,1,0,0,0,533,534,3,292,143,0,534,535,3,328,161,0,535,
+ 17,1,0,0,0,536,537,3,292,143,0,537,538,3,328,161,0,538,539,3,296,145,
+ 0,539,551,1,0,0,0,540,541,3,292,143,0,541,542,3,328,161,0,542,543,3,296,
+ 145,0,543,544,3,300,147,0,544,545,3,318,156,0,545,546,3,298,146,0,546,
+ 547,3,308,151,0,547,548,3,318,156,0,548,549,3,304,149,0,549,551,1,0,0,
+ 0,550,536,1,0,0,0,550,540,1,0,0,0,551,19,1,0,0,0,552,553,3,292,143,0,
+ 553,554,3,328,161,0,554,555,3,320,157,0,555,556,3,302,148,0,556,21,1,
+ 0,0,0,557,558,3,294,144,0,558,559,3,300,147,0,559,560,3,330,162,0,560,
+ 561,3,336,165,0,561,562,3,300,147,0,562,563,3,300,147,0,563,564,3,318,
+ 156,0,564,23,1,0,0,0,565,566,3,294,144,0,566,567,3,320,157,0,567,568,
+ 3,330,162,0,568,569,3,306,150,0,569,25,1,0,0,0,570,571,3,294,144,0,571,
+ 572,3,340,167,0,572,27,1,0,0,0,573,574,3,296,145,0,574,575,3,292,143,
+ 0,575,576,3,328,161,0,576,577,3,300,147,0,577,29,1,0,0,0,578,579,3,296,
+ 145,0,579,580,3,292,143,0,580,581,3,328,161,0,581,582,3,330,162,0,582,
+ 31,1,0,0,0,583,584,3,296,145,0,584,585,3,292,143,0,585,586,3,330,162,
+ 0,586,587,3,296,145,0,587,588,3,306,150,0,588,33,1,0,0,0,589,590,3,296,
+ 145,0,590,591,3,320,157,0,591,592,3,306,150,0,592,593,3,320,157,0,593,
+ 594,3,326,160,0,594,595,3,330,162,0,595,35,1,0,0,0,596,597,3,296,145,
+ 0,597,598,3,320,157,0,598,599,3,314,154,0,599,600,3,314,154,0,600,601,
+ 3,292,143,0,601,602,3,330,162,0,602,603,3,300,147,0,603,37,1,0,0,0,604,
+ 605,3,296,145,0,605,606,3,320,157,0,606,607,3,314,154,0,607,608,3,332,
+ 163,0,608,609,3,316,155,0,609,610,3,318,156,0,610,611,3,328,161,0,611,
+ 39,1,0,0,0,612,613,3,296,145,0,613,614,3,326,160,0,614,615,3,320,157,
+ 0,615,616,3,328,161,0,616,617,3,328,161,0,617,41,1,0,0,0,618,619,3,296,
+ 145,0,619,620,3,332,163,0,620,621,3,294,144,0,621,622,3,300,147,0,622,
+ 43,1,0,0,0,623,624,3,296,145,0,624,625,3,332,163,0,625,626,3,326,160,
+ 0,626,627,3,326,160,0,627,628,3,300,147,0,628,629,3,318,156,0,629,630,
+ 3,330,162,0,630,45,1,0,0,0,631,632,3,298,146,0,632,633,3,292,143,0,633,
+ 634,3,330,162,0,634,635,3,300,147,0,635,47,1,0,0,0,636,637,3,298,146,
+ 0,637,638,3,292,143,0,638,639,3,340,167,0,639,49,1,0,0,0,640,641,3,298,
+ 146,0,641,642,3,300,147,0,642,643,3,328,161,0,643,644,3,296,145,0,644,
+ 51,1,0,0,0,645,646,3,298,146,0,646,647,3,300,147,0,647,648,3,328,161,
+ 0,648,649,3,296,145,0,649,650,3,300,147,0,650,651,3,318,156,0,651,652,
+ 3,298,146,0,652,653,3,308,151,0,653,654,3,318,156,0,654,655,3,304,149,
+ 0,655,53,1,0,0,0,656,657,3,298,146,0,657,658,3,308,151,0,658,659,3,328,
+ 161,0,659,660,3,330,162,0,660,661,3,308,151,0,661,662,3,318,156,0,662,
+ 663,3,296,145,0,663,664,3,330,162,0,664,55,1,0,0,0,665,666,3,300,147,
+ 0,666,667,3,314,154,0,667,668,3,328,161,0,668,669,3,300,147,0,669,57,
+ 1,0,0,0,670,671,3,300,147,0,671,672,3,318,156,0,672,673,3,298,146,0,673,
+ 59,1,0,0,0,674,675,3,300,147,0,675,676,3,338,166,0,676,677,3,296,145,
+ 0,677,678,3,300,147,0,678,679,3,322,158,0,679,680,3,330,162,0,680,61,
+ 1,0,0,0,681,682,3,300,147,0,682,683,3,338,166,0,683,684,3,296,145,0,684,
+ 685,3,314,154,0,685,686,3,332,163,0,686,687,3,298,146,0,687,688,3,300,
+ 147,0,688,63,1,0,0,0,689,690,3,300,147,0,690,691,3,338,166,0,691,692,
+ 3,330,162,0,692,693,3,326,160,0,693,694,3,292,143,0,694,695,3,296,145,
+ 0,695,696,3,330,162,0,696,65,1,0,0,0,697,698,3,302,148,0,698,699,3,308,
+ 151,0,699,700,3,318,156,0,700,701,3,292,143,0,701,702,3,314,154,0,702,
+ 67,1,0,0,0,703,704,3,302,148,0,704,705,3,308,151,0,705,706,3,314,154,
+ 0,706,707,3,314,154,0,707,69,1,0,0,0,708,709,3,302,148,0,709,710,3,308,
+ 151,0,710,711,3,314,154,0,711,712,3,330,162,0,712,713,3,300,147,0,713,
+ 714,3,326,160,0,714,71,1,0,0,0,715,716,3,302,148,0,716,717,3,308,151,
+ 0,717,718,3,318,156,0,718,719,3,292,143,0,719,720,3,314,154,0,720,721,
+ 3,314,154,0,721,722,3,340,167,0,722,73,1,0,0,0,723,724,3,302,148,0,724,
+ 725,3,308,151,0,725,726,3,326,160,0,726,727,3,328,161,0,727,728,3,330,
+ 162,0,728,75,1,0,0,0,729,730,3,302,148,0,730,731,3,318,156,0,731,77,1,
+ 0,0,0,732,733,3,302,148,0,733,734,3,320,157,0,734,735,3,314,154,0,735,
+ 736,3,314,154,0,736,737,3,320,157,0,737,738,3,336,165,0,738,739,3,308,
+ 151,0,739,740,3,318,156,0,740,741,3,304,149,0,741,79,1,0,0,0,742,743,
+ 3,302,148,0,743,744,3,320,157,0,744,745,3,326,160,0,745,81,1,0,0,0,746,
+ 747,3,302,148,0,747,748,3,326,160,0,748,749,3,320,157,0,749,750,3,316,
+ 155,0,750,83,1,0,0,0,751,752,3,302,148,0,752,753,3,332,163,0,753,754,
+ 3,314,154,0,754,755,3,314,154,0,755,85,1,0,0,0,756,757,3,302,148,0,757,
+ 758,3,332,163,0,758,759,3,318,156,0,759,87,1,0,0,0,760,761,3,304,149,
+ 0,761,762,3,326,160,0,762,763,3,320,157,0,763,764,3,332,163,0,764,765,
+ 3,322,158,0,765,89,1,0,0,0,766,767,3,304,149,0,767,768,3,326,160,0,768,
+ 769,3,320,157,0,769,770,3,332,163,0,770,771,3,322,158,0,771,772,3,308,
+ 151,0,772,773,3,318,156,0,773,774,3,304,149,0,774,91,1,0,0,0,775,776,
+ 3,306,150,0,776,777,3,292,143,0,777,778,3,334,164,0,778,779,3,308,151,
+ 0,779,780,3,318,156,0,780,781,3,304,149,0,781,93,1,0,0,0,782,783,3,306,
+ 150,0,783,784,3,320,157,0,784,785,3,332,163,0,785,786,3,326,160,0,786,
+ 95,1,0,0,0,787,788,3,308,151,0,788,789,3,298,146,0,789,97,1,0,0,0,790,
+ 791,3,308,151,0,791,792,3,302,148,0,792,99,1,0,0,0,793,794,3,308,151,
+ 0,794,795,3,314,154,0,795,796,3,308,151,0,796,797,3,312,153,0,797,798,
+ 3,300,147,0,798,101,1,0,0,0,799,800,3,308,151,0,800,801,3,304,149,0,801,
+ 802,3,318,156,0,802,803,3,320,157,0,803,804,3,326,160,0,804,805,3,300,
+ 147,0,805,103,1,0,0,0,806,807,3,308,151,0,807,808,3,318,156,0,808,809,
+ 3,296,145,0,809,810,3,314,154,0,810,811,3,332,163,0,811,812,3,298,146,
+ 0,812,813,3,300,147,0,813,105,1,0,0,0,814,815,3,308,151,0,815,816,3,318,
+ 156,0,816,107,1,0,0,0,817,818,3,308,151,0,818,819,3,318,156,0,819,820,
+ 3,302,148,0,820,831,1,0,0,0,821,822,3,308,151,0,822,823,3,318,156,0,823,
+ 824,3,302,148,0,824,825,3,308,151,0,825,826,3,318,156,0,826,827,3,308,
+ 151,0,827,828,3,330,162,0,828,829,3,340,167,0,829,831,1,0,0,0,830,817,
+ 1,0,0,0,830,821,1,0,0,0,831,109,1,0,0,0,832,833,3,308,151,0,833,834,3,
+ 318,156,0,834,835,3,318,156,0,835,836,3,300,147,0,836,837,3,326,160,0,
+ 837,111,1,0,0,0,838,839,3,308,151,0,839,840,3,318,156,0,840,841,3,330,
+ 162,0,841,842,3,300,147,0,842,843,3,326,160,0,843,844,3,328,161,0,844,
+ 845,3,300,147,0,845,846,3,296,145,0,846,847,3,330,162,0,847,113,1,0,0,
+ 0,848,849,3,308,151,0,849,850,3,318,156,0,850,851,3,330,162,0,851,852,
+ 3,300,147,0,852,853,3,326,160,0,853,854,3,322,158,0,854,855,3,320,157,
+ 0,855,856,3,314,154,0,856,857,3,292,143,0,857,858,3,330,162,0,858,859,
+ 3,300,147,0,859,115,1,0,0,0,860,861,3,308,151,0,861,862,3,318,156,0,862,
+ 863,3,330,162,0,863,864,3,300,147,0,864,865,3,326,160,0,865,866,3,334,
+ 164,0,866,867,3,292,143,0,867,868,3,314,154,0,868,117,1,0,0,0,869,870,
+ 3,308,151,0,870,871,3,328,161,0,871,119,1,0,0,0,872,873,3,310,152,0,873,
+ 874,3,320,157,0,874,875,3,308,151,0,875,876,3,318,156,0,876,121,1,0,0,
+ 0,877,878,3,312,153,0,878,879,3,300,147,0,879,880,3,340,167,0,880,123,
+ 1,0,0,0,881,882,3,314,154,0,882,883,3,292,143,0,883,884,3,316,155,0,884,
+ 885,3,294,144,0,885,886,3,298,146,0,886,887,3,292,143,0,887,125,1,0,0,
+ 0,888,889,3,314,154,0,889,890,3,292,143,0,890,891,3,328,161,0,891,892,
+ 3,330,162,0,892,127,1,0,0,0,893,894,3,314,154,0,894,895,3,300,147,0,895,
+ 896,3,292,143,0,896,897,3,298,146,0,897,898,3,308,151,0,898,899,3,318,
+ 156,0,899,900,3,304,149,0,900,129,1,0,0,0,901,902,3,314,154,0,902,903,
+ 3,300,147,0,903,904,3,302,148,0,904,905,3,330,162,0,905,131,1,0,0,0,906,
+ 907,3,314,154,0,907,908,3,300,147,0,908,909,3,330,162,0,909,133,1,0,0,
+ 0,910,911,3,314,154,0,911,912,3,308,151,0,912,913,3,312,153,0,913,914,
+ 3,300,147,0,914,135,1,0,0,0,915,916,3,314,154,0,916,917,3,308,151,0,917,
+ 918,3,316,155,0,918,919,3,308,151,0,919,920,3,330,162,0,920,137,1,0,0,
+ 0,921,922,3,316,155,0,922,923,3,292,143,0,923,924,3,330,162,0,924,925,
+ 3,300,147,0,925,926,3,326,160,0,926,927,3,308,151,0,927,928,3,292,143,
+ 0,928,929,3,314,154,0,929,930,3,308,151,0,930,931,3,342,168,0,931,932,
+ 3,300,147,0,932,933,3,298,146,0,933,139,1,0,0,0,934,935,3,316,155,0,935,
+ 936,3,308,151,0,936,937,3,318,156,0,937,938,3,332,163,0,938,939,3,330,
+ 162,0,939,940,3,300,147,0,940,141,1,0,0,0,941,942,3,316,155,0,942,943,
+ 3,320,157,0,943,944,3,318,156,0,944,945,3,330,162,0,945,946,3,306,150,
+ 0,946,143,1,0,0,0,947,948,3,318,156,0,948,949,3,292,143,0,949,950,3,316,
+ 155,0,950,951,3,300,147,0,951,145,1,0,0,0,952,953,3,318,156,0,953,954,
+ 3,292,143,0,954,955,3,330,162,0,955,956,3,332,163,0,956,957,3,326,160,
+ 0,957,958,3,292,143,0,958,959,3,314,154,0,959,147,1,0,0,0,960,961,3,318,
+ 156,0,961,962,3,292,143,0,962,963,3,318,156,0,963,149,1,0,0,0,964,965,
+ 3,318,156,0,965,966,3,320,157,0,966,967,3,330,162,0,967,151,1,0,0,0,968,
+ 969,3,318,156,0,969,970,3,332,163,0,970,971,3,314,154,0,971,972,3,314,
+ 154,0,972,153,1,0,0,0,973,974,3,318,156,0,974,975,3,332,163,0,975,976,
+ 3,314,154,0,976,977,3,314,154,0,977,978,3,328,161,0,978,155,1,0,0,0,979,
+ 980,3,320,157,0,980,981,3,302,148,0,981,982,3,302,148,0,982,983,3,328,
+ 161,0,983,984,3,300,147,0,984,985,3,330,162,0,985,157,1,0,0,0,986,987,
+ 3,320,157,0,987,988,3,318,156,0,988,159,1,0,0,0,989,990,3,320,157,0,990,
+ 991,3,326,160,0,991,161,1,0,0,0,992,993,3,320,157,0,993,994,3,326,160,
+ 0,994,995,3,298,146,0,995,996,3,300,147,0,996,997,3,326,160,0,997,163,
+ 1,0,0,0,998,999,3,320,157,0,999,1000,3,332,163,0,1000,1001,3,330,162,
+ 0,1001,1002,3,300,147,0,1002,1003,3,326,160,0,1003,165,1,0,0,0,1004,1005,
+ 3,320,157,0,1005,1006,3,334,164,0,1006,1007,3,300,147,0,1007,1008,3,326,
+ 160,0,1008,167,1,0,0,0,1009,1010,3,322,158,0,1010,1011,3,292,143,0,1011,
+ 1012,3,326,160,0,1012,1013,3,330,162,0,1013,1014,3,308,151,0,1014,1015,
+ 3,330,162,0,1015,1016,3,308,151,0,1016,1017,3,320,157,0,1017,1018,3,318,
+ 156,0,1018,169,1,0,0,0,1019,1020,3,322,158,0,1020,1021,3,308,151,0,1021,
+ 1022,3,334,164,0,1022,1023,3,320,157,0,1023,1024,3,330,162,0,1024,171,
+ 1,0,0,0,1025,1026,3,322,158,0,1026,1027,3,320,157,0,1027,1028,3,328,161,
+ 0,1028,1029,3,308,151,0,1029,1030,3,330,162,0,1030,1031,3,308,151,0,1031,
+ 1032,3,320,157,0,1032,1033,3,318,156,0,1033,1034,3,292,143,0,1034,1035,
+ 3,314,154,0,1035,173,1,0,0,0,1036,1037,3,322,158,0,1037,1038,3,326,160,
+ 0,1038,1039,3,300,147,0,1039,1040,3,296,145,0,1040,1041,3,300,147,0,1041,
+ 1042,3,298,146,0,1042,1043,3,308,151,0,1043,1044,3,318,156,0,1044,1045,
+ 3,304,149,0,1045,175,1,0,0,0,1046,1047,3,322,158,0,1047,1048,3,326,160,
+ 0,1048,1049,3,300,147,0,1049,1050,3,336,165,0,1050,1051,3,306,150,0,1051,
+ 1052,3,300,147,0,1052,1053,3,326,160,0,1053,1054,3,300,147,0,1054,177,
+ 1,0,0,0,1055,1056,3,324,159,0,1056,1057,3,332,163,0,1057,1058,3,292,143,
+ 0,1058,1059,3,314,154,0,1059,1060,3,308,151,0,1060,1061,3,302,148,0,1061,
+ 1062,3,340,167,0,1062,179,1,0,0,0,1063,1064,3,324,159,0,1064,1065,3,332,
+ 163,0,1065,1066,3,292,143,0,1066,1067,3,326,160,0,1067,1068,3,330,162,
+ 0,1068,1069,3,300,147,0,1069,1070,3,326,160,0,1070,181,1,0,0,0,1071,1072,
+ 3,326,160,0,1072,1073,3,292,143,0,1073,1074,3,318,156,0,1074,1075,3,304,
+ 149,0,1075,1076,3,300,147,0,1076,183,1,0,0,0,1077,1078,3,326,160,0,1078,
+ 1079,3,300,147,0,1079,1080,3,296,145,0,1080,1081,3,332,163,0,1081,1082,
+ 3,326,160,0,1082,1083,3,328,161,0,1083,1084,3,308,151,0,1084,1085,3,334,
+ 164,0,1085,1086,3,300,147,0,1086,185,1,0,0,0,1087,1088,3,326,160,0,1088,
+ 1089,3,300,147,0,1089,1090,3,322,158,0,1090,1091,3,314,154,0,1091,1092,
+ 3,292,143,0,1092,1093,3,296,145,0,1093,1094,3,300,147,0,1094,187,1,0,
+ 0,0,1095,1096,3,326,160,0,1096,1097,3,300,147,0,1097,1098,3,330,162,0,
+ 1098,1099,3,332,163,0,1099,1100,3,326,160,0,1100,1101,3,318,156,0,1101,
+ 189,1,0,0,0,1102,1103,3,326,160,0,1103,1104,3,308,151,0,1104,1105,3,304,
+ 149,0,1105,1106,3,306,150,0,1106,1107,3,330,162,0,1107,191,1,0,0,0,1108,
+ 1109,3,326,160,0,1109,1110,3,320,157,0,1110,1111,3,314,154,0,1111,1112,
+ 3,314,154,0,1112,1113,3,332,163,0,1113,1114,3,322,158,0,1114,193,1,0,
+ 0,0,1115,1116,3,326,160,0,1116,1117,3,320,157,0,1117,1118,3,336,165,0,
+ 1118,195,1,0,0,0,1119,1120,3,326,160,0,1120,1121,3,320,157,0,1121,1122,
+ 3,336,165,0,1122,1123,3,328,161,0,1123,197,1,0,0,0,1124,1125,3,328,161,
+ 0,1125,1126,3,292,143,0,1126,1127,3,316,155,0,1127,1128,3,322,158,0,1128,
+ 1129,3,314,154,0,1129,1130,3,300,147,0,1130,199,1,0,0,0,1131,1132,3,328,
+ 161,0,1132,1133,3,300,147,0,1133,1134,3,296,145,0,1134,1135,3,320,157,
+ 0,1135,1136,3,318,156,0,1136,1137,3,298,146,0,1137,201,1,0,0,0,1138,1139,
+ 3,328,161,0,1139,1140,3,300,147,0,1140,1141,3,314,154,0,1141,1142,3,300,
+ 147,0,1142,1143,3,296,145,0,1143,1144,3,330,162,0,1144,203,1,0,0,0,1145,
+ 1146,3,328,161,0,1146,1147,3,300,147,0,1147,1148,3,316,155,0,1148,1149,
+ 3,308,151,0,1149,205,1,0,0,0,1150,1151,3,328,161,0,1151,1152,3,300,147,
+ 0,1152,1153,3,330,162,0,1153,1154,3,328,161,0,1154,207,1,0,0,0,1155,1156,
+ 3,328,161,0,1156,1157,3,300,147,0,1157,1158,3,330,162,0,1158,1159,3,330,
+ 162,0,1159,1160,3,308,151,0,1160,1161,3,318,156,0,1161,1162,3,304,149,
+ 0,1162,1163,3,328,161,0,1163,209,1,0,0,0,1164,1165,3,328,161,0,1165,1166,
+ 3,330,162,0,1166,1167,3,300,147,0,1167,1168,3,322,158,0,1168,211,1,0,
+ 0,0,1169,1170,3,328,161,0,1170,1171,3,332,163,0,1171,1172,3,294,144,0,
+ 1172,1173,3,328,161,0,1173,1174,3,330,162,0,1174,1175,3,326,160,0,1175,
+ 1176,3,308,151,0,1176,1177,3,318,156,0,1177,1178,3,304,149,0,1178,213,
+ 1,0,0,0,1179,1180,3,330,162,0,1180,1181,3,306,150,0,1181,1182,3,300,147,
+ 0,1182,1183,3,318,156,0,1183,215,1,0,0,0,1184,1185,3,330,162,0,1185,1186,
+ 3,306,150,0,1186,1187,3,326,160,0,1187,1188,3,320,157,0,1188,1189,3,336,
+ 165,0,1189,217,1,0,0,0,1190,1191,3,330,162,0,1191,1192,3,308,151,0,1192,
+ 1193,3,300,147,0,1193,1194,3,328,161,0,1194,219,1,0,0,0,1195,1196,3,330,
+ 162,0,1196,1197,3,308,151,0,1197,1198,3,316,155,0,1198,1199,3,300,147,
+ 0,1199,1200,3,328,161,0,1200,1201,3,330,162,0,1201,1202,3,292,143,0,1202,
+ 1203,3,316,155,0,1203,1204,3,322,158,0,1204,221,1,0,0,0,1205,1206,3,330,
+ 162,0,1206,1207,3,308,151,0,1207,1208,3,316,155,0,1208,1209,3,300,147,
+ 0,1209,223,1,0,0,0,1210,1211,3,314,154,0,1211,1212,3,320,157,0,1212,1213,
+ 3,296,145,0,1213,1214,3,292,143,0,1214,1215,3,314,154,0,1215,225,1,0,
+ 0,0,1216,1217,3,342,168,0,1217,1218,3,320,157,0,1218,1219,3,318,156,0,
+ 1219,1220,3,300,147,0,1220,227,1,0,0,0,1221,1222,3,330,162,0,1222,1223,
+ 3,320,157,0,1223,229,1,0,0,0,1224,1225,3,330,162,0,1225,1226,3,320,157,
+ 0,1226,1227,3,322,158,0,1227,231,1,0,0,0,1228,1229,3,330,162,0,1229,1230,
+ 3,320,157,0,1230,1231,3,330,162,0,1231,1232,3,292,143,0,1232,1233,3,314,
+ 154,0,1233,1234,3,328,161,0,1234,233,1,0,0,0,1235,1236,3,330,162,0,1236,
+ 1237,3,326,160,0,1237,1238,3,292,143,0,1238,1239,3,308,151,0,1239,1240,
+ 3,314,154,0,1240,1241,3,308,151,0,1241,1242,3,318,156,0,1242,1243,3,304,
+ 149,0,1243,235,1,0,0,0,1244,1245,3,330,162,0,1245,1246,3,326,160,0,1246,
+ 1247,3,308,151,0,1247,1248,3,316,155,0,1248,237,1,0,0,0,1249,1250,3,330,
+ 162,0,1250,1251,3,326,160,0,1251,1252,3,332,163,0,1252,1253,3,318,156,
+ 0,1253,1254,3,296,145,0,1254,1255,3,292,143,0,1255,1256,3,330,162,0,1256,
+ 1257,3,300,147,0,1257,239,1,0,0,0,1258,1259,3,330,162,0,1259,1260,3,326,
+ 160,0,1260,1261,3,340,167,0,1261,241,1,0,0,0,1262,1263,3,330,162,0,1263,
+ 1264,3,326,160,0,1264,1265,3,340,167,0,1265,1266,5,95,0,0,1266,1267,3,
+ 296,145,0,1267,1268,3,292,143,0,1268,1269,3,328,161,0,1269,1270,3,330,
+ 162,0,1270,243,1,0,0,0,1271,1272,3,332,163,0,1272,1273,3,318,156,0,1273,
+ 1274,3,294,144,0,1274,1275,3,320,157,0,1275,1276,3,332,163,0,1276,1277,
+ 3,318,156,0,1277,1278,3,298,146,0,1278,1279,3,300,147,0,1279,1280,3,298,
+ 146,0,1280,245,1,0,0,0,1281,1282,3,332,163,0,1282,1283,3,318,156,0,1283,
+ 1284,3,308,151,0,1284,1285,3,320,157,0,1285,1286,3,318,156,0,1286,247,
+ 1,0,0,0,1287,1288,3,332,163,0,1288,1289,3,318,156,0,1289,1290,3,322,158,
+ 0,1290,1291,3,308,151,0,1291,1292,3,334,164,0,1292,1293,3,320,157,0,1293,
+ 1294,3,330,162,0,1294,249,1,0,0,0,1295,1296,3,332,163,0,1296,1297,3,328,
+ 161,0,1297,1298,3,308,151,0,1298,1299,3,318,156,0,1299,1300,3,304,149,
+ 0,1300,251,1,0,0,0,1301,1302,3,334,164,0,1302,1303,3,292,143,0,1303,1304,
+ 3,314,154,0,1304,1305,3,332,163,0,1305,1306,3,300,147,0,1306,1307,3,328,
+ 161,0,1307,253,1,0,0,0,1308,1309,3,336,165,0,1309,1310,3,300,147,0,1310,
+ 1311,3,300,147,0,1311,1312,3,312,153,0,1312,255,1,0,0,0,1313,1314,3,336,
+ 165,0,1314,1315,3,306,150,0,1315,1316,3,300,147,0,1316,1317,3,318,156,
+ 0,1317,257,1,0,0,0,1318,1319,3,336,165,0,1319,1320,3,306,150,0,1320,1321,
+ 3,300,147,0,1321,1322,3,326,160,0,1322,1323,3,300,147,0,1323,259,1,0,
+ 0,0,1324,1325,3,336,165,0,1325,1326,3,306,150,0,1326,1327,3,308,151,0,
+ 1327,1328,3,314,154,0,1328,1329,3,300,147,0,1329,261,1,0,0,0,1330,1331,
+ 3,336,165,0,1331,1332,3,308,151,0,1332,1333,3,318,156,0,1333,1334,3,298,
+ 146,0,1334,1335,3,320,157,0,1335,1336,3,336,165,0,1336,263,1,0,0,0,1337,
+ 1338,3,336,165,0,1338,1339,3,308,151,0,1339,1340,3,330,162,0,1340,1341,
+ 3,306,150,0,1341,265,1,0,0,0,1342,1343,3,336,165,0,1343,1344,3,308,151,
+ 0,1344,1345,3,330,162,0,1345,1346,3,306,150,0,1346,1347,3,308,151,0,1347,
+ 1348,3,318,156,0,1348,267,1,0,0,0,1349,1350,3,340,167,0,1350,1351,3,300,
+ 147,0,1351,1352,3,292,143,0,1352,1353,3,326,160,0,1353,1360,1,0,0,0,1354,
+ 1355,3,340,167,0,1355,1356,3,340,167,0,1356,1357,3,340,167,0,1357,1358,
+ 3,340,167,0,1358,1360,1,0,0,0,1359,1349,1,0,0,0,1359,1354,1,0,0,0,1360,
+ 269,1,0,0,0,1361,1362,3,360,177,0,1362,1363,3,294,144,0,1363,1394,1,0,
+ 0,0,1364,1365,3,360,177,0,1365,1366,3,302,148,0,1366,1394,1,0,0,0,1367,
+ 1368,3,360,177,0,1368,1369,3,326,160,0,1369,1394,1,0,0,0,1370,1371,3,
+ 360,177,0,1371,1372,3,318,156,0,1372,1394,1,0,0,0,1373,1374,3,360,177,
+ 0,1374,1375,3,330,162,0,1375,1394,1,0,0,0,1376,1377,3,360,177,0,1377,
+ 1378,5,48,0,0,1378,1394,1,0,0,0,1379,1380,3,360,177,0,1380,1381,3,292,
+ 143,0,1381,1394,1,0,0,0,1382,1383,3,360,177,0,1383,1384,3,334,164,0,1384,
+ 1394,1,0,0,0,1385,1386,3,360,177,0,1386,1387,3,360,177,0,1387,1394,1,
+ 0,0,0,1388,1389,3,360,177,0,1389,1390,3,338,166,0,1390,1391,3,352,173,
+ 0,1391,1392,3,352,173,0,1392,1394,1,0,0,0,1393,1361,1,0,0,0,1393,1364,
+ 1,0,0,0,1393,1367,1,0,0,0,1393,1370,1,0,0,0,1393,1373,1,0,0,0,1393,1376,
+ 1,0,0,0,1393,1379,1,0,0,0,1393,1382,1,0,0,0,1393,1385,1,0,0,0,1393,1388,
+ 1,0,0,0,1394,271,1,0,0,0,1395,1399,3,344,169,0,1396,1399,3,448,221,0,
+ 1397,1399,3,374,184,0,1398,1395,1,0,0,0,1398,1396,1,0,0,0,1398,1397,1,
+ 0,0,0,1399,1406,1,0,0,0,1400,1405,3,344,169,0,1401,1405,3,448,221,0,1402,
+ 1405,3,350,172,0,1403,1405,3,374,184,0,1404,1400,1,0,0,0,1404,1401,1,
+ 0,0,0,1404,1402,1,0,0,0,1404,1403,1,0,0,0,1405,1408,1,0,0,0,1406,1404,
+ 1,0,0,0,1406,1407,1,0,0,0,1407,273,1,0,0,0,1408,1406,1,0,0,0,1409,1420,
+ 3,358,176,0,1410,1419,8,0,0,0,1411,1419,3,270,132,0,1412,1413,3,360,177,
+ 0,1413,1414,3,430,212,0,1414,1419,1,0,0,0,1415,1416,3,358,176,0,1416,
+ 1417,3,358,176,0,1417,1419,1,0,0,0,1418,1410,1,0,0,0,1418,1411,1,0,0,
+ 0,1418,1412,1,0,0,0,1418,1415,1,0,0,0,1419,1422,1,0,0,0,1420,1418,1,0,
+ 0,0,1420,1421,1,0,0,0,1421,1423,1,0,0,0,1422,1420,1,0,0,0,1423,1424,3,
+ 358,176,0,1424,1442,1,0,0,0,1425,1436,3,424,209,0,1426,1435,8,1,0,0,1427,
+ 1435,3,270,132,0,1428,1429,3,360,177,0,1429,1430,3,424,209,0,1430,1435,
+ 1,0,0,0,1431,1432,3,424,209,0,1432,1433,3,424,209,0,1433,1435,1,0,0,0,
+ 1434,1426,1,0,0,0,1434,1427,1,0,0,0,1434,1428,1,0,0,0,1434,1431,1,0,0,
+ 0,1435,1438,1,0,0,0,1436,1434,1,0,0,0,1436,1437,1,0,0,0,1437,1439,1,0,
+ 0,0,1438,1436,1,0,0,0,1439,1440,3,424,209,0,1440,1442,1,0,0,0,1441,1409,
+ 1,0,0,0,1441,1425,1,0,0,0,1442,275,1,0,0,0,1443,1444,3,284,139,0,1444,
+ 1448,3,376,185,0,1445,1447,3,352,173,0,1446,1445,1,0,0,0,1447,1450,1,
+ 0,0,0,1448,1446,1,0,0,0,1448,1449,1,0,0,0,1449,1451,1,0,0,0,1450,1448,
+ 1,0,0,0,1451,1454,3,322,158,0,1452,1455,3,420,207,0,1453,1455,3,372,183,
+ 0,1454,1452,1,0,0,0,1454,1453,1,0,0,0,1454,1455,1,0,0,0,1455,1457,1,0,
+ 0,0,1456,1458,3,350,172,0,1457,1456,1,0,0,0,1458,1459,1,0,0,0,1459,1457,
+ 1,0,0,0,1459,1460,1,0,0,0,1460,1514,1,0,0,0,1461,1462,3,284,139,0,1462,
+ 1465,3,322,158,0,1463,1466,3,420,207,0,1464,1466,3,372,183,0,1465,1463,
+ 1,0,0,0,1465,1464,1,0,0,0,1465,1466,1,0,0,0,1466,1468,1,0,0,0,1467,1469,
+ 3,350,172,0,1468,1467,1,0,0,0,1469,1470,1,0,0,0,1470,1468,1,0,0,0,1470,
+ 1471,1,0,0,0,1471,1514,1,0,0,0,1472,1473,3,282,138,0,1473,1477,3,376,
+ 185,0,1474,1476,3,350,172,0,1475,1474,1,0,0,0,1476,1479,1,0,0,0,1477,
+ 1475,1,0,0,0,1477,1478,1,0,0,0,1478,1480,1,0,0,0,1479,1477,1,0,0,0,1480,
+ 1483,3,300,147,0,1481,1484,3,420,207,0,1482,1484,3,372,183,0,1483,1481,
+ 1,0,0,0,1483,1482,1,0,0,0,1483,1484,1,0,0,0,1484,1486,1,0,0,0,1485,1487,
+ 3,350,172,0,1486,1485,1,0,0,0,1487,1488,1,0,0,0,1488,1486,1,0,0,0,1488,
+ 1489,1,0,0,0,1489,1514,1,0,0,0,1490,1491,3,376,185,0,1491,1492,3,282,
+ 138,0,1492,1495,3,300,147,0,1493,1496,3,420,207,0,1494,1496,3,372,183,
+ 0,1495,1493,1,0,0,0,1495,1494,1,0,0,0,1495,1496,1,0,0,0,1496,1498,1,0,
+ 0,0,1497,1499,3,350,172,0,1498,1497,1,0,0,0,1499,1500,1,0,0,0,1500,1498,
+ 1,0,0,0,1500,1501,1,0,0,0,1501,1514,1,0,0,0,1502,1503,3,282,138,0,1503,
+ 1506,3,300,147,0,1504,1507,3,420,207,0,1505,1507,3,372,183,0,1506,1504,
+ 1,0,0,0,1506,1505,1,0,0,0,1506,1507,1,0,0,0,1507,1509,1,0,0,0,1508,1510,
+ 3,350,172,0,1509,1508,1,0,0,0,1510,1511,1,0,0,0,1511,1509,1,0,0,0,1511,
+ 1512,1,0,0,0,1512,1514,1,0,0,0,1513,1443,1,0,0,0,1513,1461,1,0,0,0,1513,
+ 1472,1,0,0,0,1513,1490,1,0,0,0,1513,1502,1,0,0,0,1514,277,1,0,0,0,1515,
+ 1516,5,48,0,0,1516,1518,3,294,144,0,1517,1519,3,346,170,0,1518,1517,1,
+ 0,0,0,1519,1520,1,0,0,0,1520,1518,1,0,0,0,1520,1521,1,0,0,0,1521,279,
+ 1,0,0,0,1522,1524,5,48,0,0,1523,1525,3,348,171,0,1524,1523,1,0,0,0,1525,
+ 1526,1,0,0,0,1526,1524,1,0,0,0,1526,1527,1,0,0,0,1527,281,1,0,0,0,1528,
+ 1530,3,350,172,0,1529,1528,1,0,0,0,1530,1531,1,0,0,0,1531,1529,1,0,0,
+ 0,1531,1532,1,0,0,0,1532,283,1,0,0,0,1533,1534,5,48,0,0,1534,1536,3,338,
+ 166,0,1535,1537,3,352,173,0,1536,1535,1,0,0,0,1537,1538,1,0,0,0,1538,
+ 1536,1,0,0,0,1538,1539,1,0,0,0,1539,285,1,0,0,0,1540,1541,5,48,0,0,1541,
+ 1543,7,2,0,0,1542,1544,3,350,172,0,1543,1542,1,0,0,0,1544,1545,1,0,0,
+ 0,1545,1543,1,0,0,0,1545,1546,1,0,0,0,1546,287,1,0,0,0,1547,1548,5,48,
+ 0,0,1548,1550,7,3,0,0,1549,1551,3,350,172,0,1550,1549,1,0,0,0,1551,1552,
+ 1,0,0,0,1552,1550,1,0,0,0,1552,1553,1,0,0,0,1553,289,1,0,0,0,1554,1565,
+ 3,430,212,0,1555,1564,8,4,0,0,1556,1564,3,270,132,0,1557,1558,3,360,177,
+ 0,1558,1559,3,430,212,0,1559,1564,1,0,0,0,1560,1561,3,430,212,0,1561,
+ 1562,3,430,212,0,1562,1564,1,0,0,0,1563,1555,1,0,0,0,1563,1556,1,0,0,
+ 0,1563,1557,1,0,0,0,1563,1560,1,0,0,0,1564,1567,1,0,0,0,1565,1563,1,0,
+ 0,0,1565,1566,1,0,0,0,1566,1568,1,0,0,0,1567,1565,1,0,0,0,1568,1569,3,
+ 430,212,0,1569,291,1,0,0,0,1570,1571,7,5,0,0,1571,293,1,0,0,0,1572,1573,
+ 7,3,0,0,1573,295,1,0,0,0,1574,1575,7,6,0,0,1575,297,1,0,0,0,1576,1577,
+ 7,7,0,0,1577,299,1,0,0,0,1578,1579,7,8,0,0,1579,301,1,0,0,0,1580,1581,
+ 7,9,0,0,1581,303,1,0,0,0,1582,1583,7,10,0,0,1583,305,1,0,0,0,1584,1585,
+ 7,11,0,0,1585,307,1,0,0,0,1586,1587,7,12,0,0,1587,309,1,0,0,0,1588,1589,
+ 7,13,0,0,1589,311,1,0,0,0,1590,1591,7,14,0,0,1591,313,1,0,0,0,1592,1593,
+ 7,15,0,0,1593,315,1,0,0,0,1594,1595,7,16,0,0,1595,317,1,0,0,0,1596,1597,
+ 7,17,0,0,1597,319,1,0,0,0,1598,1599,7,2,0,0,1599,321,1,0,0,0,1600,1601,
+ 7,18,0,0,1601,323,1,0,0,0,1602,1603,7,19,0,0,1603,325,1,0,0,0,1604,1605,
+ 7,20,0,0,1605,327,1,0,0,0,1606,1607,7,21,0,0,1607,329,1,0,0,0,1608,1609,
+ 7,22,0,0,1609,331,1,0,0,0,1610,1611,7,23,0,0,1611,333,1,0,0,0,1612,1613,
+ 7,24,0,0,1613,335,1,0,0,0,1614,1615,7,25,0,0,1615,337,1,0,0,0,1616,1617,
+ 7,26,0,0,1617,339,1,0,0,0,1618,1619,7,27,0,0,1619,341,1,0,0,0,1620,1621,
+ 7,28,0,0,1621,343,1,0,0,0,1622,1623,7,29,0,0,1623,345,1,0,0,0,1624,1625,
+ 7,30,0,0,1625,347,1,0,0,0,1626,1627,7,31,0,0,1627,349,1,0,0,0,1628,1629,
+ 7,32,0,0,1629,351,1,0,0,0,1630,1631,7,33,0,0,1631,353,1,0,0,0,1632,1633,
+ 5,45,0,0,1633,1634,5,62,0,0,1634,355,1,0,0,0,1635,1636,5,42,0,0,1636,
+ 357,1,0,0,0,1637,1638,5,96,0,0,1638,359,1,0,0,0,1639,1640,5,92,0,0,1640,
+ 361,1,0,0,0,1641,1642,5,58,0,0,1642,1643,5,58,0,0,1643,363,1,0,0,0,1644,
+ 1645,5,58,0,0,1645,1646,5,61,0,0,1646,365,1,0,0,0,1647,1648,5,58,0,0,
+ 1648,367,1,0,0,0,1649,1650,5,44,0,0,1650,369,1,0,0,0,1651,1652,5,124,
+ 0,0,1652,1653,5,124,0,0,1653,371,1,0,0,0,1654,1655,5,45,0,0,1655,373,
+ 1,0,0,0,1656,1657,5,36,0,0,1657,375,1,0,0,0,1658,1659,5,46,0,0,1659,377,
+ 1,0,0,0,1660,1661,5,61,0,0,1661,1662,5,61,0,0,1662,379,1,0,0,0,1663,1664,
+ 5,61,0,0,1664,381,1,0,0,0,1665,1666,5,62,0,0,1666,1667,5,61,0,0,1667,
+ 383,1,0,0,0,1668,1669,5,62,0,0,1669,385,1,0,0,0,1670,1671,5,35,0,0,1671,
+ 387,1,0,0,0,1672,1673,5,126,0,0,1673,1674,5,42,0,0,1674,389,1,0,0,0,1675,
+ 1676,5,61,0,0,1676,1677,5,126,0,0,1677,1678,5,42,0,0,1678,391,1,0,0,0,
+ 1679,1680,5,123,0,0,1680,1681,1,0,0,0,1681,1682,6,193,0,0,1682,393,1,
+ 0,0,0,1683,1684,5,91,0,0,1684,395,1,0,0,0,1685,1686,5,40,0,0,1686,397,
+ 1,0,0,0,1687,1688,5,60,0,0,1688,1689,5,61,0,0,1689,399,1,0,0,0,1690,1691,
+ 5,60,0,0,1691,1692,5,47,0,0,1692,1693,1,0,0,0,1693,1694,6,197,1,0,1694,
+ 1695,6,197,2,0,1695,401,1,0,0,0,1696,1697,5,60,0,0,1697,1698,4,198,0,
+ 0,1698,1699,1,0,0,0,1699,1700,6,198,3,0,1700,1701,6,198,4,0,1701,403,
+ 1,0,0,0,1702,1703,5,60,0,0,1703,405,1,0,0,0,1704,1705,5,60,0,0,1705,1706,
+ 5,47,0,0,1706,407,1,0,0,0,1707,1708,5,33,0,0,1708,1712,5,61,0,0,1709,
+ 1710,5,60,0,0,1710,1712,5,62,0,0,1711,1707,1,0,0,0,1711,1709,1,0,0,0,
+ 1712,409,1,0,0,0,1713,1714,5,33,0,0,1714,1715,5,126,0,0,1715,1716,5,42,
+ 0,0,1716,411,1,0,0,0,1717,1718,5,33,0,0,1718,1719,5,126,0,0,1719,413,
+ 1,0,0,0,1720,1721,5,63,0,0,1721,1722,5,46,0,0,1722,415,1,0,0,0,1723,1724,
+ 5,63,0,0,1724,1725,5,63,0,0,1725,417,1,0,0,0,1726,1727,5,37,0,0,1727,
+ 419,1,0,0,0,1728,1729,5,43,0,0,1729,421,1,0,0,0,1730,1731,5,63,0,0,1731,
+ 423,1,0,0,0,1732,1733,5,34,0,0,1733,425,1,0,0,0,1734,1735,5,102,0,0,1735,
+ 1736,5,39,0,0,1736,1737,1,0,0,0,1737,1738,6,210,5,0,1738,427,1,0,0,0,
+ 1739,1740,5,70,0,0,1740,1741,5,39,0,0,1741,1742,1,0,0,0,1742,1743,6,211,
+ 6,0,1743,429,1,0,0,0,1744,1745,5,39,0,0,1745,431,1,0,0,0,1746,1747,5,
+ 126,0,0,1747,433,1,0,0,0,1748,1749,5,61,0,0,1749,1750,5,126,0,0,1750,
+ 435,1,0,0,0,1751,1752,5,125,0,0,1752,1753,1,0,0,0,1753,1754,6,215,7,0,
+ 1754,437,1,0,0,0,1755,1756,5,93,0,0,1756,439,1,0,0,0,1757,1758,5,41,0,
+ 0,1758,441,1,0,0,0,1759,1760,5,59,0,0,1760,443,1,0,0,0,1761,1762,5,47,
+ 0,0,1762,445,1,0,0,0,1763,1764,5,47,0,0,1764,1765,5,62,0,0,1765,447,1,
+ 0,0,0,1766,1767,5,95,0,0,1767,449,1,0,0,0,1768,1769,5,47,0,0,1769,1770,
+ 5,42,0,0,1770,1774,1,0,0,0,1771,1773,9,0,0,0,1772,1771,1,0,0,0,1773,1776,
+ 1,0,0,0,1774,1775,1,0,0,0,1774,1772,1,0,0,0,1775,1777,1,0,0,0,1776,1774,
+ 1,0,0,0,1777,1778,5,42,0,0,1778,1779,5,47,0,0,1779,1780,1,0,0,0,1780,
+ 1781,6,222,8,0,1781,451,1,0,0,0,1782,1783,5,45,0,0,1783,1787,5,45,0,0,
+ 1784,1785,5,47,0,0,1785,1787,5,47,0,0,1786,1782,1,0,0,0,1786,1784,1,0,
+ 0,0,1787,1791,1,0,0,0,1788,1790,8,34,0,0,1789,1788,1,0,0,0,1790,1793,
+ 1,0,0,0,1791,1789,1,0,0,0,1791,1792,1,0,0,0,1792,1795,1,0,0,0,1793,1791,
+ 1,0,0,0,1794,1796,7,35,0,0,1795,1794,1,0,0,0,1796,1797,1,0,0,0,1797,1798,
+ 6,223,8,0,1798,453,1,0,0,0,1799,1800,7,36,0,0,1800,1801,1,0,0,0,1801,
+ 1802,6,224,9,0,1802,455,1,0,0,0,1803,1804,9,0,0,0,1804,457,1,0,0,0,1805,
+ 1817,8,37,0,0,1806,1817,3,270,132,0,1807,1808,3,360,177,0,1808,1809,3,
+ 430,212,0,1809,1817,1,0,0,0,1810,1811,3,360,177,0,1811,1812,3,392,193,
+ 0,1812,1817,1,0,0,0,1813,1814,3,430,212,0,1814,1815,3,430,212,0,1815,
+ 1817,1,0,0,0,1816,1805,1,0,0,0,1816,1806,1,0,0,0,1816,1807,1,0,0,0,1816,
+ 1810,1,0,0,0,1816,1813,1,0,0,0,1817,1818,1,0,0,0,1818,1816,1,0,0,0,1818,
+ 1819,1,0,0,0,1819,459,1,0,0,0,1820,1821,3,392,193,0,1821,1822,1,0,0,0,
+ 1822,1823,6,227,0,0,1823,461,1,0,0,0,1824,1825,3,430,212,0,1825,1826,
+ 1,0,0,0,1826,1827,6,228,10,0,1827,1828,6,228,7,0,1828,463,1,0,0,0,1829,
+ 1835,8,38,0,0,1830,1835,3,270,132,0,1831,1832,3,360,177,0,1832,1833,3,
+ 392,193,0,1833,1835,1,0,0,0,1834,1829,1,0,0,0,1834,1830,1,0,0,0,1834,
+ 1831,1,0,0,0,1835,1836,1,0,0,0,1836,1834,1,0,0,0,1836,1837,1,0,0,0,1837,
+ 465,1,0,0,0,1838,1839,3,392,193,0,1839,1840,1,0,0,0,1840,1841,6,230,0,
+ 0,1841,467,1,0,0,0,1842,1843,5,47,0,0,1843,1844,5,62,0,0,1844,1845,1,
+ 0,0,0,1845,1846,6,231,11,0,1846,1847,6,231,7,0,1847,469,1,0,0,0,1848,
+ 1849,5,62,0,0,1849,1850,1,0,0,0,1850,1851,6,232,12,0,1851,1852,6,232,
+ 7,0,1852,1853,6,232,13,0,1853,471,1,0,0,0,1854,1855,5,47,0,0,1855,1856,
+ 5,42,0,0,1856,1860,1,0,0,0,1857,1859,9,0,0,0,1858,1857,1,0,0,0,1859,1862,
+ 1,0,0,0,1860,1861,1,0,0,0,1860,1858,1,0,0,0,1861,1863,1,0,0,0,1862,1860,
+ 1,0,0,0,1863,1864,5,42,0,0,1864,1865,5,47,0,0,1865,1866,1,0,0,0,1866,
+ 1867,6,233,8,0,1867,473,1,0,0,0,1868,1869,5,45,0,0,1869,1873,5,45,0,0,
+ 1870,1871,5,47,0,0,1871,1873,5,47,0,0,1872,1868,1,0,0,0,1872,1870,1,0,
+ 0,0,1873,1877,1,0,0,0,1874,1876,8,34,0,0,1875,1874,1,0,0,0,1876,1879,
+ 1,0,0,0,1877,1875,1,0,0,0,1877,1878,1,0,0,0,1878,1881,1,0,0,0,1879,1877,
+ 1,0,0,0,1880,1882,7,35,0,0,1881,1880,1,0,0,0,1882,1883,1,0,0,0,1883,1884,
+ 6,234,8,0,1884,475,1,0,0,0,1885,1889,7,39,0,0,1886,1888,7,40,0,0,1887,
+ 1886,1,0,0,0,1888,1891,1,0,0,0,1889,1887,1,0,0,0,1889,1890,1,0,0,0,1890,
+ 1892,1,0,0,0,1891,1889,1,0,0,0,1892,1893,6,235,14,0,1893,477,1,0,0,0,
+ 1894,1895,5,61,0,0,1895,1896,1,0,0,0,1896,1897,6,236,15,0,1897,479,1,
+ 0,0,0,1898,1899,3,290,142,0,1899,1900,1,0,0,0,1900,1901,6,237,16,0,1901,
+ 481,1,0,0,0,1902,1904,7,41,0,0,1903,1902,1,0,0,0,1904,1905,1,0,0,0,1905,
+ 1903,1,0,0,0,1905,1906,1,0,0,0,1906,1907,1,0,0,0,1907,1908,6,238,9,0,
+ 1908,483,1,0,0,0,1909,1910,5,123,0,0,1910,1911,1,0,0,0,1911,1912,6,239,
+ 17,0,1912,1913,6,239,0,0,1913,485,1,0,0,0,1914,1915,9,0,0,0,1915,1916,
+ 1,0,0,0,1916,1917,6,240,18,0,1917,487,1,0,0,0,1918,1919,5,62,0,0,1919,
+ 1920,1,0,0,0,1920,1921,6,241,12,0,1921,1922,6,241,7,0,1922,489,1,0,0,
+ 0,1923,1924,5,47,0,0,1924,1925,5,42,0,0,1925,1929,1,0,0,0,1926,1928,9,
+ 0,0,0,1927,1926,1,0,0,0,1928,1931,1,0,0,0,1929,1930,1,0,0,0,1929,1927,
+ 1,0,0,0,1930,1932,1,0,0,0,1931,1929,1,0,0,0,1932,1933,5,42,0,0,1933,1934,
+ 5,47,0,0,1934,1935,1,0,0,0,1935,1936,6,242,8,0,1936,491,1,0,0,0,1937,
+ 1938,5,45,0,0,1938,1942,5,45,0,0,1939,1940,5,47,0,0,1940,1942,5,47,0,
+ 0,1941,1937,1,0,0,0,1941,1939,1,0,0,0,1942,1946,1,0,0,0,1943,1945,8,34,
+ 0,0,1944,1943,1,0,0,0,1945,1948,1,0,0,0,1946,1944,1,0,0,0,1946,1947,1,
+ 0,0,0,1947,1950,1,0,0,0,1948,1946,1,0,0,0,1949,1951,7,35,0,0,1950,1949,
+ 1,0,0,0,1951,1952,1,0,0,0,1952,1953,6,243,8,0,1953,493,1,0,0,0,1954,1958,
+ 7,39,0,0,1955,1957,7,40,0,0,1956,1955,1,0,0,0,1957,1960,1,0,0,0,1958,
+ 1956,1,0,0,0,1958,1959,1,0,0,0,1959,1961,1,0,0,0,1960,1958,1,0,0,0,1961,
+ 1962,6,244,14,0,1962,495,1,0,0,0,1963,1965,7,41,0,0,1964,1963,1,0,0,0,
+ 1965,1966,1,0,0,0,1966,1964,1,0,0,0,1966,1967,1,0,0,0,1967,1968,1,0,0,
+ 0,1968,1969,6,245,9,0,1969,497,1,0,0,0,1970,1971,9,0,0,0,1971,1972,1,
+ 0,0,0,1972,1973,6,246,18,0,1973,499,1,0,0,0,1974,1976,8,42,0,0,1975,1974,
+ 1,0,0,0,1976,1977,1,0,0,0,1977,1975,1,0,0,0,1977,1978,1,0,0,0,1978,501,
+ 1,0,0,0,1979,1980,5,123,0,0,1980,1981,1,0,0,0,1981,1982,6,248,17,0,1982,
+ 1983,6,248,0,0,1983,503,1,0,0,0,1984,1985,5,60,0,0,1985,1986,5,47,0,0,
+ 1986,1987,1,0,0,0,1987,1988,6,249,1,0,1988,1989,6,249,7,0,1989,1990,6,
+ 249,2,0,1990,505,1,0,0,0,1991,1992,5,60,0,0,1992,1993,1,0,0,0,1993,1994,
+ 6,250,3,0,1994,1995,6,250,4,0,1995,507,1,0,0,0,1996,1998,7,41,0,0,1997,
+ 1996,1,0,0,0,1998,1999,1,0,0,0,1999,1997,1,0,0,0,1999,2000,1,0,0,0,2000,
+ 2001,1,0,0,0,2001,2002,6,251,9,0,2002,509,1,0,0,0,62,0,1,2,3,4,5,550,
+ 830,1359,1393,1398,1404,1406,1418,1420,1434,1436,1441,1448,1454,1459,
+ 1465,1470,1477,1483,1488,1495,1500,1506,1511,1513,1520,1526,1531,1538,
+ 1545,1552,1563,1565,1711,1774,1786,1791,1795,1816,1818,1834,1836,1860,
+ 1872,1877,1881,1889,1905,1929,1941,1946,1950,1958,1966,1977,1999,19,5,
+ 0,0,7,168,0,5,4,0,7,167,0,5,3,0,5,1,0,5,2,0,4,0,0,6,0,0,0,1,0,7,180,0,
+ 7,188,0,7,159,0,5,5,0,7,134,0,7,157,0,7,143,0,7,163,0,7,193,0
};
staticData->serializedATN = antlr4::atn::SerializedATNView(serializedATNSegment, sizeof(serializedATNSegment) / sizeof(serializedATNSegment[0]));
diff --git a/common/hogql_parser/HogQLLexer.h b/common/hogql_parser/HogQLLexer.h
index fec59c5975ba..237d8a20a4ea 100644
--- a/common/hogql_parser/HogQLLexer.h
+++ b/common/hogql_parser/HogQLLexer.h
@@ -55,8 +55,10 @@ public:
RPAREN = 185, SEMICOLON = 186, SLASH = 187, SLASH_GT = 188, UNDERSCORE = 189,
MULTI_LINE_COMMENT = 190, SINGLE_LINE_COMMENT = 191, WHITESPACE = 192,
UNEXPECTED_CHARACTER = 193, STRING_TEXT = 194, STRING_ESCAPE_TRIGGER = 195,
- FULL_STRING_TEXT = 196, FULL_STRING_ESCAPE_TRIGGER = 197, TAG_WS = 198,
- TAGC_WS = 199, HOGQLX_TEXT_TEXT = 200, HOGQLX_TEXT_WS = 201
+ FULL_STRING_TEXT = 196, FULL_STRING_ESCAPE_TRIGGER = 197, TAG_MULTI_LINE_COMMENT = 198,
+ TAG_SINGLE_LINE_COMMENT = 199, TAG_WS = 200, TAGC_MULTI_LINE_COMMENT = 201,
+ TAGC_SINGLE_LINE_COMMENT = 202, TAGC_WS = 203, HOGQLX_TEXT_TEXT = 204,
+ HOGQLX_TEXT_WS = 205
};
enum {
diff --git a/common/hogql_parser/HogQLLexer.interp b/common/hogql_parser/HogQLLexer.interp
index b293f47605b9..1a5faea7ed8e 100644
--- a/common/hogql_parser/HogQLLexer.interp
+++ b/common/hogql_parser/HogQLLexer.interp
@@ -201,6 +201,10 @@ null
null
null
null
+null
+null
+null
+null
token symbolic names:
null
@@ -401,7 +405,11 @@ STRING_TEXT
STRING_ESCAPE_TRIGGER
FULL_STRING_TEXT
FULL_STRING_ESCAPE_TRIGGER
+TAG_MULTI_LINE_COMMENT
+TAG_SINGLE_LINE_COMMENT
TAG_WS
+TAGC_MULTI_LINE_COMMENT
+TAGC_SINGLE_LINE_COMMENT
TAGC_WS
HOGQLX_TEXT_TEXT
HOGQLX_TEXT_WS
@@ -640,14 +648,20 @@ FULL_STRING_TEXT
FULL_STRING_ESCAPE_TRIGGER
TAG_SELF_CLOSE_GT
TAG_OPEN_GT
+TAG_MULTI_LINE_COMMENT
+TAG_SINGLE_LINE_COMMENT
TAG_IDENT
TAG_EQ
TAG_STRING
TAG_WS
TAG_LBRACE
+TAG_UNEXPECTED
TAGC_GT
+TAGC_MULTI_LINE_COMMENT
+TAGC_SINGLE_LINE_COMMENT
TAGC_IDENT
TAGC_WS
+TAGC_UNEXPECTED
HOGQLX_TEXT_TEXT
HOGQLX_TEXT_LBRACE
HOGQLX_TEXT_LT_SLASH
@@ -667,4 +681,4 @@ HOGQLX_TAG_CLOSE
HOGQLX_TEXT
atn:
-[4, 0, 201, 1927, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 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, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103, 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, 108, 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 2, 111, 7, 111, 2, 112, 7, 112, 2, 113, 7, 113, 2, 114, 7, 114, 2, 115, 7, 115, 2, 116, 7, 116, 2, 117, 7, 117, 2, 118, 7, 118, 2, 119, 7, 119, 2, 120, 7, 120, 2, 121, 7, 121, 2, 122, 7, 122, 2, 123, 7, 123, 2, 124, 7, 124, 2, 125, 7, 125, 2, 126, 7, 126, 2, 127, 7, 127, 2, 128, 7, 128, 2, 129, 7, 129, 2, 130, 7, 130, 2, 131, 7, 131, 2, 132, 7, 132, 2, 133, 7, 133, 2, 134, 7, 134, 2, 135, 7, 135, 2, 136, 7, 136, 2, 137, 7, 137, 2, 138, 7, 138, 2, 139, 7, 139, 2, 140, 7, 140, 2, 141, 7, 141, 2, 142, 7, 142, 2, 143, 7, 143, 2, 144, 7, 144, 2, 145, 7, 145, 2, 146, 7, 146, 2, 147, 7, 147, 2, 148, 7, 148, 2, 149, 7, 149, 2, 150, 7, 150, 2, 151, 7, 151, 2, 152, 7, 152, 2, 153, 7, 153, 2, 154, 7, 154, 2, 155, 7, 155, 2, 156, 7, 156, 2, 157, 7, 157, 2, 158, 7, 158, 2, 159, 7, 159, 2, 160, 7, 160, 2, 161, 7, 161, 2, 162, 7, 162, 2, 163, 7, 163, 2, 164, 7, 164, 2, 165, 7, 165, 2, 166, 7, 166, 2, 167, 7, 167, 2, 168, 7, 168, 2, 169, 7, 169, 2, 170, 7, 170, 2, 171, 7, 171, 2, 172, 7, 172, 2, 173, 7, 173, 2, 174, 7, 174, 2, 175, 7, 175, 2, 176, 7, 176, 2, 177, 7, 177, 2, 178, 7, 178, 2, 179, 7, 179, 2, 180, 7, 180, 2, 181, 7, 181, 2, 182, 7, 182, 2, 183, 7, 183, 2, 184, 7, 184, 2, 185, 7, 185, 2, 186, 7, 186, 2, 187, 7, 187, 2, 188, 7, 188, 2, 189, 7, 189, 2, 190, 7, 190, 2, 191, 7, 191, 2, 192, 7, 192, 2, 193, 7, 193, 2, 194, 7, 194, 2, 195, 7, 195, 2, 196, 7, 196, 2, 197, 7, 197, 2, 198, 7, 198, 2, 199, 7, 199, 2, 200, 7, 200, 2, 201, 7, 201, 2, 202, 7, 202, 2, 203, 7, 203, 2, 204, 7, 204, 2, 205, 7, 205, 2, 206, 7, 206, 2, 207, 7, 207, 2, 208, 7, 208, 2, 209, 7, 209, 2, 210, 7, 210, 2, 211, 7, 211, 2, 212, 7, 212, 2, 213, 7, 213, 2, 214, 7, 214, 2, 215, 7, 215, 2, 216, 7, 216, 2, 217, 7, 217, 2, 218, 7, 218, 2, 219, 7, 219, 2, 220, 7, 220, 2, 221, 7, 221, 2, 222, 7, 222, 2, 223, 7, 223, 2, 224, 7, 224, 2, 225, 7, 225, 2, 226, 7, 226, 2, 227, 7, 227, 2, 228, 7, 228, 2, 229, 7, 229, 2, 230, 7, 230, 2, 231, 7, 231, 2, 232, 7, 232, 2, 233, 7, 233, 2, 234, 7, 234, 2, 235, 7, 235, 2, 236, 7, 236, 2, 237, 7, 237, 2, 238, 7, 238, 2, 239, 7, 239, 2, 240, 7, 240, 2, 241, 7, 241, 2, 242, 7, 242, 2, 243, 7, 243, 2, 244, 7, 244, 2, 245, 7, 245, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 539, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 50, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 3, 51, 819, 8, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 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, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 56, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, 1, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 62, 1, 62, 1, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 71, 1, 71, 1, 71, 1, 71, 1, 72, 1, 72, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 75, 1, 75, 1, 75, 1, 75, 1, 75, 1, 75, 1, 75, 1, 76, 1, 76, 1, 76, 1, 77, 1, 77, 1, 77, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 82, 1, 82, 1, 82, 1, 82, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 94, 1, 94, 1, 94, 1, 94, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 109, 1, 109, 1, 109, 1, 109, 1, 109, 1, 109, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 111, 1, 111, 1, 111, 1, 112, 1, 112, 1, 112, 1, 112, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 115, 1, 115, 1, 115, 1, 115, 1, 115, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 117, 1, 117, 1, 117, 1, 117, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 120, 1, 120, 1, 120, 1, 120, 1, 120, 1, 120, 1, 121, 1, 121, 1, 121, 1, 121, 1, 121, 1, 121, 1, 121, 1, 121, 1, 122, 1, 122, 1, 122, 1, 122, 1, 122, 1, 122, 1, 123, 1, 123, 1, 123, 1, 123, 1, 123, 1, 123, 1, 123, 1, 124, 1, 124, 1, 124, 1, 124, 1, 124, 1, 125, 1, 125, 1, 125, 1, 125, 1, 125, 1, 126, 1, 126, 1, 126, 1, 126, 1, 126, 1, 126, 1, 127, 1, 127, 1, 127, 1, 127, 1, 127, 1, 127, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 1, 129, 1, 129, 1, 129, 1, 129, 1, 129, 1, 130, 1, 130, 1, 130, 1, 130, 1, 130, 1, 130, 1, 130, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 3, 131, 1348, 8, 131, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 3, 132, 1382, 8, 132, 1, 133, 1, 133, 1, 133, 3, 133, 1387, 8, 133, 1, 133, 1, 133, 1, 133, 1, 133, 5, 133, 1393, 8, 133, 10, 133, 12, 133, 1396, 9, 133, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 5, 134, 1407, 8, 134, 10, 134, 12, 134, 1410, 9, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 5, 134, 1423, 8, 134, 10, 134, 12, 134, 1426, 9, 134, 1, 134, 1, 134, 3, 134, 1430, 8, 134, 1, 135, 1, 135, 1, 135, 5, 135, 1435, 8, 135, 10, 135, 12, 135, 1438, 9, 135, 1, 135, 1, 135, 3, 135, 1442, 8, 135, 1, 135, 1, 135, 3, 135, 1446, 8, 135, 1, 135, 4, 135, 1449, 8, 135, 11, 135, 12, 135, 1450, 1, 135, 1, 135, 1, 135, 3, 135, 1456, 8, 135, 1, 135, 1, 135, 3, 135, 1460, 8, 135, 1, 135, 4, 135, 1463, 8, 135, 11, 135, 12, 135, 1464, 1, 135, 1, 135, 1, 135, 5, 135, 1470, 8, 135, 10, 135, 12, 135, 1473, 9, 135, 1, 135, 1, 135, 1, 135, 3, 135, 1478, 8, 135, 1, 135, 4, 135, 1481, 8, 135, 11, 135, 12, 135, 1482, 1, 135, 1, 135, 1, 135, 1, 135, 1, 135, 3, 135, 1490, 8, 135, 1, 135, 4, 135, 1493, 8, 135, 11, 135, 12, 135, 1494, 1, 135, 1, 135, 1, 135, 1, 135, 3, 135, 1501, 8, 135, 1, 135, 4, 135, 1504, 8, 135, 11, 135, 12, 135, 1505, 3, 135, 1508, 8, 135, 1, 136, 1, 136, 1, 136, 4, 136, 1513, 8, 136, 11, 136, 12, 136, 1514, 1, 137, 1, 137, 4, 137, 1519, 8, 137, 11, 137, 12, 137, 1520, 1, 138, 4, 138, 1524, 8, 138, 11, 138, 12, 138, 1525, 1, 139, 1, 139, 1, 139, 4, 139, 1531, 8, 139, 11, 139, 12, 139, 1532, 1, 140, 1, 140, 1, 140, 4, 140, 1538, 8, 140, 11, 140, 12, 140, 1539, 1, 141, 1, 141, 1, 141, 4, 141, 1545, 8, 141, 11, 141, 12, 141, 1546, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 5, 142, 1558, 8, 142, 10, 142, 12, 142, 1561, 9, 142, 1, 142, 1, 142, 1, 143, 1, 143, 1, 144, 1, 144, 1, 145, 1, 145, 1, 146, 1, 146, 1, 147, 1, 147, 1, 148, 1, 148, 1, 149, 1, 149, 1, 150, 1, 150, 1, 151, 1, 151, 1, 152, 1, 152, 1, 153, 1, 153, 1, 154, 1, 154, 1, 155, 1, 155, 1, 156, 1, 156, 1, 157, 1, 157, 1, 158, 1, 158, 1, 159, 1, 159, 1, 160, 1, 160, 1, 161, 1, 161, 1, 162, 1, 162, 1, 163, 1, 163, 1, 164, 1, 164, 1, 165, 1, 165, 1, 166, 1, 166, 1, 167, 1, 167, 1, 168, 1, 168, 1, 169, 1, 169, 1, 170, 1, 170, 1, 171, 1, 171, 1, 172, 1, 172, 1, 173, 1, 173, 1, 174, 1, 174, 1, 174, 1, 175, 1, 175, 1, 176, 1, 176, 1, 177, 1, 177, 1, 178, 1, 178, 1, 178, 1, 179, 1, 179, 1, 179, 1, 180, 1, 180, 1, 181, 1, 181, 1, 182, 1, 182, 1, 182, 1, 183, 1, 183, 1, 184, 1, 184, 1, 185, 1, 185, 1, 186, 1, 186, 1, 186, 1, 187, 1, 187, 1, 188, 1, 188, 1, 188, 1, 189, 1, 189, 1, 190, 1, 190, 1, 191, 1, 191, 1, 191, 1, 192, 1, 192, 1, 192, 1, 192, 1, 193, 1, 193, 1, 193, 1, 193, 1, 194, 1, 194, 1, 195, 1, 195, 1, 196, 1, 196, 1, 196, 1, 197, 1, 197, 1, 197, 1, 197, 1, 197, 1, 197, 1, 198, 1, 198, 1, 198, 1, 198, 1, 198, 1, 198, 1, 199, 1, 199, 1, 200, 1, 200, 1, 200, 1, 201, 1, 201, 1, 201, 1, 201, 3, 201, 1706, 8, 201, 1, 202, 1, 202, 1, 202, 1, 202, 1, 203, 1, 203, 1, 203, 1, 204, 1, 204, 1, 204, 1, 205, 1, 205, 1, 205, 1, 206, 1, 206, 1, 207, 1, 207, 1, 208, 1, 208, 1, 209, 1, 209, 1, 210, 1, 210, 1, 210, 1, 210, 1, 210, 1, 211, 1, 211, 1, 211, 1, 211, 1, 211, 1, 212, 1, 212, 1, 213, 1, 213, 1, 214, 1, 214, 1, 214, 1, 215, 1, 215, 1, 215, 1, 215, 1, 216, 1, 216, 1, 217, 1, 217, 1, 218, 1, 218, 1, 219, 1, 219, 1, 220, 1, 220, 1, 220, 1, 221, 1, 221, 1, 222, 1, 222, 1, 222, 1, 222, 5, 222, 1767, 8, 222, 10, 222, 12, 222, 1770, 9, 222, 1, 222, 1, 222, 1, 222, 1, 222, 1, 222, 1, 223, 1, 223, 1, 223, 1, 223, 3, 223, 1781, 8, 223, 1, 223, 5, 223, 1784, 8, 223, 10, 223, 12, 223, 1787, 9, 223, 1, 223, 3, 223, 1790, 8, 223, 1, 223, 1, 223, 1, 224, 1, 224, 1, 224, 1, 224, 1, 225, 1, 225, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 4, 226, 1811, 8, 226, 11, 226, 12, 226, 1812, 1, 227, 1, 227, 1, 227, 1, 227, 1, 228, 1, 228, 1, 228, 1, 228, 1, 228, 1, 229, 1, 229, 1, 229, 1, 229, 1, 229, 4, 229, 1829, 8, 229, 11, 229, 12, 229, 1830, 1, 230, 1, 230, 1, 230, 1, 230, 1, 231, 1, 231, 1, 231, 1, 231, 1, 231, 1, 231, 1, 232, 1, 232, 1, 232, 1, 232, 1, 232, 1, 232, 1, 233, 1, 233, 5, 233, 1851, 8, 233, 10, 233, 12, 233, 1854, 9, 233, 1, 233, 1, 233, 1, 234, 1, 234, 1, 234, 1, 234, 1, 235, 1, 235, 1, 235, 1, 235, 1, 236, 4, 236, 1867, 8, 236, 11, 236, 12, 236, 1868, 1, 236, 1, 236, 1, 237, 1, 237, 1, 237, 1, 237, 1, 237, 1, 238, 1, 238, 1, 238, 1, 238, 1, 238, 1, 239, 1, 239, 5, 239, 1885, 8, 239, 10, 239, 12, 239, 1888, 9, 239, 1, 239, 1, 239, 1, 240, 4, 240, 1893, 8, 240, 11, 240, 12, 240, 1894, 1, 240, 1, 240, 1, 241, 4, 241, 1900, 8, 241, 11, 241, 12, 241, 1901, 1, 242, 1, 242, 1, 242, 1, 242, 1, 242, 1, 243, 1, 243, 1, 243, 1, 243, 1, 243, 1, 243, 1, 243, 1, 244, 1, 244, 1, 244, 1, 244, 1, 244, 1, 245, 4, 245, 1922, 8, 245, 11, 245, 12, 245, 1923, 1, 245, 1, 245, 1, 1768, 0, 246, 6, 1, 8, 2, 10, 3, 12, 4, 14, 5, 16, 6, 18, 7, 20, 8, 22, 9, 24, 10, 26, 11, 28, 12, 30, 13, 32, 14, 34, 15, 36, 16, 38, 17, 40, 18, 42, 19, 44, 20, 46, 21, 48, 22, 50, 23, 52, 24, 54, 25, 56, 26, 58, 27, 60, 28, 62, 29, 64, 30, 66, 31, 68, 32, 70, 33, 72, 34, 74, 35, 76, 36, 78, 37, 80, 38, 82, 39, 84, 40, 86, 41, 88, 42, 90, 43, 92, 44, 94, 45, 96, 46, 98, 47, 100, 48, 102, 49, 104, 50, 106, 51, 108, 52, 110, 53, 112, 54, 114, 55, 116, 56, 118, 57, 120, 58, 122, 59, 124, 60, 126, 61, 128, 62, 130, 63, 132, 64, 134, 65, 136, 66, 138, 67, 140, 68, 142, 69, 144, 70, 146, 71, 148, 72, 150, 73, 152, 74, 154, 75, 156, 76, 158, 77, 160, 78, 162, 79, 164, 80, 166, 81, 168, 82, 170, 83, 172, 84, 174, 85, 176, 86, 178, 87, 180, 88, 182, 89, 184, 90, 186, 91, 188, 92, 190, 93, 192, 94, 194, 95, 196, 96, 198, 97, 200, 98, 202, 99, 204, 100, 206, 101, 208, 102, 210, 103, 212, 104, 214, 105, 216, 106, 218, 107, 220, 108, 222, 109, 224, 110, 226, 111, 228, 112, 230, 113, 232, 114, 234, 115, 236, 116, 238, 117, 240, 118, 242, 119, 244, 120, 246, 121, 248, 122, 250, 123, 252, 124, 254, 125, 256, 126, 258, 127, 260, 128, 262, 129, 264, 130, 266, 131, 268, 132, 270, 133, 272, 134, 274, 135, 276, 136, 278, 137, 280, 138, 282, 139, 284, 140, 286, 141, 288, 142, 290, 143, 292, 0, 294, 0, 296, 0, 298, 0, 300, 0, 302, 0, 304, 0, 306, 0, 308, 0, 310, 0, 312, 0, 314, 0, 316, 0, 318, 0, 320, 0, 322, 0, 324, 0, 326, 0, 328, 0, 330, 0, 332, 0, 334, 0, 336, 0, 338, 0, 340, 0, 342, 0, 344, 0, 346, 0, 348, 0, 350, 0, 352, 0, 354, 144, 356, 145, 358, 146, 360, 147, 362, 148, 364, 149, 366, 150, 368, 151, 370, 152, 372, 153, 374, 154, 376, 155, 378, 156, 380, 157, 382, 158, 384, 159, 386, 160, 388, 161, 390, 162, 392, 163, 394, 164, 396, 165, 398, 166, 400, 0, 402, 0, 404, 167, 406, 168, 408, 169, 410, 170, 412, 171, 414, 172, 416, 173, 418, 174, 420, 175, 422, 176, 424, 177, 426, 178, 428, 179, 430, 180, 432, 181, 434, 182, 436, 183, 438, 184, 440, 185, 442, 186, 444, 187, 446, 188, 448, 189, 450, 190, 452, 191, 454, 192, 456, 193, 458, 194, 460, 195, 462, 0, 464, 196, 466, 197, 468, 0, 470, 0, 472, 0, 474, 0, 476, 0, 478, 198, 480, 0, 482, 0, 484, 0, 486, 199, 488, 200, 490, 0, 492, 0, 494, 0, 496, 201, 6, 0, 1, 2, 3, 4, 5, 43, 2, 0, 92, 92, 96, 96, 2, 0, 34, 34, 92, 92, 2, 0, 79, 79, 111, 111, 2, 0, 66, 66, 98, 98, 2, 0, 39, 39, 92, 92, 2, 0, 65, 65, 97, 97, 2, 0, 67, 67, 99, 99, 2, 0, 68, 68, 100, 100, 2, 0, 69, 69, 101, 101, 2, 0, 70, 70, 102, 102, 2, 0, 71, 71, 103, 103, 2, 0, 72, 72, 104, 104, 2, 0, 73, 73, 105, 105, 2, 0, 74, 74, 106, 106, 2, 0, 75, 75, 107, 107, 2, 0, 76, 76, 108, 108, 2, 0, 77, 77, 109, 109, 2, 0, 78, 78, 110, 110, 2, 0, 80, 80, 112, 112, 2, 0, 81, 81, 113, 113, 2, 0, 82, 82, 114, 114, 2, 0, 83, 83, 115, 115, 2, 0, 84, 84, 116, 116, 2, 0, 85, 85, 117, 117, 2, 0, 86, 86, 118, 118, 2, 0, 87, 87, 119, 119, 2, 0, 88, 88, 120, 120, 2, 0, 89, 89, 121, 121, 2, 0, 90, 90, 122, 122, 2, 0, 65, 90, 97, 122, 1, 0, 48, 49, 1, 0, 48, 55, 1, 0, 48, 57, 3, 0, 48, 57, 65, 70, 97, 102, 2, 0, 10, 10, 13, 13, 2, 1, 10, 10, 13, 13, 11, 0, 9, 13, 32, 32, 133, 133, 160, 160, 5760, 5760, 8192, 8202, 8232, 8233, 8239, 8239, 8287, 8287, 12288, 12288, 65279, 65279, 3, 0, 39, 39, 92, 92, 123, 123, 1, 0, 123, 123, 3, 0, 65, 90, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, 95, 95, 97, 122, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 60, 60, 123, 123, 1968, 0, 6, 1, 0, 0, 0, 0, 8, 1, 0, 0, 0, 0, 10, 1, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 14, 1, 0, 0, 0, 0, 16, 1, 0, 0, 0, 0, 18, 1, 0, 0, 0, 0, 20, 1, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 24, 1, 0, 0, 0, 0, 26, 1, 0, 0, 0, 0, 28, 1, 0, 0, 0, 0, 30, 1, 0, 0, 0, 0, 32, 1, 0, 0, 0, 0, 34, 1, 0, 0, 0, 0, 36, 1, 0, 0, 0, 0, 38, 1, 0, 0, 0, 0, 40, 1, 0, 0, 0, 0, 42, 1, 0, 0, 0, 0, 44, 1, 0, 0, 0, 0, 46, 1, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 50, 1, 0, 0, 0, 0, 52, 1, 0, 0, 0, 0, 54, 1, 0, 0, 0, 0, 56, 1, 0, 0, 0, 0, 58, 1, 0, 0, 0, 0, 60, 1, 0, 0, 0, 0, 62, 1, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 66, 1, 0, 0, 0, 0, 68, 1, 0, 0, 0, 0, 70, 1, 0, 0, 0, 0, 72, 1, 0, 0, 0, 0, 74, 1, 0, 0, 0, 0, 76, 1, 0, 0, 0, 0, 78, 1, 0, 0, 0, 0, 80, 1, 0, 0, 0, 0, 82, 1, 0, 0, 0, 0, 84, 1, 0, 0, 0, 0, 86, 1, 0, 0, 0, 0, 88, 1, 0, 0, 0, 0, 90, 1, 0, 0, 0, 0, 92, 1, 0, 0, 0, 0, 94, 1, 0, 0, 0, 0, 96, 1, 0, 0, 0, 0, 98, 1, 0, 0, 0, 0, 100, 1, 0, 0, 0, 0, 102, 1, 0, 0, 0, 0, 104, 1, 0, 0, 0, 0, 106, 1, 0, 0, 0, 0, 108, 1, 0, 0, 0, 0, 110, 1, 0, 0, 0, 0, 112, 1, 0, 0, 0, 0, 114, 1, 0, 0, 0, 0, 116, 1, 0, 0, 0, 0, 118, 1, 0, 0, 0, 0, 120, 1, 0, 0, 0, 0, 122, 1, 0, 0, 0, 0, 124, 1, 0, 0, 0, 0, 126, 1, 0, 0, 0, 0, 128, 1, 0, 0, 0, 0, 130, 1, 0, 0, 0, 0, 132, 1, 0, 0, 0, 0, 134, 1, 0, 0, 0, 0, 136, 1, 0, 0, 0, 0, 138, 1, 0, 0, 0, 0, 140, 1, 0, 0, 0, 0, 142, 1, 0, 0, 0, 0, 144, 1, 0, 0, 0, 0, 146, 1, 0, 0, 0, 0, 148, 1, 0, 0, 0, 0, 150, 1, 0, 0, 0, 0, 152, 1, 0, 0, 0, 0, 154, 1, 0, 0, 0, 0, 156, 1, 0, 0, 0, 0, 158, 1, 0, 0, 0, 0, 160, 1, 0, 0, 0, 0, 162, 1, 0, 0, 0, 0, 164, 1, 0, 0, 0, 0, 166, 1, 0, 0, 0, 0, 168, 1, 0, 0, 0, 0, 170, 1, 0, 0, 0, 0, 172, 1, 0, 0, 0, 0, 174, 1, 0, 0, 0, 0, 176, 1, 0, 0, 0, 0, 178, 1, 0, 0, 0, 0, 180, 1, 0, 0, 0, 0, 182, 1, 0, 0, 0, 0, 184, 1, 0, 0, 0, 0, 186, 1, 0, 0, 0, 0, 188, 1, 0, 0, 0, 0, 190, 1, 0, 0, 0, 0, 192, 1, 0, 0, 0, 0, 194, 1, 0, 0, 0, 0, 196, 1, 0, 0, 0, 0, 198, 1, 0, 0, 0, 0, 200, 1, 0, 0, 0, 0, 202, 1, 0, 0, 0, 0, 204, 1, 0, 0, 0, 0, 206, 1, 0, 0, 0, 0, 208, 1, 0, 0, 0, 0, 210, 1, 0, 0, 0, 0, 212, 1, 0, 0, 0, 0, 214, 1, 0, 0, 0, 0, 216, 1, 0, 0, 0, 0, 218, 1, 0, 0, 0, 0, 220, 1, 0, 0, 0, 0, 222, 1, 0, 0, 0, 0, 224, 1, 0, 0, 0, 0, 226, 1, 0, 0, 0, 0, 228, 1, 0, 0, 0, 0, 230, 1, 0, 0, 0, 0, 232, 1, 0, 0, 0, 0, 234, 1, 0, 0, 0, 0, 236, 1, 0, 0, 0, 0, 238, 1, 0, 0, 0, 0, 240, 1, 0, 0, 0, 0, 242, 1, 0, 0, 0, 0, 244, 1, 0, 0, 0, 0, 246, 1, 0, 0, 0, 0, 248, 1, 0, 0, 0, 0, 250, 1, 0, 0, 0, 0, 252, 1, 0, 0, 0, 0, 254, 1, 0, 0, 0, 0, 256, 1, 0, 0, 0, 0, 258, 1, 0, 0, 0, 0, 260, 1, 0, 0, 0, 0, 262, 1, 0, 0, 0, 0, 264, 1, 0, 0, 0, 0, 266, 1, 0, 0, 0, 0, 268, 1, 0, 0, 0, 0, 270, 1, 0, 0, 0, 0, 272, 1, 0, 0, 0, 0, 274, 1, 0, 0, 0, 0, 276, 1, 0, 0, 0, 0, 278, 1, 0, 0, 0, 0, 280, 1, 0, 0, 0, 0, 282, 1, 0, 0, 0, 0, 284, 1, 0, 0, 0, 0, 286, 1, 0, 0, 0, 0, 288, 1, 0, 0, 0, 0, 290, 1, 0, 0, 0, 0, 354, 1, 0, 0, 0, 0, 356, 1, 0, 0, 0, 0, 358, 1, 0, 0, 0, 0, 360, 1, 0, 0, 0, 0, 362, 1, 0, 0, 0, 0, 364, 1, 0, 0, 0, 0, 366, 1, 0, 0, 0, 0, 368, 1, 0, 0, 0, 0, 370, 1, 0, 0, 0, 0, 372, 1, 0, 0, 0, 0, 374, 1, 0, 0, 0, 0, 376, 1, 0, 0, 0, 0, 378, 1, 0, 0, 0, 0, 380, 1, 0, 0, 0, 0, 382, 1, 0, 0, 0, 0, 384, 1, 0, 0, 0, 0, 386, 1, 0, 0, 0, 0, 388, 1, 0, 0, 0, 0, 390, 1, 0, 0, 0, 0, 392, 1, 0, 0, 0, 0, 394, 1, 0, 0, 0, 0, 396, 1, 0, 0, 0, 0, 398, 1, 0, 0, 0, 0, 400, 1, 0, 0, 0, 0, 402, 1, 0, 0, 0, 0, 404, 1, 0, 0, 0, 0, 406, 1, 0, 0, 0, 0, 408, 1, 0, 0, 0, 0, 410, 1, 0, 0, 0, 0, 412, 1, 0, 0, 0, 0, 414, 1, 0, 0, 0, 0, 416, 1, 0, 0, 0, 0, 418, 1, 0, 0, 0, 0, 420, 1, 0, 0, 0, 0, 422, 1, 0, 0, 0, 0, 424, 1, 0, 0, 0, 0, 426, 1, 0, 0, 0, 0, 428, 1, 0, 0, 0, 0, 430, 1, 0, 0, 0, 0, 432, 1, 0, 0, 0, 0, 434, 1, 0, 0, 0, 0, 436, 1, 0, 0, 0, 0, 438, 1, 0, 0, 0, 0, 440, 1, 0, 0, 0, 0, 442, 1, 0, 0, 0, 0, 444, 1, 0, 0, 0, 0, 446, 1, 0, 0, 0, 0, 448, 1, 0, 0, 0, 0, 450, 1, 0, 0, 0, 0, 452, 1, 0, 0, 0, 0, 454, 1, 0, 0, 0, 0, 456, 1, 0, 0, 0, 1, 458, 1, 0, 0, 0, 1, 460, 1, 0, 0, 0, 1, 462, 1, 0, 0, 0, 2, 464, 1, 0, 0, 0, 2, 466, 1, 0, 0, 0, 3, 468, 1, 0, 0, 0, 3, 470, 1, 0, 0, 0, 3, 472, 1, 0, 0, 0, 3, 474, 1, 0, 0, 0, 3, 476, 1, 0, 0, 0, 3, 478, 1, 0, 0, 0, 3, 480, 1, 0, 0, 0, 4, 482, 1, 0, 0, 0, 4, 484, 1, 0, 0, 0, 4, 486, 1, 0, 0, 0, 5, 488, 1, 0, 0, 0, 5, 490, 1, 0, 0, 0, 5, 492, 1, 0, 0, 0, 5, 494, 1, 0, 0, 0, 5, 496, 1, 0, 0, 0, 6, 498, 1, 0, 0, 0, 8, 502, 1, 0, 0, 0, 10, 506, 1, 0, 0, 0, 12, 511, 1, 0, 0, 0, 14, 515, 1, 0, 0, 0, 16, 521, 1, 0, 0, 0, 18, 538, 1, 0, 0, 0, 20, 540, 1, 0, 0, 0, 22, 545, 1, 0, 0, 0, 24, 553, 1, 0, 0, 0, 26, 558, 1, 0, 0, 0, 28, 561, 1, 0, 0, 0, 30, 566, 1, 0, 0, 0, 32, 571, 1, 0, 0, 0, 34, 577, 1, 0, 0, 0, 36, 584, 1, 0, 0, 0, 38, 592, 1, 0, 0, 0, 40, 600, 1, 0, 0, 0, 42, 606, 1, 0, 0, 0, 44, 611, 1, 0, 0, 0, 46, 619, 1, 0, 0, 0, 48, 624, 1, 0, 0, 0, 50, 628, 1, 0, 0, 0, 52, 633, 1, 0, 0, 0, 54, 644, 1, 0, 0, 0, 56, 653, 1, 0, 0, 0, 58, 658, 1, 0, 0, 0, 60, 662, 1, 0, 0, 0, 62, 669, 1, 0, 0, 0, 64, 677, 1, 0, 0, 0, 66, 685, 1, 0, 0, 0, 68, 691, 1, 0, 0, 0, 70, 696, 1, 0, 0, 0, 72, 703, 1, 0, 0, 0, 74, 711, 1, 0, 0, 0, 76, 717, 1, 0, 0, 0, 78, 720, 1, 0, 0, 0, 80, 730, 1, 0, 0, 0, 82, 734, 1, 0, 0, 0, 84, 739, 1, 0, 0, 0, 86, 744, 1, 0, 0, 0, 88, 748, 1, 0, 0, 0, 90, 754, 1, 0, 0, 0, 92, 763, 1, 0, 0, 0, 94, 770, 1, 0, 0, 0, 96, 775, 1, 0, 0, 0, 98, 778, 1, 0, 0, 0, 100, 781, 1, 0, 0, 0, 102, 787, 1, 0, 0, 0, 104, 794, 1, 0, 0, 0, 106, 802, 1, 0, 0, 0, 108, 818, 1, 0, 0, 0, 110, 820, 1, 0, 0, 0, 112, 826, 1, 0, 0, 0, 114, 836, 1, 0, 0, 0, 116, 848, 1, 0, 0, 0, 118, 857, 1, 0, 0, 0, 120, 860, 1, 0, 0, 0, 122, 865, 1, 0, 0, 0, 124, 869, 1, 0, 0, 0, 126, 876, 1, 0, 0, 0, 128, 881, 1, 0, 0, 0, 130, 889, 1, 0, 0, 0, 132, 894, 1, 0, 0, 0, 134, 898, 1, 0, 0, 0, 136, 903, 1, 0, 0, 0, 138, 909, 1, 0, 0, 0, 140, 922, 1, 0, 0, 0, 142, 929, 1, 0, 0, 0, 144, 935, 1, 0, 0, 0, 146, 940, 1, 0, 0, 0, 148, 948, 1, 0, 0, 0, 150, 952, 1, 0, 0, 0, 152, 956, 1, 0, 0, 0, 154, 961, 1, 0, 0, 0, 156, 967, 1, 0, 0, 0, 158, 974, 1, 0, 0, 0, 160, 977, 1, 0, 0, 0, 162, 980, 1, 0, 0, 0, 164, 986, 1, 0, 0, 0, 166, 992, 1, 0, 0, 0, 168, 997, 1, 0, 0, 0, 170, 1007, 1, 0, 0, 0, 172, 1013, 1, 0, 0, 0, 174, 1024, 1, 0, 0, 0, 176, 1034, 1, 0, 0, 0, 178, 1043, 1, 0, 0, 0, 180, 1051, 1, 0, 0, 0, 182, 1059, 1, 0, 0, 0, 184, 1065, 1, 0, 0, 0, 186, 1075, 1, 0, 0, 0, 188, 1083, 1, 0, 0, 0, 190, 1090, 1, 0, 0, 0, 192, 1096, 1, 0, 0, 0, 194, 1103, 1, 0, 0, 0, 196, 1107, 1, 0, 0, 0, 198, 1112, 1, 0, 0, 0, 200, 1119, 1, 0, 0, 0, 202, 1126, 1, 0, 0, 0, 204, 1133, 1, 0, 0, 0, 206, 1138, 1, 0, 0, 0, 208, 1143, 1, 0, 0, 0, 210, 1152, 1, 0, 0, 0, 212, 1157, 1, 0, 0, 0, 214, 1167, 1, 0, 0, 0, 216, 1172, 1, 0, 0, 0, 218, 1178, 1, 0, 0, 0, 220, 1183, 1, 0, 0, 0, 222, 1193, 1, 0, 0, 0, 224, 1198, 1, 0, 0, 0, 226, 1204, 1, 0, 0, 0, 228, 1209, 1, 0, 0, 0, 230, 1212, 1, 0, 0, 0, 232, 1216, 1, 0, 0, 0, 234, 1223, 1, 0, 0, 0, 236, 1232, 1, 0, 0, 0, 238, 1237, 1, 0, 0, 0, 240, 1246, 1, 0, 0, 0, 242, 1250, 1, 0, 0, 0, 244, 1259, 1, 0, 0, 0, 246, 1269, 1, 0, 0, 0, 248, 1275, 1, 0, 0, 0, 250, 1283, 1, 0, 0, 0, 252, 1289, 1, 0, 0, 0, 254, 1296, 1, 0, 0, 0, 256, 1301, 1, 0, 0, 0, 258, 1306, 1, 0, 0, 0, 260, 1312, 1, 0, 0, 0, 262, 1318, 1, 0, 0, 0, 264, 1325, 1, 0, 0, 0, 266, 1330, 1, 0, 0, 0, 268, 1347, 1, 0, 0, 0, 270, 1381, 1, 0, 0, 0, 272, 1386, 1, 0, 0, 0, 274, 1429, 1, 0, 0, 0, 276, 1507, 1, 0, 0, 0, 278, 1509, 1, 0, 0, 0, 280, 1516, 1, 0, 0, 0, 282, 1523, 1, 0, 0, 0, 284, 1527, 1, 0, 0, 0, 286, 1534, 1, 0, 0, 0, 288, 1541, 1, 0, 0, 0, 290, 1548, 1, 0, 0, 0, 292, 1564, 1, 0, 0, 0, 294, 1566, 1, 0, 0, 0, 296, 1568, 1, 0, 0, 0, 298, 1570, 1, 0, 0, 0, 300, 1572, 1, 0, 0, 0, 302, 1574, 1, 0, 0, 0, 304, 1576, 1, 0, 0, 0, 306, 1578, 1, 0, 0, 0, 308, 1580, 1, 0, 0, 0, 310, 1582, 1, 0, 0, 0, 312, 1584, 1, 0, 0, 0, 314, 1586, 1, 0, 0, 0, 316, 1588, 1, 0, 0, 0, 318, 1590, 1, 0, 0, 0, 320, 1592, 1, 0, 0, 0, 322, 1594, 1, 0, 0, 0, 324, 1596, 1, 0, 0, 0, 326, 1598, 1, 0, 0, 0, 328, 1600, 1, 0, 0, 0, 330, 1602, 1, 0, 0, 0, 332, 1604, 1, 0, 0, 0, 334, 1606, 1, 0, 0, 0, 336, 1608, 1, 0, 0, 0, 338, 1610, 1, 0, 0, 0, 340, 1612, 1, 0, 0, 0, 342, 1614, 1, 0, 0, 0, 344, 1616, 1, 0, 0, 0, 346, 1618, 1, 0, 0, 0, 348, 1620, 1, 0, 0, 0, 350, 1622, 1, 0, 0, 0, 352, 1624, 1, 0, 0, 0, 354, 1626, 1, 0, 0, 0, 356, 1629, 1, 0, 0, 0, 358, 1631, 1, 0, 0, 0, 360, 1633, 1, 0, 0, 0, 362, 1635, 1, 0, 0, 0, 364, 1638, 1, 0, 0, 0, 366, 1641, 1, 0, 0, 0, 368, 1643, 1, 0, 0, 0, 370, 1645, 1, 0, 0, 0, 372, 1648, 1, 0, 0, 0, 374, 1650, 1, 0, 0, 0, 376, 1652, 1, 0, 0, 0, 378, 1654, 1, 0, 0, 0, 380, 1657, 1, 0, 0, 0, 382, 1659, 1, 0, 0, 0, 384, 1662, 1, 0, 0, 0, 386, 1664, 1, 0, 0, 0, 388, 1666, 1, 0, 0, 0, 390, 1669, 1, 0, 0, 0, 392, 1673, 1, 0, 0, 0, 394, 1677, 1, 0, 0, 0, 396, 1679, 1, 0, 0, 0, 398, 1681, 1, 0, 0, 0, 400, 1684, 1, 0, 0, 0, 402, 1690, 1, 0, 0, 0, 404, 1696, 1, 0, 0, 0, 406, 1698, 1, 0, 0, 0, 408, 1705, 1, 0, 0, 0, 410, 1707, 1, 0, 0, 0, 412, 1711, 1, 0, 0, 0, 414, 1714, 1, 0, 0, 0, 416, 1717, 1, 0, 0, 0, 418, 1720, 1, 0, 0, 0, 420, 1722, 1, 0, 0, 0, 422, 1724, 1, 0, 0, 0, 424, 1726, 1, 0, 0, 0, 426, 1728, 1, 0, 0, 0, 428, 1733, 1, 0, 0, 0, 430, 1738, 1, 0, 0, 0, 432, 1740, 1, 0, 0, 0, 434, 1742, 1, 0, 0, 0, 436, 1745, 1, 0, 0, 0, 438, 1749, 1, 0, 0, 0, 440, 1751, 1, 0, 0, 0, 442, 1753, 1, 0, 0, 0, 444, 1755, 1, 0, 0, 0, 446, 1757, 1, 0, 0, 0, 448, 1760, 1, 0, 0, 0, 450, 1762, 1, 0, 0, 0, 452, 1780, 1, 0, 0, 0, 454, 1793, 1, 0, 0, 0, 456, 1797, 1, 0, 0, 0, 458, 1810, 1, 0, 0, 0, 460, 1814, 1, 0, 0, 0, 462, 1818, 1, 0, 0, 0, 464, 1828, 1, 0, 0, 0, 466, 1832, 1, 0, 0, 0, 468, 1836, 1, 0, 0, 0, 470, 1842, 1, 0, 0, 0, 472, 1848, 1, 0, 0, 0, 474, 1857, 1, 0, 0, 0, 476, 1861, 1, 0, 0, 0, 478, 1866, 1, 0, 0, 0, 480, 1872, 1, 0, 0, 0, 482, 1877, 1, 0, 0, 0, 484, 1882, 1, 0, 0, 0, 486, 1892, 1, 0, 0, 0, 488, 1899, 1, 0, 0, 0, 490, 1903, 1, 0, 0, 0, 492, 1908, 1, 0, 0, 0, 494, 1915, 1, 0, 0, 0, 496, 1921, 1, 0, 0, 0, 498, 499, 3, 292, 143, 0, 499, 500, 3, 314, 154, 0, 500, 501, 3, 314, 154, 0, 501, 7, 1, 0, 0, 0, 502, 503, 3, 292, 143, 0, 503, 504, 3, 318, 156, 0, 504, 505, 3, 298, 146, 0, 505, 9, 1, 0, 0, 0, 506, 507, 3, 292, 143, 0, 507, 508, 3, 318, 156, 0, 508, 509, 3, 330, 162, 0, 509, 510, 3, 308, 151, 0, 510, 11, 1, 0, 0, 0, 511, 512, 3, 292, 143, 0, 512, 513, 3, 318, 156, 0, 513, 514, 3, 340, 167, 0, 514, 13, 1, 0, 0, 0, 515, 516, 3, 292, 143, 0, 516, 517, 3, 326, 160, 0, 517, 518, 3, 326, 160, 0, 518, 519, 3, 292, 143, 0, 519, 520, 3, 340, 167, 0, 520, 15, 1, 0, 0, 0, 521, 522, 3, 292, 143, 0, 522, 523, 3, 328, 161, 0, 523, 17, 1, 0, 0, 0, 524, 525, 3, 292, 143, 0, 525, 526, 3, 328, 161, 0, 526, 527, 3, 296, 145, 0, 527, 539, 1, 0, 0, 0, 528, 529, 3, 292, 143, 0, 529, 530, 3, 328, 161, 0, 530, 531, 3, 296, 145, 0, 531, 532, 3, 300, 147, 0, 532, 533, 3, 318, 156, 0, 533, 534, 3, 298, 146, 0, 534, 535, 3, 308, 151, 0, 535, 536, 3, 318, 156, 0, 536, 537, 3, 304, 149, 0, 537, 539, 1, 0, 0, 0, 538, 524, 1, 0, 0, 0, 538, 528, 1, 0, 0, 0, 539, 19, 1, 0, 0, 0, 540, 541, 3, 292, 143, 0, 541, 542, 3, 328, 161, 0, 542, 543, 3, 320, 157, 0, 543, 544, 3, 302, 148, 0, 544, 21, 1, 0, 0, 0, 545, 546, 3, 294, 144, 0, 546, 547, 3, 300, 147, 0, 547, 548, 3, 330, 162, 0, 548, 549, 3, 336, 165, 0, 549, 550, 3, 300, 147, 0, 550, 551, 3, 300, 147, 0, 551, 552, 3, 318, 156, 0, 552, 23, 1, 0, 0, 0, 553, 554, 3, 294, 144, 0, 554, 555, 3, 320, 157, 0, 555, 556, 3, 330, 162, 0, 556, 557, 3, 306, 150, 0, 557, 25, 1, 0, 0, 0, 558, 559, 3, 294, 144, 0, 559, 560, 3, 340, 167, 0, 560, 27, 1, 0, 0, 0, 561, 562, 3, 296, 145, 0, 562, 563, 3, 292, 143, 0, 563, 564, 3, 328, 161, 0, 564, 565, 3, 300, 147, 0, 565, 29, 1, 0, 0, 0, 566, 567, 3, 296, 145, 0, 567, 568, 3, 292, 143, 0, 568, 569, 3, 328, 161, 0, 569, 570, 3, 330, 162, 0, 570, 31, 1, 0, 0, 0, 571, 572, 3, 296, 145, 0, 572, 573, 3, 292, 143, 0, 573, 574, 3, 330, 162, 0, 574, 575, 3, 296, 145, 0, 575, 576, 3, 306, 150, 0, 576, 33, 1, 0, 0, 0, 577, 578, 3, 296, 145, 0, 578, 579, 3, 320, 157, 0, 579, 580, 3, 306, 150, 0, 580, 581, 3, 320, 157, 0, 581, 582, 3, 326, 160, 0, 582, 583, 3, 330, 162, 0, 583, 35, 1, 0, 0, 0, 584, 585, 3, 296, 145, 0, 585, 586, 3, 320, 157, 0, 586, 587, 3, 314, 154, 0, 587, 588, 3, 314, 154, 0, 588, 589, 3, 292, 143, 0, 589, 590, 3, 330, 162, 0, 590, 591, 3, 300, 147, 0, 591, 37, 1, 0, 0, 0, 592, 593, 3, 296, 145, 0, 593, 594, 3, 320, 157, 0, 594, 595, 3, 314, 154, 0, 595, 596, 3, 332, 163, 0, 596, 597, 3, 316, 155, 0, 597, 598, 3, 318, 156, 0, 598, 599, 3, 328, 161, 0, 599, 39, 1, 0, 0, 0, 600, 601, 3, 296, 145, 0, 601, 602, 3, 326, 160, 0, 602, 603, 3, 320, 157, 0, 603, 604, 3, 328, 161, 0, 604, 605, 3, 328, 161, 0, 605, 41, 1, 0, 0, 0, 606, 607, 3, 296, 145, 0, 607, 608, 3, 332, 163, 0, 608, 609, 3, 294, 144, 0, 609, 610, 3, 300, 147, 0, 610, 43, 1, 0, 0, 0, 611, 612, 3, 296, 145, 0, 612, 613, 3, 332, 163, 0, 613, 614, 3, 326, 160, 0, 614, 615, 3, 326, 160, 0, 615, 616, 3, 300, 147, 0, 616, 617, 3, 318, 156, 0, 617, 618, 3, 330, 162, 0, 618, 45, 1, 0, 0, 0, 619, 620, 3, 298, 146, 0, 620, 621, 3, 292, 143, 0, 621, 622, 3, 330, 162, 0, 622, 623, 3, 300, 147, 0, 623, 47, 1, 0, 0, 0, 624, 625, 3, 298, 146, 0, 625, 626, 3, 292, 143, 0, 626, 627, 3, 340, 167, 0, 627, 49, 1, 0, 0, 0, 628, 629, 3, 298, 146, 0, 629, 630, 3, 300, 147, 0, 630, 631, 3, 328, 161, 0, 631, 632, 3, 296, 145, 0, 632, 51, 1, 0, 0, 0, 633, 634, 3, 298, 146, 0, 634, 635, 3, 300, 147, 0, 635, 636, 3, 328, 161, 0, 636, 637, 3, 296, 145, 0, 637, 638, 3, 300, 147, 0, 638, 639, 3, 318, 156, 0, 639, 640, 3, 298, 146, 0, 640, 641, 3, 308, 151, 0, 641, 642, 3, 318, 156, 0, 642, 643, 3, 304, 149, 0, 643, 53, 1, 0, 0, 0, 644, 645, 3, 298, 146, 0, 645, 646, 3, 308, 151, 0, 646, 647, 3, 328, 161, 0, 647, 648, 3, 330, 162, 0, 648, 649, 3, 308, 151, 0, 649, 650, 3, 318, 156, 0, 650, 651, 3, 296, 145, 0, 651, 652, 3, 330, 162, 0, 652, 55, 1, 0, 0, 0, 653, 654, 3, 300, 147, 0, 654, 655, 3, 314, 154, 0, 655, 656, 3, 328, 161, 0, 656, 657, 3, 300, 147, 0, 657, 57, 1, 0, 0, 0, 658, 659, 3, 300, 147, 0, 659, 660, 3, 318, 156, 0, 660, 661, 3, 298, 146, 0, 661, 59, 1, 0, 0, 0, 662, 663, 3, 300, 147, 0, 663, 664, 3, 338, 166, 0, 664, 665, 3, 296, 145, 0, 665, 666, 3, 300, 147, 0, 666, 667, 3, 322, 158, 0, 667, 668, 3, 330, 162, 0, 668, 61, 1, 0, 0, 0, 669, 670, 3, 300, 147, 0, 670, 671, 3, 338, 166, 0, 671, 672, 3, 296, 145, 0, 672, 673, 3, 314, 154, 0, 673, 674, 3, 332, 163, 0, 674, 675, 3, 298, 146, 0, 675, 676, 3, 300, 147, 0, 676, 63, 1, 0, 0, 0, 677, 678, 3, 300, 147, 0, 678, 679, 3, 338, 166, 0, 679, 680, 3, 330, 162, 0, 680, 681, 3, 326, 160, 0, 681, 682, 3, 292, 143, 0, 682, 683, 3, 296, 145, 0, 683, 684, 3, 330, 162, 0, 684, 65, 1, 0, 0, 0, 685, 686, 3, 302, 148, 0, 686, 687, 3, 308, 151, 0, 687, 688, 3, 318, 156, 0, 688, 689, 3, 292, 143, 0, 689, 690, 3, 314, 154, 0, 690, 67, 1, 0, 0, 0, 691, 692, 3, 302, 148, 0, 692, 693, 3, 308, 151, 0, 693, 694, 3, 314, 154, 0, 694, 695, 3, 314, 154, 0, 695, 69, 1, 0, 0, 0, 696, 697, 3, 302, 148, 0, 697, 698, 3, 308, 151, 0, 698, 699, 3, 314, 154, 0, 699, 700, 3, 330, 162, 0, 700, 701, 3, 300, 147, 0, 701, 702, 3, 326, 160, 0, 702, 71, 1, 0, 0, 0, 703, 704, 3, 302, 148, 0, 704, 705, 3, 308, 151, 0, 705, 706, 3, 318, 156, 0, 706, 707, 3, 292, 143, 0, 707, 708, 3, 314, 154, 0, 708, 709, 3, 314, 154, 0, 709, 710, 3, 340, 167, 0, 710, 73, 1, 0, 0, 0, 711, 712, 3, 302, 148, 0, 712, 713, 3, 308, 151, 0, 713, 714, 3, 326, 160, 0, 714, 715, 3, 328, 161, 0, 715, 716, 3, 330, 162, 0, 716, 75, 1, 0, 0, 0, 717, 718, 3, 302, 148, 0, 718, 719, 3, 318, 156, 0, 719, 77, 1, 0, 0, 0, 720, 721, 3, 302, 148, 0, 721, 722, 3, 320, 157, 0, 722, 723, 3, 314, 154, 0, 723, 724, 3, 314, 154, 0, 724, 725, 3, 320, 157, 0, 725, 726, 3, 336, 165, 0, 726, 727, 3, 308, 151, 0, 727, 728, 3, 318, 156, 0, 728, 729, 3, 304, 149, 0, 729, 79, 1, 0, 0, 0, 730, 731, 3, 302, 148, 0, 731, 732, 3, 320, 157, 0, 732, 733, 3, 326, 160, 0, 733, 81, 1, 0, 0, 0, 734, 735, 3, 302, 148, 0, 735, 736, 3, 326, 160, 0, 736, 737, 3, 320, 157, 0, 737, 738, 3, 316, 155, 0, 738, 83, 1, 0, 0, 0, 739, 740, 3, 302, 148, 0, 740, 741, 3, 332, 163, 0, 741, 742, 3, 314, 154, 0, 742, 743, 3, 314, 154, 0, 743, 85, 1, 0, 0, 0, 744, 745, 3, 302, 148, 0, 745, 746, 3, 332, 163, 0, 746, 747, 3, 318, 156, 0, 747, 87, 1, 0, 0, 0, 748, 749, 3, 304, 149, 0, 749, 750, 3, 326, 160, 0, 750, 751, 3, 320, 157, 0, 751, 752, 3, 332, 163, 0, 752, 753, 3, 322, 158, 0, 753, 89, 1, 0, 0, 0, 754, 755, 3, 304, 149, 0, 755, 756, 3, 326, 160, 0, 756, 757, 3, 320, 157, 0, 757, 758, 3, 332, 163, 0, 758, 759, 3, 322, 158, 0, 759, 760, 3, 308, 151, 0, 760, 761, 3, 318, 156, 0, 761, 762, 3, 304, 149, 0, 762, 91, 1, 0, 0, 0, 763, 764, 3, 306, 150, 0, 764, 765, 3, 292, 143, 0, 765, 766, 3, 334, 164, 0, 766, 767, 3, 308, 151, 0, 767, 768, 3, 318, 156, 0, 768, 769, 3, 304, 149, 0, 769, 93, 1, 0, 0, 0, 770, 771, 3, 306, 150, 0, 771, 772, 3, 320, 157, 0, 772, 773, 3, 332, 163, 0, 773, 774, 3, 326, 160, 0, 774, 95, 1, 0, 0, 0, 775, 776, 3, 308, 151, 0, 776, 777, 3, 298, 146, 0, 777, 97, 1, 0, 0, 0, 778, 779, 3, 308, 151, 0, 779, 780, 3, 302, 148, 0, 780, 99, 1, 0, 0, 0, 781, 782, 3, 308, 151, 0, 782, 783, 3, 314, 154, 0, 783, 784, 3, 308, 151, 0, 784, 785, 3, 312, 153, 0, 785, 786, 3, 300, 147, 0, 786, 101, 1, 0, 0, 0, 787, 788, 3, 308, 151, 0, 788, 789, 3, 304, 149, 0, 789, 790, 3, 318, 156, 0, 790, 791, 3, 320, 157, 0, 791, 792, 3, 326, 160, 0, 792, 793, 3, 300, 147, 0, 793, 103, 1, 0, 0, 0, 794, 795, 3, 308, 151, 0, 795, 796, 3, 318, 156, 0, 796, 797, 3, 296, 145, 0, 797, 798, 3, 314, 154, 0, 798, 799, 3, 332, 163, 0, 799, 800, 3, 298, 146, 0, 800, 801, 3, 300, 147, 0, 801, 105, 1, 0, 0, 0, 802, 803, 3, 308, 151, 0, 803, 804, 3, 318, 156, 0, 804, 107, 1, 0, 0, 0, 805, 806, 3, 308, 151, 0, 806, 807, 3, 318, 156, 0, 807, 808, 3, 302, 148, 0, 808, 819, 1, 0, 0, 0, 809, 810, 3, 308, 151, 0, 810, 811, 3, 318, 156, 0, 811, 812, 3, 302, 148, 0, 812, 813, 3, 308, 151, 0, 813, 814, 3, 318, 156, 0, 814, 815, 3, 308, 151, 0, 815, 816, 3, 330, 162, 0, 816, 817, 3, 340, 167, 0, 817, 819, 1, 0, 0, 0, 818, 805, 1, 0, 0, 0, 818, 809, 1, 0, 0, 0, 819, 109, 1, 0, 0, 0, 820, 821, 3, 308, 151, 0, 821, 822, 3, 318, 156, 0, 822, 823, 3, 318, 156, 0, 823, 824, 3, 300, 147, 0, 824, 825, 3, 326, 160, 0, 825, 111, 1, 0, 0, 0, 826, 827, 3, 308, 151, 0, 827, 828, 3, 318, 156, 0, 828, 829, 3, 330, 162, 0, 829, 830, 3, 300, 147, 0, 830, 831, 3, 326, 160, 0, 831, 832, 3, 328, 161, 0, 832, 833, 3, 300, 147, 0, 833, 834, 3, 296, 145, 0, 834, 835, 3, 330, 162, 0, 835, 113, 1, 0, 0, 0, 836, 837, 3, 308, 151, 0, 837, 838, 3, 318, 156, 0, 838, 839, 3, 330, 162, 0, 839, 840, 3, 300, 147, 0, 840, 841, 3, 326, 160, 0, 841, 842, 3, 322, 158, 0, 842, 843, 3, 320, 157, 0, 843, 844, 3, 314, 154, 0, 844, 845, 3, 292, 143, 0, 845, 846, 3, 330, 162, 0, 846, 847, 3, 300, 147, 0, 847, 115, 1, 0, 0, 0, 848, 849, 3, 308, 151, 0, 849, 850, 3, 318, 156, 0, 850, 851, 3, 330, 162, 0, 851, 852, 3, 300, 147, 0, 852, 853, 3, 326, 160, 0, 853, 854, 3, 334, 164, 0, 854, 855, 3, 292, 143, 0, 855, 856, 3, 314, 154, 0, 856, 117, 1, 0, 0, 0, 857, 858, 3, 308, 151, 0, 858, 859, 3, 328, 161, 0, 859, 119, 1, 0, 0, 0, 860, 861, 3, 310, 152, 0, 861, 862, 3, 320, 157, 0, 862, 863, 3, 308, 151, 0, 863, 864, 3, 318, 156, 0, 864, 121, 1, 0, 0, 0, 865, 866, 3, 312, 153, 0, 866, 867, 3, 300, 147, 0, 867, 868, 3, 340, 167, 0, 868, 123, 1, 0, 0, 0, 869, 870, 3, 314, 154, 0, 870, 871, 3, 292, 143, 0, 871, 872, 3, 316, 155, 0, 872, 873, 3, 294, 144, 0, 873, 874, 3, 298, 146, 0, 874, 875, 3, 292, 143, 0, 875, 125, 1, 0, 0, 0, 876, 877, 3, 314, 154, 0, 877, 878, 3, 292, 143, 0, 878, 879, 3, 328, 161, 0, 879, 880, 3, 330, 162, 0, 880, 127, 1, 0, 0, 0, 881, 882, 3, 314, 154, 0, 882, 883, 3, 300, 147, 0, 883, 884, 3, 292, 143, 0, 884, 885, 3, 298, 146, 0, 885, 886, 3, 308, 151, 0, 886, 887, 3, 318, 156, 0, 887, 888, 3, 304, 149, 0, 888, 129, 1, 0, 0, 0, 889, 890, 3, 314, 154, 0, 890, 891, 3, 300, 147, 0, 891, 892, 3, 302, 148, 0, 892, 893, 3, 330, 162, 0, 893, 131, 1, 0, 0, 0, 894, 895, 3, 314, 154, 0, 895, 896, 3, 300, 147, 0, 896, 897, 3, 330, 162, 0, 897, 133, 1, 0, 0, 0, 898, 899, 3, 314, 154, 0, 899, 900, 3, 308, 151, 0, 900, 901, 3, 312, 153, 0, 901, 902, 3, 300, 147, 0, 902, 135, 1, 0, 0, 0, 903, 904, 3, 314, 154, 0, 904, 905, 3, 308, 151, 0, 905, 906, 3, 316, 155, 0, 906, 907, 3, 308, 151, 0, 907, 908, 3, 330, 162, 0, 908, 137, 1, 0, 0, 0, 909, 910, 3, 316, 155, 0, 910, 911, 3, 292, 143, 0, 911, 912, 3, 330, 162, 0, 912, 913, 3, 300, 147, 0, 913, 914, 3, 326, 160, 0, 914, 915, 3, 308, 151, 0, 915, 916, 3, 292, 143, 0, 916, 917, 3, 314, 154, 0, 917, 918, 3, 308, 151, 0, 918, 919, 3, 342, 168, 0, 919, 920, 3, 300, 147, 0, 920, 921, 3, 298, 146, 0, 921, 139, 1, 0, 0, 0, 922, 923, 3, 316, 155, 0, 923, 924, 3, 308, 151, 0, 924, 925, 3, 318, 156, 0, 925, 926, 3, 332, 163, 0, 926, 927, 3, 330, 162, 0, 927, 928, 3, 300, 147, 0, 928, 141, 1, 0, 0, 0, 929, 930, 3, 316, 155, 0, 930, 931, 3, 320, 157, 0, 931, 932, 3, 318, 156, 0, 932, 933, 3, 330, 162, 0, 933, 934, 3, 306, 150, 0, 934, 143, 1, 0, 0, 0, 935, 936, 3, 318, 156, 0, 936, 937, 3, 292, 143, 0, 937, 938, 3, 316, 155, 0, 938, 939, 3, 300, 147, 0, 939, 145, 1, 0, 0, 0, 940, 941, 3, 318, 156, 0, 941, 942, 3, 292, 143, 0, 942, 943, 3, 330, 162, 0, 943, 944, 3, 332, 163, 0, 944, 945, 3, 326, 160, 0, 945, 946, 3, 292, 143, 0, 946, 947, 3, 314, 154, 0, 947, 147, 1, 0, 0, 0, 948, 949, 3, 318, 156, 0, 949, 950, 3, 292, 143, 0, 950, 951, 3, 318, 156, 0, 951, 149, 1, 0, 0, 0, 952, 953, 3, 318, 156, 0, 953, 954, 3, 320, 157, 0, 954, 955, 3, 330, 162, 0, 955, 151, 1, 0, 0, 0, 956, 957, 3, 318, 156, 0, 957, 958, 3, 332, 163, 0, 958, 959, 3, 314, 154, 0, 959, 960, 3, 314, 154, 0, 960, 153, 1, 0, 0, 0, 961, 962, 3, 318, 156, 0, 962, 963, 3, 332, 163, 0, 963, 964, 3, 314, 154, 0, 964, 965, 3, 314, 154, 0, 965, 966, 3, 328, 161, 0, 966, 155, 1, 0, 0, 0, 967, 968, 3, 320, 157, 0, 968, 969, 3, 302, 148, 0, 969, 970, 3, 302, 148, 0, 970, 971, 3, 328, 161, 0, 971, 972, 3, 300, 147, 0, 972, 973, 3, 330, 162, 0, 973, 157, 1, 0, 0, 0, 974, 975, 3, 320, 157, 0, 975, 976, 3, 318, 156, 0, 976, 159, 1, 0, 0, 0, 977, 978, 3, 320, 157, 0, 978, 979, 3, 326, 160, 0, 979, 161, 1, 0, 0, 0, 980, 981, 3, 320, 157, 0, 981, 982, 3, 326, 160, 0, 982, 983, 3, 298, 146, 0, 983, 984, 3, 300, 147, 0, 984, 985, 3, 326, 160, 0, 985, 163, 1, 0, 0, 0, 986, 987, 3, 320, 157, 0, 987, 988, 3, 332, 163, 0, 988, 989, 3, 330, 162, 0, 989, 990, 3, 300, 147, 0, 990, 991, 3, 326, 160, 0, 991, 165, 1, 0, 0, 0, 992, 993, 3, 320, 157, 0, 993, 994, 3, 334, 164, 0, 994, 995, 3, 300, 147, 0, 995, 996, 3, 326, 160, 0, 996, 167, 1, 0, 0, 0, 997, 998, 3, 322, 158, 0, 998, 999, 3, 292, 143, 0, 999, 1000, 3, 326, 160, 0, 1000, 1001, 3, 330, 162, 0, 1001, 1002, 3, 308, 151, 0, 1002, 1003, 3, 330, 162, 0, 1003, 1004, 3, 308, 151, 0, 1004, 1005, 3, 320, 157, 0, 1005, 1006, 3, 318, 156, 0, 1006, 169, 1, 0, 0, 0, 1007, 1008, 3, 322, 158, 0, 1008, 1009, 3, 308, 151, 0, 1009, 1010, 3, 334, 164, 0, 1010, 1011, 3, 320, 157, 0, 1011, 1012, 3, 330, 162, 0, 1012, 171, 1, 0, 0, 0, 1013, 1014, 3, 322, 158, 0, 1014, 1015, 3, 320, 157, 0, 1015, 1016, 3, 328, 161, 0, 1016, 1017, 3, 308, 151, 0, 1017, 1018, 3, 330, 162, 0, 1018, 1019, 3, 308, 151, 0, 1019, 1020, 3, 320, 157, 0, 1020, 1021, 3, 318, 156, 0, 1021, 1022, 3, 292, 143, 0, 1022, 1023, 3, 314, 154, 0, 1023, 173, 1, 0, 0, 0, 1024, 1025, 3, 322, 158, 0, 1025, 1026, 3, 326, 160, 0, 1026, 1027, 3, 300, 147, 0, 1027, 1028, 3, 296, 145, 0, 1028, 1029, 3, 300, 147, 0, 1029, 1030, 3, 298, 146, 0, 1030, 1031, 3, 308, 151, 0, 1031, 1032, 3, 318, 156, 0, 1032, 1033, 3, 304, 149, 0, 1033, 175, 1, 0, 0, 0, 1034, 1035, 3, 322, 158, 0, 1035, 1036, 3, 326, 160, 0, 1036, 1037, 3, 300, 147, 0, 1037, 1038, 3, 336, 165, 0, 1038, 1039, 3, 306, 150, 0, 1039, 1040, 3, 300, 147, 0, 1040, 1041, 3, 326, 160, 0, 1041, 1042, 3, 300, 147, 0, 1042, 177, 1, 0, 0, 0, 1043, 1044, 3, 324, 159, 0, 1044, 1045, 3, 332, 163, 0, 1045, 1046, 3, 292, 143, 0, 1046, 1047, 3, 314, 154, 0, 1047, 1048, 3, 308, 151, 0, 1048, 1049, 3, 302, 148, 0, 1049, 1050, 3, 340, 167, 0, 1050, 179, 1, 0, 0, 0, 1051, 1052, 3, 324, 159, 0, 1052, 1053, 3, 332, 163, 0, 1053, 1054, 3, 292, 143, 0, 1054, 1055, 3, 326, 160, 0, 1055, 1056, 3, 330, 162, 0, 1056, 1057, 3, 300, 147, 0, 1057, 1058, 3, 326, 160, 0, 1058, 181, 1, 0, 0, 0, 1059, 1060, 3, 326, 160, 0, 1060, 1061, 3, 292, 143, 0, 1061, 1062, 3, 318, 156, 0, 1062, 1063, 3, 304, 149, 0, 1063, 1064, 3, 300, 147, 0, 1064, 183, 1, 0, 0, 0, 1065, 1066, 3, 326, 160, 0, 1066, 1067, 3, 300, 147, 0, 1067, 1068, 3, 296, 145, 0, 1068, 1069, 3, 332, 163, 0, 1069, 1070, 3, 326, 160, 0, 1070, 1071, 3, 328, 161, 0, 1071, 1072, 3, 308, 151, 0, 1072, 1073, 3, 334, 164, 0, 1073, 1074, 3, 300, 147, 0, 1074, 185, 1, 0, 0, 0, 1075, 1076, 3, 326, 160, 0, 1076, 1077, 3, 300, 147, 0, 1077, 1078, 3, 322, 158, 0, 1078, 1079, 3, 314, 154, 0, 1079, 1080, 3, 292, 143, 0, 1080, 1081, 3, 296, 145, 0, 1081, 1082, 3, 300, 147, 0, 1082, 187, 1, 0, 0, 0, 1083, 1084, 3, 326, 160, 0, 1084, 1085, 3, 300, 147, 0, 1085, 1086, 3, 330, 162, 0, 1086, 1087, 3, 332, 163, 0, 1087, 1088, 3, 326, 160, 0, 1088, 1089, 3, 318, 156, 0, 1089, 189, 1, 0, 0, 0, 1090, 1091, 3, 326, 160, 0, 1091, 1092, 3, 308, 151, 0, 1092, 1093, 3, 304, 149, 0, 1093, 1094, 3, 306, 150, 0, 1094, 1095, 3, 330, 162, 0, 1095, 191, 1, 0, 0, 0, 1096, 1097, 3, 326, 160, 0, 1097, 1098, 3, 320, 157, 0, 1098, 1099, 3, 314, 154, 0, 1099, 1100, 3, 314, 154, 0, 1100, 1101, 3, 332, 163, 0, 1101, 1102, 3, 322, 158, 0, 1102, 193, 1, 0, 0, 0, 1103, 1104, 3, 326, 160, 0, 1104, 1105, 3, 320, 157, 0, 1105, 1106, 3, 336, 165, 0, 1106, 195, 1, 0, 0, 0, 1107, 1108, 3, 326, 160, 0, 1108, 1109, 3, 320, 157, 0, 1109, 1110, 3, 336, 165, 0, 1110, 1111, 3, 328, 161, 0, 1111, 197, 1, 0, 0, 0, 1112, 1113, 3, 328, 161, 0, 1113, 1114, 3, 292, 143, 0, 1114, 1115, 3, 316, 155, 0, 1115, 1116, 3, 322, 158, 0, 1116, 1117, 3, 314, 154, 0, 1117, 1118, 3, 300, 147, 0, 1118, 199, 1, 0, 0, 0, 1119, 1120, 3, 328, 161, 0, 1120, 1121, 3, 300, 147, 0, 1121, 1122, 3, 296, 145, 0, 1122, 1123, 3, 320, 157, 0, 1123, 1124, 3, 318, 156, 0, 1124, 1125, 3, 298, 146, 0, 1125, 201, 1, 0, 0, 0, 1126, 1127, 3, 328, 161, 0, 1127, 1128, 3, 300, 147, 0, 1128, 1129, 3, 314, 154, 0, 1129, 1130, 3, 300, 147, 0, 1130, 1131, 3, 296, 145, 0, 1131, 1132, 3, 330, 162, 0, 1132, 203, 1, 0, 0, 0, 1133, 1134, 3, 328, 161, 0, 1134, 1135, 3, 300, 147, 0, 1135, 1136, 3, 316, 155, 0, 1136, 1137, 3, 308, 151, 0, 1137, 205, 1, 0, 0, 0, 1138, 1139, 3, 328, 161, 0, 1139, 1140, 3, 300, 147, 0, 1140, 1141, 3, 330, 162, 0, 1141, 1142, 3, 328, 161, 0, 1142, 207, 1, 0, 0, 0, 1143, 1144, 3, 328, 161, 0, 1144, 1145, 3, 300, 147, 0, 1145, 1146, 3, 330, 162, 0, 1146, 1147, 3, 330, 162, 0, 1147, 1148, 3, 308, 151, 0, 1148, 1149, 3, 318, 156, 0, 1149, 1150, 3, 304, 149, 0, 1150, 1151, 3, 328, 161, 0, 1151, 209, 1, 0, 0, 0, 1152, 1153, 3, 328, 161, 0, 1153, 1154, 3, 330, 162, 0, 1154, 1155, 3, 300, 147, 0, 1155, 1156, 3, 322, 158, 0, 1156, 211, 1, 0, 0, 0, 1157, 1158, 3, 328, 161, 0, 1158, 1159, 3, 332, 163, 0, 1159, 1160, 3, 294, 144, 0, 1160, 1161, 3, 328, 161, 0, 1161, 1162, 3, 330, 162, 0, 1162, 1163, 3, 326, 160, 0, 1163, 1164, 3, 308, 151, 0, 1164, 1165, 3, 318, 156, 0, 1165, 1166, 3, 304, 149, 0, 1166, 213, 1, 0, 0, 0, 1167, 1168, 3, 330, 162, 0, 1168, 1169, 3, 306, 150, 0, 1169, 1170, 3, 300, 147, 0, 1170, 1171, 3, 318, 156, 0, 1171, 215, 1, 0, 0, 0, 1172, 1173, 3, 330, 162, 0, 1173, 1174, 3, 306, 150, 0, 1174, 1175, 3, 326, 160, 0, 1175, 1176, 3, 320, 157, 0, 1176, 1177, 3, 336, 165, 0, 1177, 217, 1, 0, 0, 0, 1178, 1179, 3, 330, 162, 0, 1179, 1180, 3, 308, 151, 0, 1180, 1181, 3, 300, 147, 0, 1181, 1182, 3, 328, 161, 0, 1182, 219, 1, 0, 0, 0, 1183, 1184, 3, 330, 162, 0, 1184, 1185, 3, 308, 151, 0, 1185, 1186, 3, 316, 155, 0, 1186, 1187, 3, 300, 147, 0, 1187, 1188, 3, 328, 161, 0, 1188, 1189, 3, 330, 162, 0, 1189, 1190, 3, 292, 143, 0, 1190, 1191, 3, 316, 155, 0, 1191, 1192, 3, 322, 158, 0, 1192, 221, 1, 0, 0, 0, 1193, 1194, 3, 330, 162, 0, 1194, 1195, 3, 308, 151, 0, 1195, 1196, 3, 316, 155, 0, 1196, 1197, 3, 300, 147, 0, 1197, 223, 1, 0, 0, 0, 1198, 1199, 3, 314, 154, 0, 1199, 1200, 3, 320, 157, 0, 1200, 1201, 3, 296, 145, 0, 1201, 1202, 3, 292, 143, 0, 1202, 1203, 3, 314, 154, 0, 1203, 225, 1, 0, 0, 0, 1204, 1205, 3, 342, 168, 0, 1205, 1206, 3, 320, 157, 0, 1206, 1207, 3, 318, 156, 0, 1207, 1208, 3, 300, 147, 0, 1208, 227, 1, 0, 0, 0, 1209, 1210, 3, 330, 162, 0, 1210, 1211, 3, 320, 157, 0, 1211, 229, 1, 0, 0, 0, 1212, 1213, 3, 330, 162, 0, 1213, 1214, 3, 320, 157, 0, 1214, 1215, 3, 322, 158, 0, 1215, 231, 1, 0, 0, 0, 1216, 1217, 3, 330, 162, 0, 1217, 1218, 3, 320, 157, 0, 1218, 1219, 3, 330, 162, 0, 1219, 1220, 3, 292, 143, 0, 1220, 1221, 3, 314, 154, 0, 1221, 1222, 3, 328, 161, 0, 1222, 233, 1, 0, 0, 0, 1223, 1224, 3, 330, 162, 0, 1224, 1225, 3, 326, 160, 0, 1225, 1226, 3, 292, 143, 0, 1226, 1227, 3, 308, 151, 0, 1227, 1228, 3, 314, 154, 0, 1228, 1229, 3, 308, 151, 0, 1229, 1230, 3, 318, 156, 0, 1230, 1231, 3, 304, 149, 0, 1231, 235, 1, 0, 0, 0, 1232, 1233, 3, 330, 162, 0, 1233, 1234, 3, 326, 160, 0, 1234, 1235, 3, 308, 151, 0, 1235, 1236, 3, 316, 155, 0, 1236, 237, 1, 0, 0, 0, 1237, 1238, 3, 330, 162, 0, 1238, 1239, 3, 326, 160, 0, 1239, 1240, 3, 332, 163, 0, 1240, 1241, 3, 318, 156, 0, 1241, 1242, 3, 296, 145, 0, 1242, 1243, 3, 292, 143, 0, 1243, 1244, 3, 330, 162, 0, 1244, 1245, 3, 300, 147, 0, 1245, 239, 1, 0, 0, 0, 1246, 1247, 3, 330, 162, 0, 1247, 1248, 3, 326, 160, 0, 1248, 1249, 3, 340, 167, 0, 1249, 241, 1, 0, 0, 0, 1250, 1251, 3, 330, 162, 0, 1251, 1252, 3, 326, 160, 0, 1252, 1253, 3, 340, 167, 0, 1253, 1254, 5, 95, 0, 0, 1254, 1255, 3, 296, 145, 0, 1255, 1256, 3, 292, 143, 0, 1256, 1257, 3, 328, 161, 0, 1257, 1258, 3, 330, 162, 0, 1258, 243, 1, 0, 0, 0, 1259, 1260, 3, 332, 163, 0, 1260, 1261, 3, 318, 156, 0, 1261, 1262, 3, 294, 144, 0, 1262, 1263, 3, 320, 157, 0, 1263, 1264, 3, 332, 163, 0, 1264, 1265, 3, 318, 156, 0, 1265, 1266, 3, 298, 146, 0, 1266, 1267, 3, 300, 147, 0, 1267, 1268, 3, 298, 146, 0, 1268, 245, 1, 0, 0, 0, 1269, 1270, 3, 332, 163, 0, 1270, 1271, 3, 318, 156, 0, 1271, 1272, 3, 308, 151, 0, 1272, 1273, 3, 320, 157, 0, 1273, 1274, 3, 318, 156, 0, 1274, 247, 1, 0, 0, 0, 1275, 1276, 3, 332, 163, 0, 1276, 1277, 3, 318, 156, 0, 1277, 1278, 3, 322, 158, 0, 1278, 1279, 3, 308, 151, 0, 1279, 1280, 3, 334, 164, 0, 1280, 1281, 3, 320, 157, 0, 1281, 1282, 3, 330, 162, 0, 1282, 249, 1, 0, 0, 0, 1283, 1284, 3, 332, 163, 0, 1284, 1285, 3, 328, 161, 0, 1285, 1286, 3, 308, 151, 0, 1286, 1287, 3, 318, 156, 0, 1287, 1288, 3, 304, 149, 0, 1288, 251, 1, 0, 0, 0, 1289, 1290, 3, 334, 164, 0, 1290, 1291, 3, 292, 143, 0, 1291, 1292, 3, 314, 154, 0, 1292, 1293, 3, 332, 163, 0, 1293, 1294, 3, 300, 147, 0, 1294, 1295, 3, 328, 161, 0, 1295, 253, 1, 0, 0, 0, 1296, 1297, 3, 336, 165, 0, 1297, 1298, 3, 300, 147, 0, 1298, 1299, 3, 300, 147, 0, 1299, 1300, 3, 312, 153, 0, 1300, 255, 1, 0, 0, 0, 1301, 1302, 3, 336, 165, 0, 1302, 1303, 3, 306, 150, 0, 1303, 1304, 3, 300, 147, 0, 1304, 1305, 3, 318, 156, 0, 1305, 257, 1, 0, 0, 0, 1306, 1307, 3, 336, 165, 0, 1307, 1308, 3, 306, 150, 0, 1308, 1309, 3, 300, 147, 0, 1309, 1310, 3, 326, 160, 0, 1310, 1311, 3, 300, 147, 0, 1311, 259, 1, 0, 0, 0, 1312, 1313, 3, 336, 165, 0, 1313, 1314, 3, 306, 150, 0, 1314, 1315, 3, 308, 151, 0, 1315, 1316, 3, 314, 154, 0, 1316, 1317, 3, 300, 147, 0, 1317, 261, 1, 0, 0, 0, 1318, 1319, 3, 336, 165, 0, 1319, 1320, 3, 308, 151, 0, 1320, 1321, 3, 318, 156, 0, 1321, 1322, 3, 298, 146, 0, 1322, 1323, 3, 320, 157, 0, 1323, 1324, 3, 336, 165, 0, 1324, 263, 1, 0, 0, 0, 1325, 1326, 3, 336, 165, 0, 1326, 1327, 3, 308, 151, 0, 1327, 1328, 3, 330, 162, 0, 1328, 1329, 3, 306, 150, 0, 1329, 265, 1, 0, 0, 0, 1330, 1331, 3, 336, 165, 0, 1331, 1332, 3, 308, 151, 0, 1332, 1333, 3, 330, 162, 0, 1333, 1334, 3, 306, 150, 0, 1334, 1335, 3, 308, 151, 0, 1335, 1336, 3, 318, 156, 0, 1336, 267, 1, 0, 0, 0, 1337, 1338, 3, 340, 167, 0, 1338, 1339, 3, 300, 147, 0, 1339, 1340, 3, 292, 143, 0, 1340, 1341, 3, 326, 160, 0, 1341, 1348, 1, 0, 0, 0, 1342, 1343, 3, 340, 167, 0, 1343, 1344, 3, 340, 167, 0, 1344, 1345, 3, 340, 167, 0, 1345, 1346, 3, 340, 167, 0, 1346, 1348, 1, 0, 0, 0, 1347, 1337, 1, 0, 0, 0, 1347, 1342, 1, 0, 0, 0, 1348, 269, 1, 0, 0, 0, 1349, 1350, 3, 360, 177, 0, 1350, 1351, 3, 294, 144, 0, 1351, 1382, 1, 0, 0, 0, 1352, 1353, 3, 360, 177, 0, 1353, 1354, 3, 302, 148, 0, 1354, 1382, 1, 0, 0, 0, 1355, 1356, 3, 360, 177, 0, 1356, 1357, 3, 326, 160, 0, 1357, 1382, 1, 0, 0, 0, 1358, 1359, 3, 360, 177, 0, 1359, 1360, 3, 318, 156, 0, 1360, 1382, 1, 0, 0, 0, 1361, 1362, 3, 360, 177, 0, 1362, 1363, 3, 330, 162, 0, 1363, 1382, 1, 0, 0, 0, 1364, 1365, 3, 360, 177, 0, 1365, 1366, 5, 48, 0, 0, 1366, 1382, 1, 0, 0, 0, 1367, 1368, 3, 360, 177, 0, 1368, 1369, 3, 292, 143, 0, 1369, 1382, 1, 0, 0, 0, 1370, 1371, 3, 360, 177, 0, 1371, 1372, 3, 334, 164, 0, 1372, 1382, 1, 0, 0, 0, 1373, 1374, 3, 360, 177, 0, 1374, 1375, 3, 360, 177, 0, 1375, 1382, 1, 0, 0, 0, 1376, 1377, 3, 360, 177, 0, 1377, 1378, 3, 338, 166, 0, 1378, 1379, 3, 352, 173, 0, 1379, 1380, 3, 352, 173, 0, 1380, 1382, 1, 0, 0, 0, 1381, 1349, 1, 0, 0, 0, 1381, 1352, 1, 0, 0, 0, 1381, 1355, 1, 0, 0, 0, 1381, 1358, 1, 0, 0, 0, 1381, 1361, 1, 0, 0, 0, 1381, 1364, 1, 0, 0, 0, 1381, 1367, 1, 0, 0, 0, 1381, 1370, 1, 0, 0, 0, 1381, 1373, 1, 0, 0, 0, 1381, 1376, 1, 0, 0, 0, 1382, 271, 1, 0, 0, 0, 1383, 1387, 3, 344, 169, 0, 1384, 1387, 3, 448, 221, 0, 1385, 1387, 3, 374, 184, 0, 1386, 1383, 1, 0, 0, 0, 1386, 1384, 1, 0, 0, 0, 1386, 1385, 1, 0, 0, 0, 1387, 1394, 1, 0, 0, 0, 1388, 1393, 3, 344, 169, 0, 1389, 1393, 3, 448, 221, 0, 1390, 1393, 3, 350, 172, 0, 1391, 1393, 3, 374, 184, 0, 1392, 1388, 1, 0, 0, 0, 1392, 1389, 1, 0, 0, 0, 1392, 1390, 1, 0, 0, 0, 1392, 1391, 1, 0, 0, 0, 1393, 1396, 1, 0, 0, 0, 1394, 1392, 1, 0, 0, 0, 1394, 1395, 1, 0, 0, 0, 1395, 273, 1, 0, 0, 0, 1396, 1394, 1, 0, 0, 0, 1397, 1408, 3, 358, 176, 0, 1398, 1407, 8, 0, 0, 0, 1399, 1407, 3, 270, 132, 0, 1400, 1401, 3, 360, 177, 0, 1401, 1402, 3, 430, 212, 0, 1402, 1407, 1, 0, 0, 0, 1403, 1404, 3, 358, 176, 0, 1404, 1405, 3, 358, 176, 0, 1405, 1407, 1, 0, 0, 0, 1406, 1398, 1, 0, 0, 0, 1406, 1399, 1, 0, 0, 0, 1406, 1400, 1, 0, 0, 0, 1406, 1403, 1, 0, 0, 0, 1407, 1410, 1, 0, 0, 0, 1408, 1406, 1, 0, 0, 0, 1408, 1409, 1, 0, 0, 0, 1409, 1411, 1, 0, 0, 0, 1410, 1408, 1, 0, 0, 0, 1411, 1412, 3, 358, 176, 0, 1412, 1430, 1, 0, 0, 0, 1413, 1424, 3, 424, 209, 0, 1414, 1423, 8, 1, 0, 0, 1415, 1423, 3, 270, 132, 0, 1416, 1417, 3, 360, 177, 0, 1417, 1418, 3, 424, 209, 0, 1418, 1423, 1, 0, 0, 0, 1419, 1420, 3, 424, 209, 0, 1420, 1421, 3, 424, 209, 0, 1421, 1423, 1, 0, 0, 0, 1422, 1414, 1, 0, 0, 0, 1422, 1415, 1, 0, 0, 0, 1422, 1416, 1, 0, 0, 0, 1422, 1419, 1, 0, 0, 0, 1423, 1426, 1, 0, 0, 0, 1424, 1422, 1, 0, 0, 0, 1424, 1425, 1, 0, 0, 0, 1425, 1427, 1, 0, 0, 0, 1426, 1424, 1, 0, 0, 0, 1427, 1428, 3, 424, 209, 0, 1428, 1430, 1, 0, 0, 0, 1429, 1397, 1, 0, 0, 0, 1429, 1413, 1, 0, 0, 0, 1430, 275, 1, 0, 0, 0, 1431, 1432, 3, 284, 139, 0, 1432, 1436, 3, 376, 185, 0, 1433, 1435, 3, 352, 173, 0, 1434, 1433, 1, 0, 0, 0, 1435, 1438, 1, 0, 0, 0, 1436, 1434, 1, 0, 0, 0, 1436, 1437, 1, 0, 0, 0, 1437, 1441, 1, 0, 0, 0, 1438, 1436, 1, 0, 0, 0, 1439, 1442, 3, 322, 158, 0, 1440, 1442, 3, 300, 147, 0, 1441, 1439, 1, 0, 0, 0, 1441, 1440, 1, 0, 0, 0, 1442, 1445, 1, 0, 0, 0, 1443, 1446, 3, 420, 207, 0, 1444, 1446, 3, 372, 183, 0, 1445, 1443, 1, 0, 0, 0, 1445, 1444, 1, 0, 0, 0, 1445, 1446, 1, 0, 0, 0, 1446, 1448, 1, 0, 0, 0, 1447, 1449, 3, 350, 172, 0, 1448, 1447, 1, 0, 0, 0, 1449, 1450, 1, 0, 0, 0, 1450, 1448, 1, 0, 0, 0, 1450, 1451, 1, 0, 0, 0, 1451, 1508, 1, 0, 0, 0, 1452, 1455, 3, 284, 139, 0, 1453, 1456, 3, 322, 158, 0, 1454, 1456, 3, 300, 147, 0, 1455, 1453, 1, 0, 0, 0, 1455, 1454, 1, 0, 0, 0, 1456, 1459, 1, 0, 0, 0, 1457, 1460, 3, 420, 207, 0, 1458, 1460, 3, 372, 183, 0, 1459, 1457, 1, 0, 0, 0, 1459, 1458, 1, 0, 0, 0, 1459, 1460, 1, 0, 0, 0, 1460, 1462, 1, 0, 0, 0, 1461, 1463, 3, 350, 172, 0, 1462, 1461, 1, 0, 0, 0, 1463, 1464, 1, 0, 0, 0, 1464, 1462, 1, 0, 0, 0, 1464, 1465, 1, 0, 0, 0, 1465, 1508, 1, 0, 0, 0, 1466, 1467, 3, 282, 138, 0, 1467, 1471, 3, 376, 185, 0, 1468, 1470, 3, 350, 172, 0, 1469, 1468, 1, 0, 0, 0, 1470, 1473, 1, 0, 0, 0, 1471, 1469, 1, 0, 0, 0, 1471, 1472, 1, 0, 0, 0, 1472, 1474, 1, 0, 0, 0, 1473, 1471, 1, 0, 0, 0, 1474, 1477, 3, 300, 147, 0, 1475, 1478, 3, 420, 207, 0, 1476, 1478, 3, 372, 183, 0, 1477, 1475, 1, 0, 0, 0, 1477, 1476, 1, 0, 0, 0, 1477, 1478, 1, 0, 0, 0, 1478, 1480, 1, 0, 0, 0, 1479, 1481, 3, 350, 172, 0, 1480, 1479, 1, 0, 0, 0, 1481, 1482, 1, 0, 0, 0, 1482, 1480, 1, 0, 0, 0, 1482, 1483, 1, 0, 0, 0, 1483, 1508, 1, 0, 0, 0, 1484, 1485, 3, 376, 185, 0, 1485, 1486, 3, 282, 138, 0, 1486, 1489, 3, 300, 147, 0, 1487, 1490, 3, 420, 207, 0, 1488, 1490, 3, 372, 183, 0, 1489, 1487, 1, 0, 0, 0, 1489, 1488, 1, 0, 0, 0, 1489, 1490, 1, 0, 0, 0, 1490, 1492, 1, 0, 0, 0, 1491, 1493, 3, 350, 172, 0, 1492, 1491, 1, 0, 0, 0, 1493, 1494, 1, 0, 0, 0, 1494, 1492, 1, 0, 0, 0, 1494, 1495, 1, 0, 0, 0, 1495, 1508, 1, 0, 0, 0, 1496, 1497, 3, 282, 138, 0, 1497, 1500, 3, 300, 147, 0, 1498, 1501, 3, 420, 207, 0, 1499, 1501, 3, 372, 183, 0, 1500, 1498, 1, 0, 0, 0, 1500, 1499, 1, 0, 0, 0, 1500, 1501, 1, 0, 0, 0, 1501, 1503, 1, 0, 0, 0, 1502, 1504, 3, 350, 172, 0, 1503, 1502, 1, 0, 0, 0, 1504, 1505, 1, 0, 0, 0, 1505, 1503, 1, 0, 0, 0, 1505, 1506, 1, 0, 0, 0, 1506, 1508, 1, 0, 0, 0, 1507, 1431, 1, 0, 0, 0, 1507, 1452, 1, 0, 0, 0, 1507, 1466, 1, 0, 0, 0, 1507, 1484, 1, 0, 0, 0, 1507, 1496, 1, 0, 0, 0, 1508, 277, 1, 0, 0, 0, 1509, 1510, 5, 48, 0, 0, 1510, 1512, 3, 294, 144, 0, 1511, 1513, 3, 346, 170, 0, 1512, 1511, 1, 0, 0, 0, 1513, 1514, 1, 0, 0, 0, 1514, 1512, 1, 0, 0, 0, 1514, 1515, 1, 0, 0, 0, 1515, 279, 1, 0, 0, 0, 1516, 1518, 5, 48, 0, 0, 1517, 1519, 3, 348, 171, 0, 1518, 1517, 1, 0, 0, 0, 1519, 1520, 1, 0, 0, 0, 1520, 1518, 1, 0, 0, 0, 1520, 1521, 1, 0, 0, 0, 1521, 281, 1, 0, 0, 0, 1522, 1524, 3, 350, 172, 0, 1523, 1522, 1, 0, 0, 0, 1524, 1525, 1, 0, 0, 0, 1525, 1523, 1, 0, 0, 0, 1525, 1526, 1, 0, 0, 0, 1526, 283, 1, 0, 0, 0, 1527, 1528, 5, 48, 0, 0, 1528, 1530, 3, 338, 166, 0, 1529, 1531, 3, 352, 173, 0, 1530, 1529, 1, 0, 0, 0, 1531, 1532, 1, 0, 0, 0, 1532, 1530, 1, 0, 0, 0, 1532, 1533, 1, 0, 0, 0, 1533, 285, 1, 0, 0, 0, 1534, 1535, 5, 48, 0, 0, 1535, 1537, 7, 2, 0, 0, 1536, 1538, 3, 350, 172, 0, 1537, 1536, 1, 0, 0, 0, 1538, 1539, 1, 0, 0, 0, 1539, 1537, 1, 0, 0, 0, 1539, 1540, 1, 0, 0, 0, 1540, 287, 1, 0, 0, 0, 1541, 1542, 5, 48, 0, 0, 1542, 1544, 7, 3, 0, 0, 1543, 1545, 3, 350, 172, 0, 1544, 1543, 1, 0, 0, 0, 1545, 1546, 1, 0, 0, 0, 1546, 1544, 1, 0, 0, 0, 1546, 1547, 1, 0, 0, 0, 1547, 289, 1, 0, 0, 0, 1548, 1559, 3, 430, 212, 0, 1549, 1558, 8, 4, 0, 0, 1550, 1558, 3, 270, 132, 0, 1551, 1552, 3, 360, 177, 0, 1552, 1553, 3, 430, 212, 0, 1553, 1558, 1, 0, 0, 0, 1554, 1555, 3, 430, 212, 0, 1555, 1556, 3, 430, 212, 0, 1556, 1558, 1, 0, 0, 0, 1557, 1549, 1, 0, 0, 0, 1557, 1550, 1, 0, 0, 0, 1557, 1551, 1, 0, 0, 0, 1557, 1554, 1, 0, 0, 0, 1558, 1561, 1, 0, 0, 0, 1559, 1557, 1, 0, 0, 0, 1559, 1560, 1, 0, 0, 0, 1560, 1562, 1, 0, 0, 0, 1561, 1559, 1, 0, 0, 0, 1562, 1563, 3, 430, 212, 0, 1563, 291, 1, 0, 0, 0, 1564, 1565, 7, 5, 0, 0, 1565, 293, 1, 0, 0, 0, 1566, 1567, 7, 3, 0, 0, 1567, 295, 1, 0, 0, 0, 1568, 1569, 7, 6, 0, 0, 1569, 297, 1, 0, 0, 0, 1570, 1571, 7, 7, 0, 0, 1571, 299, 1, 0, 0, 0, 1572, 1573, 7, 8, 0, 0, 1573, 301, 1, 0, 0, 0, 1574, 1575, 7, 9, 0, 0, 1575, 303, 1, 0, 0, 0, 1576, 1577, 7, 10, 0, 0, 1577, 305, 1, 0, 0, 0, 1578, 1579, 7, 11, 0, 0, 1579, 307, 1, 0, 0, 0, 1580, 1581, 7, 12, 0, 0, 1581, 309, 1, 0, 0, 0, 1582, 1583, 7, 13, 0, 0, 1583, 311, 1, 0, 0, 0, 1584, 1585, 7, 14, 0, 0, 1585, 313, 1, 0, 0, 0, 1586, 1587, 7, 15, 0, 0, 1587, 315, 1, 0, 0, 0, 1588, 1589, 7, 16, 0, 0, 1589, 317, 1, 0, 0, 0, 1590, 1591, 7, 17, 0, 0, 1591, 319, 1, 0, 0, 0, 1592, 1593, 7, 2, 0, 0, 1593, 321, 1, 0, 0, 0, 1594, 1595, 7, 18, 0, 0, 1595, 323, 1, 0, 0, 0, 1596, 1597, 7, 19, 0, 0, 1597, 325, 1, 0, 0, 0, 1598, 1599, 7, 20, 0, 0, 1599, 327, 1, 0, 0, 0, 1600, 1601, 7, 21, 0, 0, 1601, 329, 1, 0, 0, 0, 1602, 1603, 7, 22, 0, 0, 1603, 331, 1, 0, 0, 0, 1604, 1605, 7, 23, 0, 0, 1605, 333, 1, 0, 0, 0, 1606, 1607, 7, 24, 0, 0, 1607, 335, 1, 0, 0, 0, 1608, 1609, 7, 25, 0, 0, 1609, 337, 1, 0, 0, 0, 1610, 1611, 7, 26, 0, 0, 1611, 339, 1, 0, 0, 0, 1612, 1613, 7, 27, 0, 0, 1613, 341, 1, 0, 0, 0, 1614, 1615, 7, 28, 0, 0, 1615, 343, 1, 0, 0, 0, 1616, 1617, 7, 29, 0, 0, 1617, 345, 1, 0, 0, 0, 1618, 1619, 7, 30, 0, 0, 1619, 347, 1, 0, 0, 0, 1620, 1621, 7, 31, 0, 0, 1621, 349, 1, 0, 0, 0, 1622, 1623, 7, 32, 0, 0, 1623, 351, 1, 0, 0, 0, 1624, 1625, 7, 33, 0, 0, 1625, 353, 1, 0, 0, 0, 1626, 1627, 5, 45, 0, 0, 1627, 1628, 5, 62, 0, 0, 1628, 355, 1, 0, 0, 0, 1629, 1630, 5, 42, 0, 0, 1630, 357, 1, 0, 0, 0, 1631, 1632, 5, 96, 0, 0, 1632, 359, 1, 0, 0, 0, 1633, 1634, 5, 92, 0, 0, 1634, 361, 1, 0, 0, 0, 1635, 1636, 5, 58, 0, 0, 1636, 1637, 5, 58, 0, 0, 1637, 363, 1, 0, 0, 0, 1638, 1639, 5, 58, 0, 0, 1639, 1640, 5, 61, 0, 0, 1640, 365, 1, 0, 0, 0, 1641, 1642, 5, 58, 0, 0, 1642, 367, 1, 0, 0, 0, 1643, 1644, 5, 44, 0, 0, 1644, 369, 1, 0, 0, 0, 1645, 1646, 5, 124, 0, 0, 1646, 1647, 5, 124, 0, 0, 1647, 371, 1, 0, 0, 0, 1648, 1649, 5, 45, 0, 0, 1649, 373, 1, 0, 0, 0, 1650, 1651, 5, 36, 0, 0, 1651, 375, 1, 0, 0, 0, 1652, 1653, 5, 46, 0, 0, 1653, 377, 1, 0, 0, 0, 1654, 1655, 5, 61, 0, 0, 1655, 1656, 5, 61, 0, 0, 1656, 379, 1, 0, 0, 0, 1657, 1658, 5, 61, 0, 0, 1658, 381, 1, 0, 0, 0, 1659, 1660, 5, 62, 0, 0, 1660, 1661, 5, 61, 0, 0, 1661, 383, 1, 0, 0, 0, 1662, 1663, 5, 62, 0, 0, 1663, 385, 1, 0, 0, 0, 1664, 1665, 5, 35, 0, 0, 1665, 387, 1, 0, 0, 0, 1666, 1667, 5, 126, 0, 0, 1667, 1668, 5, 42, 0, 0, 1668, 389, 1, 0, 0, 0, 1669, 1670, 5, 61, 0, 0, 1670, 1671, 5, 126, 0, 0, 1671, 1672, 5, 42, 0, 0, 1672, 391, 1, 0, 0, 0, 1673, 1674, 5, 123, 0, 0, 1674, 1675, 1, 0, 0, 0, 1675, 1676, 6, 193, 0, 0, 1676, 393, 1, 0, 0, 0, 1677, 1678, 5, 91, 0, 0, 1678, 395, 1, 0, 0, 0, 1679, 1680, 5, 40, 0, 0, 1680, 397, 1, 0, 0, 0, 1681, 1682, 5, 60, 0, 0, 1682, 1683, 5, 61, 0, 0, 1683, 399, 1, 0, 0, 0, 1684, 1685, 5, 60, 0, 0, 1685, 1686, 5, 47, 0, 0, 1686, 1687, 1, 0, 0, 0, 1687, 1688, 6, 197, 1, 0, 1688, 1689, 6, 197, 2, 0, 1689, 401, 1, 0, 0, 0, 1690, 1691, 5, 60, 0, 0, 1691, 1692, 4, 198, 0, 0, 1692, 1693, 1, 0, 0, 0, 1693, 1694, 6, 198, 3, 0, 1694, 1695, 6, 198, 4, 0, 1695, 403, 1, 0, 0, 0, 1696, 1697, 5, 60, 0, 0, 1697, 405, 1, 0, 0, 0, 1698, 1699, 5, 60, 0, 0, 1699, 1700, 5, 47, 0, 0, 1700, 407, 1, 0, 0, 0, 1701, 1702, 5, 33, 0, 0, 1702, 1706, 5, 61, 0, 0, 1703, 1704, 5, 60, 0, 0, 1704, 1706, 5, 62, 0, 0, 1705, 1701, 1, 0, 0, 0, 1705, 1703, 1, 0, 0, 0, 1706, 409, 1, 0, 0, 0, 1707, 1708, 5, 33, 0, 0, 1708, 1709, 5, 126, 0, 0, 1709, 1710, 5, 42, 0, 0, 1710, 411, 1, 0, 0, 0, 1711, 1712, 5, 33, 0, 0, 1712, 1713, 5, 126, 0, 0, 1713, 413, 1, 0, 0, 0, 1714, 1715, 5, 63, 0, 0, 1715, 1716, 5, 46, 0, 0, 1716, 415, 1, 0, 0, 0, 1717, 1718, 5, 63, 0, 0, 1718, 1719, 5, 63, 0, 0, 1719, 417, 1, 0, 0, 0, 1720, 1721, 5, 37, 0, 0, 1721, 419, 1, 0, 0, 0, 1722, 1723, 5, 43, 0, 0, 1723, 421, 1, 0, 0, 0, 1724, 1725, 5, 63, 0, 0, 1725, 423, 1, 0, 0, 0, 1726, 1727, 5, 34, 0, 0, 1727, 425, 1, 0, 0, 0, 1728, 1729, 5, 102, 0, 0, 1729, 1730, 5, 39, 0, 0, 1730, 1731, 1, 0, 0, 0, 1731, 1732, 6, 210, 5, 0, 1732, 427, 1, 0, 0, 0, 1733, 1734, 5, 70, 0, 0, 1734, 1735, 5, 39, 0, 0, 1735, 1736, 1, 0, 0, 0, 1736, 1737, 6, 211, 6, 0, 1737, 429, 1, 0, 0, 0, 1738, 1739, 5, 39, 0, 0, 1739, 431, 1, 0, 0, 0, 1740, 1741, 5, 126, 0, 0, 1741, 433, 1, 0, 0, 0, 1742, 1743, 5, 61, 0, 0, 1743, 1744, 5, 126, 0, 0, 1744, 435, 1, 0, 0, 0, 1745, 1746, 5, 125, 0, 0, 1746, 1747, 1, 0, 0, 0, 1747, 1748, 6, 215, 7, 0, 1748, 437, 1, 0, 0, 0, 1749, 1750, 5, 93, 0, 0, 1750, 439, 1, 0, 0, 0, 1751, 1752, 5, 41, 0, 0, 1752, 441, 1, 0, 0, 0, 1753, 1754, 5, 59, 0, 0, 1754, 443, 1, 0, 0, 0, 1755, 1756, 5, 47, 0, 0, 1756, 445, 1, 0, 0, 0, 1757, 1758, 5, 47, 0, 0, 1758, 1759, 5, 62, 0, 0, 1759, 447, 1, 0, 0, 0, 1760, 1761, 5, 95, 0, 0, 1761, 449, 1, 0, 0, 0, 1762, 1763, 5, 47, 0, 0, 1763, 1764, 5, 42, 0, 0, 1764, 1768, 1, 0, 0, 0, 1765, 1767, 9, 0, 0, 0, 1766, 1765, 1, 0, 0, 0, 1767, 1770, 1, 0, 0, 0, 1768, 1769, 1, 0, 0, 0, 1768, 1766, 1, 0, 0, 0, 1769, 1771, 1, 0, 0, 0, 1770, 1768, 1, 0, 0, 0, 1771, 1772, 5, 42, 0, 0, 1772, 1773, 5, 47, 0, 0, 1773, 1774, 1, 0, 0, 0, 1774, 1775, 6, 222, 8, 0, 1775, 451, 1, 0, 0, 0, 1776, 1777, 5, 45, 0, 0, 1777, 1781, 5, 45, 0, 0, 1778, 1779, 5, 47, 0, 0, 1779, 1781, 5, 47, 0, 0, 1780, 1776, 1, 0, 0, 0, 1780, 1778, 1, 0, 0, 0, 1781, 1785, 1, 0, 0, 0, 1782, 1784, 8, 34, 0, 0, 1783, 1782, 1, 0, 0, 0, 1784, 1787, 1, 0, 0, 0, 1785, 1783, 1, 0, 0, 0, 1785, 1786, 1, 0, 0, 0, 1786, 1789, 1, 0, 0, 0, 1787, 1785, 1, 0, 0, 0, 1788, 1790, 7, 35, 0, 0, 1789, 1788, 1, 0, 0, 0, 1790, 1791, 1, 0, 0, 0, 1791, 1792, 6, 223, 8, 0, 1792, 453, 1, 0, 0, 0, 1793, 1794, 7, 36, 0, 0, 1794, 1795, 1, 0, 0, 0, 1795, 1796, 6, 224, 9, 0, 1796, 455, 1, 0, 0, 0, 1797, 1798, 9, 0, 0, 0, 1798, 457, 1, 0, 0, 0, 1799, 1811, 8, 37, 0, 0, 1800, 1811, 3, 270, 132, 0, 1801, 1802, 3, 360, 177, 0, 1802, 1803, 3, 430, 212, 0, 1803, 1811, 1, 0, 0, 0, 1804, 1805, 3, 360, 177, 0, 1805, 1806, 3, 392, 193, 0, 1806, 1811, 1, 0, 0, 0, 1807, 1808, 3, 430, 212, 0, 1808, 1809, 3, 430, 212, 0, 1809, 1811, 1, 0, 0, 0, 1810, 1799, 1, 0, 0, 0, 1810, 1800, 1, 0, 0, 0, 1810, 1801, 1, 0, 0, 0, 1810, 1804, 1, 0, 0, 0, 1810, 1807, 1, 0, 0, 0, 1811, 1812, 1, 0, 0, 0, 1812, 1810, 1, 0, 0, 0, 1812, 1813, 1, 0, 0, 0, 1813, 459, 1, 0, 0, 0, 1814, 1815, 3, 392, 193, 0, 1815, 1816, 1, 0, 0, 0, 1816, 1817, 6, 227, 0, 0, 1817, 461, 1, 0, 0, 0, 1818, 1819, 3, 430, 212, 0, 1819, 1820, 1, 0, 0, 0, 1820, 1821, 6, 228, 10, 0, 1821, 1822, 6, 228, 7, 0, 1822, 463, 1, 0, 0, 0, 1823, 1829, 8, 38, 0, 0, 1824, 1829, 3, 270, 132, 0, 1825, 1826, 3, 360, 177, 0, 1826, 1827, 3, 392, 193, 0, 1827, 1829, 1, 0, 0, 0, 1828, 1823, 1, 0, 0, 0, 1828, 1824, 1, 0, 0, 0, 1828, 1825, 1, 0, 0, 0, 1829, 1830, 1, 0, 0, 0, 1830, 1828, 1, 0, 0, 0, 1830, 1831, 1, 0, 0, 0, 1831, 465, 1, 0, 0, 0, 1832, 1833, 3, 392, 193, 0, 1833, 1834, 1, 0, 0, 0, 1834, 1835, 6, 230, 0, 0, 1835, 467, 1, 0, 0, 0, 1836, 1837, 5, 47, 0, 0, 1837, 1838, 5, 62, 0, 0, 1838, 1839, 1, 0, 0, 0, 1839, 1840, 6, 231, 11, 0, 1840, 1841, 6, 231, 7, 0, 1841, 469, 1, 0, 0, 0, 1842, 1843, 5, 62, 0, 0, 1843, 1844, 1, 0, 0, 0, 1844, 1845, 6, 232, 12, 0, 1845, 1846, 6, 232, 7, 0, 1846, 1847, 6, 232, 13, 0, 1847, 471, 1, 0, 0, 0, 1848, 1852, 7, 39, 0, 0, 1849, 1851, 7, 40, 0, 0, 1850, 1849, 1, 0, 0, 0, 1851, 1854, 1, 0, 0, 0, 1852, 1850, 1, 0, 0, 0, 1852, 1853, 1, 0, 0, 0, 1853, 1855, 1, 0, 0, 0, 1854, 1852, 1, 0, 0, 0, 1855, 1856, 6, 233, 14, 0, 1856, 473, 1, 0, 0, 0, 1857, 1858, 5, 61, 0, 0, 1858, 1859, 1, 0, 0, 0, 1859, 1860, 6, 234, 15, 0, 1860, 475, 1, 0, 0, 0, 1861, 1862, 3, 290, 142, 0, 1862, 1863, 1, 0, 0, 0, 1863, 1864, 6, 235, 16, 0, 1864, 477, 1, 0, 0, 0, 1865, 1867, 7, 41, 0, 0, 1866, 1865, 1, 0, 0, 0, 1867, 1868, 1, 0, 0, 0, 1868, 1866, 1, 0, 0, 0, 1868, 1869, 1, 0, 0, 0, 1869, 1870, 1, 0, 0, 0, 1870, 1871, 6, 236, 9, 0, 1871, 479, 1, 0, 0, 0, 1872, 1873, 5, 123, 0, 0, 1873, 1874, 1, 0, 0, 0, 1874, 1875, 6, 237, 17, 0, 1875, 1876, 6, 237, 0, 0, 1876, 481, 1, 0, 0, 0, 1877, 1878, 5, 62, 0, 0, 1878, 1879, 1, 0, 0, 0, 1879, 1880, 6, 238, 12, 0, 1880, 1881, 6, 238, 7, 0, 1881, 483, 1, 0, 0, 0, 1882, 1886, 7, 39, 0, 0, 1883, 1885, 7, 40, 0, 0, 1884, 1883, 1, 0, 0, 0, 1885, 1888, 1, 0, 0, 0, 1886, 1884, 1, 0, 0, 0, 1886, 1887, 1, 0, 0, 0, 1887, 1889, 1, 0, 0, 0, 1888, 1886, 1, 0, 0, 0, 1889, 1890, 6, 239, 14, 0, 1890, 485, 1, 0, 0, 0, 1891, 1893, 7, 41, 0, 0, 1892, 1891, 1, 0, 0, 0, 1893, 1894, 1, 0, 0, 0, 1894, 1892, 1, 0, 0, 0, 1894, 1895, 1, 0, 0, 0, 1895, 1896, 1, 0, 0, 0, 1896, 1897, 6, 240, 9, 0, 1897, 487, 1, 0, 0, 0, 1898, 1900, 8, 42, 0, 0, 1899, 1898, 1, 0, 0, 0, 1900, 1901, 1, 0, 0, 0, 1901, 1899, 1, 0, 0, 0, 1901, 1902, 1, 0, 0, 0, 1902, 489, 1, 0, 0, 0, 1903, 1904, 5, 123, 0, 0, 1904, 1905, 1, 0, 0, 0, 1905, 1906, 6, 242, 17, 0, 1906, 1907, 6, 242, 0, 0, 1907, 491, 1, 0, 0, 0, 1908, 1909, 5, 60, 0, 0, 1909, 1910, 5, 47, 0, 0, 1910, 1911, 1, 0, 0, 0, 1911, 1912, 6, 243, 1, 0, 1912, 1913, 6, 243, 7, 0, 1913, 1914, 6, 243, 2, 0, 1914, 493, 1, 0, 0, 0, 1915, 1916, 5, 60, 0, 0, 1916, 1917, 1, 0, 0, 0, 1917, 1918, 6, 244, 3, 0, 1918, 1919, 6, 244, 4, 0, 1919, 495, 1, 0, 0, 0, 1920, 1922, 7, 41, 0, 0, 1921, 1920, 1, 0, 0, 0, 1922, 1923, 1, 0, 0, 0, 1923, 1921, 1, 0, 0, 0, 1923, 1924, 1, 0, 0, 0, 1924, 1925, 1, 0, 0, 0, 1925, 1926, 6, 245, 9, 0, 1926, 497, 1, 0, 0, 0, 56, 0, 1, 2, 3, 4, 5, 538, 818, 1347, 1381, 1386, 1392, 1394, 1406, 1408, 1422, 1424, 1429, 1436, 1441, 1445, 1450, 1455, 1459, 1464, 1471, 1477, 1482, 1489, 1494, 1500, 1505, 1507, 1514, 1520, 1525, 1532, 1539, 1546, 1557, 1559, 1705, 1768, 1780, 1785, 1789, 1810, 1812, 1828, 1830, 1852, 1868, 1886, 1894, 1901, 1923, 18, 5, 0, 0, 7, 168, 0, 5, 4, 0, 7, 167, 0, 5, 3, 0, 5, 1, 0, 5, 2, 0, 4, 0, 0, 6, 0, 0, 0, 1, 0, 7, 180, 0, 7, 188, 0, 7, 159, 0, 5, 5, 0, 7, 134, 0, 7, 157, 0, 7, 143, 0, 7, 163, 0]
\ No newline at end of file
+[4, 0, 205, 2003, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 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, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103, 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, 108, 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 2, 111, 7, 111, 2, 112, 7, 112, 2, 113, 7, 113, 2, 114, 7, 114, 2, 115, 7, 115, 2, 116, 7, 116, 2, 117, 7, 117, 2, 118, 7, 118, 2, 119, 7, 119, 2, 120, 7, 120, 2, 121, 7, 121, 2, 122, 7, 122, 2, 123, 7, 123, 2, 124, 7, 124, 2, 125, 7, 125, 2, 126, 7, 126, 2, 127, 7, 127, 2, 128, 7, 128, 2, 129, 7, 129, 2, 130, 7, 130, 2, 131, 7, 131, 2, 132, 7, 132, 2, 133, 7, 133, 2, 134, 7, 134, 2, 135, 7, 135, 2, 136, 7, 136, 2, 137, 7, 137, 2, 138, 7, 138, 2, 139, 7, 139, 2, 140, 7, 140, 2, 141, 7, 141, 2, 142, 7, 142, 2, 143, 7, 143, 2, 144, 7, 144, 2, 145, 7, 145, 2, 146, 7, 146, 2, 147, 7, 147, 2, 148, 7, 148, 2, 149, 7, 149, 2, 150, 7, 150, 2, 151, 7, 151, 2, 152, 7, 152, 2, 153, 7, 153, 2, 154, 7, 154, 2, 155, 7, 155, 2, 156, 7, 156, 2, 157, 7, 157, 2, 158, 7, 158, 2, 159, 7, 159, 2, 160, 7, 160, 2, 161, 7, 161, 2, 162, 7, 162, 2, 163, 7, 163, 2, 164, 7, 164, 2, 165, 7, 165, 2, 166, 7, 166, 2, 167, 7, 167, 2, 168, 7, 168, 2, 169, 7, 169, 2, 170, 7, 170, 2, 171, 7, 171, 2, 172, 7, 172, 2, 173, 7, 173, 2, 174, 7, 174, 2, 175, 7, 175, 2, 176, 7, 176, 2, 177, 7, 177, 2, 178, 7, 178, 2, 179, 7, 179, 2, 180, 7, 180, 2, 181, 7, 181, 2, 182, 7, 182, 2, 183, 7, 183, 2, 184, 7, 184, 2, 185, 7, 185, 2, 186, 7, 186, 2, 187, 7, 187, 2, 188, 7, 188, 2, 189, 7, 189, 2, 190, 7, 190, 2, 191, 7, 191, 2, 192, 7, 192, 2, 193, 7, 193, 2, 194, 7, 194, 2, 195, 7, 195, 2, 196, 7, 196, 2, 197, 7, 197, 2, 198, 7, 198, 2, 199, 7, 199, 2, 200, 7, 200, 2, 201, 7, 201, 2, 202, 7, 202, 2, 203, 7, 203, 2, 204, 7, 204, 2, 205, 7, 205, 2, 206, 7, 206, 2, 207, 7, 207, 2, 208, 7, 208, 2, 209, 7, 209, 2, 210, 7, 210, 2, 211, 7, 211, 2, 212, 7, 212, 2, 213, 7, 213, 2, 214, 7, 214, 2, 215, 7, 215, 2, 216, 7, 216, 2, 217, 7, 217, 2, 218, 7, 218, 2, 219, 7, 219, 2, 220, 7, 220, 2, 221, 7, 221, 2, 222, 7, 222, 2, 223, 7, 223, 2, 224, 7, 224, 2, 225, 7, 225, 2, 226, 7, 226, 2, 227, 7, 227, 2, 228, 7, 228, 2, 229, 7, 229, 2, 230, 7, 230, 2, 231, 7, 231, 2, 232, 7, 232, 2, 233, 7, 233, 2, 234, 7, 234, 2, 235, 7, 235, 2, 236, 7, 236, 2, 237, 7, 237, 2, 238, 7, 238, 2, 239, 7, 239, 2, 240, 7, 240, 2, 241, 7, 241, 2, 242, 7, 242, 2, 243, 7, 243, 2, 244, 7, 244, 2, 245, 7, 245, 2, 246, 7, 246, 2, 247, 7, 247, 2, 248, 7, 248, 2, 249, 7, 249, 2, 250, 7, 250, 2, 251, 7, 251, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 551, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 50, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 3, 51, 831, 8, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 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, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 56, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, 1, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 62, 1, 62, 1, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 71, 1, 71, 1, 71, 1, 71, 1, 72, 1, 72, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 75, 1, 75, 1, 75, 1, 75, 1, 75, 1, 75, 1, 75, 1, 76, 1, 76, 1, 76, 1, 77, 1, 77, 1, 77, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 82, 1, 82, 1, 82, 1, 82, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 94, 1, 94, 1, 94, 1, 94, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 109, 1, 109, 1, 109, 1, 109, 1, 109, 1, 109, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 111, 1, 111, 1, 111, 1, 112, 1, 112, 1, 112, 1, 112, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 115, 1, 115, 1, 115, 1, 115, 1, 115, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 117, 1, 117, 1, 117, 1, 117, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 120, 1, 120, 1, 120, 1, 120, 1, 120, 1, 120, 1, 121, 1, 121, 1, 121, 1, 121, 1, 121, 1, 121, 1, 121, 1, 121, 1, 122, 1, 122, 1, 122, 1, 122, 1, 122, 1, 122, 1, 123, 1, 123, 1, 123, 1, 123, 1, 123, 1, 123, 1, 123, 1, 124, 1, 124, 1, 124, 1, 124, 1, 124, 1, 125, 1, 125, 1, 125, 1, 125, 1, 125, 1, 126, 1, 126, 1, 126, 1, 126, 1, 126, 1, 126, 1, 127, 1, 127, 1, 127, 1, 127, 1, 127, 1, 127, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 1, 129, 1, 129, 1, 129, 1, 129, 1, 129, 1, 130, 1, 130, 1, 130, 1, 130, 1, 130, 1, 130, 1, 130, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 3, 131, 1360, 8, 131, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 3, 132, 1394, 8, 132, 1, 133, 1, 133, 1, 133, 3, 133, 1399, 8, 133, 1, 133, 1, 133, 1, 133, 1, 133, 5, 133, 1405, 8, 133, 10, 133, 12, 133, 1408, 9, 133, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 5, 134, 1419, 8, 134, 10, 134, 12, 134, 1422, 9, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 5, 134, 1435, 8, 134, 10, 134, 12, 134, 1438, 9, 134, 1, 134, 1, 134, 3, 134, 1442, 8, 134, 1, 135, 1, 135, 1, 135, 5, 135, 1447, 8, 135, 10, 135, 12, 135, 1450, 9, 135, 1, 135, 1, 135, 1, 135, 3, 135, 1455, 8, 135, 1, 135, 4, 135, 1458, 8, 135, 11, 135, 12, 135, 1459, 1, 135, 1, 135, 1, 135, 1, 135, 3, 135, 1466, 8, 135, 1, 135, 4, 135, 1469, 8, 135, 11, 135, 12, 135, 1470, 1, 135, 1, 135, 1, 135, 5, 135, 1476, 8, 135, 10, 135, 12, 135, 1479, 9, 135, 1, 135, 1, 135, 1, 135, 3, 135, 1484, 8, 135, 1, 135, 4, 135, 1487, 8, 135, 11, 135, 12, 135, 1488, 1, 135, 1, 135, 1, 135, 1, 135, 1, 135, 3, 135, 1496, 8, 135, 1, 135, 4, 135, 1499, 8, 135, 11, 135, 12, 135, 1500, 1, 135, 1, 135, 1, 135, 1, 135, 3, 135, 1507, 8, 135, 1, 135, 4, 135, 1510, 8, 135, 11, 135, 12, 135, 1511, 3, 135, 1514, 8, 135, 1, 136, 1, 136, 1, 136, 4, 136, 1519, 8, 136, 11, 136, 12, 136, 1520, 1, 137, 1, 137, 4, 137, 1525, 8, 137, 11, 137, 12, 137, 1526, 1, 138, 4, 138, 1530, 8, 138, 11, 138, 12, 138, 1531, 1, 139, 1, 139, 1, 139, 4, 139, 1537, 8, 139, 11, 139, 12, 139, 1538, 1, 140, 1, 140, 1, 140, 4, 140, 1544, 8, 140, 11, 140, 12, 140, 1545, 1, 141, 1, 141, 1, 141, 4, 141, 1551, 8, 141, 11, 141, 12, 141, 1552, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 5, 142, 1564, 8, 142, 10, 142, 12, 142, 1567, 9, 142, 1, 142, 1, 142, 1, 143, 1, 143, 1, 144, 1, 144, 1, 145, 1, 145, 1, 146, 1, 146, 1, 147, 1, 147, 1, 148, 1, 148, 1, 149, 1, 149, 1, 150, 1, 150, 1, 151, 1, 151, 1, 152, 1, 152, 1, 153, 1, 153, 1, 154, 1, 154, 1, 155, 1, 155, 1, 156, 1, 156, 1, 157, 1, 157, 1, 158, 1, 158, 1, 159, 1, 159, 1, 160, 1, 160, 1, 161, 1, 161, 1, 162, 1, 162, 1, 163, 1, 163, 1, 164, 1, 164, 1, 165, 1, 165, 1, 166, 1, 166, 1, 167, 1, 167, 1, 168, 1, 168, 1, 169, 1, 169, 1, 170, 1, 170, 1, 171, 1, 171, 1, 172, 1, 172, 1, 173, 1, 173, 1, 174, 1, 174, 1, 174, 1, 175, 1, 175, 1, 176, 1, 176, 1, 177, 1, 177, 1, 178, 1, 178, 1, 178, 1, 179, 1, 179, 1, 179, 1, 180, 1, 180, 1, 181, 1, 181, 1, 182, 1, 182, 1, 182, 1, 183, 1, 183, 1, 184, 1, 184, 1, 185, 1, 185, 1, 186, 1, 186, 1, 186, 1, 187, 1, 187, 1, 188, 1, 188, 1, 188, 1, 189, 1, 189, 1, 190, 1, 190, 1, 191, 1, 191, 1, 191, 1, 192, 1, 192, 1, 192, 1, 192, 1, 193, 1, 193, 1, 193, 1, 193, 1, 194, 1, 194, 1, 195, 1, 195, 1, 196, 1, 196, 1, 196, 1, 197, 1, 197, 1, 197, 1, 197, 1, 197, 1, 197, 1, 198, 1, 198, 1, 198, 1, 198, 1, 198, 1, 198, 1, 199, 1, 199, 1, 200, 1, 200, 1, 200, 1, 201, 1, 201, 1, 201, 1, 201, 3, 201, 1712, 8, 201, 1, 202, 1, 202, 1, 202, 1, 202, 1, 203, 1, 203, 1, 203, 1, 204, 1, 204, 1, 204, 1, 205, 1, 205, 1, 205, 1, 206, 1, 206, 1, 207, 1, 207, 1, 208, 1, 208, 1, 209, 1, 209, 1, 210, 1, 210, 1, 210, 1, 210, 1, 210, 1, 211, 1, 211, 1, 211, 1, 211, 1, 211, 1, 212, 1, 212, 1, 213, 1, 213, 1, 214, 1, 214, 1, 214, 1, 215, 1, 215, 1, 215, 1, 215, 1, 216, 1, 216, 1, 217, 1, 217, 1, 218, 1, 218, 1, 219, 1, 219, 1, 220, 1, 220, 1, 220, 1, 221, 1, 221, 1, 222, 1, 222, 1, 222, 1, 222, 5, 222, 1773, 8, 222, 10, 222, 12, 222, 1776, 9, 222, 1, 222, 1, 222, 1, 222, 1, 222, 1, 222, 1, 223, 1, 223, 1, 223, 1, 223, 3, 223, 1787, 8, 223, 1, 223, 5, 223, 1790, 8, 223, 10, 223, 12, 223, 1793, 9, 223, 1, 223, 3, 223, 1796, 8, 223, 1, 223, 1, 223, 1, 224, 1, 224, 1, 224, 1, 224, 1, 225, 1, 225, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 4, 226, 1817, 8, 226, 11, 226, 12, 226, 1818, 1, 227, 1, 227, 1, 227, 1, 227, 1, 228, 1, 228, 1, 228, 1, 228, 1, 228, 1, 229, 1, 229, 1, 229, 1, 229, 1, 229, 4, 229, 1835, 8, 229, 11, 229, 12, 229, 1836, 1, 230, 1, 230, 1, 230, 1, 230, 1, 231, 1, 231, 1, 231, 1, 231, 1, 231, 1, 231, 1, 232, 1, 232, 1, 232, 1, 232, 1, 232, 1, 232, 1, 233, 1, 233, 1, 233, 1, 233, 5, 233, 1859, 8, 233, 10, 233, 12, 233, 1862, 9, 233, 1, 233, 1, 233, 1, 233, 1, 233, 1, 233, 1, 234, 1, 234, 1, 234, 1, 234, 3, 234, 1873, 8, 234, 1, 234, 5, 234, 1876, 8, 234, 10, 234, 12, 234, 1879, 9, 234, 1, 234, 3, 234, 1882, 8, 234, 1, 234, 1, 234, 1, 235, 1, 235, 5, 235, 1888, 8, 235, 10, 235, 12, 235, 1891, 9, 235, 1, 235, 1, 235, 1, 236, 1, 236, 1, 236, 1, 236, 1, 237, 1, 237, 1, 237, 1, 237, 1, 238, 4, 238, 1904, 8, 238, 11, 238, 12, 238, 1905, 1, 238, 1, 238, 1, 239, 1, 239, 1, 239, 1, 239, 1, 239, 1, 240, 1, 240, 1, 240, 1, 240, 1, 241, 1, 241, 1, 241, 1, 241, 1, 241, 1, 242, 1, 242, 1, 242, 1, 242, 5, 242, 1928, 8, 242, 10, 242, 12, 242, 1931, 9, 242, 1, 242, 1, 242, 1, 242, 1, 242, 1, 242, 1, 243, 1, 243, 1, 243, 1, 243, 3, 243, 1942, 8, 243, 1, 243, 5, 243, 1945, 8, 243, 10, 243, 12, 243, 1948, 9, 243, 1, 243, 3, 243, 1951, 8, 243, 1, 243, 1, 243, 1, 244, 1, 244, 5, 244, 1957, 8, 244, 10, 244, 12, 244, 1960, 9, 244, 1, 244, 1, 244, 1, 245, 4, 245, 1965, 8, 245, 11, 245, 12, 245, 1966, 1, 245, 1, 245, 1, 246, 1, 246, 1, 246, 1, 246, 1, 247, 4, 247, 1976, 8, 247, 11, 247, 12, 247, 1977, 1, 248, 1, 248, 1, 248, 1, 248, 1, 248, 1, 249, 1, 249, 1, 249, 1, 249, 1, 249, 1, 249, 1, 249, 1, 250, 1, 250, 1, 250, 1, 250, 1, 250, 1, 251, 4, 251, 1998, 8, 251, 11, 251, 12, 251, 1999, 1, 251, 1, 251, 3, 1774, 1860, 1929, 0, 252, 6, 1, 8, 2, 10, 3, 12, 4, 14, 5, 16, 6, 18, 7, 20, 8, 22, 9, 24, 10, 26, 11, 28, 12, 30, 13, 32, 14, 34, 15, 36, 16, 38, 17, 40, 18, 42, 19, 44, 20, 46, 21, 48, 22, 50, 23, 52, 24, 54, 25, 56, 26, 58, 27, 60, 28, 62, 29, 64, 30, 66, 31, 68, 32, 70, 33, 72, 34, 74, 35, 76, 36, 78, 37, 80, 38, 82, 39, 84, 40, 86, 41, 88, 42, 90, 43, 92, 44, 94, 45, 96, 46, 98, 47, 100, 48, 102, 49, 104, 50, 106, 51, 108, 52, 110, 53, 112, 54, 114, 55, 116, 56, 118, 57, 120, 58, 122, 59, 124, 60, 126, 61, 128, 62, 130, 63, 132, 64, 134, 65, 136, 66, 138, 67, 140, 68, 142, 69, 144, 70, 146, 71, 148, 72, 150, 73, 152, 74, 154, 75, 156, 76, 158, 77, 160, 78, 162, 79, 164, 80, 166, 81, 168, 82, 170, 83, 172, 84, 174, 85, 176, 86, 178, 87, 180, 88, 182, 89, 184, 90, 186, 91, 188, 92, 190, 93, 192, 94, 194, 95, 196, 96, 198, 97, 200, 98, 202, 99, 204, 100, 206, 101, 208, 102, 210, 103, 212, 104, 214, 105, 216, 106, 218, 107, 220, 108, 222, 109, 224, 110, 226, 111, 228, 112, 230, 113, 232, 114, 234, 115, 236, 116, 238, 117, 240, 118, 242, 119, 244, 120, 246, 121, 248, 122, 250, 123, 252, 124, 254, 125, 256, 126, 258, 127, 260, 128, 262, 129, 264, 130, 266, 131, 268, 132, 270, 133, 272, 134, 274, 135, 276, 136, 278, 137, 280, 138, 282, 139, 284, 140, 286, 141, 288, 142, 290, 143, 292, 0, 294, 0, 296, 0, 298, 0, 300, 0, 302, 0, 304, 0, 306, 0, 308, 0, 310, 0, 312, 0, 314, 0, 316, 0, 318, 0, 320, 0, 322, 0, 324, 0, 326, 0, 328, 0, 330, 0, 332, 0, 334, 0, 336, 0, 338, 0, 340, 0, 342, 0, 344, 0, 346, 0, 348, 0, 350, 0, 352, 0, 354, 144, 356, 145, 358, 146, 360, 147, 362, 148, 364, 149, 366, 150, 368, 151, 370, 152, 372, 153, 374, 154, 376, 155, 378, 156, 380, 157, 382, 158, 384, 159, 386, 160, 388, 161, 390, 162, 392, 163, 394, 164, 396, 165, 398, 166, 400, 0, 402, 0, 404, 167, 406, 168, 408, 169, 410, 170, 412, 171, 414, 172, 416, 173, 418, 174, 420, 175, 422, 176, 424, 177, 426, 178, 428, 179, 430, 180, 432, 181, 434, 182, 436, 183, 438, 184, 440, 185, 442, 186, 444, 187, 446, 188, 448, 189, 450, 190, 452, 191, 454, 192, 456, 193, 458, 194, 460, 195, 462, 0, 464, 196, 466, 197, 468, 0, 470, 0, 472, 198, 474, 199, 476, 0, 478, 0, 480, 0, 482, 200, 484, 0, 486, 0, 488, 0, 490, 201, 492, 202, 494, 0, 496, 203, 498, 0, 500, 204, 502, 0, 504, 0, 506, 0, 508, 205, 6, 0, 1, 2, 3, 4, 5, 43, 2, 0, 92, 92, 96, 96, 2, 0, 34, 34, 92, 92, 2, 0, 79, 79, 111, 111, 2, 0, 66, 66, 98, 98, 2, 0, 39, 39, 92, 92, 2, 0, 65, 65, 97, 97, 2, 0, 67, 67, 99, 99, 2, 0, 68, 68, 100, 100, 2, 0, 69, 69, 101, 101, 2, 0, 70, 70, 102, 102, 2, 0, 71, 71, 103, 103, 2, 0, 72, 72, 104, 104, 2, 0, 73, 73, 105, 105, 2, 0, 74, 74, 106, 106, 2, 0, 75, 75, 107, 107, 2, 0, 76, 76, 108, 108, 2, 0, 77, 77, 109, 109, 2, 0, 78, 78, 110, 110, 2, 0, 80, 80, 112, 112, 2, 0, 81, 81, 113, 113, 2, 0, 82, 82, 114, 114, 2, 0, 83, 83, 115, 115, 2, 0, 84, 84, 116, 116, 2, 0, 85, 85, 117, 117, 2, 0, 86, 86, 118, 118, 2, 0, 87, 87, 119, 119, 2, 0, 88, 88, 120, 120, 2, 0, 89, 89, 121, 121, 2, 0, 90, 90, 122, 122, 2, 0, 65, 90, 97, 122, 1, 0, 48, 49, 1, 0, 48, 55, 1, 0, 48, 57, 3, 0, 48, 57, 65, 70, 97, 102, 2, 0, 10, 10, 13, 13, 2, 1, 10, 10, 13, 13, 11, 0, 9, 13, 32, 32, 133, 133, 160, 160, 5760, 5760, 8192, 8202, 8232, 8233, 8239, 8239, 8287, 8287, 12288, 12288, 65279, 65279, 3, 0, 39, 39, 92, 92, 123, 123, 1, 0, 123, 123, 3, 0, 65, 90, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, 95, 95, 97, 122, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 60, 60, 123, 123, 2048, 0, 6, 1, 0, 0, 0, 0, 8, 1, 0, 0, 0, 0, 10, 1, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 14, 1, 0, 0, 0, 0, 16, 1, 0, 0, 0, 0, 18, 1, 0, 0, 0, 0, 20, 1, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 24, 1, 0, 0, 0, 0, 26, 1, 0, 0, 0, 0, 28, 1, 0, 0, 0, 0, 30, 1, 0, 0, 0, 0, 32, 1, 0, 0, 0, 0, 34, 1, 0, 0, 0, 0, 36, 1, 0, 0, 0, 0, 38, 1, 0, 0, 0, 0, 40, 1, 0, 0, 0, 0, 42, 1, 0, 0, 0, 0, 44, 1, 0, 0, 0, 0, 46, 1, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 50, 1, 0, 0, 0, 0, 52, 1, 0, 0, 0, 0, 54, 1, 0, 0, 0, 0, 56, 1, 0, 0, 0, 0, 58, 1, 0, 0, 0, 0, 60, 1, 0, 0, 0, 0, 62, 1, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 66, 1, 0, 0, 0, 0, 68, 1, 0, 0, 0, 0, 70, 1, 0, 0, 0, 0, 72, 1, 0, 0, 0, 0, 74, 1, 0, 0, 0, 0, 76, 1, 0, 0, 0, 0, 78, 1, 0, 0, 0, 0, 80, 1, 0, 0, 0, 0, 82, 1, 0, 0, 0, 0, 84, 1, 0, 0, 0, 0, 86, 1, 0, 0, 0, 0, 88, 1, 0, 0, 0, 0, 90, 1, 0, 0, 0, 0, 92, 1, 0, 0, 0, 0, 94, 1, 0, 0, 0, 0, 96, 1, 0, 0, 0, 0, 98, 1, 0, 0, 0, 0, 100, 1, 0, 0, 0, 0, 102, 1, 0, 0, 0, 0, 104, 1, 0, 0, 0, 0, 106, 1, 0, 0, 0, 0, 108, 1, 0, 0, 0, 0, 110, 1, 0, 0, 0, 0, 112, 1, 0, 0, 0, 0, 114, 1, 0, 0, 0, 0, 116, 1, 0, 0, 0, 0, 118, 1, 0, 0, 0, 0, 120, 1, 0, 0, 0, 0, 122, 1, 0, 0, 0, 0, 124, 1, 0, 0, 0, 0, 126, 1, 0, 0, 0, 0, 128, 1, 0, 0, 0, 0, 130, 1, 0, 0, 0, 0, 132, 1, 0, 0, 0, 0, 134, 1, 0, 0, 0, 0, 136, 1, 0, 0, 0, 0, 138, 1, 0, 0, 0, 0, 140, 1, 0, 0, 0, 0, 142, 1, 0, 0, 0, 0, 144, 1, 0, 0, 0, 0, 146, 1, 0, 0, 0, 0, 148, 1, 0, 0, 0, 0, 150, 1, 0, 0, 0, 0, 152, 1, 0, 0, 0, 0, 154, 1, 0, 0, 0, 0, 156, 1, 0, 0, 0, 0, 158, 1, 0, 0, 0, 0, 160, 1, 0, 0, 0, 0, 162, 1, 0, 0, 0, 0, 164, 1, 0, 0, 0, 0, 166, 1, 0, 0, 0, 0, 168, 1, 0, 0, 0, 0, 170, 1, 0, 0, 0, 0, 172, 1, 0, 0, 0, 0, 174, 1, 0, 0, 0, 0, 176, 1, 0, 0, 0, 0, 178, 1, 0, 0, 0, 0, 180, 1, 0, 0, 0, 0, 182, 1, 0, 0, 0, 0, 184, 1, 0, 0, 0, 0, 186, 1, 0, 0, 0, 0, 188, 1, 0, 0, 0, 0, 190, 1, 0, 0, 0, 0, 192, 1, 0, 0, 0, 0, 194, 1, 0, 0, 0, 0, 196, 1, 0, 0, 0, 0, 198, 1, 0, 0, 0, 0, 200, 1, 0, 0, 0, 0, 202, 1, 0, 0, 0, 0, 204, 1, 0, 0, 0, 0, 206, 1, 0, 0, 0, 0, 208, 1, 0, 0, 0, 0, 210, 1, 0, 0, 0, 0, 212, 1, 0, 0, 0, 0, 214, 1, 0, 0, 0, 0, 216, 1, 0, 0, 0, 0, 218, 1, 0, 0, 0, 0, 220, 1, 0, 0, 0, 0, 222, 1, 0, 0, 0, 0, 224, 1, 0, 0, 0, 0, 226, 1, 0, 0, 0, 0, 228, 1, 0, 0, 0, 0, 230, 1, 0, 0, 0, 0, 232, 1, 0, 0, 0, 0, 234, 1, 0, 0, 0, 0, 236, 1, 0, 0, 0, 0, 238, 1, 0, 0, 0, 0, 240, 1, 0, 0, 0, 0, 242, 1, 0, 0, 0, 0, 244, 1, 0, 0, 0, 0, 246, 1, 0, 0, 0, 0, 248, 1, 0, 0, 0, 0, 250, 1, 0, 0, 0, 0, 252, 1, 0, 0, 0, 0, 254, 1, 0, 0, 0, 0, 256, 1, 0, 0, 0, 0, 258, 1, 0, 0, 0, 0, 260, 1, 0, 0, 0, 0, 262, 1, 0, 0, 0, 0, 264, 1, 0, 0, 0, 0, 266, 1, 0, 0, 0, 0, 268, 1, 0, 0, 0, 0, 270, 1, 0, 0, 0, 0, 272, 1, 0, 0, 0, 0, 274, 1, 0, 0, 0, 0, 276, 1, 0, 0, 0, 0, 278, 1, 0, 0, 0, 0, 280, 1, 0, 0, 0, 0, 282, 1, 0, 0, 0, 0, 284, 1, 0, 0, 0, 0, 286, 1, 0, 0, 0, 0, 288, 1, 0, 0, 0, 0, 290, 1, 0, 0, 0, 0, 354, 1, 0, 0, 0, 0, 356, 1, 0, 0, 0, 0, 358, 1, 0, 0, 0, 0, 360, 1, 0, 0, 0, 0, 362, 1, 0, 0, 0, 0, 364, 1, 0, 0, 0, 0, 366, 1, 0, 0, 0, 0, 368, 1, 0, 0, 0, 0, 370, 1, 0, 0, 0, 0, 372, 1, 0, 0, 0, 0, 374, 1, 0, 0, 0, 0, 376, 1, 0, 0, 0, 0, 378, 1, 0, 0, 0, 0, 380, 1, 0, 0, 0, 0, 382, 1, 0, 0, 0, 0, 384, 1, 0, 0, 0, 0, 386, 1, 0, 0, 0, 0, 388, 1, 0, 0, 0, 0, 390, 1, 0, 0, 0, 0, 392, 1, 0, 0, 0, 0, 394, 1, 0, 0, 0, 0, 396, 1, 0, 0, 0, 0, 398, 1, 0, 0, 0, 0, 400, 1, 0, 0, 0, 0, 402, 1, 0, 0, 0, 0, 404, 1, 0, 0, 0, 0, 406, 1, 0, 0, 0, 0, 408, 1, 0, 0, 0, 0, 410, 1, 0, 0, 0, 0, 412, 1, 0, 0, 0, 0, 414, 1, 0, 0, 0, 0, 416, 1, 0, 0, 0, 0, 418, 1, 0, 0, 0, 0, 420, 1, 0, 0, 0, 0, 422, 1, 0, 0, 0, 0, 424, 1, 0, 0, 0, 0, 426, 1, 0, 0, 0, 0, 428, 1, 0, 0, 0, 0, 430, 1, 0, 0, 0, 0, 432, 1, 0, 0, 0, 0, 434, 1, 0, 0, 0, 0, 436, 1, 0, 0, 0, 0, 438, 1, 0, 0, 0, 0, 440, 1, 0, 0, 0, 0, 442, 1, 0, 0, 0, 0, 444, 1, 0, 0, 0, 0, 446, 1, 0, 0, 0, 0, 448, 1, 0, 0, 0, 0, 450, 1, 0, 0, 0, 0, 452, 1, 0, 0, 0, 0, 454, 1, 0, 0, 0, 0, 456, 1, 0, 0, 0, 1, 458, 1, 0, 0, 0, 1, 460, 1, 0, 0, 0, 1, 462, 1, 0, 0, 0, 2, 464, 1, 0, 0, 0, 2, 466, 1, 0, 0, 0, 3, 468, 1, 0, 0, 0, 3, 470, 1, 0, 0, 0, 3, 472, 1, 0, 0, 0, 3, 474, 1, 0, 0, 0, 3, 476, 1, 0, 0, 0, 3, 478, 1, 0, 0, 0, 3, 480, 1, 0, 0, 0, 3, 482, 1, 0, 0, 0, 3, 484, 1, 0, 0, 0, 3, 486, 1, 0, 0, 0, 4, 488, 1, 0, 0, 0, 4, 490, 1, 0, 0, 0, 4, 492, 1, 0, 0, 0, 4, 494, 1, 0, 0, 0, 4, 496, 1, 0, 0, 0, 4, 498, 1, 0, 0, 0, 5, 500, 1, 0, 0, 0, 5, 502, 1, 0, 0, 0, 5, 504, 1, 0, 0, 0, 5, 506, 1, 0, 0, 0, 5, 508, 1, 0, 0, 0, 6, 510, 1, 0, 0, 0, 8, 514, 1, 0, 0, 0, 10, 518, 1, 0, 0, 0, 12, 523, 1, 0, 0, 0, 14, 527, 1, 0, 0, 0, 16, 533, 1, 0, 0, 0, 18, 550, 1, 0, 0, 0, 20, 552, 1, 0, 0, 0, 22, 557, 1, 0, 0, 0, 24, 565, 1, 0, 0, 0, 26, 570, 1, 0, 0, 0, 28, 573, 1, 0, 0, 0, 30, 578, 1, 0, 0, 0, 32, 583, 1, 0, 0, 0, 34, 589, 1, 0, 0, 0, 36, 596, 1, 0, 0, 0, 38, 604, 1, 0, 0, 0, 40, 612, 1, 0, 0, 0, 42, 618, 1, 0, 0, 0, 44, 623, 1, 0, 0, 0, 46, 631, 1, 0, 0, 0, 48, 636, 1, 0, 0, 0, 50, 640, 1, 0, 0, 0, 52, 645, 1, 0, 0, 0, 54, 656, 1, 0, 0, 0, 56, 665, 1, 0, 0, 0, 58, 670, 1, 0, 0, 0, 60, 674, 1, 0, 0, 0, 62, 681, 1, 0, 0, 0, 64, 689, 1, 0, 0, 0, 66, 697, 1, 0, 0, 0, 68, 703, 1, 0, 0, 0, 70, 708, 1, 0, 0, 0, 72, 715, 1, 0, 0, 0, 74, 723, 1, 0, 0, 0, 76, 729, 1, 0, 0, 0, 78, 732, 1, 0, 0, 0, 80, 742, 1, 0, 0, 0, 82, 746, 1, 0, 0, 0, 84, 751, 1, 0, 0, 0, 86, 756, 1, 0, 0, 0, 88, 760, 1, 0, 0, 0, 90, 766, 1, 0, 0, 0, 92, 775, 1, 0, 0, 0, 94, 782, 1, 0, 0, 0, 96, 787, 1, 0, 0, 0, 98, 790, 1, 0, 0, 0, 100, 793, 1, 0, 0, 0, 102, 799, 1, 0, 0, 0, 104, 806, 1, 0, 0, 0, 106, 814, 1, 0, 0, 0, 108, 830, 1, 0, 0, 0, 110, 832, 1, 0, 0, 0, 112, 838, 1, 0, 0, 0, 114, 848, 1, 0, 0, 0, 116, 860, 1, 0, 0, 0, 118, 869, 1, 0, 0, 0, 120, 872, 1, 0, 0, 0, 122, 877, 1, 0, 0, 0, 124, 881, 1, 0, 0, 0, 126, 888, 1, 0, 0, 0, 128, 893, 1, 0, 0, 0, 130, 901, 1, 0, 0, 0, 132, 906, 1, 0, 0, 0, 134, 910, 1, 0, 0, 0, 136, 915, 1, 0, 0, 0, 138, 921, 1, 0, 0, 0, 140, 934, 1, 0, 0, 0, 142, 941, 1, 0, 0, 0, 144, 947, 1, 0, 0, 0, 146, 952, 1, 0, 0, 0, 148, 960, 1, 0, 0, 0, 150, 964, 1, 0, 0, 0, 152, 968, 1, 0, 0, 0, 154, 973, 1, 0, 0, 0, 156, 979, 1, 0, 0, 0, 158, 986, 1, 0, 0, 0, 160, 989, 1, 0, 0, 0, 162, 992, 1, 0, 0, 0, 164, 998, 1, 0, 0, 0, 166, 1004, 1, 0, 0, 0, 168, 1009, 1, 0, 0, 0, 170, 1019, 1, 0, 0, 0, 172, 1025, 1, 0, 0, 0, 174, 1036, 1, 0, 0, 0, 176, 1046, 1, 0, 0, 0, 178, 1055, 1, 0, 0, 0, 180, 1063, 1, 0, 0, 0, 182, 1071, 1, 0, 0, 0, 184, 1077, 1, 0, 0, 0, 186, 1087, 1, 0, 0, 0, 188, 1095, 1, 0, 0, 0, 190, 1102, 1, 0, 0, 0, 192, 1108, 1, 0, 0, 0, 194, 1115, 1, 0, 0, 0, 196, 1119, 1, 0, 0, 0, 198, 1124, 1, 0, 0, 0, 200, 1131, 1, 0, 0, 0, 202, 1138, 1, 0, 0, 0, 204, 1145, 1, 0, 0, 0, 206, 1150, 1, 0, 0, 0, 208, 1155, 1, 0, 0, 0, 210, 1164, 1, 0, 0, 0, 212, 1169, 1, 0, 0, 0, 214, 1179, 1, 0, 0, 0, 216, 1184, 1, 0, 0, 0, 218, 1190, 1, 0, 0, 0, 220, 1195, 1, 0, 0, 0, 222, 1205, 1, 0, 0, 0, 224, 1210, 1, 0, 0, 0, 226, 1216, 1, 0, 0, 0, 228, 1221, 1, 0, 0, 0, 230, 1224, 1, 0, 0, 0, 232, 1228, 1, 0, 0, 0, 234, 1235, 1, 0, 0, 0, 236, 1244, 1, 0, 0, 0, 238, 1249, 1, 0, 0, 0, 240, 1258, 1, 0, 0, 0, 242, 1262, 1, 0, 0, 0, 244, 1271, 1, 0, 0, 0, 246, 1281, 1, 0, 0, 0, 248, 1287, 1, 0, 0, 0, 250, 1295, 1, 0, 0, 0, 252, 1301, 1, 0, 0, 0, 254, 1308, 1, 0, 0, 0, 256, 1313, 1, 0, 0, 0, 258, 1318, 1, 0, 0, 0, 260, 1324, 1, 0, 0, 0, 262, 1330, 1, 0, 0, 0, 264, 1337, 1, 0, 0, 0, 266, 1342, 1, 0, 0, 0, 268, 1359, 1, 0, 0, 0, 270, 1393, 1, 0, 0, 0, 272, 1398, 1, 0, 0, 0, 274, 1441, 1, 0, 0, 0, 276, 1513, 1, 0, 0, 0, 278, 1515, 1, 0, 0, 0, 280, 1522, 1, 0, 0, 0, 282, 1529, 1, 0, 0, 0, 284, 1533, 1, 0, 0, 0, 286, 1540, 1, 0, 0, 0, 288, 1547, 1, 0, 0, 0, 290, 1554, 1, 0, 0, 0, 292, 1570, 1, 0, 0, 0, 294, 1572, 1, 0, 0, 0, 296, 1574, 1, 0, 0, 0, 298, 1576, 1, 0, 0, 0, 300, 1578, 1, 0, 0, 0, 302, 1580, 1, 0, 0, 0, 304, 1582, 1, 0, 0, 0, 306, 1584, 1, 0, 0, 0, 308, 1586, 1, 0, 0, 0, 310, 1588, 1, 0, 0, 0, 312, 1590, 1, 0, 0, 0, 314, 1592, 1, 0, 0, 0, 316, 1594, 1, 0, 0, 0, 318, 1596, 1, 0, 0, 0, 320, 1598, 1, 0, 0, 0, 322, 1600, 1, 0, 0, 0, 324, 1602, 1, 0, 0, 0, 326, 1604, 1, 0, 0, 0, 328, 1606, 1, 0, 0, 0, 330, 1608, 1, 0, 0, 0, 332, 1610, 1, 0, 0, 0, 334, 1612, 1, 0, 0, 0, 336, 1614, 1, 0, 0, 0, 338, 1616, 1, 0, 0, 0, 340, 1618, 1, 0, 0, 0, 342, 1620, 1, 0, 0, 0, 344, 1622, 1, 0, 0, 0, 346, 1624, 1, 0, 0, 0, 348, 1626, 1, 0, 0, 0, 350, 1628, 1, 0, 0, 0, 352, 1630, 1, 0, 0, 0, 354, 1632, 1, 0, 0, 0, 356, 1635, 1, 0, 0, 0, 358, 1637, 1, 0, 0, 0, 360, 1639, 1, 0, 0, 0, 362, 1641, 1, 0, 0, 0, 364, 1644, 1, 0, 0, 0, 366, 1647, 1, 0, 0, 0, 368, 1649, 1, 0, 0, 0, 370, 1651, 1, 0, 0, 0, 372, 1654, 1, 0, 0, 0, 374, 1656, 1, 0, 0, 0, 376, 1658, 1, 0, 0, 0, 378, 1660, 1, 0, 0, 0, 380, 1663, 1, 0, 0, 0, 382, 1665, 1, 0, 0, 0, 384, 1668, 1, 0, 0, 0, 386, 1670, 1, 0, 0, 0, 388, 1672, 1, 0, 0, 0, 390, 1675, 1, 0, 0, 0, 392, 1679, 1, 0, 0, 0, 394, 1683, 1, 0, 0, 0, 396, 1685, 1, 0, 0, 0, 398, 1687, 1, 0, 0, 0, 400, 1690, 1, 0, 0, 0, 402, 1696, 1, 0, 0, 0, 404, 1702, 1, 0, 0, 0, 406, 1704, 1, 0, 0, 0, 408, 1711, 1, 0, 0, 0, 410, 1713, 1, 0, 0, 0, 412, 1717, 1, 0, 0, 0, 414, 1720, 1, 0, 0, 0, 416, 1723, 1, 0, 0, 0, 418, 1726, 1, 0, 0, 0, 420, 1728, 1, 0, 0, 0, 422, 1730, 1, 0, 0, 0, 424, 1732, 1, 0, 0, 0, 426, 1734, 1, 0, 0, 0, 428, 1739, 1, 0, 0, 0, 430, 1744, 1, 0, 0, 0, 432, 1746, 1, 0, 0, 0, 434, 1748, 1, 0, 0, 0, 436, 1751, 1, 0, 0, 0, 438, 1755, 1, 0, 0, 0, 440, 1757, 1, 0, 0, 0, 442, 1759, 1, 0, 0, 0, 444, 1761, 1, 0, 0, 0, 446, 1763, 1, 0, 0, 0, 448, 1766, 1, 0, 0, 0, 450, 1768, 1, 0, 0, 0, 452, 1786, 1, 0, 0, 0, 454, 1799, 1, 0, 0, 0, 456, 1803, 1, 0, 0, 0, 458, 1816, 1, 0, 0, 0, 460, 1820, 1, 0, 0, 0, 462, 1824, 1, 0, 0, 0, 464, 1834, 1, 0, 0, 0, 466, 1838, 1, 0, 0, 0, 468, 1842, 1, 0, 0, 0, 470, 1848, 1, 0, 0, 0, 472, 1854, 1, 0, 0, 0, 474, 1872, 1, 0, 0, 0, 476, 1885, 1, 0, 0, 0, 478, 1894, 1, 0, 0, 0, 480, 1898, 1, 0, 0, 0, 482, 1903, 1, 0, 0, 0, 484, 1909, 1, 0, 0, 0, 486, 1914, 1, 0, 0, 0, 488, 1918, 1, 0, 0, 0, 490, 1923, 1, 0, 0, 0, 492, 1941, 1, 0, 0, 0, 494, 1954, 1, 0, 0, 0, 496, 1964, 1, 0, 0, 0, 498, 1970, 1, 0, 0, 0, 500, 1975, 1, 0, 0, 0, 502, 1979, 1, 0, 0, 0, 504, 1984, 1, 0, 0, 0, 506, 1991, 1, 0, 0, 0, 508, 1997, 1, 0, 0, 0, 510, 511, 3, 292, 143, 0, 511, 512, 3, 314, 154, 0, 512, 513, 3, 314, 154, 0, 513, 7, 1, 0, 0, 0, 514, 515, 3, 292, 143, 0, 515, 516, 3, 318, 156, 0, 516, 517, 3, 298, 146, 0, 517, 9, 1, 0, 0, 0, 518, 519, 3, 292, 143, 0, 519, 520, 3, 318, 156, 0, 520, 521, 3, 330, 162, 0, 521, 522, 3, 308, 151, 0, 522, 11, 1, 0, 0, 0, 523, 524, 3, 292, 143, 0, 524, 525, 3, 318, 156, 0, 525, 526, 3, 340, 167, 0, 526, 13, 1, 0, 0, 0, 527, 528, 3, 292, 143, 0, 528, 529, 3, 326, 160, 0, 529, 530, 3, 326, 160, 0, 530, 531, 3, 292, 143, 0, 531, 532, 3, 340, 167, 0, 532, 15, 1, 0, 0, 0, 533, 534, 3, 292, 143, 0, 534, 535, 3, 328, 161, 0, 535, 17, 1, 0, 0, 0, 536, 537, 3, 292, 143, 0, 537, 538, 3, 328, 161, 0, 538, 539, 3, 296, 145, 0, 539, 551, 1, 0, 0, 0, 540, 541, 3, 292, 143, 0, 541, 542, 3, 328, 161, 0, 542, 543, 3, 296, 145, 0, 543, 544, 3, 300, 147, 0, 544, 545, 3, 318, 156, 0, 545, 546, 3, 298, 146, 0, 546, 547, 3, 308, 151, 0, 547, 548, 3, 318, 156, 0, 548, 549, 3, 304, 149, 0, 549, 551, 1, 0, 0, 0, 550, 536, 1, 0, 0, 0, 550, 540, 1, 0, 0, 0, 551, 19, 1, 0, 0, 0, 552, 553, 3, 292, 143, 0, 553, 554, 3, 328, 161, 0, 554, 555, 3, 320, 157, 0, 555, 556, 3, 302, 148, 0, 556, 21, 1, 0, 0, 0, 557, 558, 3, 294, 144, 0, 558, 559, 3, 300, 147, 0, 559, 560, 3, 330, 162, 0, 560, 561, 3, 336, 165, 0, 561, 562, 3, 300, 147, 0, 562, 563, 3, 300, 147, 0, 563, 564, 3, 318, 156, 0, 564, 23, 1, 0, 0, 0, 565, 566, 3, 294, 144, 0, 566, 567, 3, 320, 157, 0, 567, 568, 3, 330, 162, 0, 568, 569, 3, 306, 150, 0, 569, 25, 1, 0, 0, 0, 570, 571, 3, 294, 144, 0, 571, 572, 3, 340, 167, 0, 572, 27, 1, 0, 0, 0, 573, 574, 3, 296, 145, 0, 574, 575, 3, 292, 143, 0, 575, 576, 3, 328, 161, 0, 576, 577, 3, 300, 147, 0, 577, 29, 1, 0, 0, 0, 578, 579, 3, 296, 145, 0, 579, 580, 3, 292, 143, 0, 580, 581, 3, 328, 161, 0, 581, 582, 3, 330, 162, 0, 582, 31, 1, 0, 0, 0, 583, 584, 3, 296, 145, 0, 584, 585, 3, 292, 143, 0, 585, 586, 3, 330, 162, 0, 586, 587, 3, 296, 145, 0, 587, 588, 3, 306, 150, 0, 588, 33, 1, 0, 0, 0, 589, 590, 3, 296, 145, 0, 590, 591, 3, 320, 157, 0, 591, 592, 3, 306, 150, 0, 592, 593, 3, 320, 157, 0, 593, 594, 3, 326, 160, 0, 594, 595, 3, 330, 162, 0, 595, 35, 1, 0, 0, 0, 596, 597, 3, 296, 145, 0, 597, 598, 3, 320, 157, 0, 598, 599, 3, 314, 154, 0, 599, 600, 3, 314, 154, 0, 600, 601, 3, 292, 143, 0, 601, 602, 3, 330, 162, 0, 602, 603, 3, 300, 147, 0, 603, 37, 1, 0, 0, 0, 604, 605, 3, 296, 145, 0, 605, 606, 3, 320, 157, 0, 606, 607, 3, 314, 154, 0, 607, 608, 3, 332, 163, 0, 608, 609, 3, 316, 155, 0, 609, 610, 3, 318, 156, 0, 610, 611, 3, 328, 161, 0, 611, 39, 1, 0, 0, 0, 612, 613, 3, 296, 145, 0, 613, 614, 3, 326, 160, 0, 614, 615, 3, 320, 157, 0, 615, 616, 3, 328, 161, 0, 616, 617, 3, 328, 161, 0, 617, 41, 1, 0, 0, 0, 618, 619, 3, 296, 145, 0, 619, 620, 3, 332, 163, 0, 620, 621, 3, 294, 144, 0, 621, 622, 3, 300, 147, 0, 622, 43, 1, 0, 0, 0, 623, 624, 3, 296, 145, 0, 624, 625, 3, 332, 163, 0, 625, 626, 3, 326, 160, 0, 626, 627, 3, 326, 160, 0, 627, 628, 3, 300, 147, 0, 628, 629, 3, 318, 156, 0, 629, 630, 3, 330, 162, 0, 630, 45, 1, 0, 0, 0, 631, 632, 3, 298, 146, 0, 632, 633, 3, 292, 143, 0, 633, 634, 3, 330, 162, 0, 634, 635, 3, 300, 147, 0, 635, 47, 1, 0, 0, 0, 636, 637, 3, 298, 146, 0, 637, 638, 3, 292, 143, 0, 638, 639, 3, 340, 167, 0, 639, 49, 1, 0, 0, 0, 640, 641, 3, 298, 146, 0, 641, 642, 3, 300, 147, 0, 642, 643, 3, 328, 161, 0, 643, 644, 3, 296, 145, 0, 644, 51, 1, 0, 0, 0, 645, 646, 3, 298, 146, 0, 646, 647, 3, 300, 147, 0, 647, 648, 3, 328, 161, 0, 648, 649, 3, 296, 145, 0, 649, 650, 3, 300, 147, 0, 650, 651, 3, 318, 156, 0, 651, 652, 3, 298, 146, 0, 652, 653, 3, 308, 151, 0, 653, 654, 3, 318, 156, 0, 654, 655, 3, 304, 149, 0, 655, 53, 1, 0, 0, 0, 656, 657, 3, 298, 146, 0, 657, 658, 3, 308, 151, 0, 658, 659, 3, 328, 161, 0, 659, 660, 3, 330, 162, 0, 660, 661, 3, 308, 151, 0, 661, 662, 3, 318, 156, 0, 662, 663, 3, 296, 145, 0, 663, 664, 3, 330, 162, 0, 664, 55, 1, 0, 0, 0, 665, 666, 3, 300, 147, 0, 666, 667, 3, 314, 154, 0, 667, 668, 3, 328, 161, 0, 668, 669, 3, 300, 147, 0, 669, 57, 1, 0, 0, 0, 670, 671, 3, 300, 147, 0, 671, 672, 3, 318, 156, 0, 672, 673, 3, 298, 146, 0, 673, 59, 1, 0, 0, 0, 674, 675, 3, 300, 147, 0, 675, 676, 3, 338, 166, 0, 676, 677, 3, 296, 145, 0, 677, 678, 3, 300, 147, 0, 678, 679, 3, 322, 158, 0, 679, 680, 3, 330, 162, 0, 680, 61, 1, 0, 0, 0, 681, 682, 3, 300, 147, 0, 682, 683, 3, 338, 166, 0, 683, 684, 3, 296, 145, 0, 684, 685, 3, 314, 154, 0, 685, 686, 3, 332, 163, 0, 686, 687, 3, 298, 146, 0, 687, 688, 3, 300, 147, 0, 688, 63, 1, 0, 0, 0, 689, 690, 3, 300, 147, 0, 690, 691, 3, 338, 166, 0, 691, 692, 3, 330, 162, 0, 692, 693, 3, 326, 160, 0, 693, 694, 3, 292, 143, 0, 694, 695, 3, 296, 145, 0, 695, 696, 3, 330, 162, 0, 696, 65, 1, 0, 0, 0, 697, 698, 3, 302, 148, 0, 698, 699, 3, 308, 151, 0, 699, 700, 3, 318, 156, 0, 700, 701, 3, 292, 143, 0, 701, 702, 3, 314, 154, 0, 702, 67, 1, 0, 0, 0, 703, 704, 3, 302, 148, 0, 704, 705, 3, 308, 151, 0, 705, 706, 3, 314, 154, 0, 706, 707, 3, 314, 154, 0, 707, 69, 1, 0, 0, 0, 708, 709, 3, 302, 148, 0, 709, 710, 3, 308, 151, 0, 710, 711, 3, 314, 154, 0, 711, 712, 3, 330, 162, 0, 712, 713, 3, 300, 147, 0, 713, 714, 3, 326, 160, 0, 714, 71, 1, 0, 0, 0, 715, 716, 3, 302, 148, 0, 716, 717, 3, 308, 151, 0, 717, 718, 3, 318, 156, 0, 718, 719, 3, 292, 143, 0, 719, 720, 3, 314, 154, 0, 720, 721, 3, 314, 154, 0, 721, 722, 3, 340, 167, 0, 722, 73, 1, 0, 0, 0, 723, 724, 3, 302, 148, 0, 724, 725, 3, 308, 151, 0, 725, 726, 3, 326, 160, 0, 726, 727, 3, 328, 161, 0, 727, 728, 3, 330, 162, 0, 728, 75, 1, 0, 0, 0, 729, 730, 3, 302, 148, 0, 730, 731, 3, 318, 156, 0, 731, 77, 1, 0, 0, 0, 732, 733, 3, 302, 148, 0, 733, 734, 3, 320, 157, 0, 734, 735, 3, 314, 154, 0, 735, 736, 3, 314, 154, 0, 736, 737, 3, 320, 157, 0, 737, 738, 3, 336, 165, 0, 738, 739, 3, 308, 151, 0, 739, 740, 3, 318, 156, 0, 740, 741, 3, 304, 149, 0, 741, 79, 1, 0, 0, 0, 742, 743, 3, 302, 148, 0, 743, 744, 3, 320, 157, 0, 744, 745, 3, 326, 160, 0, 745, 81, 1, 0, 0, 0, 746, 747, 3, 302, 148, 0, 747, 748, 3, 326, 160, 0, 748, 749, 3, 320, 157, 0, 749, 750, 3, 316, 155, 0, 750, 83, 1, 0, 0, 0, 751, 752, 3, 302, 148, 0, 752, 753, 3, 332, 163, 0, 753, 754, 3, 314, 154, 0, 754, 755, 3, 314, 154, 0, 755, 85, 1, 0, 0, 0, 756, 757, 3, 302, 148, 0, 757, 758, 3, 332, 163, 0, 758, 759, 3, 318, 156, 0, 759, 87, 1, 0, 0, 0, 760, 761, 3, 304, 149, 0, 761, 762, 3, 326, 160, 0, 762, 763, 3, 320, 157, 0, 763, 764, 3, 332, 163, 0, 764, 765, 3, 322, 158, 0, 765, 89, 1, 0, 0, 0, 766, 767, 3, 304, 149, 0, 767, 768, 3, 326, 160, 0, 768, 769, 3, 320, 157, 0, 769, 770, 3, 332, 163, 0, 770, 771, 3, 322, 158, 0, 771, 772, 3, 308, 151, 0, 772, 773, 3, 318, 156, 0, 773, 774, 3, 304, 149, 0, 774, 91, 1, 0, 0, 0, 775, 776, 3, 306, 150, 0, 776, 777, 3, 292, 143, 0, 777, 778, 3, 334, 164, 0, 778, 779, 3, 308, 151, 0, 779, 780, 3, 318, 156, 0, 780, 781, 3, 304, 149, 0, 781, 93, 1, 0, 0, 0, 782, 783, 3, 306, 150, 0, 783, 784, 3, 320, 157, 0, 784, 785, 3, 332, 163, 0, 785, 786, 3, 326, 160, 0, 786, 95, 1, 0, 0, 0, 787, 788, 3, 308, 151, 0, 788, 789, 3, 298, 146, 0, 789, 97, 1, 0, 0, 0, 790, 791, 3, 308, 151, 0, 791, 792, 3, 302, 148, 0, 792, 99, 1, 0, 0, 0, 793, 794, 3, 308, 151, 0, 794, 795, 3, 314, 154, 0, 795, 796, 3, 308, 151, 0, 796, 797, 3, 312, 153, 0, 797, 798, 3, 300, 147, 0, 798, 101, 1, 0, 0, 0, 799, 800, 3, 308, 151, 0, 800, 801, 3, 304, 149, 0, 801, 802, 3, 318, 156, 0, 802, 803, 3, 320, 157, 0, 803, 804, 3, 326, 160, 0, 804, 805, 3, 300, 147, 0, 805, 103, 1, 0, 0, 0, 806, 807, 3, 308, 151, 0, 807, 808, 3, 318, 156, 0, 808, 809, 3, 296, 145, 0, 809, 810, 3, 314, 154, 0, 810, 811, 3, 332, 163, 0, 811, 812, 3, 298, 146, 0, 812, 813, 3, 300, 147, 0, 813, 105, 1, 0, 0, 0, 814, 815, 3, 308, 151, 0, 815, 816, 3, 318, 156, 0, 816, 107, 1, 0, 0, 0, 817, 818, 3, 308, 151, 0, 818, 819, 3, 318, 156, 0, 819, 820, 3, 302, 148, 0, 820, 831, 1, 0, 0, 0, 821, 822, 3, 308, 151, 0, 822, 823, 3, 318, 156, 0, 823, 824, 3, 302, 148, 0, 824, 825, 3, 308, 151, 0, 825, 826, 3, 318, 156, 0, 826, 827, 3, 308, 151, 0, 827, 828, 3, 330, 162, 0, 828, 829, 3, 340, 167, 0, 829, 831, 1, 0, 0, 0, 830, 817, 1, 0, 0, 0, 830, 821, 1, 0, 0, 0, 831, 109, 1, 0, 0, 0, 832, 833, 3, 308, 151, 0, 833, 834, 3, 318, 156, 0, 834, 835, 3, 318, 156, 0, 835, 836, 3, 300, 147, 0, 836, 837, 3, 326, 160, 0, 837, 111, 1, 0, 0, 0, 838, 839, 3, 308, 151, 0, 839, 840, 3, 318, 156, 0, 840, 841, 3, 330, 162, 0, 841, 842, 3, 300, 147, 0, 842, 843, 3, 326, 160, 0, 843, 844, 3, 328, 161, 0, 844, 845, 3, 300, 147, 0, 845, 846, 3, 296, 145, 0, 846, 847, 3, 330, 162, 0, 847, 113, 1, 0, 0, 0, 848, 849, 3, 308, 151, 0, 849, 850, 3, 318, 156, 0, 850, 851, 3, 330, 162, 0, 851, 852, 3, 300, 147, 0, 852, 853, 3, 326, 160, 0, 853, 854, 3, 322, 158, 0, 854, 855, 3, 320, 157, 0, 855, 856, 3, 314, 154, 0, 856, 857, 3, 292, 143, 0, 857, 858, 3, 330, 162, 0, 858, 859, 3, 300, 147, 0, 859, 115, 1, 0, 0, 0, 860, 861, 3, 308, 151, 0, 861, 862, 3, 318, 156, 0, 862, 863, 3, 330, 162, 0, 863, 864, 3, 300, 147, 0, 864, 865, 3, 326, 160, 0, 865, 866, 3, 334, 164, 0, 866, 867, 3, 292, 143, 0, 867, 868, 3, 314, 154, 0, 868, 117, 1, 0, 0, 0, 869, 870, 3, 308, 151, 0, 870, 871, 3, 328, 161, 0, 871, 119, 1, 0, 0, 0, 872, 873, 3, 310, 152, 0, 873, 874, 3, 320, 157, 0, 874, 875, 3, 308, 151, 0, 875, 876, 3, 318, 156, 0, 876, 121, 1, 0, 0, 0, 877, 878, 3, 312, 153, 0, 878, 879, 3, 300, 147, 0, 879, 880, 3, 340, 167, 0, 880, 123, 1, 0, 0, 0, 881, 882, 3, 314, 154, 0, 882, 883, 3, 292, 143, 0, 883, 884, 3, 316, 155, 0, 884, 885, 3, 294, 144, 0, 885, 886, 3, 298, 146, 0, 886, 887, 3, 292, 143, 0, 887, 125, 1, 0, 0, 0, 888, 889, 3, 314, 154, 0, 889, 890, 3, 292, 143, 0, 890, 891, 3, 328, 161, 0, 891, 892, 3, 330, 162, 0, 892, 127, 1, 0, 0, 0, 893, 894, 3, 314, 154, 0, 894, 895, 3, 300, 147, 0, 895, 896, 3, 292, 143, 0, 896, 897, 3, 298, 146, 0, 897, 898, 3, 308, 151, 0, 898, 899, 3, 318, 156, 0, 899, 900, 3, 304, 149, 0, 900, 129, 1, 0, 0, 0, 901, 902, 3, 314, 154, 0, 902, 903, 3, 300, 147, 0, 903, 904, 3, 302, 148, 0, 904, 905, 3, 330, 162, 0, 905, 131, 1, 0, 0, 0, 906, 907, 3, 314, 154, 0, 907, 908, 3, 300, 147, 0, 908, 909, 3, 330, 162, 0, 909, 133, 1, 0, 0, 0, 910, 911, 3, 314, 154, 0, 911, 912, 3, 308, 151, 0, 912, 913, 3, 312, 153, 0, 913, 914, 3, 300, 147, 0, 914, 135, 1, 0, 0, 0, 915, 916, 3, 314, 154, 0, 916, 917, 3, 308, 151, 0, 917, 918, 3, 316, 155, 0, 918, 919, 3, 308, 151, 0, 919, 920, 3, 330, 162, 0, 920, 137, 1, 0, 0, 0, 921, 922, 3, 316, 155, 0, 922, 923, 3, 292, 143, 0, 923, 924, 3, 330, 162, 0, 924, 925, 3, 300, 147, 0, 925, 926, 3, 326, 160, 0, 926, 927, 3, 308, 151, 0, 927, 928, 3, 292, 143, 0, 928, 929, 3, 314, 154, 0, 929, 930, 3, 308, 151, 0, 930, 931, 3, 342, 168, 0, 931, 932, 3, 300, 147, 0, 932, 933, 3, 298, 146, 0, 933, 139, 1, 0, 0, 0, 934, 935, 3, 316, 155, 0, 935, 936, 3, 308, 151, 0, 936, 937, 3, 318, 156, 0, 937, 938, 3, 332, 163, 0, 938, 939, 3, 330, 162, 0, 939, 940, 3, 300, 147, 0, 940, 141, 1, 0, 0, 0, 941, 942, 3, 316, 155, 0, 942, 943, 3, 320, 157, 0, 943, 944, 3, 318, 156, 0, 944, 945, 3, 330, 162, 0, 945, 946, 3, 306, 150, 0, 946, 143, 1, 0, 0, 0, 947, 948, 3, 318, 156, 0, 948, 949, 3, 292, 143, 0, 949, 950, 3, 316, 155, 0, 950, 951, 3, 300, 147, 0, 951, 145, 1, 0, 0, 0, 952, 953, 3, 318, 156, 0, 953, 954, 3, 292, 143, 0, 954, 955, 3, 330, 162, 0, 955, 956, 3, 332, 163, 0, 956, 957, 3, 326, 160, 0, 957, 958, 3, 292, 143, 0, 958, 959, 3, 314, 154, 0, 959, 147, 1, 0, 0, 0, 960, 961, 3, 318, 156, 0, 961, 962, 3, 292, 143, 0, 962, 963, 3, 318, 156, 0, 963, 149, 1, 0, 0, 0, 964, 965, 3, 318, 156, 0, 965, 966, 3, 320, 157, 0, 966, 967, 3, 330, 162, 0, 967, 151, 1, 0, 0, 0, 968, 969, 3, 318, 156, 0, 969, 970, 3, 332, 163, 0, 970, 971, 3, 314, 154, 0, 971, 972, 3, 314, 154, 0, 972, 153, 1, 0, 0, 0, 973, 974, 3, 318, 156, 0, 974, 975, 3, 332, 163, 0, 975, 976, 3, 314, 154, 0, 976, 977, 3, 314, 154, 0, 977, 978, 3, 328, 161, 0, 978, 155, 1, 0, 0, 0, 979, 980, 3, 320, 157, 0, 980, 981, 3, 302, 148, 0, 981, 982, 3, 302, 148, 0, 982, 983, 3, 328, 161, 0, 983, 984, 3, 300, 147, 0, 984, 985, 3, 330, 162, 0, 985, 157, 1, 0, 0, 0, 986, 987, 3, 320, 157, 0, 987, 988, 3, 318, 156, 0, 988, 159, 1, 0, 0, 0, 989, 990, 3, 320, 157, 0, 990, 991, 3, 326, 160, 0, 991, 161, 1, 0, 0, 0, 992, 993, 3, 320, 157, 0, 993, 994, 3, 326, 160, 0, 994, 995, 3, 298, 146, 0, 995, 996, 3, 300, 147, 0, 996, 997, 3, 326, 160, 0, 997, 163, 1, 0, 0, 0, 998, 999, 3, 320, 157, 0, 999, 1000, 3, 332, 163, 0, 1000, 1001, 3, 330, 162, 0, 1001, 1002, 3, 300, 147, 0, 1002, 1003, 3, 326, 160, 0, 1003, 165, 1, 0, 0, 0, 1004, 1005, 3, 320, 157, 0, 1005, 1006, 3, 334, 164, 0, 1006, 1007, 3, 300, 147, 0, 1007, 1008, 3, 326, 160, 0, 1008, 167, 1, 0, 0, 0, 1009, 1010, 3, 322, 158, 0, 1010, 1011, 3, 292, 143, 0, 1011, 1012, 3, 326, 160, 0, 1012, 1013, 3, 330, 162, 0, 1013, 1014, 3, 308, 151, 0, 1014, 1015, 3, 330, 162, 0, 1015, 1016, 3, 308, 151, 0, 1016, 1017, 3, 320, 157, 0, 1017, 1018, 3, 318, 156, 0, 1018, 169, 1, 0, 0, 0, 1019, 1020, 3, 322, 158, 0, 1020, 1021, 3, 308, 151, 0, 1021, 1022, 3, 334, 164, 0, 1022, 1023, 3, 320, 157, 0, 1023, 1024, 3, 330, 162, 0, 1024, 171, 1, 0, 0, 0, 1025, 1026, 3, 322, 158, 0, 1026, 1027, 3, 320, 157, 0, 1027, 1028, 3, 328, 161, 0, 1028, 1029, 3, 308, 151, 0, 1029, 1030, 3, 330, 162, 0, 1030, 1031, 3, 308, 151, 0, 1031, 1032, 3, 320, 157, 0, 1032, 1033, 3, 318, 156, 0, 1033, 1034, 3, 292, 143, 0, 1034, 1035, 3, 314, 154, 0, 1035, 173, 1, 0, 0, 0, 1036, 1037, 3, 322, 158, 0, 1037, 1038, 3, 326, 160, 0, 1038, 1039, 3, 300, 147, 0, 1039, 1040, 3, 296, 145, 0, 1040, 1041, 3, 300, 147, 0, 1041, 1042, 3, 298, 146, 0, 1042, 1043, 3, 308, 151, 0, 1043, 1044, 3, 318, 156, 0, 1044, 1045, 3, 304, 149, 0, 1045, 175, 1, 0, 0, 0, 1046, 1047, 3, 322, 158, 0, 1047, 1048, 3, 326, 160, 0, 1048, 1049, 3, 300, 147, 0, 1049, 1050, 3, 336, 165, 0, 1050, 1051, 3, 306, 150, 0, 1051, 1052, 3, 300, 147, 0, 1052, 1053, 3, 326, 160, 0, 1053, 1054, 3, 300, 147, 0, 1054, 177, 1, 0, 0, 0, 1055, 1056, 3, 324, 159, 0, 1056, 1057, 3, 332, 163, 0, 1057, 1058, 3, 292, 143, 0, 1058, 1059, 3, 314, 154, 0, 1059, 1060, 3, 308, 151, 0, 1060, 1061, 3, 302, 148, 0, 1061, 1062, 3, 340, 167, 0, 1062, 179, 1, 0, 0, 0, 1063, 1064, 3, 324, 159, 0, 1064, 1065, 3, 332, 163, 0, 1065, 1066, 3, 292, 143, 0, 1066, 1067, 3, 326, 160, 0, 1067, 1068, 3, 330, 162, 0, 1068, 1069, 3, 300, 147, 0, 1069, 1070, 3, 326, 160, 0, 1070, 181, 1, 0, 0, 0, 1071, 1072, 3, 326, 160, 0, 1072, 1073, 3, 292, 143, 0, 1073, 1074, 3, 318, 156, 0, 1074, 1075, 3, 304, 149, 0, 1075, 1076, 3, 300, 147, 0, 1076, 183, 1, 0, 0, 0, 1077, 1078, 3, 326, 160, 0, 1078, 1079, 3, 300, 147, 0, 1079, 1080, 3, 296, 145, 0, 1080, 1081, 3, 332, 163, 0, 1081, 1082, 3, 326, 160, 0, 1082, 1083, 3, 328, 161, 0, 1083, 1084, 3, 308, 151, 0, 1084, 1085, 3, 334, 164, 0, 1085, 1086, 3, 300, 147, 0, 1086, 185, 1, 0, 0, 0, 1087, 1088, 3, 326, 160, 0, 1088, 1089, 3, 300, 147, 0, 1089, 1090, 3, 322, 158, 0, 1090, 1091, 3, 314, 154, 0, 1091, 1092, 3, 292, 143, 0, 1092, 1093, 3, 296, 145, 0, 1093, 1094, 3, 300, 147, 0, 1094, 187, 1, 0, 0, 0, 1095, 1096, 3, 326, 160, 0, 1096, 1097, 3, 300, 147, 0, 1097, 1098, 3, 330, 162, 0, 1098, 1099, 3, 332, 163, 0, 1099, 1100, 3, 326, 160, 0, 1100, 1101, 3, 318, 156, 0, 1101, 189, 1, 0, 0, 0, 1102, 1103, 3, 326, 160, 0, 1103, 1104, 3, 308, 151, 0, 1104, 1105, 3, 304, 149, 0, 1105, 1106, 3, 306, 150, 0, 1106, 1107, 3, 330, 162, 0, 1107, 191, 1, 0, 0, 0, 1108, 1109, 3, 326, 160, 0, 1109, 1110, 3, 320, 157, 0, 1110, 1111, 3, 314, 154, 0, 1111, 1112, 3, 314, 154, 0, 1112, 1113, 3, 332, 163, 0, 1113, 1114, 3, 322, 158, 0, 1114, 193, 1, 0, 0, 0, 1115, 1116, 3, 326, 160, 0, 1116, 1117, 3, 320, 157, 0, 1117, 1118, 3, 336, 165, 0, 1118, 195, 1, 0, 0, 0, 1119, 1120, 3, 326, 160, 0, 1120, 1121, 3, 320, 157, 0, 1121, 1122, 3, 336, 165, 0, 1122, 1123, 3, 328, 161, 0, 1123, 197, 1, 0, 0, 0, 1124, 1125, 3, 328, 161, 0, 1125, 1126, 3, 292, 143, 0, 1126, 1127, 3, 316, 155, 0, 1127, 1128, 3, 322, 158, 0, 1128, 1129, 3, 314, 154, 0, 1129, 1130, 3, 300, 147, 0, 1130, 199, 1, 0, 0, 0, 1131, 1132, 3, 328, 161, 0, 1132, 1133, 3, 300, 147, 0, 1133, 1134, 3, 296, 145, 0, 1134, 1135, 3, 320, 157, 0, 1135, 1136, 3, 318, 156, 0, 1136, 1137, 3, 298, 146, 0, 1137, 201, 1, 0, 0, 0, 1138, 1139, 3, 328, 161, 0, 1139, 1140, 3, 300, 147, 0, 1140, 1141, 3, 314, 154, 0, 1141, 1142, 3, 300, 147, 0, 1142, 1143, 3, 296, 145, 0, 1143, 1144, 3, 330, 162, 0, 1144, 203, 1, 0, 0, 0, 1145, 1146, 3, 328, 161, 0, 1146, 1147, 3, 300, 147, 0, 1147, 1148, 3, 316, 155, 0, 1148, 1149, 3, 308, 151, 0, 1149, 205, 1, 0, 0, 0, 1150, 1151, 3, 328, 161, 0, 1151, 1152, 3, 300, 147, 0, 1152, 1153, 3, 330, 162, 0, 1153, 1154, 3, 328, 161, 0, 1154, 207, 1, 0, 0, 0, 1155, 1156, 3, 328, 161, 0, 1156, 1157, 3, 300, 147, 0, 1157, 1158, 3, 330, 162, 0, 1158, 1159, 3, 330, 162, 0, 1159, 1160, 3, 308, 151, 0, 1160, 1161, 3, 318, 156, 0, 1161, 1162, 3, 304, 149, 0, 1162, 1163, 3, 328, 161, 0, 1163, 209, 1, 0, 0, 0, 1164, 1165, 3, 328, 161, 0, 1165, 1166, 3, 330, 162, 0, 1166, 1167, 3, 300, 147, 0, 1167, 1168, 3, 322, 158, 0, 1168, 211, 1, 0, 0, 0, 1169, 1170, 3, 328, 161, 0, 1170, 1171, 3, 332, 163, 0, 1171, 1172, 3, 294, 144, 0, 1172, 1173, 3, 328, 161, 0, 1173, 1174, 3, 330, 162, 0, 1174, 1175, 3, 326, 160, 0, 1175, 1176, 3, 308, 151, 0, 1176, 1177, 3, 318, 156, 0, 1177, 1178, 3, 304, 149, 0, 1178, 213, 1, 0, 0, 0, 1179, 1180, 3, 330, 162, 0, 1180, 1181, 3, 306, 150, 0, 1181, 1182, 3, 300, 147, 0, 1182, 1183, 3, 318, 156, 0, 1183, 215, 1, 0, 0, 0, 1184, 1185, 3, 330, 162, 0, 1185, 1186, 3, 306, 150, 0, 1186, 1187, 3, 326, 160, 0, 1187, 1188, 3, 320, 157, 0, 1188, 1189, 3, 336, 165, 0, 1189, 217, 1, 0, 0, 0, 1190, 1191, 3, 330, 162, 0, 1191, 1192, 3, 308, 151, 0, 1192, 1193, 3, 300, 147, 0, 1193, 1194, 3, 328, 161, 0, 1194, 219, 1, 0, 0, 0, 1195, 1196, 3, 330, 162, 0, 1196, 1197, 3, 308, 151, 0, 1197, 1198, 3, 316, 155, 0, 1198, 1199, 3, 300, 147, 0, 1199, 1200, 3, 328, 161, 0, 1200, 1201, 3, 330, 162, 0, 1201, 1202, 3, 292, 143, 0, 1202, 1203, 3, 316, 155, 0, 1203, 1204, 3, 322, 158, 0, 1204, 221, 1, 0, 0, 0, 1205, 1206, 3, 330, 162, 0, 1206, 1207, 3, 308, 151, 0, 1207, 1208, 3, 316, 155, 0, 1208, 1209, 3, 300, 147, 0, 1209, 223, 1, 0, 0, 0, 1210, 1211, 3, 314, 154, 0, 1211, 1212, 3, 320, 157, 0, 1212, 1213, 3, 296, 145, 0, 1213, 1214, 3, 292, 143, 0, 1214, 1215, 3, 314, 154, 0, 1215, 225, 1, 0, 0, 0, 1216, 1217, 3, 342, 168, 0, 1217, 1218, 3, 320, 157, 0, 1218, 1219, 3, 318, 156, 0, 1219, 1220, 3, 300, 147, 0, 1220, 227, 1, 0, 0, 0, 1221, 1222, 3, 330, 162, 0, 1222, 1223, 3, 320, 157, 0, 1223, 229, 1, 0, 0, 0, 1224, 1225, 3, 330, 162, 0, 1225, 1226, 3, 320, 157, 0, 1226, 1227, 3, 322, 158, 0, 1227, 231, 1, 0, 0, 0, 1228, 1229, 3, 330, 162, 0, 1229, 1230, 3, 320, 157, 0, 1230, 1231, 3, 330, 162, 0, 1231, 1232, 3, 292, 143, 0, 1232, 1233, 3, 314, 154, 0, 1233, 1234, 3, 328, 161, 0, 1234, 233, 1, 0, 0, 0, 1235, 1236, 3, 330, 162, 0, 1236, 1237, 3, 326, 160, 0, 1237, 1238, 3, 292, 143, 0, 1238, 1239, 3, 308, 151, 0, 1239, 1240, 3, 314, 154, 0, 1240, 1241, 3, 308, 151, 0, 1241, 1242, 3, 318, 156, 0, 1242, 1243, 3, 304, 149, 0, 1243, 235, 1, 0, 0, 0, 1244, 1245, 3, 330, 162, 0, 1245, 1246, 3, 326, 160, 0, 1246, 1247, 3, 308, 151, 0, 1247, 1248, 3, 316, 155, 0, 1248, 237, 1, 0, 0, 0, 1249, 1250, 3, 330, 162, 0, 1250, 1251, 3, 326, 160, 0, 1251, 1252, 3, 332, 163, 0, 1252, 1253, 3, 318, 156, 0, 1253, 1254, 3, 296, 145, 0, 1254, 1255, 3, 292, 143, 0, 1255, 1256, 3, 330, 162, 0, 1256, 1257, 3, 300, 147, 0, 1257, 239, 1, 0, 0, 0, 1258, 1259, 3, 330, 162, 0, 1259, 1260, 3, 326, 160, 0, 1260, 1261, 3, 340, 167, 0, 1261, 241, 1, 0, 0, 0, 1262, 1263, 3, 330, 162, 0, 1263, 1264, 3, 326, 160, 0, 1264, 1265, 3, 340, 167, 0, 1265, 1266, 5, 95, 0, 0, 1266, 1267, 3, 296, 145, 0, 1267, 1268, 3, 292, 143, 0, 1268, 1269, 3, 328, 161, 0, 1269, 1270, 3, 330, 162, 0, 1270, 243, 1, 0, 0, 0, 1271, 1272, 3, 332, 163, 0, 1272, 1273, 3, 318, 156, 0, 1273, 1274, 3, 294, 144, 0, 1274, 1275, 3, 320, 157, 0, 1275, 1276, 3, 332, 163, 0, 1276, 1277, 3, 318, 156, 0, 1277, 1278, 3, 298, 146, 0, 1278, 1279, 3, 300, 147, 0, 1279, 1280, 3, 298, 146, 0, 1280, 245, 1, 0, 0, 0, 1281, 1282, 3, 332, 163, 0, 1282, 1283, 3, 318, 156, 0, 1283, 1284, 3, 308, 151, 0, 1284, 1285, 3, 320, 157, 0, 1285, 1286, 3, 318, 156, 0, 1286, 247, 1, 0, 0, 0, 1287, 1288, 3, 332, 163, 0, 1288, 1289, 3, 318, 156, 0, 1289, 1290, 3, 322, 158, 0, 1290, 1291, 3, 308, 151, 0, 1291, 1292, 3, 334, 164, 0, 1292, 1293, 3, 320, 157, 0, 1293, 1294, 3, 330, 162, 0, 1294, 249, 1, 0, 0, 0, 1295, 1296, 3, 332, 163, 0, 1296, 1297, 3, 328, 161, 0, 1297, 1298, 3, 308, 151, 0, 1298, 1299, 3, 318, 156, 0, 1299, 1300, 3, 304, 149, 0, 1300, 251, 1, 0, 0, 0, 1301, 1302, 3, 334, 164, 0, 1302, 1303, 3, 292, 143, 0, 1303, 1304, 3, 314, 154, 0, 1304, 1305, 3, 332, 163, 0, 1305, 1306, 3, 300, 147, 0, 1306, 1307, 3, 328, 161, 0, 1307, 253, 1, 0, 0, 0, 1308, 1309, 3, 336, 165, 0, 1309, 1310, 3, 300, 147, 0, 1310, 1311, 3, 300, 147, 0, 1311, 1312, 3, 312, 153, 0, 1312, 255, 1, 0, 0, 0, 1313, 1314, 3, 336, 165, 0, 1314, 1315, 3, 306, 150, 0, 1315, 1316, 3, 300, 147, 0, 1316, 1317, 3, 318, 156, 0, 1317, 257, 1, 0, 0, 0, 1318, 1319, 3, 336, 165, 0, 1319, 1320, 3, 306, 150, 0, 1320, 1321, 3, 300, 147, 0, 1321, 1322, 3, 326, 160, 0, 1322, 1323, 3, 300, 147, 0, 1323, 259, 1, 0, 0, 0, 1324, 1325, 3, 336, 165, 0, 1325, 1326, 3, 306, 150, 0, 1326, 1327, 3, 308, 151, 0, 1327, 1328, 3, 314, 154, 0, 1328, 1329, 3, 300, 147, 0, 1329, 261, 1, 0, 0, 0, 1330, 1331, 3, 336, 165, 0, 1331, 1332, 3, 308, 151, 0, 1332, 1333, 3, 318, 156, 0, 1333, 1334, 3, 298, 146, 0, 1334, 1335, 3, 320, 157, 0, 1335, 1336, 3, 336, 165, 0, 1336, 263, 1, 0, 0, 0, 1337, 1338, 3, 336, 165, 0, 1338, 1339, 3, 308, 151, 0, 1339, 1340, 3, 330, 162, 0, 1340, 1341, 3, 306, 150, 0, 1341, 265, 1, 0, 0, 0, 1342, 1343, 3, 336, 165, 0, 1343, 1344, 3, 308, 151, 0, 1344, 1345, 3, 330, 162, 0, 1345, 1346, 3, 306, 150, 0, 1346, 1347, 3, 308, 151, 0, 1347, 1348, 3, 318, 156, 0, 1348, 267, 1, 0, 0, 0, 1349, 1350, 3, 340, 167, 0, 1350, 1351, 3, 300, 147, 0, 1351, 1352, 3, 292, 143, 0, 1352, 1353, 3, 326, 160, 0, 1353, 1360, 1, 0, 0, 0, 1354, 1355, 3, 340, 167, 0, 1355, 1356, 3, 340, 167, 0, 1356, 1357, 3, 340, 167, 0, 1357, 1358, 3, 340, 167, 0, 1358, 1360, 1, 0, 0, 0, 1359, 1349, 1, 0, 0, 0, 1359, 1354, 1, 0, 0, 0, 1360, 269, 1, 0, 0, 0, 1361, 1362, 3, 360, 177, 0, 1362, 1363, 3, 294, 144, 0, 1363, 1394, 1, 0, 0, 0, 1364, 1365, 3, 360, 177, 0, 1365, 1366, 3, 302, 148, 0, 1366, 1394, 1, 0, 0, 0, 1367, 1368, 3, 360, 177, 0, 1368, 1369, 3, 326, 160, 0, 1369, 1394, 1, 0, 0, 0, 1370, 1371, 3, 360, 177, 0, 1371, 1372, 3, 318, 156, 0, 1372, 1394, 1, 0, 0, 0, 1373, 1374, 3, 360, 177, 0, 1374, 1375, 3, 330, 162, 0, 1375, 1394, 1, 0, 0, 0, 1376, 1377, 3, 360, 177, 0, 1377, 1378, 5, 48, 0, 0, 1378, 1394, 1, 0, 0, 0, 1379, 1380, 3, 360, 177, 0, 1380, 1381, 3, 292, 143, 0, 1381, 1394, 1, 0, 0, 0, 1382, 1383, 3, 360, 177, 0, 1383, 1384, 3, 334, 164, 0, 1384, 1394, 1, 0, 0, 0, 1385, 1386, 3, 360, 177, 0, 1386, 1387, 3, 360, 177, 0, 1387, 1394, 1, 0, 0, 0, 1388, 1389, 3, 360, 177, 0, 1389, 1390, 3, 338, 166, 0, 1390, 1391, 3, 352, 173, 0, 1391, 1392, 3, 352, 173, 0, 1392, 1394, 1, 0, 0, 0, 1393, 1361, 1, 0, 0, 0, 1393, 1364, 1, 0, 0, 0, 1393, 1367, 1, 0, 0, 0, 1393, 1370, 1, 0, 0, 0, 1393, 1373, 1, 0, 0, 0, 1393, 1376, 1, 0, 0, 0, 1393, 1379, 1, 0, 0, 0, 1393, 1382, 1, 0, 0, 0, 1393, 1385, 1, 0, 0, 0, 1393, 1388, 1, 0, 0, 0, 1394, 271, 1, 0, 0, 0, 1395, 1399, 3, 344, 169, 0, 1396, 1399, 3, 448, 221, 0, 1397, 1399, 3, 374, 184, 0, 1398, 1395, 1, 0, 0, 0, 1398, 1396, 1, 0, 0, 0, 1398, 1397, 1, 0, 0, 0, 1399, 1406, 1, 0, 0, 0, 1400, 1405, 3, 344, 169, 0, 1401, 1405, 3, 448, 221, 0, 1402, 1405, 3, 350, 172, 0, 1403, 1405, 3, 374, 184, 0, 1404, 1400, 1, 0, 0, 0, 1404, 1401, 1, 0, 0, 0, 1404, 1402, 1, 0, 0, 0, 1404, 1403, 1, 0, 0, 0, 1405, 1408, 1, 0, 0, 0, 1406, 1404, 1, 0, 0, 0, 1406, 1407, 1, 0, 0, 0, 1407, 273, 1, 0, 0, 0, 1408, 1406, 1, 0, 0, 0, 1409, 1420, 3, 358, 176, 0, 1410, 1419, 8, 0, 0, 0, 1411, 1419, 3, 270, 132, 0, 1412, 1413, 3, 360, 177, 0, 1413, 1414, 3, 430, 212, 0, 1414, 1419, 1, 0, 0, 0, 1415, 1416, 3, 358, 176, 0, 1416, 1417, 3, 358, 176, 0, 1417, 1419, 1, 0, 0, 0, 1418, 1410, 1, 0, 0, 0, 1418, 1411, 1, 0, 0, 0, 1418, 1412, 1, 0, 0, 0, 1418, 1415, 1, 0, 0, 0, 1419, 1422, 1, 0, 0, 0, 1420, 1418, 1, 0, 0, 0, 1420, 1421, 1, 0, 0, 0, 1421, 1423, 1, 0, 0, 0, 1422, 1420, 1, 0, 0, 0, 1423, 1424, 3, 358, 176, 0, 1424, 1442, 1, 0, 0, 0, 1425, 1436, 3, 424, 209, 0, 1426, 1435, 8, 1, 0, 0, 1427, 1435, 3, 270, 132, 0, 1428, 1429, 3, 360, 177, 0, 1429, 1430, 3, 424, 209, 0, 1430, 1435, 1, 0, 0, 0, 1431, 1432, 3, 424, 209, 0, 1432, 1433, 3, 424, 209, 0, 1433, 1435, 1, 0, 0, 0, 1434, 1426, 1, 0, 0, 0, 1434, 1427, 1, 0, 0, 0, 1434, 1428, 1, 0, 0, 0, 1434, 1431, 1, 0, 0, 0, 1435, 1438, 1, 0, 0, 0, 1436, 1434, 1, 0, 0, 0, 1436, 1437, 1, 0, 0, 0, 1437, 1439, 1, 0, 0, 0, 1438, 1436, 1, 0, 0, 0, 1439, 1440, 3, 424, 209, 0, 1440, 1442, 1, 0, 0, 0, 1441, 1409, 1, 0, 0, 0, 1441, 1425, 1, 0, 0, 0, 1442, 275, 1, 0, 0, 0, 1443, 1444, 3, 284, 139, 0, 1444, 1448, 3, 376, 185, 0, 1445, 1447, 3, 352, 173, 0, 1446, 1445, 1, 0, 0, 0, 1447, 1450, 1, 0, 0, 0, 1448, 1446, 1, 0, 0, 0, 1448, 1449, 1, 0, 0, 0, 1449, 1451, 1, 0, 0, 0, 1450, 1448, 1, 0, 0, 0, 1451, 1454, 3, 322, 158, 0, 1452, 1455, 3, 420, 207, 0, 1453, 1455, 3, 372, 183, 0, 1454, 1452, 1, 0, 0, 0, 1454, 1453, 1, 0, 0, 0, 1454, 1455, 1, 0, 0, 0, 1455, 1457, 1, 0, 0, 0, 1456, 1458, 3, 350, 172, 0, 1457, 1456, 1, 0, 0, 0, 1458, 1459, 1, 0, 0, 0, 1459, 1457, 1, 0, 0, 0, 1459, 1460, 1, 0, 0, 0, 1460, 1514, 1, 0, 0, 0, 1461, 1462, 3, 284, 139, 0, 1462, 1465, 3, 322, 158, 0, 1463, 1466, 3, 420, 207, 0, 1464, 1466, 3, 372, 183, 0, 1465, 1463, 1, 0, 0, 0, 1465, 1464, 1, 0, 0, 0, 1465, 1466, 1, 0, 0, 0, 1466, 1468, 1, 0, 0, 0, 1467, 1469, 3, 350, 172, 0, 1468, 1467, 1, 0, 0, 0, 1469, 1470, 1, 0, 0, 0, 1470, 1468, 1, 0, 0, 0, 1470, 1471, 1, 0, 0, 0, 1471, 1514, 1, 0, 0, 0, 1472, 1473, 3, 282, 138, 0, 1473, 1477, 3, 376, 185, 0, 1474, 1476, 3, 350, 172, 0, 1475, 1474, 1, 0, 0, 0, 1476, 1479, 1, 0, 0, 0, 1477, 1475, 1, 0, 0, 0, 1477, 1478, 1, 0, 0, 0, 1478, 1480, 1, 0, 0, 0, 1479, 1477, 1, 0, 0, 0, 1480, 1483, 3, 300, 147, 0, 1481, 1484, 3, 420, 207, 0, 1482, 1484, 3, 372, 183, 0, 1483, 1481, 1, 0, 0, 0, 1483, 1482, 1, 0, 0, 0, 1483, 1484, 1, 0, 0, 0, 1484, 1486, 1, 0, 0, 0, 1485, 1487, 3, 350, 172, 0, 1486, 1485, 1, 0, 0, 0, 1487, 1488, 1, 0, 0, 0, 1488, 1486, 1, 0, 0, 0, 1488, 1489, 1, 0, 0, 0, 1489, 1514, 1, 0, 0, 0, 1490, 1491, 3, 376, 185, 0, 1491, 1492, 3, 282, 138, 0, 1492, 1495, 3, 300, 147, 0, 1493, 1496, 3, 420, 207, 0, 1494, 1496, 3, 372, 183, 0, 1495, 1493, 1, 0, 0, 0, 1495, 1494, 1, 0, 0, 0, 1495, 1496, 1, 0, 0, 0, 1496, 1498, 1, 0, 0, 0, 1497, 1499, 3, 350, 172, 0, 1498, 1497, 1, 0, 0, 0, 1499, 1500, 1, 0, 0, 0, 1500, 1498, 1, 0, 0, 0, 1500, 1501, 1, 0, 0, 0, 1501, 1514, 1, 0, 0, 0, 1502, 1503, 3, 282, 138, 0, 1503, 1506, 3, 300, 147, 0, 1504, 1507, 3, 420, 207, 0, 1505, 1507, 3, 372, 183, 0, 1506, 1504, 1, 0, 0, 0, 1506, 1505, 1, 0, 0, 0, 1506, 1507, 1, 0, 0, 0, 1507, 1509, 1, 0, 0, 0, 1508, 1510, 3, 350, 172, 0, 1509, 1508, 1, 0, 0, 0, 1510, 1511, 1, 0, 0, 0, 1511, 1509, 1, 0, 0, 0, 1511, 1512, 1, 0, 0, 0, 1512, 1514, 1, 0, 0, 0, 1513, 1443, 1, 0, 0, 0, 1513, 1461, 1, 0, 0, 0, 1513, 1472, 1, 0, 0, 0, 1513, 1490, 1, 0, 0, 0, 1513, 1502, 1, 0, 0, 0, 1514, 277, 1, 0, 0, 0, 1515, 1516, 5, 48, 0, 0, 1516, 1518, 3, 294, 144, 0, 1517, 1519, 3, 346, 170, 0, 1518, 1517, 1, 0, 0, 0, 1519, 1520, 1, 0, 0, 0, 1520, 1518, 1, 0, 0, 0, 1520, 1521, 1, 0, 0, 0, 1521, 279, 1, 0, 0, 0, 1522, 1524, 5, 48, 0, 0, 1523, 1525, 3, 348, 171, 0, 1524, 1523, 1, 0, 0, 0, 1525, 1526, 1, 0, 0, 0, 1526, 1524, 1, 0, 0, 0, 1526, 1527, 1, 0, 0, 0, 1527, 281, 1, 0, 0, 0, 1528, 1530, 3, 350, 172, 0, 1529, 1528, 1, 0, 0, 0, 1530, 1531, 1, 0, 0, 0, 1531, 1529, 1, 0, 0, 0, 1531, 1532, 1, 0, 0, 0, 1532, 283, 1, 0, 0, 0, 1533, 1534, 5, 48, 0, 0, 1534, 1536, 3, 338, 166, 0, 1535, 1537, 3, 352, 173, 0, 1536, 1535, 1, 0, 0, 0, 1537, 1538, 1, 0, 0, 0, 1538, 1536, 1, 0, 0, 0, 1538, 1539, 1, 0, 0, 0, 1539, 285, 1, 0, 0, 0, 1540, 1541, 5, 48, 0, 0, 1541, 1543, 7, 2, 0, 0, 1542, 1544, 3, 350, 172, 0, 1543, 1542, 1, 0, 0, 0, 1544, 1545, 1, 0, 0, 0, 1545, 1543, 1, 0, 0, 0, 1545, 1546, 1, 0, 0, 0, 1546, 287, 1, 0, 0, 0, 1547, 1548, 5, 48, 0, 0, 1548, 1550, 7, 3, 0, 0, 1549, 1551, 3, 350, 172, 0, 1550, 1549, 1, 0, 0, 0, 1551, 1552, 1, 0, 0, 0, 1552, 1550, 1, 0, 0, 0, 1552, 1553, 1, 0, 0, 0, 1553, 289, 1, 0, 0, 0, 1554, 1565, 3, 430, 212, 0, 1555, 1564, 8, 4, 0, 0, 1556, 1564, 3, 270, 132, 0, 1557, 1558, 3, 360, 177, 0, 1558, 1559, 3, 430, 212, 0, 1559, 1564, 1, 0, 0, 0, 1560, 1561, 3, 430, 212, 0, 1561, 1562, 3, 430, 212, 0, 1562, 1564, 1, 0, 0, 0, 1563, 1555, 1, 0, 0, 0, 1563, 1556, 1, 0, 0, 0, 1563, 1557, 1, 0, 0, 0, 1563, 1560, 1, 0, 0, 0, 1564, 1567, 1, 0, 0, 0, 1565, 1563, 1, 0, 0, 0, 1565, 1566, 1, 0, 0, 0, 1566, 1568, 1, 0, 0, 0, 1567, 1565, 1, 0, 0, 0, 1568, 1569, 3, 430, 212, 0, 1569, 291, 1, 0, 0, 0, 1570, 1571, 7, 5, 0, 0, 1571, 293, 1, 0, 0, 0, 1572, 1573, 7, 3, 0, 0, 1573, 295, 1, 0, 0, 0, 1574, 1575, 7, 6, 0, 0, 1575, 297, 1, 0, 0, 0, 1576, 1577, 7, 7, 0, 0, 1577, 299, 1, 0, 0, 0, 1578, 1579, 7, 8, 0, 0, 1579, 301, 1, 0, 0, 0, 1580, 1581, 7, 9, 0, 0, 1581, 303, 1, 0, 0, 0, 1582, 1583, 7, 10, 0, 0, 1583, 305, 1, 0, 0, 0, 1584, 1585, 7, 11, 0, 0, 1585, 307, 1, 0, 0, 0, 1586, 1587, 7, 12, 0, 0, 1587, 309, 1, 0, 0, 0, 1588, 1589, 7, 13, 0, 0, 1589, 311, 1, 0, 0, 0, 1590, 1591, 7, 14, 0, 0, 1591, 313, 1, 0, 0, 0, 1592, 1593, 7, 15, 0, 0, 1593, 315, 1, 0, 0, 0, 1594, 1595, 7, 16, 0, 0, 1595, 317, 1, 0, 0, 0, 1596, 1597, 7, 17, 0, 0, 1597, 319, 1, 0, 0, 0, 1598, 1599, 7, 2, 0, 0, 1599, 321, 1, 0, 0, 0, 1600, 1601, 7, 18, 0, 0, 1601, 323, 1, 0, 0, 0, 1602, 1603, 7, 19, 0, 0, 1603, 325, 1, 0, 0, 0, 1604, 1605, 7, 20, 0, 0, 1605, 327, 1, 0, 0, 0, 1606, 1607, 7, 21, 0, 0, 1607, 329, 1, 0, 0, 0, 1608, 1609, 7, 22, 0, 0, 1609, 331, 1, 0, 0, 0, 1610, 1611, 7, 23, 0, 0, 1611, 333, 1, 0, 0, 0, 1612, 1613, 7, 24, 0, 0, 1613, 335, 1, 0, 0, 0, 1614, 1615, 7, 25, 0, 0, 1615, 337, 1, 0, 0, 0, 1616, 1617, 7, 26, 0, 0, 1617, 339, 1, 0, 0, 0, 1618, 1619, 7, 27, 0, 0, 1619, 341, 1, 0, 0, 0, 1620, 1621, 7, 28, 0, 0, 1621, 343, 1, 0, 0, 0, 1622, 1623, 7, 29, 0, 0, 1623, 345, 1, 0, 0, 0, 1624, 1625, 7, 30, 0, 0, 1625, 347, 1, 0, 0, 0, 1626, 1627, 7, 31, 0, 0, 1627, 349, 1, 0, 0, 0, 1628, 1629, 7, 32, 0, 0, 1629, 351, 1, 0, 0, 0, 1630, 1631, 7, 33, 0, 0, 1631, 353, 1, 0, 0, 0, 1632, 1633, 5, 45, 0, 0, 1633, 1634, 5, 62, 0, 0, 1634, 355, 1, 0, 0, 0, 1635, 1636, 5, 42, 0, 0, 1636, 357, 1, 0, 0, 0, 1637, 1638, 5, 96, 0, 0, 1638, 359, 1, 0, 0, 0, 1639, 1640, 5, 92, 0, 0, 1640, 361, 1, 0, 0, 0, 1641, 1642, 5, 58, 0, 0, 1642, 1643, 5, 58, 0, 0, 1643, 363, 1, 0, 0, 0, 1644, 1645, 5, 58, 0, 0, 1645, 1646, 5, 61, 0, 0, 1646, 365, 1, 0, 0, 0, 1647, 1648, 5, 58, 0, 0, 1648, 367, 1, 0, 0, 0, 1649, 1650, 5, 44, 0, 0, 1650, 369, 1, 0, 0, 0, 1651, 1652, 5, 124, 0, 0, 1652, 1653, 5, 124, 0, 0, 1653, 371, 1, 0, 0, 0, 1654, 1655, 5, 45, 0, 0, 1655, 373, 1, 0, 0, 0, 1656, 1657, 5, 36, 0, 0, 1657, 375, 1, 0, 0, 0, 1658, 1659, 5, 46, 0, 0, 1659, 377, 1, 0, 0, 0, 1660, 1661, 5, 61, 0, 0, 1661, 1662, 5, 61, 0, 0, 1662, 379, 1, 0, 0, 0, 1663, 1664, 5, 61, 0, 0, 1664, 381, 1, 0, 0, 0, 1665, 1666, 5, 62, 0, 0, 1666, 1667, 5, 61, 0, 0, 1667, 383, 1, 0, 0, 0, 1668, 1669, 5, 62, 0, 0, 1669, 385, 1, 0, 0, 0, 1670, 1671, 5, 35, 0, 0, 1671, 387, 1, 0, 0, 0, 1672, 1673, 5, 126, 0, 0, 1673, 1674, 5, 42, 0, 0, 1674, 389, 1, 0, 0, 0, 1675, 1676, 5, 61, 0, 0, 1676, 1677, 5, 126, 0, 0, 1677, 1678, 5, 42, 0, 0, 1678, 391, 1, 0, 0, 0, 1679, 1680, 5, 123, 0, 0, 1680, 1681, 1, 0, 0, 0, 1681, 1682, 6, 193, 0, 0, 1682, 393, 1, 0, 0, 0, 1683, 1684, 5, 91, 0, 0, 1684, 395, 1, 0, 0, 0, 1685, 1686, 5, 40, 0, 0, 1686, 397, 1, 0, 0, 0, 1687, 1688, 5, 60, 0, 0, 1688, 1689, 5, 61, 0, 0, 1689, 399, 1, 0, 0, 0, 1690, 1691, 5, 60, 0, 0, 1691, 1692, 5, 47, 0, 0, 1692, 1693, 1, 0, 0, 0, 1693, 1694, 6, 197, 1, 0, 1694, 1695, 6, 197, 2, 0, 1695, 401, 1, 0, 0, 0, 1696, 1697, 5, 60, 0, 0, 1697, 1698, 4, 198, 0, 0, 1698, 1699, 1, 0, 0, 0, 1699, 1700, 6, 198, 3, 0, 1700, 1701, 6, 198, 4, 0, 1701, 403, 1, 0, 0, 0, 1702, 1703, 5, 60, 0, 0, 1703, 405, 1, 0, 0, 0, 1704, 1705, 5, 60, 0, 0, 1705, 1706, 5, 47, 0, 0, 1706, 407, 1, 0, 0, 0, 1707, 1708, 5, 33, 0, 0, 1708, 1712, 5, 61, 0, 0, 1709, 1710, 5, 60, 0, 0, 1710, 1712, 5, 62, 0, 0, 1711, 1707, 1, 0, 0, 0, 1711, 1709, 1, 0, 0, 0, 1712, 409, 1, 0, 0, 0, 1713, 1714, 5, 33, 0, 0, 1714, 1715, 5, 126, 0, 0, 1715, 1716, 5, 42, 0, 0, 1716, 411, 1, 0, 0, 0, 1717, 1718, 5, 33, 0, 0, 1718, 1719, 5, 126, 0, 0, 1719, 413, 1, 0, 0, 0, 1720, 1721, 5, 63, 0, 0, 1721, 1722, 5, 46, 0, 0, 1722, 415, 1, 0, 0, 0, 1723, 1724, 5, 63, 0, 0, 1724, 1725, 5, 63, 0, 0, 1725, 417, 1, 0, 0, 0, 1726, 1727, 5, 37, 0, 0, 1727, 419, 1, 0, 0, 0, 1728, 1729, 5, 43, 0, 0, 1729, 421, 1, 0, 0, 0, 1730, 1731, 5, 63, 0, 0, 1731, 423, 1, 0, 0, 0, 1732, 1733, 5, 34, 0, 0, 1733, 425, 1, 0, 0, 0, 1734, 1735, 5, 102, 0, 0, 1735, 1736, 5, 39, 0, 0, 1736, 1737, 1, 0, 0, 0, 1737, 1738, 6, 210, 5, 0, 1738, 427, 1, 0, 0, 0, 1739, 1740, 5, 70, 0, 0, 1740, 1741, 5, 39, 0, 0, 1741, 1742, 1, 0, 0, 0, 1742, 1743, 6, 211, 6, 0, 1743, 429, 1, 0, 0, 0, 1744, 1745, 5, 39, 0, 0, 1745, 431, 1, 0, 0, 0, 1746, 1747, 5, 126, 0, 0, 1747, 433, 1, 0, 0, 0, 1748, 1749, 5, 61, 0, 0, 1749, 1750, 5, 126, 0, 0, 1750, 435, 1, 0, 0, 0, 1751, 1752, 5, 125, 0, 0, 1752, 1753, 1, 0, 0, 0, 1753, 1754, 6, 215, 7, 0, 1754, 437, 1, 0, 0, 0, 1755, 1756, 5, 93, 0, 0, 1756, 439, 1, 0, 0, 0, 1757, 1758, 5, 41, 0, 0, 1758, 441, 1, 0, 0, 0, 1759, 1760, 5, 59, 0, 0, 1760, 443, 1, 0, 0, 0, 1761, 1762, 5, 47, 0, 0, 1762, 445, 1, 0, 0, 0, 1763, 1764, 5, 47, 0, 0, 1764, 1765, 5, 62, 0, 0, 1765, 447, 1, 0, 0, 0, 1766, 1767, 5, 95, 0, 0, 1767, 449, 1, 0, 0, 0, 1768, 1769, 5, 47, 0, 0, 1769, 1770, 5, 42, 0, 0, 1770, 1774, 1, 0, 0, 0, 1771, 1773, 9, 0, 0, 0, 1772, 1771, 1, 0, 0, 0, 1773, 1776, 1, 0, 0, 0, 1774, 1775, 1, 0, 0, 0, 1774, 1772, 1, 0, 0, 0, 1775, 1777, 1, 0, 0, 0, 1776, 1774, 1, 0, 0, 0, 1777, 1778, 5, 42, 0, 0, 1778, 1779, 5, 47, 0, 0, 1779, 1780, 1, 0, 0, 0, 1780, 1781, 6, 222, 8, 0, 1781, 451, 1, 0, 0, 0, 1782, 1783, 5, 45, 0, 0, 1783, 1787, 5, 45, 0, 0, 1784, 1785, 5, 47, 0, 0, 1785, 1787, 5, 47, 0, 0, 1786, 1782, 1, 0, 0, 0, 1786, 1784, 1, 0, 0, 0, 1787, 1791, 1, 0, 0, 0, 1788, 1790, 8, 34, 0, 0, 1789, 1788, 1, 0, 0, 0, 1790, 1793, 1, 0, 0, 0, 1791, 1789, 1, 0, 0, 0, 1791, 1792, 1, 0, 0, 0, 1792, 1795, 1, 0, 0, 0, 1793, 1791, 1, 0, 0, 0, 1794, 1796, 7, 35, 0, 0, 1795, 1794, 1, 0, 0, 0, 1796, 1797, 1, 0, 0, 0, 1797, 1798, 6, 223, 8, 0, 1798, 453, 1, 0, 0, 0, 1799, 1800, 7, 36, 0, 0, 1800, 1801, 1, 0, 0, 0, 1801, 1802, 6, 224, 9, 0, 1802, 455, 1, 0, 0, 0, 1803, 1804, 9, 0, 0, 0, 1804, 457, 1, 0, 0, 0, 1805, 1817, 8, 37, 0, 0, 1806, 1817, 3, 270, 132, 0, 1807, 1808, 3, 360, 177, 0, 1808, 1809, 3, 430, 212, 0, 1809, 1817, 1, 0, 0, 0, 1810, 1811, 3, 360, 177, 0, 1811, 1812, 3, 392, 193, 0, 1812, 1817, 1, 0, 0, 0, 1813, 1814, 3, 430, 212, 0, 1814, 1815, 3, 430, 212, 0, 1815, 1817, 1, 0, 0, 0, 1816, 1805, 1, 0, 0, 0, 1816, 1806, 1, 0, 0, 0, 1816, 1807, 1, 0, 0, 0, 1816, 1810, 1, 0, 0, 0, 1816, 1813, 1, 0, 0, 0, 1817, 1818, 1, 0, 0, 0, 1818, 1816, 1, 0, 0, 0, 1818, 1819, 1, 0, 0, 0, 1819, 459, 1, 0, 0, 0, 1820, 1821, 3, 392, 193, 0, 1821, 1822, 1, 0, 0, 0, 1822, 1823, 6, 227, 0, 0, 1823, 461, 1, 0, 0, 0, 1824, 1825, 3, 430, 212, 0, 1825, 1826, 1, 0, 0, 0, 1826, 1827, 6, 228, 10, 0, 1827, 1828, 6, 228, 7, 0, 1828, 463, 1, 0, 0, 0, 1829, 1835, 8, 38, 0, 0, 1830, 1835, 3, 270, 132, 0, 1831, 1832, 3, 360, 177, 0, 1832, 1833, 3, 392, 193, 0, 1833, 1835, 1, 0, 0, 0, 1834, 1829, 1, 0, 0, 0, 1834, 1830, 1, 0, 0, 0, 1834, 1831, 1, 0, 0, 0, 1835, 1836, 1, 0, 0, 0, 1836, 1834, 1, 0, 0, 0, 1836, 1837, 1, 0, 0, 0, 1837, 465, 1, 0, 0, 0, 1838, 1839, 3, 392, 193, 0, 1839, 1840, 1, 0, 0, 0, 1840, 1841, 6, 230, 0, 0, 1841, 467, 1, 0, 0, 0, 1842, 1843, 5, 47, 0, 0, 1843, 1844, 5, 62, 0, 0, 1844, 1845, 1, 0, 0, 0, 1845, 1846, 6, 231, 11, 0, 1846, 1847, 6, 231, 7, 0, 1847, 469, 1, 0, 0, 0, 1848, 1849, 5, 62, 0, 0, 1849, 1850, 1, 0, 0, 0, 1850, 1851, 6, 232, 12, 0, 1851, 1852, 6, 232, 7, 0, 1852, 1853, 6, 232, 13, 0, 1853, 471, 1, 0, 0, 0, 1854, 1855, 5, 47, 0, 0, 1855, 1856, 5, 42, 0, 0, 1856, 1860, 1, 0, 0, 0, 1857, 1859, 9, 0, 0, 0, 1858, 1857, 1, 0, 0, 0, 1859, 1862, 1, 0, 0, 0, 1860, 1861, 1, 0, 0, 0, 1860, 1858, 1, 0, 0, 0, 1861, 1863, 1, 0, 0, 0, 1862, 1860, 1, 0, 0, 0, 1863, 1864, 5, 42, 0, 0, 1864, 1865, 5, 47, 0, 0, 1865, 1866, 1, 0, 0, 0, 1866, 1867, 6, 233, 8, 0, 1867, 473, 1, 0, 0, 0, 1868, 1869, 5, 45, 0, 0, 1869, 1873, 5, 45, 0, 0, 1870, 1871, 5, 47, 0, 0, 1871, 1873, 5, 47, 0, 0, 1872, 1868, 1, 0, 0, 0, 1872, 1870, 1, 0, 0, 0, 1873, 1877, 1, 0, 0, 0, 1874, 1876, 8, 34, 0, 0, 1875, 1874, 1, 0, 0, 0, 1876, 1879, 1, 0, 0, 0, 1877, 1875, 1, 0, 0, 0, 1877, 1878, 1, 0, 0, 0, 1878, 1881, 1, 0, 0, 0, 1879, 1877, 1, 0, 0, 0, 1880, 1882, 7, 35, 0, 0, 1881, 1880, 1, 0, 0, 0, 1882, 1883, 1, 0, 0, 0, 1883, 1884, 6, 234, 8, 0, 1884, 475, 1, 0, 0, 0, 1885, 1889, 7, 39, 0, 0, 1886, 1888, 7, 40, 0, 0, 1887, 1886, 1, 0, 0, 0, 1888, 1891, 1, 0, 0, 0, 1889, 1887, 1, 0, 0, 0, 1889, 1890, 1, 0, 0, 0, 1890, 1892, 1, 0, 0, 0, 1891, 1889, 1, 0, 0, 0, 1892, 1893, 6, 235, 14, 0, 1893, 477, 1, 0, 0, 0, 1894, 1895, 5, 61, 0, 0, 1895, 1896, 1, 0, 0, 0, 1896, 1897, 6, 236, 15, 0, 1897, 479, 1, 0, 0, 0, 1898, 1899, 3, 290, 142, 0, 1899, 1900, 1, 0, 0, 0, 1900, 1901, 6, 237, 16, 0, 1901, 481, 1, 0, 0, 0, 1902, 1904, 7, 41, 0, 0, 1903, 1902, 1, 0, 0, 0, 1904, 1905, 1, 0, 0, 0, 1905, 1903, 1, 0, 0, 0, 1905, 1906, 1, 0, 0, 0, 1906, 1907, 1, 0, 0, 0, 1907, 1908, 6, 238, 9, 0, 1908, 483, 1, 0, 0, 0, 1909, 1910, 5, 123, 0, 0, 1910, 1911, 1, 0, 0, 0, 1911, 1912, 6, 239, 17, 0, 1912, 1913, 6, 239, 0, 0, 1913, 485, 1, 0, 0, 0, 1914, 1915, 9, 0, 0, 0, 1915, 1916, 1, 0, 0, 0, 1916, 1917, 6, 240, 18, 0, 1917, 487, 1, 0, 0, 0, 1918, 1919, 5, 62, 0, 0, 1919, 1920, 1, 0, 0, 0, 1920, 1921, 6, 241, 12, 0, 1921, 1922, 6, 241, 7, 0, 1922, 489, 1, 0, 0, 0, 1923, 1924, 5, 47, 0, 0, 1924, 1925, 5, 42, 0, 0, 1925, 1929, 1, 0, 0, 0, 1926, 1928, 9, 0, 0, 0, 1927, 1926, 1, 0, 0, 0, 1928, 1931, 1, 0, 0, 0, 1929, 1930, 1, 0, 0, 0, 1929, 1927, 1, 0, 0, 0, 1930, 1932, 1, 0, 0, 0, 1931, 1929, 1, 0, 0, 0, 1932, 1933, 5, 42, 0, 0, 1933, 1934, 5, 47, 0, 0, 1934, 1935, 1, 0, 0, 0, 1935, 1936, 6, 242, 8, 0, 1936, 491, 1, 0, 0, 0, 1937, 1938, 5, 45, 0, 0, 1938, 1942, 5, 45, 0, 0, 1939, 1940, 5, 47, 0, 0, 1940, 1942, 5, 47, 0, 0, 1941, 1937, 1, 0, 0, 0, 1941, 1939, 1, 0, 0, 0, 1942, 1946, 1, 0, 0, 0, 1943, 1945, 8, 34, 0, 0, 1944, 1943, 1, 0, 0, 0, 1945, 1948, 1, 0, 0, 0, 1946, 1944, 1, 0, 0, 0, 1946, 1947, 1, 0, 0, 0, 1947, 1950, 1, 0, 0, 0, 1948, 1946, 1, 0, 0, 0, 1949, 1951, 7, 35, 0, 0, 1950, 1949, 1, 0, 0, 0, 1951, 1952, 1, 0, 0, 0, 1952, 1953, 6, 243, 8, 0, 1953, 493, 1, 0, 0, 0, 1954, 1958, 7, 39, 0, 0, 1955, 1957, 7, 40, 0, 0, 1956, 1955, 1, 0, 0, 0, 1957, 1960, 1, 0, 0, 0, 1958, 1956, 1, 0, 0, 0, 1958, 1959, 1, 0, 0, 0, 1959, 1961, 1, 0, 0, 0, 1960, 1958, 1, 0, 0, 0, 1961, 1962, 6, 244, 14, 0, 1962, 495, 1, 0, 0, 0, 1963, 1965, 7, 41, 0, 0, 1964, 1963, 1, 0, 0, 0, 1965, 1966, 1, 0, 0, 0, 1966, 1964, 1, 0, 0, 0, 1966, 1967, 1, 0, 0, 0, 1967, 1968, 1, 0, 0, 0, 1968, 1969, 6, 245, 9, 0, 1969, 497, 1, 0, 0, 0, 1970, 1971, 9, 0, 0, 0, 1971, 1972, 1, 0, 0, 0, 1972, 1973, 6, 246, 18, 0, 1973, 499, 1, 0, 0, 0, 1974, 1976, 8, 42, 0, 0, 1975, 1974, 1, 0, 0, 0, 1976, 1977, 1, 0, 0, 0, 1977, 1975, 1, 0, 0, 0, 1977, 1978, 1, 0, 0, 0, 1978, 501, 1, 0, 0, 0, 1979, 1980, 5, 123, 0, 0, 1980, 1981, 1, 0, 0, 0, 1981, 1982, 6, 248, 17, 0, 1982, 1983, 6, 248, 0, 0, 1983, 503, 1, 0, 0, 0, 1984, 1985, 5, 60, 0, 0, 1985, 1986, 5, 47, 0, 0, 1986, 1987, 1, 0, 0, 0, 1987, 1988, 6, 249, 1, 0, 1988, 1989, 6, 249, 7, 0, 1989, 1990, 6, 249, 2, 0, 1990, 505, 1, 0, 0, 0, 1991, 1992, 5, 60, 0, 0, 1992, 1993, 1, 0, 0, 0, 1993, 1994, 6, 250, 3, 0, 1994, 1995, 6, 250, 4, 0, 1995, 507, 1, 0, 0, 0, 1996, 1998, 7, 41, 0, 0, 1997, 1996, 1, 0, 0, 0, 1998, 1999, 1, 0, 0, 0, 1999, 1997, 1, 0, 0, 0, 1999, 2000, 1, 0, 0, 0, 2000, 2001, 1, 0, 0, 0, 2001, 2002, 6, 251, 9, 0, 2002, 509, 1, 0, 0, 0, 62, 0, 1, 2, 3, 4, 5, 550, 830, 1359, 1393, 1398, 1404, 1406, 1418, 1420, 1434, 1436, 1441, 1448, 1454, 1459, 1465, 1470, 1477, 1483, 1488, 1495, 1500, 1506, 1511, 1513, 1520, 1526, 1531, 1538, 1545, 1552, 1563, 1565, 1711, 1774, 1786, 1791, 1795, 1816, 1818, 1834, 1836, 1860, 1872, 1877, 1881, 1889, 1905, 1929, 1941, 1946, 1950, 1958, 1966, 1977, 1999, 19, 5, 0, 0, 7, 168, 0, 5, 4, 0, 7, 167, 0, 5, 3, 0, 5, 1, 0, 5, 2, 0, 4, 0, 0, 6, 0, 0, 0, 1, 0, 7, 180, 0, 7, 188, 0, 7, 159, 0, 5, 5, 0, 7, 134, 0, 7, 157, 0, 7, 143, 0, 7, 163, 0, 7, 193, 0]
\ No newline at end of file
diff --git a/common/hogql_parser/HogQLLexer.tokens b/common/hogql_parser/HogQLLexer.tokens
index 0c367d1ea732..73381877cef8 100644
--- a/common/hogql_parser/HogQLLexer.tokens
+++ b/common/hogql_parser/HogQLLexer.tokens
@@ -195,10 +195,14 @@ STRING_TEXT=194
STRING_ESCAPE_TRIGGER=195
FULL_STRING_TEXT=196
FULL_STRING_ESCAPE_TRIGGER=197
-TAG_WS=198
-TAGC_WS=199
-HOGQLX_TEXT_TEXT=200
-HOGQLX_TEXT_WS=201
+TAG_MULTI_LINE_COMMENT=198
+TAG_SINGLE_LINE_COMMENT=199
+TAG_WS=200
+TAGC_MULTI_LINE_COMMENT=201
+TAGC_SINGLE_LINE_COMMENT=202
+TAGC_WS=203
+HOGQLX_TEXT_TEXT=204
+HOGQLX_TEXT_WS=205
'->'=144
'*'=145
'`'=146
diff --git a/common/hogql_parser/HogQLParser.cpp b/common/hogql_parser/HogQLParser.cpp
index 2716d3a92b25..3a1590454c52 100644
--- a/common/hogql_parser/HogQLParser.cpp
+++ b/common/hogql_parser/HogQLParser.cpp
@@ -128,12 +128,13 @@ void hogqlparserParserInitialize() {
"REGEX_SINGLE", "REGEX_DOUBLE", "RBRACE", "RBRACKET", "RPAREN", "SEMICOLON",
"SLASH", "SLASH_GT", "UNDERSCORE", "MULTI_LINE_COMMENT", "SINGLE_LINE_COMMENT",
"WHITESPACE", "UNEXPECTED_CHARACTER", "STRING_TEXT", "STRING_ESCAPE_TRIGGER",
- "FULL_STRING_TEXT", "FULL_STRING_ESCAPE_TRIGGER", "TAG_WS", "TAGC_WS",
- "HOGQLX_TEXT_TEXT", "HOGQLX_TEXT_WS"
+ "FULL_STRING_TEXT", "FULL_STRING_ESCAPE_TRIGGER", "TAG_MULTI_LINE_COMMENT",
+ "TAG_SINGLE_LINE_COMMENT", "TAG_WS", "TAGC_MULTI_LINE_COMMENT", "TAGC_SINGLE_LINE_COMMENT",
+ "TAGC_WS", "HOGQLX_TEXT_TEXT", "HOGQLX_TEXT_WS"
}
);
static const int32_t serializedATNSegment[] = {
- 4,1,201,2081,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,
+ 4,1,205,2081,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,
@@ -810,7 +811,7 @@ void hogqlparserParserInitialize() {
3,154,77,0,1725,1726,5,6,0,0,1726,1727,3,220,110,0,1727,161,1,0,0,0,1728,
1735,3,166,83,0,1729,1735,3,164,82,0,1730,1731,5,163,0,0,1731,1732,3,
154,77,0,1732,1733,5,183,0,0,1733,1735,1,0,0,0,1734,1728,1,0,0,0,1734,
- 1729,1,0,0,0,1734,1730,1,0,0,0,1735,163,1,0,0,0,1736,1737,5,200,0,0,1737,
+ 1729,1,0,0,0,1734,1730,1,0,0,0,1735,163,1,0,0,0,1736,1737,5,204,0,0,1737,
165,1,0,0,0,1738,1739,5,167,0,0,1739,1743,3,220,110,0,1740,1742,3,168,
84,0,1741,1740,1,0,0,0,1742,1745,1,0,0,0,1743,1741,1,0,0,0,1743,1744,
1,0,0,0,1744,1746,1,0,0,0,1745,1743,1,0,0,0,1746,1747,5,188,0,0,1747,
@@ -14048,7 +14049,7 @@ HogQLParser::HogqlxTagElementContext* HogQLParser::hogqlxTagElement() {
_errHandler->sync(this);
_la = _input->LA(1);
while (((((_la - 163) & ~ 0x3fULL) == 0) &&
- ((1ULL << (_la - 163)) & 137438953489) != 0)) {
+ ((1ULL << (_la - 163)) & 2199023255569) != 0)) {
setState(1757);
hogqlxChildElement();
setState(1762);
diff --git a/common/hogql_parser/HogQLParser.h b/common/hogql_parser/HogQLParser.h
index 7117f08a671d..7e673fbc5e40 100644
--- a/common/hogql_parser/HogQLParser.h
+++ b/common/hogql_parser/HogQLParser.h
@@ -50,8 +50,10 @@ public:
RPAREN = 185, SEMICOLON = 186, SLASH = 187, SLASH_GT = 188, UNDERSCORE = 189,
MULTI_LINE_COMMENT = 190, SINGLE_LINE_COMMENT = 191, WHITESPACE = 192,
UNEXPECTED_CHARACTER = 193, STRING_TEXT = 194, STRING_ESCAPE_TRIGGER = 195,
- FULL_STRING_TEXT = 196, FULL_STRING_ESCAPE_TRIGGER = 197, TAG_WS = 198,
- TAGC_WS = 199, HOGQLX_TEXT_TEXT = 200, HOGQLX_TEXT_WS = 201
+ FULL_STRING_TEXT = 196, FULL_STRING_ESCAPE_TRIGGER = 197, TAG_MULTI_LINE_COMMENT = 198,
+ TAG_SINGLE_LINE_COMMENT = 199, TAG_WS = 200, TAGC_MULTI_LINE_COMMENT = 201,
+ TAGC_SINGLE_LINE_COMMENT = 202, TAGC_WS = 203, HOGQLX_TEXT_TEXT = 204,
+ HOGQLX_TEXT_WS = 205
};
enum {
diff --git a/common/hogql_parser/HogQLParser.interp b/common/hogql_parser/HogQLParser.interp
index 776ab695caf4..9fe98608043b 100644
--- a/common/hogql_parser/HogQLParser.interp
+++ b/common/hogql_parser/HogQLParser.interp
@@ -201,6 +201,10 @@ null
null
null
null
+null
+null
+null
+null
token symbolic names:
null
@@ -401,7 +405,11 @@ STRING_TEXT
STRING_ESCAPE_TRIGGER
FULL_STRING_TEXT
FULL_STRING_ESCAPE_TRIGGER
+TAG_MULTI_LINE_COMMENT
+TAG_SINGLE_LINE_COMMENT
TAG_WS
+TAGC_MULTI_LINE_COMMENT
+TAGC_SINGLE_LINE_COMMENT
TAGC_WS
HOGQLX_TEXT_TEXT
HOGQLX_TEXT_WS
@@ -528,4 +536,4 @@ stringContentsFull
atn:
-[4, 1, 201, 2081, 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, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103, 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, 108, 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 2, 111, 7, 111, 2, 112, 7, 112, 2, 113, 7, 113, 2, 114, 7, 114, 2, 115, 7, 115, 2, 116, 7, 116, 2, 117, 7, 117, 1, 0, 5, 0, 238, 8, 0, 10, 0, 12, 0, 241, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 247, 8, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 255, 8, 3, 1, 4, 1, 4, 1, 4, 5, 4, 260, 8, 4, 10, 4, 12, 4, 263, 9, 4, 1, 4, 3, 4, 266, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 279, 8, 5, 1, 6, 1, 6, 3, 6, 283, 8, 6, 1, 6, 3, 6, 286, 8, 6, 1, 7, 1, 7, 1, 7, 3, 7, 291, 8, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 298, 8, 8, 1, 8, 1, 8, 3, 8, 302, 8, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 5, 9, 309, 8, 9, 10, 9, 12, 9, 312, 9, 9, 1, 9, 1, 9, 3, 9, 316, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 325, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 333, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 340, 8, 12, 1, 12, 1, 12, 3, 12, 344, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 350, 8, 12, 1, 12, 1, 12, 1, 12, 3, 12, 355, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 363, 8, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 370, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 376, 8, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 3, 16, 388, 8, 16, 1, 16, 3, 16, 391, 8, 16, 1, 17, 1, 17, 1, 18, 1, 18, 5, 18, 397, 8, 18, 10, 18, 12, 18, 400, 9, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 5, 20, 411, 8, 20, 10, 20, 12, 20, 414, 9, 20, 1, 20, 3, 20, 417, 8, 20, 1, 21, 1, 21, 1, 21, 3, 21, 422, 8, 21, 1, 21, 3, 21, 425, 8, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 440, 8, 22, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 446, 8, 23, 1, 23, 1, 23, 1, 23, 3, 23, 451, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 457, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 463, 8, 23, 1, 23, 1, 23, 1, 23, 3, 23, 468, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 474, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 480, 8, 23, 1, 23, 1, 23, 1, 23, 3, 23, 485, 8, 23, 3, 23, 487, 8, 23, 1, 23, 1, 23, 1, 24, 1, 24, 5, 24, 493, 8, 24, 10, 24, 12, 24, 496, 9, 24, 1, 24, 3, 24, 499, 8, 24, 1, 24, 3, 24, 502, 8, 24, 1, 25, 1, 25, 1, 25, 3, 25, 507, 8, 25, 1, 25, 1, 25, 3, 25, 511, 8, 25, 1, 25, 1, 25, 3, 25, 515, 8, 25, 1, 25, 1, 25, 1, 25, 3, 25, 520, 8, 25, 1, 25, 1, 25, 3, 25, 524, 8, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 3, 25, 531, 8, 25, 1, 26, 3, 26, 534, 8, 26, 1, 26, 1, 26, 3, 26, 538, 8, 26, 1, 26, 3, 26, 541, 8, 26, 1, 26, 1, 26, 3, 26, 545, 8, 26, 1, 26, 3, 26, 548, 8, 26, 1, 26, 3, 26, 551, 8, 26, 1, 26, 3, 26, 554, 8, 26, 1, 26, 3, 26, 557, 8, 26, 1, 26, 3, 26, 560, 8, 26, 1, 26, 3, 26, 563, 8, 26, 1, 26, 1, 26, 3, 26, 567, 8, 26, 1, 26, 1, 26, 3, 26, 571, 8, 26, 1, 26, 3, 26, 574, 8, 26, 1, 26, 3, 26, 577, 8, 26, 1, 26, 1, 26, 3, 26, 581, 8, 26, 1, 26, 3, 26, 584, 8, 26, 1, 26, 3, 26, 587, 8, 26, 1, 26, 3, 26, 590, 8, 26, 1, 26, 1, 26, 3, 26, 594, 8, 26, 1, 26, 3, 26, 597, 8, 26, 1, 27, 1, 27, 3, 27, 601, 8, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 3, 28, 609, 8, 28, 1, 29, 1, 29, 1, 29, 1, 30, 3, 30, 615, 8, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 5, 31, 634, 8, 31, 10, 31, 12, 31, 637, 9, 31, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 3, 34, 660, 8, 34, 1, 35, 1, 35, 1, 35, 5, 35, 665, 8, 35, 10, 35, 12, 35, 668, 9, 35, 1, 36, 1, 36, 3, 36, 672, 8, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 3, 39, 686, 8, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 5, 40, 693, 8, 40, 10, 40, 12, 40, 696, 9, 40, 1, 40, 1, 40, 3, 40, 700, 8, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 3, 43, 714, 8, 43, 1, 43, 1, 43, 3, 43, 718, 8, 43, 1, 43, 1, 43, 3, 43, 722, 8, 43, 1, 43, 1, 43, 1, 43, 3, 43, 727, 8, 43, 1, 43, 1, 43, 3, 43, 731, 8, 43, 1, 43, 1, 43, 1, 43, 3, 43, 736, 8, 43, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, 5, 46, 748, 8, 46, 10, 46, 12, 46, 751, 9, 46, 1, 47, 1, 47, 1, 47, 1, 47, 5, 47, 757, 8, 47, 10, 47, 12, 47, 760, 9, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 3, 48, 767, 8, 48, 1, 48, 3, 48, 770, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 776, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 784, 8, 48, 1, 48, 3, 48, 787, 8, 48, 1, 48, 1, 48, 1, 48, 3, 48, 792, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 799, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 809, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 817, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 5, 48, 823, 8, 48, 10, 48, 12, 48, 826, 9, 48, 1, 49, 3, 49, 829, 8, 49, 1, 49, 1, 49, 1, 49, 3, 49, 834, 8, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 841, 8, 49, 1, 49, 3, 49, 844, 8, 49, 1, 49, 1, 49, 3, 49, 848, 8, 49, 1, 49, 1, 49, 3, 49, 852, 8, 49, 1, 49, 3, 49, 855, 8, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 861, 8, 49, 3, 49, 863, 8, 49, 1, 49, 3, 49, 866, 8, 49, 1, 49, 1, 49, 3, 49, 870, 8, 49, 1, 49, 1, 49, 3, 49, 874, 8, 49, 1, 49, 3, 49, 877, 8, 49, 3, 49, 879, 8, 49, 3, 49, 881, 8, 49, 1, 50, 1, 50, 1, 50, 3, 50, 886, 8, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 3, 51, 897, 8, 51, 1, 52, 1, 52, 1, 52, 3, 52, 902, 8, 52, 1, 52, 1, 52, 3, 52, 906, 8, 52, 1, 52, 1, 52, 1, 52, 1, 52, 3, 52, 912, 8, 52, 1, 53, 1, 53, 1, 53, 3, 53, 917, 8, 53, 1, 54, 1, 54, 1, 54, 5, 54, 922, 8, 54, 10, 54, 12, 54, 925, 9, 54, 1, 55, 1, 55, 3, 55, 929, 8, 55, 1, 55, 1, 55, 3, 55, 933, 8, 55, 1, 55, 1, 55, 3, 55, 937, 8, 55, 1, 55, 3, 55, 940, 8, 55, 1, 56, 1, 56, 1, 56, 1, 56, 3, 56, 946, 8, 56, 1, 56, 1, 56, 3, 56, 950, 8, 56, 1, 56, 1, 56, 3, 56, 954, 8, 56, 1, 57, 1, 57, 1, 57, 3, 57, 959, 8, 57, 1, 58, 1, 58, 1, 58, 1, 58, 3, 58, 965, 8, 58, 3, 58, 967, 8, 58, 1, 59, 1, 59, 1, 59, 5, 59, 972, 8, 59, 10, 59, 12, 59, 975, 9, 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 61, 3, 61, 982, 8, 61, 1, 61, 3, 61, 985, 8, 61, 1, 61, 3, 61, 988, 8, 61, 1, 62, 1, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 65, 1, 65, 1, 65, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 3, 66, 1013, 8, 66, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 3, 67, 1027, 8, 67, 1, 68, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 5, 69, 1041, 8, 69, 10, 69, 12, 69, 1044, 9, 69, 1, 69, 3, 69, 1047, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 5, 69, 1056, 8, 69, 10, 69, 12, 69, 1059, 9, 69, 1, 69, 3, 69, 1062, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 5, 69, 1071, 8, 69, 10, 69, 12, 69, 1074, 9, 69, 1, 69, 3, 69, 1077, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 3, 69, 1084, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 4, 69, 1090, 8, 69, 11, 69, 12, 69, 1091, 1, 69, 3, 69, 1095, 8, 69, 1, 69, 1, 69, 1, 69, 3, 69, 1100, 8, 69, 1, 69, 5, 69, 1103, 8, 69, 10, 69, 12, 69, 1106, 9, 69, 1, 70, 1, 70, 1, 70, 3, 70, 1111, 8, 70, 1, 70, 1, 70, 1, 70, 1, 70, 3, 70, 1117, 8, 70, 1, 71, 1, 71, 1, 71, 1, 71, 3, 71, 1123, 8, 71, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 5, 73, 1130, 8, 73, 10, 73, 12, 73, 1133, 9, 73, 1, 73, 3, 73, 1136, 8, 73, 1, 74, 1, 74, 1, 74, 5, 74, 1141, 8, 74, 10, 74, 12, 74, 1144, 9, 74, 1, 74, 1, 74, 1, 74, 3, 74, 1149, 8, 74, 1, 75, 1, 75, 1, 75, 5, 75, 1154, 8, 75, 10, 75, 12, 75, 1157, 9, 75, 1, 75, 3, 75, 1160, 8, 75, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 3, 76, 1172, 8, 76, 1, 77, 1, 77, 1, 77, 3, 77, 1177, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 4, 77, 1184, 8, 77, 11, 77, 12, 77, 1185, 1, 77, 1, 77, 3, 77, 1190, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1223, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1271, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1299, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1363, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1371, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1377, 8, 77, 1, 77, 3, 77, 1380, 8, 77, 1, 77, 3, 77, 1383, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1391, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1401, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1407, 8, 77, 1, 77, 3, 77, 1410, 8, 77, 1, 77, 3, 77, 1413, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1421, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1429, 8, 77, 1, 77, 3, 77, 1432, 8, 77, 1, 77, 1, 77, 3, 77, 1436, 8, 77, 1, 77, 3, 77, 1439, 8, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1444, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1453, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1465, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1473, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 5, 77, 1479, 8, 77, 10, 77, 12, 77, 1482, 9, 77, 1, 77, 3, 77, 1485, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1503, 8, 77, 1, 77, 1, 77, 3, 77, 1507, 8, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1512, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1523, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1529, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1536, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1548, 8, 77, 1, 77, 1, 77, 3, 77, 1552, 8, 77, 1, 77, 3, 77, 1555, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1564, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1570, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1586, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1607, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1618, 8, 77, 1, 77, 1, 77, 3, 77, 1622, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1652, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1659, 8, 77, 5, 77, 1661, 8, 77, 10, 77, 12, 77, 1664, 9, 77, 1, 78, 1, 78, 1, 78, 1, 78, 5, 78, 1670, 8, 78, 10, 78, 12, 78, 1673, 9, 78, 1, 78, 3, 78, 1676, 8, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 5, 78, 1683, 8, 78, 10, 78, 12, 78, 1686, 9, 78, 1, 78, 3, 78, 1689, 8, 78, 1, 78, 1, 78, 3, 78, 1693, 8, 78, 1, 78, 1, 78, 1, 78, 3, 78, 1698, 8, 78, 1, 78, 1, 78, 1, 78, 1, 78, 5, 78, 1704, 8, 78, 10, 78, 12, 78, 1707, 9, 78, 1, 78, 3, 78, 1710, 8, 78, 1, 78, 1, 78, 1, 78, 3, 78, 1715, 8, 78, 1, 79, 1, 79, 1, 79, 5, 79, 1720, 8, 79, 10, 79, 12, 79, 1723, 9, 79, 1, 80, 1, 80, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 3, 81, 1735, 8, 81, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 5, 83, 1742, 8, 83, 10, 83, 12, 83, 1745, 9, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 5, 83, 1752, 8, 83, 10, 83, 12, 83, 1755, 9, 83, 1, 83, 1, 83, 5, 83, 1759, 8, 83, 10, 83, 12, 83, 1762, 9, 83, 1, 83, 1, 83, 1, 83, 1, 83, 3, 83, 1768, 8, 83, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 3, 84, 1781, 8, 84, 1, 85, 1, 85, 1, 85, 5, 85, 1786, 8, 85, 10, 85, 12, 85, 1789, 9, 85, 1, 85, 3, 85, 1792, 8, 85, 1, 86, 1, 86, 3, 86, 1796, 8, 86, 1, 86, 1, 86, 1, 86, 3, 86, 1801, 8, 86, 1, 86, 1, 86, 3, 86, 1805, 8, 86, 1, 86, 3, 86, 1808, 8, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 3, 86, 1818, 8, 86, 1, 87, 1, 87, 1, 87, 1, 87, 5, 87, 1824, 8, 87, 10, 87, 12, 87, 1827, 9, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, 1, 88, 3, 88, 1835, 8, 88, 1, 88, 3, 88, 1838, 8, 88, 1, 89, 1, 89, 1, 89, 5, 89, 1843, 8, 89, 10, 89, 12, 89, 1846, 9, 89, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1861, 8, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1871, 8, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1879, 8, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1889, 8, 90, 1, 90, 3, 90, 1892, 8, 90, 5, 90, 1894, 8, 90, 10, 90, 12, 90, 1897, 9, 90, 1, 91, 1, 91, 4, 91, 1901, 8, 91, 11, 91, 12, 91, 1902, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 93, 1, 93, 1, 93, 5, 93, 1914, 8, 93, 10, 93, 12, 93, 1917, 9, 93, 1, 93, 3, 93, 1920, 8, 93, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 5, 94, 1935, 8, 94, 10, 94, 12, 94, 1938, 9, 94, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 3, 95, 1945, 8, 95, 1, 96, 1, 96, 1, 96, 1, 96, 5, 96, 1951, 8, 96, 10, 96, 12, 96, 1954, 9, 96, 1, 96, 1, 96, 1, 97, 1, 97, 1, 97, 3, 97, 1961, 8, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 3, 98, 1968, 8, 98, 1, 98, 1, 98, 1, 99, 1, 99, 1, 99, 5, 99, 1975, 8, 99, 10, 99, 12, 99, 1978, 9, 99, 1, 99, 3, 99, 1981, 8, 99, 1, 100, 1, 100, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 3, 101, 1991, 8, 101, 3, 101, 1993, 8, 101, 1, 102, 3, 102, 1996, 8, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 3, 102, 2006, 8, 102, 1, 103, 1, 103, 1, 103, 3, 103, 2011, 8, 103, 1, 104, 1, 104, 1, 105, 1, 105, 1, 106, 1, 106, 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, 3, 108, 2024, 8, 108, 1, 109, 1, 109, 1, 109, 3, 109, 2029, 8, 109, 1, 110, 1, 110, 1, 110, 1, 110, 3, 110, 2035, 8, 110, 1, 111, 1, 111, 1, 111, 1, 111, 1, 112, 1, 112, 1, 112, 1, 112, 1, 113, 1, 113, 3, 113, 2047, 8, 113, 1, 114, 1, 114, 5, 114, 2051, 8, 114, 10, 114, 12, 114, 2054, 9, 114, 1, 114, 1, 114, 1, 115, 1, 115, 1, 115, 1, 115, 1, 115, 3, 115, 2063, 8, 115, 1, 116, 1, 116, 5, 116, 2067, 8, 116, 10, 116, 12, 116, 2070, 9, 116, 1, 116, 1, 116, 1, 117, 1, 117, 1, 117, 1, 117, 1, 117, 3, 117, 2079, 8, 117, 1, 117, 0, 4, 96, 138, 154, 180, 118, 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, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 0, 20, 2, 0, 36, 36, 41, 41, 2, 0, 19, 19, 94, 94, 2, 0, 53, 53, 63, 63, 3, 0, 1, 1, 4, 4, 8, 8, 2, 0, 3, 3, 100, 100, 4, 0, 1, 1, 3, 4, 8, 8, 100, 100, 2, 0, 63, 63, 93, 93, 2, 0, 76, 76, 151, 151, 2, 0, 7, 7, 23, 24, 2, 0, 35, 35, 61, 61, 2, 0, 89, 89, 96, 96, 3, 0, 21, 21, 56, 56, 108, 109, 3, 0, 10, 10, 62, 62, 115, 115, 2, 0, 48, 48, 65, 65, 1, 0, 138, 139, 2, 0, 153, 153, 175, 175, 7, 0, 22, 22, 45, 45, 68, 69, 88, 88, 98, 98, 125, 125, 132, 132, 20, 0, 1, 13, 15, 21, 23, 27, 29, 33, 35, 35, 37, 40, 42, 44, 46, 51, 53, 53, 55, 63, 65, 66, 70, 71, 73, 73, 75, 87, 89, 97, 99, 105, 107, 117, 119, 124, 126, 127, 129, 130, 4, 0, 21, 21, 35, 35, 46, 46, 59, 59, 8, 0, 7, 7, 15, 15, 21, 21, 24, 24, 31, 31, 46, 46, 92, 92, 113, 114, 2362, 0, 239, 1, 0, 0, 0, 2, 246, 1, 0, 0, 0, 4, 248, 1, 0, 0, 0, 6, 250, 1, 0, 0, 0, 8, 256, 1, 0, 0, 0, 10, 278, 1, 0, 0, 0, 12, 280, 1, 0, 0, 0, 14, 287, 1, 0, 0, 0, 16, 292, 1, 0, 0, 0, 18, 305, 1, 0, 0, 0, 20, 317, 1, 0, 0, 0, 22, 326, 1, 0, 0, 0, 24, 334, 1, 0, 0, 0, 26, 356, 1, 0, 0, 0, 28, 371, 1, 0, 0, 0, 30, 380, 1, 0, 0, 0, 32, 384, 1, 0, 0, 0, 34, 392, 1, 0, 0, 0, 36, 394, 1, 0, 0, 0, 38, 403, 1, 0, 0, 0, 40, 407, 1, 0, 0, 0, 42, 421, 1, 0, 0, 0, 44, 439, 1, 0, 0, 0, 46, 486, 1, 0, 0, 0, 48, 490, 1, 0, 0, 0, 50, 530, 1, 0, 0, 0, 52, 533, 1, 0, 0, 0, 54, 598, 1, 0, 0, 0, 56, 604, 1, 0, 0, 0, 58, 610, 1, 0, 0, 0, 60, 614, 1, 0, 0, 0, 62, 620, 1, 0, 0, 0, 64, 638, 1, 0, 0, 0, 66, 641, 1, 0, 0, 0, 68, 644, 1, 0, 0, 0, 70, 661, 1, 0, 0, 0, 72, 669, 1, 0, 0, 0, 74, 675, 1, 0, 0, 0, 76, 678, 1, 0, 0, 0, 78, 681, 1, 0, 0, 0, 80, 687, 1, 0, 0, 0, 82, 701, 1, 0, 0, 0, 84, 705, 1, 0, 0, 0, 86, 735, 1, 0, 0, 0, 88, 737, 1, 0, 0, 0, 90, 740, 1, 0, 0, 0, 92, 743, 1, 0, 0, 0, 94, 752, 1, 0, 0, 0, 96, 775, 1, 0, 0, 0, 98, 880, 1, 0, 0, 0, 100, 885, 1, 0, 0, 0, 102, 896, 1, 0, 0, 0, 104, 898, 1, 0, 0, 0, 106, 913, 1, 0, 0, 0, 108, 918, 1, 0, 0, 0, 110, 926, 1, 0, 0, 0, 112, 941, 1, 0, 0, 0, 114, 955, 1, 0, 0, 0, 116, 966, 1, 0, 0, 0, 118, 968, 1, 0, 0, 0, 120, 976, 1, 0, 0, 0, 122, 981, 1, 0, 0, 0, 124, 989, 1, 0, 0, 0, 126, 993, 1, 0, 0, 0, 128, 997, 1, 0, 0, 0, 130, 1003, 1, 0, 0, 0, 132, 1012, 1, 0, 0, 0, 134, 1026, 1, 0, 0, 0, 136, 1028, 1, 0, 0, 0, 138, 1094, 1, 0, 0, 0, 140, 1116, 1, 0, 0, 0, 142, 1122, 1, 0, 0, 0, 144, 1124, 1, 0, 0, 0, 146, 1126, 1, 0, 0, 0, 148, 1148, 1, 0, 0, 0, 150, 1150, 1, 0, 0, 0, 152, 1171, 1, 0, 0, 0, 154, 1522, 1, 0, 0, 0, 156, 1714, 1, 0, 0, 0, 158, 1716, 1, 0, 0, 0, 160, 1724, 1, 0, 0, 0, 162, 1734, 1, 0, 0, 0, 164, 1736, 1, 0, 0, 0, 166, 1767, 1, 0, 0, 0, 168, 1780, 1, 0, 0, 0, 170, 1782, 1, 0, 0, 0, 172, 1817, 1, 0, 0, 0, 174, 1819, 1, 0, 0, 0, 176, 1837, 1, 0, 0, 0, 178, 1839, 1, 0, 0, 0, 180, 1860, 1, 0, 0, 0, 182, 1898, 1, 0, 0, 0, 184, 1904, 1, 0, 0, 0, 186, 1910, 1, 0, 0, 0, 188, 1921, 1, 0, 0, 0, 190, 1944, 1, 0, 0, 0, 192, 1946, 1, 0, 0, 0, 194, 1957, 1, 0, 0, 0, 196, 1967, 1, 0, 0, 0, 198, 1971, 1, 0, 0, 0, 200, 1982, 1, 0, 0, 0, 202, 1992, 1, 0, 0, 0, 204, 1995, 1, 0, 0, 0, 206, 2010, 1, 0, 0, 0, 208, 2012, 1, 0, 0, 0, 210, 2014, 1, 0, 0, 0, 212, 2016, 1, 0, 0, 0, 214, 2018, 1, 0, 0, 0, 216, 2023, 1, 0, 0, 0, 218, 2028, 1, 0, 0, 0, 220, 2034, 1, 0, 0, 0, 222, 2036, 1, 0, 0, 0, 224, 2040, 1, 0, 0, 0, 226, 2046, 1, 0, 0, 0, 228, 2048, 1, 0, 0, 0, 230, 2062, 1, 0, 0, 0, 232, 2064, 1, 0, 0, 0, 234, 2078, 1, 0, 0, 0, 236, 238, 3, 2, 1, 0, 237, 236, 1, 0, 0, 0, 238, 241, 1, 0, 0, 0, 239, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 242, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 242, 243, 5, 0, 0, 1, 243, 1, 1, 0, 0, 0, 244, 247, 3, 6, 3, 0, 245, 247, 3, 10, 5, 0, 246, 244, 1, 0, 0, 0, 246, 245, 1, 0, 0, 0, 247, 3, 1, 0, 0, 0, 248, 249, 3, 154, 77, 0, 249, 5, 1, 0, 0, 0, 250, 251, 5, 64, 0, 0, 251, 254, 3, 220, 110, 0, 252, 253, 5, 149, 0, 0, 253, 255, 3, 4, 2, 0, 254, 252, 1, 0, 0, 0, 254, 255, 1, 0, 0, 0, 255, 7, 1, 0, 0, 0, 256, 261, 3, 178, 89, 0, 257, 258, 5, 151, 0, 0, 258, 260, 3, 178, 89, 0, 259, 257, 1, 0, 0, 0, 260, 263, 1, 0, 0, 0, 261, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 265, 1, 0, 0, 0, 263, 261, 1, 0, 0, 0, 264, 266, 5, 151, 0, 0, 265, 264, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, 9, 1, 0, 0, 0, 267, 279, 3, 12, 6, 0, 268, 279, 3, 14, 7, 0, 269, 279, 3, 18, 9, 0, 270, 279, 3, 20, 10, 0, 271, 279, 3, 22, 11, 0, 272, 279, 3, 26, 13, 0, 273, 279, 3, 24, 12, 0, 274, 279, 3, 28, 14, 0, 275, 279, 3, 36, 18, 0, 276, 279, 3, 32, 16, 0, 277, 279, 3, 34, 17, 0, 278, 267, 1, 0, 0, 0, 278, 268, 1, 0, 0, 0, 278, 269, 1, 0, 0, 0, 278, 270, 1, 0, 0, 0, 278, 271, 1, 0, 0, 0, 278, 272, 1, 0, 0, 0, 278, 273, 1, 0, 0, 0, 278, 274, 1, 0, 0, 0, 278, 275, 1, 0, 0, 0, 278, 276, 1, 0, 0, 0, 278, 277, 1, 0, 0, 0, 279, 11, 1, 0, 0, 0, 280, 282, 5, 92, 0, 0, 281, 283, 3, 4, 2, 0, 282, 281, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 285, 1, 0, 0, 0, 284, 286, 5, 186, 0, 0, 285, 284, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 13, 1, 0, 0, 0, 287, 288, 5, 106, 0, 0, 288, 290, 3, 4, 2, 0, 289, 291, 5, 186, 0, 0, 290, 289, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 15, 1, 0, 0, 0, 292, 301, 5, 14, 0, 0, 293, 294, 5, 165, 0, 0, 294, 297, 3, 220, 110, 0, 295, 296, 5, 150, 0, 0, 296, 298, 3, 220, 110, 0, 297, 295, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 300, 5, 185, 0, 0, 300, 302, 1, 0, 0, 0, 301, 293, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, 304, 3, 36, 18, 0, 304, 17, 1, 0, 0, 0, 305, 306, 5, 118, 0, 0, 306, 310, 3, 36, 18, 0, 307, 309, 3, 16, 8, 0, 308, 307, 1, 0, 0, 0, 309, 312, 1, 0, 0, 0, 310, 308, 1, 0, 0, 0, 310, 311, 1, 0, 0, 0, 311, 315, 1, 0, 0, 0, 312, 310, 1, 0, 0, 0, 313, 314, 5, 34, 0, 0, 314, 316, 3, 36, 18, 0, 315, 313, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, 19, 1, 0, 0, 0, 317, 318, 5, 47, 0, 0, 318, 319, 5, 165, 0, 0, 319, 320, 3, 4, 2, 0, 320, 321, 5, 185, 0, 0, 321, 324, 3, 10, 5, 0, 322, 323, 5, 26, 0, 0, 323, 325, 3, 10, 5, 0, 324, 322, 1, 0, 0, 0, 324, 325, 1, 0, 0, 0, 325, 21, 1, 0, 0, 0, 326, 327, 5, 128, 0, 0, 327, 328, 5, 165, 0, 0, 328, 329, 3, 4, 2, 0, 329, 330, 5, 185, 0, 0, 330, 332, 3, 10, 5, 0, 331, 333, 5, 186, 0, 0, 332, 331, 1, 0, 0, 0, 332, 333, 1, 0, 0, 0, 333, 23, 1, 0, 0, 0, 334, 335, 5, 38, 0, 0, 335, 339, 5, 165, 0, 0, 336, 340, 3, 6, 3, 0, 337, 340, 3, 30, 15, 0, 338, 340, 3, 4, 2, 0, 339, 336, 1, 0, 0, 0, 339, 337, 1, 0, 0, 0, 339, 338, 1, 0, 0, 0, 339, 340, 1, 0, 0, 0, 340, 341, 1, 0, 0, 0, 341, 343, 5, 186, 0, 0, 342, 344, 3, 4, 2, 0, 343, 342, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 349, 5, 186, 0, 0, 346, 350, 3, 6, 3, 0, 347, 350, 3, 30, 15, 0, 348, 350, 3, 4, 2, 0, 349, 346, 1, 0, 0, 0, 349, 347, 1, 0, 0, 0, 349, 348, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 352, 5, 185, 0, 0, 352, 354, 3, 10, 5, 0, 353, 355, 5, 186, 0, 0, 354, 353, 1, 0, 0, 0, 354, 355, 1, 0, 0, 0, 355, 25, 1, 0, 0, 0, 356, 357, 5, 38, 0, 0, 357, 358, 5, 165, 0, 0, 358, 359, 5, 64, 0, 0, 359, 362, 3, 220, 110, 0, 360, 361, 5, 151, 0, 0, 361, 363, 3, 220, 110, 0, 362, 360, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, 365, 5, 51, 0, 0, 365, 366, 3, 4, 2, 0, 366, 367, 5, 185, 0, 0, 367, 369, 3, 10, 5, 0, 368, 370, 5, 186, 0, 0, 369, 368, 1, 0, 0, 0, 369, 370, 1, 0, 0, 0, 370, 27, 1, 0, 0, 0, 371, 372, 7, 0, 0, 0, 372, 373, 3, 220, 110, 0, 373, 375, 5, 165, 0, 0, 374, 376, 3, 8, 4, 0, 375, 374, 1, 0, 0, 0, 375, 376, 1, 0, 0, 0, 376, 377, 1, 0, 0, 0, 377, 378, 5, 185, 0, 0, 378, 379, 3, 36, 18, 0, 379, 29, 1, 0, 0, 0, 380, 381, 3, 4, 2, 0, 381, 382, 5, 149, 0, 0, 382, 383, 3, 4, 2, 0, 383, 31, 1, 0, 0, 0, 384, 387, 3, 4, 2, 0, 385, 386, 5, 149, 0, 0, 386, 388, 3, 4, 2, 0, 387, 385, 1, 0, 0, 0, 387, 388, 1, 0, 0, 0, 388, 390, 1, 0, 0, 0, 389, 391, 5, 186, 0, 0, 390, 389, 1, 0, 0, 0, 390, 391, 1, 0, 0, 0, 391, 33, 1, 0, 0, 0, 392, 393, 5, 186, 0, 0, 393, 35, 1, 0, 0, 0, 394, 398, 5, 163, 0, 0, 395, 397, 3, 2, 1, 0, 396, 395, 1, 0, 0, 0, 397, 400, 1, 0, 0, 0, 398, 396, 1, 0, 0, 0, 398, 399, 1, 0, 0, 0, 399, 401, 1, 0, 0, 0, 400, 398, 1, 0, 0, 0, 401, 402, 5, 183, 0, 0, 402, 37, 1, 0, 0, 0, 403, 404, 3, 4, 2, 0, 404, 405, 5, 150, 0, 0, 405, 406, 3, 4, 2, 0, 406, 39, 1, 0, 0, 0, 407, 412, 3, 38, 19, 0, 408, 409, 5, 151, 0, 0, 409, 411, 3, 38, 19, 0, 410, 408, 1, 0, 0, 0, 411, 414, 1, 0, 0, 0, 412, 410, 1, 0, 0, 0, 412, 413, 1, 0, 0, 0, 413, 416, 1, 0, 0, 0, 414, 412, 1, 0, 0, 0, 415, 417, 5, 151, 0, 0, 416, 415, 1, 0, 0, 0, 416, 417, 1, 0, 0, 0, 417, 41, 1, 0, 0, 0, 418, 422, 3, 48, 24, 0, 419, 422, 3, 52, 26, 0, 420, 422, 3, 166, 83, 0, 421, 418, 1, 0, 0, 0, 421, 419, 1, 0, 0, 0, 421, 420, 1, 0, 0, 0, 422, 424, 1, 0, 0, 0, 423, 425, 5, 186, 0, 0, 424, 423, 1, 0, 0, 0, 424, 425, 1, 0, 0, 0, 425, 426, 1, 0, 0, 0, 426, 427, 5, 0, 0, 1, 427, 43, 1, 0, 0, 0, 428, 440, 3, 52, 26, 0, 429, 430, 3, 54, 27, 0, 430, 431, 5, 165, 0, 0, 431, 432, 3, 48, 24, 0, 432, 433, 5, 185, 0, 0, 433, 440, 1, 0, 0, 0, 434, 435, 5, 165, 0, 0, 435, 436, 3, 48, 24, 0, 436, 437, 5, 185, 0, 0, 437, 440, 1, 0, 0, 0, 438, 440, 3, 224, 112, 0, 439, 428, 1, 0, 0, 0, 439, 429, 1, 0, 0, 0, 439, 434, 1, 0, 0, 0, 439, 438, 1, 0, 0, 0, 440, 45, 1, 0, 0, 0, 441, 442, 5, 28, 0, 0, 442, 445, 5, 1, 0, 0, 443, 444, 5, 11, 0, 0, 444, 446, 5, 70, 0, 0, 445, 443, 1, 0, 0, 0, 445, 446, 1, 0, 0, 0, 446, 487, 1, 0, 0, 0, 447, 450, 5, 28, 0, 0, 448, 449, 5, 11, 0, 0, 449, 451, 5, 70, 0, 0, 450, 448, 1, 0, 0, 0, 450, 451, 1, 0, 0, 0, 451, 487, 1, 0, 0, 0, 452, 453, 5, 121, 0, 0, 453, 456, 5, 1, 0, 0, 454, 455, 5, 11, 0, 0, 455, 457, 5, 70, 0, 0, 456, 454, 1, 0, 0, 0, 456, 457, 1, 0, 0, 0, 457, 487, 1, 0, 0, 0, 458, 459, 5, 121, 0, 0, 459, 462, 5, 25, 0, 0, 460, 461, 5, 11, 0, 0, 461, 463, 5, 70, 0, 0, 462, 460, 1, 0, 0, 0, 462, 463, 1, 0, 0, 0, 463, 487, 1, 0, 0, 0, 464, 467, 5, 121, 0, 0, 465, 466, 5, 11, 0, 0, 466, 468, 5, 70, 0, 0, 467, 465, 1, 0, 0, 0, 467, 468, 1, 0, 0, 0, 468, 487, 1, 0, 0, 0, 469, 470, 5, 54, 0, 0, 470, 473, 5, 1, 0, 0, 471, 472, 5, 11, 0, 0, 472, 474, 5, 70, 0, 0, 473, 471, 1, 0, 0, 0, 473, 474, 1, 0, 0, 0, 474, 487, 1, 0, 0, 0, 475, 476, 5, 54, 0, 0, 476, 479, 5, 25, 0, 0, 477, 478, 5, 11, 0, 0, 478, 480, 5, 70, 0, 0, 479, 477, 1, 0, 0, 0, 479, 480, 1, 0, 0, 0, 480, 487, 1, 0, 0, 0, 481, 484, 5, 54, 0, 0, 482, 483, 5, 11, 0, 0, 483, 485, 5, 70, 0, 0, 484, 482, 1, 0, 0, 0, 484, 485, 1, 0, 0, 0, 485, 487, 1, 0, 0, 0, 486, 441, 1, 0, 0, 0, 486, 447, 1, 0, 0, 0, 486, 452, 1, 0, 0, 0, 486, 458, 1, 0, 0, 0, 486, 464, 1, 0, 0, 0, 486, 469, 1, 0, 0, 0, 486, 475, 1, 0, 0, 0, 486, 481, 1, 0, 0, 0, 487, 488, 1, 0, 0, 0, 488, 489, 3, 44, 22, 0, 489, 47, 1, 0, 0, 0, 490, 494, 3, 44, 22, 0, 491, 493, 3, 46, 23, 0, 492, 491, 1, 0, 0, 0, 493, 496, 1, 0, 0, 0, 494, 492, 1, 0, 0, 0, 494, 495, 1, 0, 0, 0, 495, 498, 1, 0, 0, 0, 496, 494, 1, 0, 0, 0, 497, 499, 3, 78, 39, 0, 498, 497, 1, 0, 0, 0, 498, 499, 1, 0, 0, 0, 499, 501, 1, 0, 0, 0, 500, 502, 3, 50, 25, 0, 501, 500, 1, 0, 0, 0, 501, 502, 1, 0, 0, 0, 502, 49, 1, 0, 0, 0, 503, 504, 5, 66, 0, 0, 504, 506, 3, 154, 77, 0, 505, 507, 5, 174, 0, 0, 506, 505, 1, 0, 0, 0, 506, 507, 1, 0, 0, 0, 507, 510, 1, 0, 0, 0, 508, 509, 5, 151, 0, 0, 509, 511, 3, 154, 77, 0, 510, 508, 1, 0, 0, 0, 510, 511, 1, 0, 0, 0, 511, 514, 1, 0, 0, 0, 512, 513, 5, 130, 0, 0, 513, 515, 5, 107, 0, 0, 514, 512, 1, 0, 0, 0, 514, 515, 1, 0, 0, 0, 515, 531, 1, 0, 0, 0, 516, 517, 5, 66, 0, 0, 517, 519, 3, 154, 77, 0, 518, 520, 5, 174, 0, 0, 519, 518, 1, 0, 0, 0, 519, 520, 1, 0, 0, 0, 520, 523, 1, 0, 0, 0, 521, 522, 5, 130, 0, 0, 522, 524, 5, 107, 0, 0, 523, 521, 1, 0, 0, 0, 523, 524, 1, 0, 0, 0, 524, 525, 1, 0, 0, 0, 525, 526, 5, 76, 0, 0, 526, 527, 3, 154, 77, 0, 527, 531, 1, 0, 0, 0, 528, 529, 5, 76, 0, 0, 529, 531, 3, 154, 77, 0, 530, 503, 1, 0, 0, 0, 530, 516, 1, 0, 0, 0, 530, 528, 1, 0, 0, 0, 531, 51, 1, 0, 0, 0, 532, 534, 3, 54, 27, 0, 533, 532, 1, 0, 0, 0, 533, 534, 1, 0, 0, 0, 534, 535, 1, 0, 0, 0, 535, 537, 5, 99, 0, 0, 536, 538, 5, 25, 0, 0, 537, 536, 1, 0, 0, 0, 537, 538, 1, 0, 0, 0, 538, 540, 1, 0, 0, 0, 539, 541, 3, 56, 28, 0, 540, 539, 1, 0, 0, 0, 540, 541, 1, 0, 0, 0, 541, 542, 1, 0, 0, 0, 542, 544, 3, 148, 74, 0, 543, 545, 3, 58, 29, 0, 544, 543, 1, 0, 0, 0, 544, 545, 1, 0, 0, 0, 545, 547, 1, 0, 0, 0, 546, 548, 3, 60, 30, 0, 547, 546, 1, 0, 0, 0, 547, 548, 1, 0, 0, 0, 548, 550, 1, 0, 0, 0, 549, 551, 3, 64, 32, 0, 550, 549, 1, 0, 0, 0, 550, 551, 1, 0, 0, 0, 551, 553, 1, 0, 0, 0, 552, 554, 3, 66, 33, 0, 553, 552, 1, 0, 0, 0, 553, 554, 1, 0, 0, 0, 554, 559, 1, 0, 0, 0, 555, 557, 5, 123, 0, 0, 556, 555, 1, 0, 0, 0, 556, 557, 1, 0, 0, 0, 557, 558, 1, 0, 0, 0, 558, 560, 3, 104, 52, 0, 559, 556, 1, 0, 0, 0, 559, 560, 1, 0, 0, 0, 560, 562, 1, 0, 0, 0, 561, 563, 3, 68, 34, 0, 562, 561, 1, 0, 0, 0, 562, 563, 1, 0, 0, 0, 563, 566, 1, 0, 0, 0, 564, 565, 5, 130, 0, 0, 565, 567, 7, 1, 0, 0, 566, 564, 1, 0, 0, 0, 566, 567, 1, 0, 0, 0, 567, 570, 1, 0, 0, 0, 568, 569, 5, 130, 0, 0, 569, 571, 5, 114, 0, 0, 570, 568, 1, 0, 0, 0, 570, 571, 1, 0, 0, 0, 571, 573, 1, 0, 0, 0, 572, 574, 3, 74, 37, 0, 573, 572, 1, 0, 0, 0, 573, 574, 1, 0, 0, 0, 574, 576, 1, 0, 0, 0, 575, 577, 3, 76, 38, 0, 576, 575, 1, 0, 0, 0, 576, 577, 1, 0, 0, 0, 577, 580, 1, 0, 0, 0, 578, 579, 5, 123, 0, 0, 579, 581, 3, 104, 52, 0, 580, 578, 1, 0, 0, 0, 580, 581, 1, 0, 0, 0, 581, 583, 1, 0, 0, 0, 582, 584, 3, 62, 31, 0, 583, 582, 1, 0, 0, 0, 583, 584, 1, 0, 0, 0, 584, 586, 1, 0, 0, 0, 585, 587, 3, 78, 39, 0, 586, 585, 1, 0, 0, 0, 586, 587, 1, 0, 0, 0, 587, 589, 1, 0, 0, 0, 588, 590, 3, 84, 42, 0, 589, 588, 1, 0, 0, 0, 589, 590, 1, 0, 0, 0, 590, 593, 1, 0, 0, 0, 591, 594, 3, 86, 43, 0, 592, 594, 3, 88, 44, 0, 593, 591, 1, 0, 0, 0, 593, 592, 1, 0, 0, 0, 593, 594, 1, 0, 0, 0, 594, 596, 1, 0, 0, 0, 595, 597, 3, 90, 45, 0, 596, 595, 1, 0, 0, 0, 596, 597, 1, 0, 0, 0, 597, 53, 1, 0, 0, 0, 598, 600, 5, 130, 0, 0, 599, 601, 5, 90, 0, 0, 600, 599, 1, 0, 0, 0, 600, 601, 1, 0, 0, 0, 601, 602, 1, 0, 0, 0, 602, 603, 3, 170, 85, 0, 603, 55, 1, 0, 0, 0, 604, 605, 5, 113, 0, 0, 605, 608, 5, 139, 0, 0, 606, 607, 5, 130, 0, 0, 607, 609, 5, 107, 0, 0, 608, 606, 1, 0, 0, 0, 608, 609, 1, 0, 0, 0, 609, 57, 1, 0, 0, 0, 610, 611, 5, 39, 0, 0, 611, 612, 3, 96, 48, 0, 612, 59, 1, 0, 0, 0, 613, 615, 7, 2, 0, 0, 614, 613, 1, 0, 0, 0, 614, 615, 1, 0, 0, 0, 615, 616, 1, 0, 0, 0, 616, 617, 5, 5, 0, 0, 617, 618, 5, 58, 0, 0, 618, 619, 3, 146, 73, 0, 619, 61, 1, 0, 0, 0, 620, 621, 5, 129, 0, 0, 621, 622, 3, 220, 110, 0, 622, 623, 5, 6, 0, 0, 623, 624, 5, 165, 0, 0, 624, 625, 3, 122, 61, 0, 625, 635, 5, 185, 0, 0, 626, 627, 5, 151, 0, 0, 627, 628, 3, 220, 110, 0, 628, 629, 5, 6, 0, 0, 629, 630, 5, 165, 0, 0, 630, 631, 3, 122, 61, 0, 631, 632, 5, 185, 0, 0, 632, 634, 1, 0, 0, 0, 633, 626, 1, 0, 0, 0, 634, 637, 1, 0, 0, 0, 635, 633, 1, 0, 0, 0, 635, 636, 1, 0, 0, 0, 636, 63, 1, 0, 0, 0, 637, 635, 1, 0, 0, 0, 638, 639, 5, 86, 0, 0, 639, 640, 3, 154, 77, 0, 640, 65, 1, 0, 0, 0, 641, 642, 5, 127, 0, 0, 642, 643, 3, 154, 77, 0, 643, 67, 1, 0, 0, 0, 644, 645, 5, 42, 0, 0, 645, 659, 5, 11, 0, 0, 646, 660, 5, 1, 0, 0, 647, 648, 7, 1, 0, 0, 648, 649, 5, 165, 0, 0, 649, 650, 3, 146, 73, 0, 650, 651, 5, 185, 0, 0, 651, 660, 1, 0, 0, 0, 652, 653, 5, 43, 0, 0, 653, 654, 5, 101, 0, 0, 654, 655, 5, 165, 0, 0, 655, 656, 3, 70, 35, 0, 656, 657, 5, 185, 0, 0, 657, 660, 1, 0, 0, 0, 658, 660, 3, 146, 73, 0, 659, 646, 1, 0, 0, 0, 659, 647, 1, 0, 0, 0, 659, 652, 1, 0, 0, 0, 659, 658, 1, 0, 0, 0, 660, 69, 1, 0, 0, 0, 661, 666, 3, 72, 36, 0, 662, 663, 5, 151, 0, 0, 663, 665, 3, 72, 36, 0, 664, 662, 1, 0, 0, 0, 665, 668, 1, 0, 0, 0, 666, 664, 1, 0, 0, 0, 666, 667, 1, 0, 0, 0, 667, 71, 1, 0, 0, 0, 668, 666, 1, 0, 0, 0, 669, 671, 5, 165, 0, 0, 670, 672, 3, 146, 73, 0, 671, 670, 1, 0, 0, 0, 671, 672, 1, 0, 0, 0, 672, 673, 1, 0, 0, 0, 673, 674, 5, 185, 0, 0, 674, 73, 1, 0, 0, 0, 675, 676, 5, 44, 0, 0, 676, 677, 3, 154, 77, 0, 677, 75, 1, 0, 0, 0, 678, 679, 5, 87, 0, 0, 679, 680, 3, 154, 77, 0, 680, 77, 1, 0, 0, 0, 681, 682, 5, 79, 0, 0, 682, 683, 5, 11, 0, 0, 683, 685, 3, 108, 54, 0, 684, 686, 3, 80, 40, 0, 685, 684, 1, 0, 0, 0, 685, 686, 1, 0, 0, 0, 686, 79, 1, 0, 0, 0, 687, 699, 5, 55, 0, 0, 688, 689, 5, 165, 0, 0, 689, 694, 3, 114, 57, 0, 690, 691, 5, 151, 0, 0, 691, 693, 3, 114, 57, 0, 692, 690, 1, 0, 0, 0, 693, 696, 1, 0, 0, 0, 694, 692, 1, 0, 0, 0, 694, 695, 1, 0, 0, 0, 695, 697, 1, 0, 0, 0, 696, 694, 1, 0, 0, 0, 697, 698, 5, 185, 0, 0, 698, 700, 1, 0, 0, 0, 699, 688, 1, 0, 0, 0, 699, 700, 1, 0, 0, 0, 700, 81, 1, 0, 0, 0, 701, 702, 5, 79, 0, 0, 702, 703, 5, 11, 0, 0, 703, 704, 3, 146, 73, 0, 704, 83, 1, 0, 0, 0, 705, 706, 5, 66, 0, 0, 706, 707, 3, 106, 53, 0, 707, 708, 5, 11, 0, 0, 708, 709, 3, 146, 73, 0, 709, 85, 1, 0, 0, 0, 710, 711, 5, 66, 0, 0, 711, 713, 3, 154, 77, 0, 712, 714, 5, 174, 0, 0, 713, 712, 1, 0, 0, 0, 713, 714, 1, 0, 0, 0, 714, 717, 1, 0, 0, 0, 715, 716, 5, 151, 0, 0, 716, 718, 3, 154, 77, 0, 717, 715, 1, 0, 0, 0, 717, 718, 1, 0, 0, 0, 718, 721, 1, 0, 0, 0, 719, 720, 5, 130, 0, 0, 720, 722, 5, 107, 0, 0, 721, 719, 1, 0, 0, 0, 721, 722, 1, 0, 0, 0, 722, 736, 1, 0, 0, 0, 723, 724, 5, 66, 0, 0, 724, 726, 3, 154, 77, 0, 725, 727, 5, 174, 0, 0, 726, 725, 1, 0, 0, 0, 726, 727, 1, 0, 0, 0, 727, 730, 1, 0, 0, 0, 728, 729, 5, 130, 0, 0, 729, 731, 5, 107, 0, 0, 730, 728, 1, 0, 0, 0, 730, 731, 1, 0, 0, 0, 731, 732, 1, 0, 0, 0, 732, 733, 5, 76, 0, 0, 733, 734, 3, 154, 77, 0, 734, 736, 1, 0, 0, 0, 735, 710, 1, 0, 0, 0, 735, 723, 1, 0, 0, 0, 736, 87, 1, 0, 0, 0, 737, 738, 5, 76, 0, 0, 738, 739, 3, 154, 77, 0, 739, 89, 1, 0, 0, 0, 740, 741, 5, 102, 0, 0, 741, 742, 3, 118, 59, 0, 742, 91, 1, 0, 0, 0, 743, 744, 5, 124, 0, 0, 744, 749, 3, 94, 47, 0, 745, 746, 5, 151, 0, 0, 746, 748, 3, 94, 47, 0, 747, 745, 1, 0, 0, 0, 748, 751, 1, 0, 0, 0, 749, 747, 1, 0, 0, 0, 749, 750, 1, 0, 0, 0, 750, 93, 1, 0, 0, 0, 751, 749, 1, 0, 0, 0, 752, 753, 5, 165, 0, 0, 753, 758, 3, 154, 77, 0, 754, 755, 5, 151, 0, 0, 755, 757, 3, 154, 77, 0, 756, 754, 1, 0, 0, 0, 757, 760, 1, 0, 0, 0, 758, 756, 1, 0, 0, 0, 758, 759, 1, 0, 0, 0, 759, 761, 1, 0, 0, 0, 760, 758, 1, 0, 0, 0, 761, 762, 5, 185, 0, 0, 762, 95, 1, 0, 0, 0, 763, 764, 6, 48, -1, 0, 764, 766, 3, 180, 90, 0, 765, 767, 5, 31, 0, 0, 766, 765, 1, 0, 0, 0, 766, 767, 1, 0, 0, 0, 767, 769, 1, 0, 0, 0, 768, 770, 3, 104, 52, 0, 769, 768, 1, 0, 0, 0, 769, 770, 1, 0, 0, 0, 770, 776, 1, 0, 0, 0, 771, 772, 5, 165, 0, 0, 772, 773, 3, 96, 48, 0, 773, 774, 5, 185, 0, 0, 774, 776, 1, 0, 0, 0, 775, 763, 1, 0, 0, 0, 775, 771, 1, 0, 0, 0, 776, 824, 1, 0, 0, 0, 777, 778, 10, 5, 0, 0, 778, 779, 3, 100, 50, 0, 779, 780, 3, 96, 48, 6, 780, 823, 1, 0, 0, 0, 781, 783, 10, 7, 0, 0, 782, 784, 5, 71, 0, 0, 783, 782, 1, 0, 0, 0, 783, 784, 1, 0, 0, 0, 784, 786, 1, 0, 0, 0, 785, 787, 3, 98, 49, 0, 786, 785, 1, 0, 0, 0, 786, 787, 1, 0, 0, 0, 787, 788, 1, 0, 0, 0, 788, 789, 5, 58, 0, 0, 789, 791, 3, 96, 48, 0, 790, 792, 3, 102, 51, 0, 791, 790, 1, 0, 0, 0, 791, 792, 1, 0, 0, 0, 792, 823, 1, 0, 0, 0, 793, 794, 10, 6, 0, 0, 794, 795, 5, 84, 0, 0, 795, 796, 5, 58, 0, 0, 796, 798, 3, 96, 48, 0, 797, 799, 3, 102, 51, 0, 798, 797, 1, 0, 0, 0, 798, 799, 1, 0, 0, 0, 799, 823, 1, 0, 0, 0, 800, 801, 10, 4, 0, 0, 801, 802, 5, 83, 0, 0, 802, 803, 5, 165, 0, 0, 803, 804, 3, 146, 73, 0, 804, 808, 3, 182, 91, 0, 805, 806, 5, 42, 0, 0, 806, 807, 5, 11, 0, 0, 807, 809, 3, 146, 73, 0, 808, 805, 1, 0, 0, 0, 808, 809, 1, 0, 0, 0, 809, 810, 1, 0, 0, 0, 810, 811, 5, 185, 0, 0, 811, 823, 1, 0, 0, 0, 812, 813, 10, 3, 0, 0, 813, 816, 5, 122, 0, 0, 814, 815, 5, 50, 0, 0, 815, 817, 5, 75, 0, 0, 816, 814, 1, 0, 0, 0, 816, 817, 1, 0, 0, 0, 817, 818, 1, 0, 0, 0, 818, 819, 5, 165, 0, 0, 819, 820, 3, 186, 93, 0, 820, 821, 5, 185, 0, 0, 821, 823, 1, 0, 0, 0, 822, 777, 1, 0, 0, 0, 822, 781, 1, 0, 0, 0, 822, 793, 1, 0, 0, 0, 822, 800, 1, 0, 0, 0, 822, 812, 1, 0, 0, 0, 823, 826, 1, 0, 0, 0, 824, 822, 1, 0, 0, 0, 824, 825, 1, 0, 0, 0, 825, 97, 1, 0, 0, 0, 826, 824, 1, 0, 0, 0, 827, 829, 7, 3, 0, 0, 828, 827, 1, 0, 0, 0, 828, 829, 1, 0, 0, 0, 829, 830, 1, 0, 0, 0, 830, 841, 5, 53, 0, 0, 831, 833, 5, 53, 0, 0, 832, 834, 7, 3, 0, 0, 833, 832, 1, 0, 0, 0, 833, 834, 1, 0, 0, 0, 834, 841, 1, 0, 0, 0, 835, 841, 7, 3, 0, 0, 836, 841, 5, 3, 0, 0, 837, 841, 5, 100, 0, 0, 838, 839, 5, 8, 0, 0, 839, 841, 7, 4, 0, 0, 840, 828, 1, 0, 0, 0, 840, 831, 1, 0, 0, 0, 840, 835, 1, 0, 0, 0, 840, 836, 1, 0, 0, 0, 840, 837, 1, 0, 0, 0, 840, 838, 1, 0, 0, 0, 841, 881, 1, 0, 0, 0, 842, 844, 7, 5, 0, 0, 843, 842, 1, 0, 0, 0, 843, 844, 1, 0, 0, 0, 844, 845, 1, 0, 0, 0, 845, 847, 7, 6, 0, 0, 846, 848, 5, 80, 0, 0, 847, 846, 1, 0, 0, 0, 847, 848, 1, 0, 0, 0, 848, 863, 1, 0, 0, 0, 849, 851, 7, 6, 0, 0, 850, 852, 5, 80, 0, 0, 851, 850, 1, 0, 0, 0, 851, 852, 1, 0, 0, 0, 852, 854, 1, 0, 0, 0, 853, 855, 7, 5, 0, 0, 854, 853, 1, 0, 0, 0, 854, 855, 1, 0, 0, 0, 855, 863, 1, 0, 0, 0, 856, 857, 5, 8, 0, 0, 857, 858, 7, 4, 0, 0, 858, 860, 7, 6, 0, 0, 859, 861, 5, 80, 0, 0, 860, 859, 1, 0, 0, 0, 860, 861, 1, 0, 0, 0, 861, 863, 1, 0, 0, 0, 862, 843, 1, 0, 0, 0, 862, 849, 1, 0, 0, 0, 862, 856, 1, 0, 0, 0, 863, 881, 1, 0, 0, 0, 864, 866, 7, 3, 0, 0, 865, 864, 1, 0, 0, 0, 865, 866, 1, 0, 0, 0, 866, 867, 1, 0, 0, 0, 867, 869, 5, 40, 0, 0, 868, 870, 5, 80, 0, 0, 869, 868, 1, 0, 0, 0, 869, 870, 1, 0, 0, 0, 870, 879, 1, 0, 0, 0, 871, 873, 5, 40, 0, 0, 872, 874, 5, 80, 0, 0, 873, 872, 1, 0, 0, 0, 873, 874, 1, 0, 0, 0, 874, 876, 1, 0, 0, 0, 875, 877, 7, 3, 0, 0, 876, 875, 1, 0, 0, 0, 876, 877, 1, 0, 0, 0, 877, 879, 1, 0, 0, 0, 878, 865, 1, 0, 0, 0, 878, 871, 1, 0, 0, 0, 879, 881, 1, 0, 0, 0, 880, 840, 1, 0, 0, 0, 880, 862, 1, 0, 0, 0, 880, 878, 1, 0, 0, 0, 881, 99, 1, 0, 0, 0, 882, 883, 5, 18, 0, 0, 883, 886, 5, 58, 0, 0, 884, 886, 5, 151, 0, 0, 885, 882, 1, 0, 0, 0, 885, 884, 1, 0, 0, 0, 886, 101, 1, 0, 0, 0, 887, 888, 5, 77, 0, 0, 888, 897, 3, 146, 73, 0, 889, 890, 5, 123, 0, 0, 890, 891, 5, 165, 0, 0, 891, 892, 3, 146, 73, 0, 892, 893, 5, 185, 0, 0, 893, 897, 1, 0, 0, 0, 894, 895, 5, 123, 0, 0, 895, 897, 3, 146, 73, 0, 896, 887, 1, 0, 0, 0, 896, 889, 1, 0, 0, 0, 896, 894, 1, 0, 0, 0, 897, 103, 1, 0, 0, 0, 898, 899, 5, 97, 0, 0, 899, 901, 3, 116, 58, 0, 900, 902, 5, 174, 0, 0, 901, 900, 1, 0, 0, 0, 901, 902, 1, 0, 0, 0, 902, 905, 1, 0, 0, 0, 903, 904, 5, 76, 0, 0, 904, 906, 3, 116, 58, 0, 905, 903, 1, 0, 0, 0, 905, 906, 1, 0, 0, 0, 906, 911, 1, 0, 0, 0, 907, 908, 5, 165, 0, 0, 908, 909, 3, 220, 110, 0, 909, 910, 5, 185, 0, 0, 910, 912, 1, 0, 0, 0, 911, 907, 1, 0, 0, 0, 911, 912, 1, 0, 0, 0, 912, 105, 1, 0, 0, 0, 913, 916, 3, 154, 77, 0, 914, 915, 7, 7, 0, 0, 915, 917, 3, 154, 77, 0, 916, 914, 1, 0, 0, 0, 916, 917, 1, 0, 0, 0, 917, 107, 1, 0, 0, 0, 918, 923, 3, 110, 55, 0, 919, 920, 5, 151, 0, 0, 920, 922, 3, 110, 55, 0, 921, 919, 1, 0, 0, 0, 922, 925, 1, 0, 0, 0, 923, 921, 1, 0, 0, 0, 923, 924, 1, 0, 0, 0, 924, 109, 1, 0, 0, 0, 925, 923, 1, 0, 0, 0, 926, 928, 3, 154, 77, 0, 927, 929, 7, 8, 0, 0, 928, 927, 1, 0, 0, 0, 928, 929, 1, 0, 0, 0, 929, 932, 1, 0, 0, 0, 930, 931, 5, 75, 0, 0, 931, 933, 7, 9, 0, 0, 932, 930, 1, 0, 0, 0, 932, 933, 1, 0, 0, 0, 933, 936, 1, 0, 0, 0, 934, 935, 5, 16, 0, 0, 935, 937, 5, 143, 0, 0, 936, 934, 1, 0, 0, 0, 936, 937, 1, 0, 0, 0, 937, 939, 1, 0, 0, 0, 938, 940, 3, 112, 56, 0, 939, 938, 1, 0, 0, 0, 939, 940, 1, 0, 0, 0, 940, 111, 1, 0, 0, 0, 941, 942, 5, 130, 0, 0, 942, 945, 5, 32, 0, 0, 943, 944, 5, 39, 0, 0, 944, 946, 3, 154, 77, 0, 945, 943, 1, 0, 0, 0, 945, 946, 1, 0, 0, 0, 946, 949, 1, 0, 0, 0, 947, 948, 5, 112, 0, 0, 948, 950, 3, 154, 77, 0, 949, 947, 1, 0, 0, 0, 949, 950, 1, 0, 0, 0, 950, 953, 1, 0, 0, 0, 951, 952, 5, 103, 0, 0, 952, 954, 3, 154, 77, 0, 953, 951, 1, 0, 0, 0, 953, 954, 1, 0, 0, 0, 954, 113, 1, 0, 0, 0, 955, 958, 3, 154, 77, 0, 956, 957, 5, 6, 0, 0, 957, 959, 3, 154, 77, 0, 958, 956, 1, 0, 0, 0, 958, 959, 1, 0, 0, 0, 959, 115, 1, 0, 0, 0, 960, 967, 3, 224, 112, 0, 961, 964, 3, 204, 102, 0, 962, 963, 5, 187, 0, 0, 963, 965, 3, 204, 102, 0, 964, 962, 1, 0, 0, 0, 964, 965, 1, 0, 0, 0, 965, 967, 1, 0, 0, 0, 966, 960, 1, 0, 0, 0, 966, 961, 1, 0, 0, 0, 967, 117, 1, 0, 0, 0, 968, 973, 3, 120, 60, 0, 969, 970, 5, 151, 0, 0, 970, 972, 3, 120, 60, 0, 971, 969, 1, 0, 0, 0, 972, 975, 1, 0, 0, 0, 973, 971, 1, 0, 0, 0, 973, 974, 1, 0, 0, 0, 974, 119, 1, 0, 0, 0, 975, 973, 1, 0, 0, 0, 976, 977, 3, 220, 110, 0, 977, 978, 5, 157, 0, 0, 978, 979, 3, 206, 103, 0, 979, 121, 1, 0, 0, 0, 980, 982, 3, 124, 62, 0, 981, 980, 1, 0, 0, 0, 981, 982, 1, 0, 0, 0, 982, 984, 1, 0, 0, 0, 983, 985, 3, 126, 63, 0, 984, 983, 1, 0, 0, 0, 984, 985, 1, 0, 0, 0, 985, 987, 1, 0, 0, 0, 986, 988, 3, 130, 65, 0, 987, 986, 1, 0, 0, 0, 987, 988, 1, 0, 0, 0, 988, 123, 1, 0, 0, 0, 989, 990, 5, 82, 0, 0, 990, 991, 5, 11, 0, 0, 991, 992, 3, 146, 73, 0, 992, 125, 1, 0, 0, 0, 993, 994, 5, 79, 0, 0, 994, 995, 5, 11, 0, 0, 995, 996, 3, 108, 54, 0, 996, 127, 1, 0, 0, 0, 997, 998, 5, 131, 0, 0, 998, 999, 5, 42, 0, 0, 999, 1000, 5, 165, 0, 0, 1000, 1001, 3, 78, 39, 0, 1001, 1002, 5, 185, 0, 0, 1002, 129, 1, 0, 0, 0, 1003, 1004, 7, 10, 0, 0, 1004, 1005, 3, 132, 66, 0, 1005, 131, 1, 0, 0, 0, 1006, 1013, 3, 134, 67, 0, 1007, 1008, 5, 9, 0, 0, 1008, 1009, 3, 134, 67, 0, 1009, 1010, 5, 2, 0, 0, 1010, 1011, 3, 134, 67, 0, 1011, 1013, 1, 0, 0, 0, 1012, 1006, 1, 0, 0, 0, 1012, 1007, 1, 0, 0, 0, 1013, 133, 1, 0, 0, 0, 1014, 1015, 5, 20, 0, 0, 1015, 1027, 5, 95, 0, 0, 1016, 1017, 5, 120, 0, 0, 1017, 1027, 5, 85, 0, 0, 1018, 1019, 5, 120, 0, 0, 1019, 1027, 5, 37, 0, 0, 1020, 1021, 3, 154, 77, 0, 1021, 1022, 5, 85, 0, 0, 1022, 1027, 1, 0, 0, 0, 1023, 1024, 3, 154, 77, 0, 1024, 1025, 5, 37, 0, 0, 1025, 1027, 1, 0, 0, 0, 1026, 1014, 1, 0, 0, 0, 1026, 1016, 1, 0, 0, 0, 1026, 1018, 1, 0, 0, 0, 1026, 1020, 1, 0, 0, 0, 1026, 1023, 1, 0, 0, 0, 1027, 135, 1, 0, 0, 0, 1028, 1029, 3, 154, 77, 0, 1029, 1030, 5, 0, 0, 1, 1030, 137, 1, 0, 0, 0, 1031, 1032, 6, 69, -1, 0, 1032, 1033, 3, 220, 110, 0, 1033, 1034, 5, 165, 0, 0, 1034, 1035, 3, 220, 110, 0, 1035, 1042, 3, 138, 69, 0, 1036, 1037, 5, 151, 0, 0, 1037, 1038, 3, 220, 110, 0, 1038, 1039, 3, 138, 69, 0, 1039, 1041, 1, 0, 0, 0, 1040, 1036, 1, 0, 0, 0, 1041, 1044, 1, 0, 0, 0, 1042, 1040, 1, 0, 0, 0, 1042, 1043, 1, 0, 0, 0, 1043, 1046, 1, 0, 0, 0, 1044, 1042, 1, 0, 0, 0, 1045, 1047, 5, 151, 0, 0, 1046, 1045, 1, 0, 0, 0, 1046, 1047, 1, 0, 0, 0, 1047, 1048, 1, 0, 0, 0, 1048, 1049, 5, 185, 0, 0, 1049, 1095, 1, 0, 0, 0, 1050, 1051, 3, 220, 110, 0, 1051, 1052, 5, 165, 0, 0, 1052, 1057, 3, 222, 111, 0, 1053, 1054, 5, 151, 0, 0, 1054, 1056, 3, 222, 111, 0, 1055, 1053, 1, 0, 0, 0, 1056, 1059, 1, 0, 0, 0, 1057, 1055, 1, 0, 0, 0, 1057, 1058, 1, 0, 0, 0, 1058, 1061, 1, 0, 0, 0, 1059, 1057, 1, 0, 0, 0, 1060, 1062, 5, 151, 0, 0, 1061, 1060, 1, 0, 0, 0, 1061, 1062, 1, 0, 0, 0, 1062, 1063, 1, 0, 0, 0, 1063, 1064, 5, 185, 0, 0, 1064, 1095, 1, 0, 0, 0, 1065, 1066, 3, 220, 110, 0, 1066, 1067, 5, 165, 0, 0, 1067, 1072, 3, 138, 69, 0, 1068, 1069, 5, 151, 0, 0, 1069, 1071, 3, 138, 69, 0, 1070, 1068, 1, 0, 0, 0, 1071, 1074, 1, 0, 0, 0, 1072, 1070, 1, 0, 0, 0, 1072, 1073, 1, 0, 0, 0, 1073, 1076, 1, 0, 0, 0, 1074, 1072, 1, 0, 0, 0, 1075, 1077, 5, 151, 0, 0, 1076, 1075, 1, 0, 0, 0, 1076, 1077, 1, 0, 0, 0, 1077, 1078, 1, 0, 0, 0, 1078, 1079, 5, 185, 0, 0, 1079, 1095, 1, 0, 0, 0, 1080, 1081, 3, 220, 110, 0, 1081, 1083, 5, 165, 0, 0, 1082, 1084, 3, 146, 73, 0, 1083, 1082, 1, 0, 0, 0, 1083, 1084, 1, 0, 0, 0, 1084, 1085, 1, 0, 0, 0, 1085, 1086, 5, 185, 0, 0, 1086, 1095, 1, 0, 0, 0, 1087, 1089, 3, 220, 110, 0, 1088, 1090, 3, 220, 110, 0, 1089, 1088, 1, 0, 0, 0, 1090, 1091, 1, 0, 0, 0, 1091, 1089, 1, 0, 0, 0, 1091, 1092, 1, 0, 0, 0, 1092, 1095, 1, 0, 0, 0, 1093, 1095, 3, 220, 110, 0, 1094, 1031, 1, 0, 0, 0, 1094, 1050, 1, 0, 0, 0, 1094, 1065, 1, 0, 0, 0, 1094, 1080, 1, 0, 0, 0, 1094, 1087, 1, 0, 0, 0, 1094, 1093, 1, 0, 0, 0, 1095, 1104, 1, 0, 0, 0, 1096, 1097, 10, 7, 0, 0, 1097, 1099, 5, 164, 0, 0, 1098, 1100, 5, 139, 0, 0, 1099, 1098, 1, 0, 0, 0, 1099, 1100, 1, 0, 0, 0, 1100, 1101, 1, 0, 0, 0, 1101, 1103, 5, 184, 0, 0, 1102, 1096, 1, 0, 0, 0, 1103, 1106, 1, 0, 0, 0, 1104, 1102, 1, 0, 0, 0, 1104, 1105, 1, 0, 0, 0, 1105, 139, 1, 0, 0, 0, 1106, 1104, 1, 0, 0, 0, 1107, 1108, 3, 142, 71, 0, 1108, 1110, 5, 130, 0, 0, 1109, 1111, 5, 110, 0, 0, 1110, 1109, 1, 0, 0, 0, 1110, 1111, 1, 0, 0, 0, 1111, 1112, 1, 0, 0, 0, 1112, 1113, 5, 109, 0, 0, 1113, 1114, 5, 111, 0, 0, 1114, 1117, 1, 0, 0, 0, 1115, 1117, 3, 142, 71, 0, 1116, 1107, 1, 0, 0, 0, 1116, 1115, 1, 0, 0, 0, 1117, 141, 1, 0, 0, 0, 1118, 1123, 5, 134, 0, 0, 1119, 1123, 5, 135, 0, 0, 1120, 1123, 3, 208, 104, 0, 1121, 1123, 3, 144, 72, 0, 1122, 1118, 1, 0, 0, 0, 1122, 1119, 1, 0, 0, 0, 1122, 1120, 1, 0, 0, 0, 1122, 1121, 1, 0, 0, 0, 1123, 143, 1, 0, 0, 0, 1124, 1125, 7, 11, 0, 0, 1125, 145, 1, 0, 0, 0, 1126, 1131, 3, 154, 77, 0, 1127, 1128, 5, 151, 0, 0, 1128, 1130, 3, 154, 77, 0, 1129, 1127, 1, 0, 0, 0, 1130, 1133, 1, 0, 0, 0, 1131, 1129, 1, 0, 0, 0, 1131, 1132, 1, 0, 0, 0, 1132, 1135, 1, 0, 0, 0, 1133, 1131, 1, 0, 0, 0, 1134, 1136, 5, 151, 0, 0, 1135, 1134, 1, 0, 0, 0, 1135, 1136, 1, 0, 0, 0, 1136, 147, 1, 0, 0, 0, 1137, 1142, 3, 152, 76, 0, 1138, 1139, 5, 151, 0, 0, 1139, 1141, 3, 152, 76, 0, 1140, 1138, 1, 0, 0, 0, 1141, 1144, 1, 0, 0, 0, 1142, 1140, 1, 0, 0, 0, 1142, 1143, 1, 0, 0, 0, 1143, 1145, 1, 0, 0, 0, 1144, 1142, 1, 0, 0, 0, 1145, 1146, 5, 151, 0, 0, 1146, 1149, 1, 0, 0, 0, 1147, 1149, 3, 150, 75, 0, 1148, 1137, 1, 0, 0, 0, 1148, 1147, 1, 0, 0, 0, 1149, 149, 1, 0, 0, 0, 1150, 1155, 3, 152, 76, 0, 1151, 1152, 5, 151, 0, 0, 1152, 1154, 3, 152, 76, 0, 1153, 1151, 1, 0, 0, 0, 1154, 1157, 1, 0, 0, 0, 1155, 1153, 1, 0, 0, 0, 1155, 1156, 1, 0, 0, 0, 1156, 1159, 1, 0, 0, 0, 1157, 1155, 1, 0, 0, 0, 1158, 1160, 5, 151, 0, 0, 1159, 1158, 1, 0, 0, 0, 1159, 1160, 1, 0, 0, 0, 1160, 151, 1, 0, 0, 0, 1161, 1162, 3, 220, 110, 0, 1162, 1163, 5, 150, 0, 0, 1163, 1164, 3, 154, 77, 0, 1164, 1172, 1, 0, 0, 0, 1165, 1166, 5, 39, 0, 0, 1166, 1172, 3, 218, 109, 0, 1167, 1172, 3, 154, 77, 0, 1168, 1169, 3, 154, 77, 0, 1169, 1170, 3, 218, 109, 0, 1170, 1172, 1, 0, 0, 0, 1171, 1161, 1, 0, 0, 0, 1171, 1165, 1, 0, 0, 0, 1171, 1167, 1, 0, 0, 0, 1171, 1168, 1, 0, 0, 0, 1172, 153, 1, 0, 0, 0, 1173, 1174, 6, 77, -1, 0, 1174, 1176, 5, 12, 0, 0, 1175, 1177, 3, 154, 77, 0, 1176, 1175, 1, 0, 0, 0, 1176, 1177, 1, 0, 0, 0, 1177, 1183, 1, 0, 0, 0, 1178, 1179, 5, 126, 0, 0, 1179, 1180, 3, 154, 77, 0, 1180, 1181, 5, 105, 0, 0, 1181, 1182, 3, 154, 77, 0, 1182, 1184, 1, 0, 0, 0, 1183, 1178, 1, 0, 0, 0, 1184, 1185, 1, 0, 0, 0, 1185, 1183, 1, 0, 0, 0, 1185, 1186, 1, 0, 0, 0, 1186, 1189, 1, 0, 0, 0, 1187, 1188, 5, 26, 0, 0, 1188, 1190, 3, 154, 77, 0, 1189, 1187, 1, 0, 0, 0, 1189, 1190, 1, 0, 0, 0, 1190, 1191, 1, 0, 0, 0, 1191, 1192, 5, 27, 0, 0, 1192, 1523, 1, 0, 0, 0, 1193, 1194, 5, 13, 0, 0, 1194, 1195, 5, 165, 0, 0, 1195, 1196, 3, 154, 77, 0, 1196, 1197, 5, 6, 0, 0, 1197, 1198, 3, 138, 69, 0, 1198, 1199, 5, 185, 0, 0, 1199, 1523, 1, 0, 0, 0, 1200, 1201, 5, 119, 0, 0, 1201, 1202, 5, 165, 0, 0, 1202, 1203, 3, 154, 77, 0, 1203, 1204, 5, 6, 0, 0, 1204, 1205, 3, 138, 69, 0, 1205, 1206, 5, 185, 0, 0, 1206, 1523, 1, 0, 0, 0, 1207, 1208, 5, 21, 0, 0, 1208, 1523, 5, 143, 0, 0, 1209, 1210, 5, 56, 0, 0, 1210, 1523, 5, 143, 0, 0, 1211, 1212, 5, 56, 0, 0, 1212, 1213, 3, 154, 77, 0, 1213, 1214, 3, 208, 104, 0, 1214, 1523, 1, 0, 0, 0, 1215, 1216, 5, 104, 0, 0, 1216, 1217, 5, 165, 0, 0, 1217, 1218, 3, 154, 77, 0, 1218, 1219, 5, 39, 0, 0, 1219, 1222, 3, 154, 77, 0, 1220, 1221, 5, 38, 0, 0, 1221, 1223, 3, 154, 77, 0, 1222, 1220, 1, 0, 0, 0, 1222, 1223, 1, 0, 0, 0, 1223, 1224, 1, 0, 0, 0, 1224, 1225, 5, 185, 0, 0, 1225, 1523, 1, 0, 0, 0, 1226, 1227, 5, 108, 0, 0, 1227, 1523, 5, 143, 0, 0, 1228, 1229, 5, 116, 0, 0, 1229, 1230, 5, 165, 0, 0, 1230, 1231, 7, 12, 0, 0, 1231, 1232, 3, 226, 113, 0, 1232, 1233, 5, 39, 0, 0, 1233, 1234, 3, 154, 77, 0, 1234, 1235, 5, 185, 0, 0, 1235, 1523, 1, 0, 0, 0, 1236, 1237, 5, 17, 0, 0, 1237, 1238, 5, 165, 0, 0, 1238, 1239, 5, 143, 0, 0, 1239, 1523, 5, 185, 0, 0, 1240, 1241, 5, 17, 0, 0, 1241, 1242, 5, 165, 0, 0, 1242, 1243, 3, 146, 73, 0, 1243, 1244, 5, 185, 0, 0, 1244, 1523, 1, 0, 0, 0, 1245, 1246, 5, 17, 0, 0, 1246, 1247, 5, 165, 0, 0, 1247, 1248, 5, 145, 0, 0, 1248, 1249, 5, 29, 0, 0, 1249, 1250, 5, 165, 0, 0, 1250, 1251, 3, 8, 4, 0, 1251, 1252, 5, 185, 0, 0, 1252, 1253, 5, 91, 0, 0, 1253, 1254, 5, 165, 0, 0, 1254, 1255, 3, 158, 79, 0, 1255, 1256, 5, 185, 0, 0, 1256, 1257, 5, 185, 0, 0, 1257, 1271, 1, 0, 0, 0, 1258, 1259, 5, 165, 0, 0, 1259, 1260, 5, 145, 0, 0, 1260, 1261, 5, 29, 0, 0, 1261, 1262, 5, 165, 0, 0, 1262, 1263, 3, 8, 4, 0, 1263, 1264, 5, 185, 0, 0, 1264, 1265, 5, 91, 0, 0, 1265, 1266, 5, 165, 0, 0, 1266, 1267, 3, 158, 79, 0, 1267, 1268, 5, 185, 0, 0, 1268, 1269, 5, 185, 0, 0, 1269, 1271, 1, 0, 0, 0, 1270, 1245, 1, 0, 0, 0, 1270, 1258, 1, 0, 0, 0, 1271, 1523, 1, 0, 0, 0, 1272, 1273, 5, 17, 0, 0, 1273, 1274, 5, 165, 0, 0, 1274, 1275, 5, 145, 0, 0, 1275, 1276, 5, 29, 0, 0, 1276, 1277, 5, 165, 0, 0, 1277, 1278, 3, 8, 4, 0, 1278, 1279, 5, 185, 0, 0, 1279, 1280, 5, 185, 0, 0, 1280, 1523, 1, 0, 0, 0, 1281, 1282, 5, 17, 0, 0, 1282, 1283, 5, 165, 0, 0, 1283, 1284, 5, 145, 0, 0, 1284, 1285, 5, 91, 0, 0, 1285, 1286, 5, 165, 0, 0, 1286, 1287, 3, 158, 79, 0, 1287, 1288, 5, 185, 0, 0, 1288, 1289, 5, 185, 0, 0, 1289, 1299, 1, 0, 0, 0, 1290, 1291, 5, 165, 0, 0, 1291, 1292, 5, 145, 0, 0, 1292, 1293, 5, 91, 0, 0, 1293, 1294, 5, 165, 0, 0, 1294, 1295, 3, 158, 79, 0, 1295, 1296, 5, 185, 0, 0, 1296, 1297, 5, 185, 0, 0, 1297, 1299, 1, 0, 0, 0, 1298, 1281, 1, 0, 0, 0, 1298, 1290, 1, 0, 0, 0, 1299, 1523, 1, 0, 0, 0, 1300, 1301, 5, 17, 0, 0, 1301, 1302, 5, 165, 0, 0, 1302, 1303, 5, 145, 0, 0, 1303, 1523, 5, 185, 0, 0, 1304, 1305, 5, 17, 0, 0, 1305, 1306, 5, 165, 0, 0, 1306, 1307, 3, 220, 110, 0, 1307, 1308, 5, 155, 0, 0, 1308, 1309, 5, 145, 0, 0, 1309, 1310, 5, 29, 0, 0, 1310, 1311, 5, 165, 0, 0, 1311, 1312, 3, 8, 4, 0, 1312, 1313, 5, 185, 0, 0, 1313, 1314, 5, 91, 0, 0, 1314, 1315, 5, 165, 0, 0, 1315, 1316, 3, 158, 79, 0, 1316, 1317, 5, 185, 0, 0, 1317, 1318, 5, 185, 0, 0, 1318, 1523, 1, 0, 0, 0, 1319, 1320, 5, 17, 0, 0, 1320, 1321, 5, 165, 0, 0, 1321, 1322, 3, 220, 110, 0, 1322, 1323, 5, 155, 0, 0, 1323, 1324, 5, 145, 0, 0, 1324, 1325, 5, 29, 0, 0, 1325, 1326, 5, 165, 0, 0, 1326, 1327, 3, 8, 4, 0, 1327, 1328, 5, 185, 0, 0, 1328, 1329, 5, 185, 0, 0, 1329, 1523, 1, 0, 0, 0, 1330, 1331, 5, 17, 0, 0, 1331, 1332, 5, 165, 0, 0, 1332, 1333, 3, 220, 110, 0, 1333, 1334, 5, 155, 0, 0, 1334, 1335, 5, 145, 0, 0, 1335, 1336, 5, 91, 0, 0, 1336, 1337, 5, 165, 0, 0, 1337, 1338, 3, 158, 79, 0, 1338, 1339, 5, 185, 0, 0, 1339, 1340, 5, 185, 0, 0, 1340, 1523, 1, 0, 0, 0, 1341, 1342, 5, 17, 0, 0, 1342, 1343, 5, 165, 0, 0, 1343, 1344, 3, 220, 110, 0, 1344, 1345, 5, 155, 0, 0, 1345, 1346, 5, 145, 0, 0, 1346, 1347, 5, 185, 0, 0, 1347, 1523, 1, 0, 0, 0, 1348, 1349, 5, 145, 0, 0, 1349, 1350, 5, 17, 0, 0, 1350, 1351, 5, 165, 0, 0, 1351, 1352, 5, 143, 0, 0, 1352, 1523, 5, 185, 0, 0, 1353, 1354, 5, 145, 0, 0, 1354, 1355, 5, 17, 0, 0, 1355, 1356, 5, 165, 0, 0, 1356, 1357, 3, 146, 73, 0, 1357, 1358, 5, 185, 0, 0, 1358, 1523, 1, 0, 0, 0, 1359, 1360, 3, 220, 110, 0, 1360, 1362, 5, 165, 0, 0, 1361, 1363, 3, 146, 73, 0, 1362, 1361, 1, 0, 0, 0, 1362, 1363, 1, 0, 0, 0, 1363, 1364, 1, 0, 0, 0, 1364, 1365, 5, 185, 0, 0, 1365, 1366, 3, 128, 64, 0, 1366, 1523, 1, 0, 0, 0, 1367, 1368, 3, 220, 110, 0, 1368, 1370, 5, 165, 0, 0, 1369, 1371, 3, 146, 73, 0, 1370, 1369, 1, 0, 0, 0, 1370, 1371, 1, 0, 0, 0, 1371, 1372, 1, 0, 0, 0, 1372, 1373, 5, 185, 0, 0, 1373, 1382, 1, 0, 0, 0, 1374, 1376, 5, 165, 0, 0, 1375, 1377, 5, 25, 0, 0, 1376, 1375, 1, 0, 0, 0, 1376, 1377, 1, 0, 0, 0, 1377, 1379, 1, 0, 0, 0, 1378, 1380, 3, 146, 73, 0, 1379, 1378, 1, 0, 0, 0, 1379, 1380, 1, 0, 0, 0, 1380, 1381, 1, 0, 0, 0, 1381, 1383, 5, 185, 0, 0, 1382, 1374, 1, 0, 0, 0, 1382, 1383, 1, 0, 0, 0, 1383, 1390, 1, 0, 0, 0, 1384, 1385, 5, 33, 0, 0, 1385, 1386, 5, 165, 0, 0, 1386, 1387, 5, 127, 0, 0, 1387, 1388, 3, 154, 77, 0, 1388, 1389, 5, 185, 0, 0, 1389, 1391, 1, 0, 0, 0, 1390, 1384, 1, 0, 0, 0, 1390, 1391, 1, 0, 0, 0, 1391, 1392, 1, 0, 0, 0, 1392, 1393, 5, 81, 0, 0, 1393, 1394, 5, 165, 0, 0, 1394, 1395, 3, 122, 61, 0, 1395, 1396, 5, 185, 0, 0, 1396, 1523, 1, 0, 0, 0, 1397, 1398, 3, 220, 110, 0, 1398, 1400, 5, 165, 0, 0, 1399, 1401, 3, 146, 73, 0, 1400, 1399, 1, 0, 0, 0, 1400, 1401, 1, 0, 0, 0, 1401, 1402, 1, 0, 0, 0, 1402, 1403, 5, 185, 0, 0, 1403, 1412, 1, 0, 0, 0, 1404, 1406, 5, 165, 0, 0, 1405, 1407, 5, 25, 0, 0, 1406, 1405, 1, 0, 0, 0, 1406, 1407, 1, 0, 0, 0, 1407, 1409, 1, 0, 0, 0, 1408, 1410, 3, 146, 73, 0, 1409, 1408, 1, 0, 0, 0, 1409, 1410, 1, 0, 0, 0, 1410, 1411, 1, 0, 0, 0, 1411, 1413, 5, 185, 0, 0, 1412, 1404, 1, 0, 0, 0, 1412, 1413, 1, 0, 0, 0, 1413, 1420, 1, 0, 0, 0, 1414, 1415, 5, 33, 0, 0, 1415, 1416, 5, 165, 0, 0, 1416, 1417, 5, 127, 0, 0, 1417, 1418, 3, 154, 77, 0, 1418, 1419, 5, 185, 0, 0, 1419, 1421, 1, 0, 0, 0, 1420, 1414, 1, 0, 0, 0, 1420, 1421, 1, 0, 0, 0, 1421, 1422, 1, 0, 0, 0, 1422, 1423, 5, 81, 0, 0, 1423, 1424, 3, 220, 110, 0, 1424, 1523, 1, 0, 0, 0, 1425, 1431, 3, 220, 110, 0, 1426, 1428, 5, 165, 0, 0, 1427, 1429, 3, 146, 73, 0, 1428, 1427, 1, 0, 0, 0, 1428, 1429, 1, 0, 0, 0, 1429, 1430, 1, 0, 0, 0, 1430, 1432, 5, 185, 0, 0, 1431, 1426, 1, 0, 0, 0, 1431, 1432, 1, 0, 0, 0, 1432, 1433, 1, 0, 0, 0, 1433, 1435, 5, 165, 0, 0, 1434, 1436, 5, 25, 0, 0, 1435, 1434, 1, 0, 0, 0, 1435, 1436, 1, 0, 0, 0, 1436, 1438, 1, 0, 0, 0, 1437, 1439, 3, 146, 73, 0, 1438, 1437, 1, 0, 0, 0, 1438, 1439, 1, 0, 0, 0, 1439, 1443, 1, 0, 0, 0, 1440, 1441, 5, 79, 0, 0, 1441, 1442, 5, 11, 0, 0, 1442, 1444, 3, 108, 54, 0, 1443, 1440, 1, 0, 0, 0, 1443, 1444, 1, 0, 0, 0, 1444, 1445, 1, 0, 0, 0, 1445, 1452, 5, 185, 0, 0, 1446, 1447, 5, 33, 0, 0, 1447, 1448, 5, 165, 0, 0, 1448, 1449, 5, 127, 0, 0, 1449, 1450, 3, 154, 77, 0, 1450, 1451, 5, 185, 0, 0, 1451, 1453, 1, 0, 0, 0, 1452, 1446, 1, 0, 0, 0, 1452, 1453, 1, 0, 0, 0, 1453, 1523, 1, 0, 0, 0, 1454, 1523, 3, 166, 83, 0, 1455, 1523, 3, 228, 114, 0, 1456, 1523, 3, 206, 103, 0, 1457, 1458, 5, 153, 0, 0, 1458, 1523, 3, 154, 77, 25, 1459, 1460, 5, 73, 0, 0, 1460, 1523, 3, 154, 77, 17, 1461, 1462, 3, 196, 98, 0, 1462, 1463, 5, 155, 0, 0, 1463, 1465, 1, 0, 0, 0, 1464, 1461, 1, 0, 0, 0, 1464, 1465, 1, 0, 0, 0, 1465, 1466, 1, 0, 0, 0, 1466, 1472, 5, 145, 0, 0, 1467, 1468, 5, 29, 0, 0, 1468, 1469, 5, 165, 0, 0, 1469, 1470, 3, 8, 4, 0, 1470, 1471, 5, 185, 0, 0, 1471, 1473, 1, 0, 0, 0, 1472, 1467, 1, 0, 0, 0, 1472, 1473, 1, 0, 0, 0, 1473, 1523, 1, 0, 0, 0, 1474, 1475, 5, 60, 0, 0, 1475, 1480, 3, 220, 110, 0, 1476, 1477, 5, 151, 0, 0, 1477, 1479, 3, 220, 110, 0, 1478, 1476, 1, 0, 0, 0, 1479, 1482, 1, 0, 0, 0, 1480, 1478, 1, 0, 0, 0, 1480, 1481, 1, 0, 0, 0, 1481, 1484, 1, 0, 0, 0, 1482, 1480, 1, 0, 0, 0, 1483, 1485, 5, 151, 0, 0, 1484, 1483, 1, 0, 0, 0, 1484, 1485, 1, 0, 0, 0, 1485, 1486, 1, 0, 0, 0, 1486, 1487, 5, 150, 0, 0, 1487, 1488, 3, 154, 77, 10, 1488, 1523, 1, 0, 0, 0, 1489, 1490, 5, 165, 0, 0, 1490, 1491, 3, 48, 24, 0, 1491, 1492, 5, 185, 0, 0, 1492, 1523, 1, 0, 0, 0, 1493, 1494, 5, 165, 0, 0, 1494, 1495, 3, 154, 77, 0, 1495, 1496, 5, 185, 0, 0, 1496, 1523, 1, 0, 0, 0, 1497, 1498, 5, 165, 0, 0, 1498, 1499, 3, 146, 73, 0, 1499, 1500, 5, 185, 0, 0, 1500, 1523, 1, 0, 0, 0, 1501, 1503, 5, 5, 0, 0, 1502, 1501, 1, 0, 0, 0, 1502, 1503, 1, 0, 0, 0, 1503, 1504, 1, 0, 0, 0, 1504, 1506, 5, 164, 0, 0, 1505, 1507, 3, 146, 73, 0, 1506, 1505, 1, 0, 0, 0, 1506, 1507, 1, 0, 0, 0, 1507, 1508, 1, 0, 0, 0, 1508, 1523, 5, 184, 0, 0, 1509, 1511, 5, 163, 0, 0, 1510, 1512, 3, 40, 20, 0, 1511, 1510, 1, 0, 0, 0, 1511, 1512, 1, 0, 0, 0, 1512, 1513, 1, 0, 0, 0, 1513, 1523, 5, 183, 0, 0, 1514, 1523, 3, 156, 78, 0, 1515, 1516, 3, 220, 110, 0, 1516, 1517, 5, 149, 0, 0, 1517, 1518, 3, 154, 77, 3, 1518, 1523, 1, 0, 0, 0, 1519, 1520, 5, 160, 0, 0, 1520, 1523, 5, 139, 0, 0, 1521, 1523, 3, 176, 88, 0, 1522, 1173, 1, 0, 0, 0, 1522, 1193, 1, 0, 0, 0, 1522, 1200, 1, 0, 0, 0, 1522, 1207, 1, 0, 0, 0, 1522, 1209, 1, 0, 0, 0, 1522, 1211, 1, 0, 0, 0, 1522, 1215, 1, 0, 0, 0, 1522, 1226, 1, 0, 0, 0, 1522, 1228, 1, 0, 0, 0, 1522, 1236, 1, 0, 0, 0, 1522, 1240, 1, 0, 0, 0, 1522, 1270, 1, 0, 0, 0, 1522, 1272, 1, 0, 0, 0, 1522, 1298, 1, 0, 0, 0, 1522, 1300, 1, 0, 0, 0, 1522, 1304, 1, 0, 0, 0, 1522, 1319, 1, 0, 0, 0, 1522, 1330, 1, 0, 0, 0, 1522, 1341, 1, 0, 0, 0, 1522, 1348, 1, 0, 0, 0, 1522, 1353, 1, 0, 0, 0, 1522, 1359, 1, 0, 0, 0, 1522, 1367, 1, 0, 0, 0, 1522, 1397, 1, 0, 0, 0, 1522, 1425, 1, 0, 0, 0, 1522, 1454, 1, 0, 0, 0, 1522, 1455, 1, 0, 0, 0, 1522, 1456, 1, 0, 0, 0, 1522, 1457, 1, 0, 0, 0, 1522, 1459, 1, 0, 0, 0, 1522, 1464, 1, 0, 0, 0, 1522, 1474, 1, 0, 0, 0, 1522, 1489, 1, 0, 0, 0, 1522, 1493, 1, 0, 0, 0, 1522, 1497, 1, 0, 0, 0, 1522, 1502, 1, 0, 0, 0, 1522, 1509, 1, 0, 0, 0, 1522, 1514, 1, 0, 0, 0, 1522, 1515, 1, 0, 0, 0, 1522, 1519, 1, 0, 0, 0, 1522, 1521, 1, 0, 0, 0, 1523, 1662, 1, 0, 0, 0, 1524, 1528, 10, 24, 0, 0, 1525, 1529, 5, 145, 0, 0, 1526, 1529, 5, 187, 0, 0, 1527, 1529, 5, 174, 0, 0, 1528, 1525, 1, 0, 0, 0, 1528, 1526, 1, 0, 0, 0, 1528, 1527, 1, 0, 0, 0, 1529, 1530, 1, 0, 0, 0, 1530, 1661, 3, 154, 77, 25, 1531, 1535, 10, 23, 0, 0, 1532, 1536, 5, 175, 0, 0, 1533, 1536, 5, 153, 0, 0, 1534, 1536, 5, 152, 0, 0, 1535, 1532, 1, 0, 0, 0, 1535, 1533, 1, 0, 0, 0, 1535, 1534, 1, 0, 0, 0, 1536, 1537, 1, 0, 0, 0, 1537, 1661, 3, 154, 77, 24, 1538, 1563, 10, 22, 0, 0, 1539, 1564, 5, 156, 0, 0, 1540, 1564, 5, 157, 0, 0, 1541, 1564, 5, 169, 0, 0, 1542, 1564, 5, 166, 0, 0, 1543, 1564, 5, 167, 0, 0, 1544, 1564, 5, 158, 0, 0, 1545, 1564, 5, 159, 0, 0, 1546, 1548, 5, 73, 0, 0, 1547, 1546, 1, 0, 0, 0, 1547, 1548, 1, 0, 0, 0, 1548, 1549, 1, 0, 0, 0, 1549, 1551, 5, 51, 0, 0, 1550, 1552, 5, 15, 0, 0, 1551, 1550, 1, 0, 0, 0, 1551, 1552, 1, 0, 0, 0, 1552, 1564, 1, 0, 0, 0, 1553, 1555, 5, 73, 0, 0, 1554, 1553, 1, 0, 0, 0, 1554, 1555, 1, 0, 0, 0, 1555, 1556, 1, 0, 0, 0, 1556, 1564, 7, 13, 0, 0, 1557, 1564, 5, 181, 0, 0, 1558, 1564, 5, 182, 0, 0, 1559, 1564, 5, 171, 0, 0, 1560, 1564, 5, 161, 0, 0, 1561, 1564, 5, 162, 0, 0, 1562, 1564, 5, 170, 0, 0, 1563, 1539, 1, 0, 0, 0, 1563, 1540, 1, 0, 0, 0, 1563, 1541, 1, 0, 0, 0, 1563, 1542, 1, 0, 0, 0, 1563, 1543, 1, 0, 0, 0, 1563, 1544, 1, 0, 0, 0, 1563, 1545, 1, 0, 0, 0, 1563, 1547, 1, 0, 0, 0, 1563, 1554, 1, 0, 0, 0, 1563, 1557, 1, 0, 0, 0, 1563, 1558, 1, 0, 0, 0, 1563, 1559, 1, 0, 0, 0, 1563, 1560, 1, 0, 0, 0, 1563, 1561, 1, 0, 0, 0, 1563, 1562, 1, 0, 0, 0, 1564, 1565, 1, 0, 0, 0, 1565, 1661, 3, 154, 77, 23, 1566, 1567, 10, 19, 0, 0, 1567, 1569, 5, 57, 0, 0, 1568, 1570, 5, 73, 0, 0, 1569, 1568, 1, 0, 0, 0, 1569, 1570, 1, 0, 0, 0, 1570, 1571, 1, 0, 0, 0, 1571, 1572, 5, 25, 0, 0, 1572, 1573, 5, 39, 0, 0, 1573, 1661, 3, 154, 77, 20, 1574, 1575, 10, 18, 0, 0, 1575, 1576, 5, 173, 0, 0, 1576, 1661, 3, 154, 77, 19, 1577, 1578, 10, 16, 0, 0, 1578, 1579, 5, 2, 0, 0, 1579, 1661, 3, 154, 77, 17, 1580, 1581, 10, 15, 0, 0, 1581, 1582, 5, 78, 0, 0, 1582, 1661, 3, 154, 77, 16, 1583, 1585, 10, 14, 0, 0, 1584, 1586, 5, 73, 0, 0, 1585, 1584, 1, 0, 0, 0, 1585, 1586, 1, 0, 0, 0, 1586, 1587, 1, 0, 0, 0, 1587, 1588, 5, 9, 0, 0, 1588, 1589, 3, 154, 77, 0, 1589, 1590, 5, 2, 0, 0, 1590, 1591, 3, 154, 77, 15, 1591, 1661, 1, 0, 0, 0, 1592, 1593, 10, 13, 0, 0, 1593, 1594, 5, 176, 0, 0, 1594, 1595, 3, 154, 77, 0, 1595, 1596, 5, 150, 0, 0, 1596, 1597, 3, 154, 77, 13, 1597, 1661, 1, 0, 0, 0, 1598, 1599, 10, 38, 0, 0, 1599, 1600, 5, 165, 0, 0, 1600, 1601, 3, 48, 24, 0, 1601, 1602, 5, 185, 0, 0, 1602, 1661, 1, 0, 0, 0, 1603, 1604, 10, 37, 0, 0, 1604, 1606, 5, 165, 0, 0, 1605, 1607, 3, 146, 73, 0, 1606, 1605, 1, 0, 0, 0, 1606, 1607, 1, 0, 0, 0, 1607, 1608, 1, 0, 0, 0, 1608, 1661, 5, 185, 0, 0, 1609, 1610, 10, 33, 0, 0, 1610, 1611, 5, 164, 0, 0, 1611, 1612, 3, 154, 77, 0, 1612, 1613, 5, 184, 0, 0, 1613, 1661, 1, 0, 0, 0, 1614, 1615, 10, 32, 0, 0, 1615, 1617, 5, 164, 0, 0, 1616, 1618, 3, 154, 77, 0, 1617, 1616, 1, 0, 0, 0, 1617, 1618, 1, 0, 0, 0, 1618, 1619, 1, 0, 0, 0, 1619, 1621, 5, 150, 0, 0, 1620, 1622, 3, 154, 77, 0, 1621, 1620, 1, 0, 0, 0, 1621, 1622, 1, 0, 0, 0, 1622, 1623, 1, 0, 0, 0, 1623, 1661, 5, 184, 0, 0, 1624, 1625, 10, 31, 0, 0, 1625, 1626, 5, 155, 0, 0, 1626, 1661, 5, 139, 0, 0, 1627, 1628, 10, 30, 0, 0, 1628, 1629, 5, 155, 0, 0, 1629, 1661, 3, 220, 110, 0, 1630, 1631, 10, 29, 0, 0, 1631, 1632, 5, 172, 0, 0, 1632, 1633, 5, 164, 0, 0, 1633, 1634, 3, 154, 77, 0, 1634, 1635, 5, 184, 0, 0, 1635, 1661, 1, 0, 0, 0, 1636, 1637, 10, 28, 0, 0, 1637, 1638, 5, 172, 0, 0, 1638, 1661, 5, 139, 0, 0, 1639, 1640, 10, 27, 0, 0, 1640, 1641, 5, 172, 0, 0, 1641, 1661, 3, 220, 110, 0, 1642, 1643, 10, 26, 0, 0, 1643, 1644, 5, 148, 0, 0, 1644, 1661, 3, 140, 70, 0, 1645, 1646, 10, 21, 0, 0, 1646, 1647, 5, 49, 0, 0, 1647, 1661, 5, 75, 0, 0, 1648, 1649, 10, 20, 0, 0, 1649, 1651, 5, 57, 0, 0, 1650, 1652, 5, 73, 0, 0, 1651, 1650, 1, 0, 0, 0, 1651, 1652, 1, 0, 0, 0, 1652, 1653, 1, 0, 0, 0, 1653, 1661, 5, 74, 0, 0, 1654, 1655, 10, 12, 0, 0, 1655, 1658, 5, 6, 0, 0, 1656, 1659, 3, 220, 110, 0, 1657, 1659, 5, 143, 0, 0, 1658, 1656, 1, 0, 0, 0, 1658, 1657, 1, 0, 0, 0, 1659, 1661, 1, 0, 0, 0, 1660, 1524, 1, 0, 0, 0, 1660, 1531, 1, 0, 0, 0, 1660, 1538, 1, 0, 0, 0, 1660, 1566, 1, 0, 0, 0, 1660, 1574, 1, 0, 0, 0, 1660, 1577, 1, 0, 0, 0, 1660, 1580, 1, 0, 0, 0, 1660, 1583, 1, 0, 0, 0, 1660, 1592, 1, 0, 0, 0, 1660, 1598, 1, 0, 0, 0, 1660, 1603, 1, 0, 0, 0, 1660, 1609, 1, 0, 0, 0, 1660, 1614, 1, 0, 0, 0, 1660, 1624, 1, 0, 0, 0, 1660, 1627, 1, 0, 0, 0, 1660, 1630, 1, 0, 0, 0, 1660, 1636, 1, 0, 0, 0, 1660, 1639, 1, 0, 0, 0, 1660, 1642, 1, 0, 0, 0, 1660, 1645, 1, 0, 0, 0, 1660, 1648, 1, 0, 0, 0, 1660, 1654, 1, 0, 0, 0, 1661, 1664, 1, 0, 0, 0, 1662, 1660, 1, 0, 0, 0, 1662, 1663, 1, 0, 0, 0, 1663, 155, 1, 0, 0, 0, 1664, 1662, 1, 0, 0, 0, 1665, 1666, 5, 165, 0, 0, 1666, 1671, 3, 220, 110, 0, 1667, 1668, 5, 151, 0, 0, 1668, 1670, 3, 220, 110, 0, 1669, 1667, 1, 0, 0, 0, 1670, 1673, 1, 0, 0, 0, 1671, 1669, 1, 0, 0, 0, 1671, 1672, 1, 0, 0, 0, 1672, 1675, 1, 0, 0, 0, 1673, 1671, 1, 0, 0, 0, 1674, 1676, 5, 151, 0, 0, 1675, 1674, 1, 0, 0, 0, 1675, 1676, 1, 0, 0, 0, 1676, 1677, 1, 0, 0, 0, 1677, 1678, 5, 185, 0, 0, 1678, 1693, 1, 0, 0, 0, 1679, 1684, 3, 220, 110, 0, 1680, 1681, 5, 151, 0, 0, 1681, 1683, 3, 220, 110, 0, 1682, 1680, 1, 0, 0, 0, 1683, 1686, 1, 0, 0, 0, 1684, 1682, 1, 0, 0, 0, 1684, 1685, 1, 0, 0, 0, 1685, 1688, 1, 0, 0, 0, 1686, 1684, 1, 0, 0, 0, 1687, 1689, 5, 151, 0, 0, 1688, 1687, 1, 0, 0, 0, 1688, 1689, 1, 0, 0, 0, 1689, 1693, 1, 0, 0, 0, 1690, 1691, 5, 165, 0, 0, 1691, 1693, 5, 185, 0, 0, 1692, 1665, 1, 0, 0, 0, 1692, 1679, 1, 0, 0, 0, 1692, 1690, 1, 0, 0, 0, 1693, 1694, 1, 0, 0, 0, 1694, 1697, 5, 144, 0, 0, 1695, 1698, 3, 154, 77, 0, 1696, 1698, 3, 36, 18, 0, 1697, 1695, 1, 0, 0, 0, 1697, 1696, 1, 0, 0, 0, 1698, 1715, 1, 0, 0, 0, 1699, 1700, 5, 60, 0, 0, 1700, 1705, 3, 220, 110, 0, 1701, 1702, 5, 151, 0, 0, 1702, 1704, 3, 220, 110, 0, 1703, 1701, 1, 0, 0, 0, 1704, 1707, 1, 0, 0, 0, 1705, 1703, 1, 0, 0, 0, 1705, 1706, 1, 0, 0, 0, 1706, 1709, 1, 0, 0, 0, 1707, 1705, 1, 0, 0, 0, 1708, 1710, 5, 151, 0, 0, 1709, 1708, 1, 0, 0, 0, 1709, 1710, 1, 0, 0, 0, 1710, 1711, 1, 0, 0, 0, 1711, 1712, 5, 150, 0, 0, 1712, 1713, 3, 154, 77, 0, 1713, 1715, 1, 0, 0, 0, 1714, 1692, 1, 0, 0, 0, 1714, 1699, 1, 0, 0, 0, 1715, 157, 1, 0, 0, 0, 1716, 1721, 3, 160, 80, 0, 1717, 1718, 5, 151, 0, 0, 1718, 1720, 3, 160, 80, 0, 1719, 1717, 1, 0, 0, 0, 1720, 1723, 1, 0, 0, 0, 1721, 1719, 1, 0, 0, 0, 1721, 1722, 1, 0, 0, 0, 1722, 159, 1, 0, 0, 0, 1723, 1721, 1, 0, 0, 0, 1724, 1725, 3, 154, 77, 0, 1725, 1726, 5, 6, 0, 0, 1726, 1727, 3, 220, 110, 0, 1727, 161, 1, 0, 0, 0, 1728, 1735, 3, 166, 83, 0, 1729, 1735, 3, 164, 82, 0, 1730, 1731, 5, 163, 0, 0, 1731, 1732, 3, 154, 77, 0, 1732, 1733, 5, 183, 0, 0, 1733, 1735, 1, 0, 0, 0, 1734, 1728, 1, 0, 0, 0, 1734, 1729, 1, 0, 0, 0, 1734, 1730, 1, 0, 0, 0, 1735, 163, 1, 0, 0, 0, 1736, 1737, 5, 200, 0, 0, 1737, 165, 1, 0, 0, 0, 1738, 1739, 5, 167, 0, 0, 1739, 1743, 3, 220, 110, 0, 1740, 1742, 3, 168, 84, 0, 1741, 1740, 1, 0, 0, 0, 1742, 1745, 1, 0, 0, 0, 1743, 1741, 1, 0, 0, 0, 1743, 1744, 1, 0, 0, 0, 1744, 1746, 1, 0, 0, 0, 1745, 1743, 1, 0, 0, 0, 1746, 1747, 5, 188, 0, 0, 1747, 1768, 1, 0, 0, 0, 1748, 1749, 5, 167, 0, 0, 1749, 1753, 3, 220, 110, 0, 1750, 1752, 3, 168, 84, 0, 1751, 1750, 1, 0, 0, 0, 1752, 1755, 1, 0, 0, 0, 1753, 1751, 1, 0, 0, 0, 1753, 1754, 1, 0, 0, 0, 1754, 1756, 1, 0, 0, 0, 1755, 1753, 1, 0, 0, 0, 1756, 1760, 5, 159, 0, 0, 1757, 1759, 3, 162, 81, 0, 1758, 1757, 1, 0, 0, 0, 1759, 1762, 1, 0, 0, 0, 1760, 1758, 1, 0, 0, 0, 1760, 1761, 1, 0, 0, 0, 1761, 1763, 1, 0, 0, 0, 1762, 1760, 1, 0, 0, 0, 1763, 1764, 5, 168, 0, 0, 1764, 1765, 3, 220, 110, 0, 1765, 1766, 5, 159, 0, 0, 1766, 1768, 1, 0, 0, 0, 1767, 1738, 1, 0, 0, 0, 1767, 1748, 1, 0, 0, 0, 1768, 167, 1, 0, 0, 0, 1769, 1770, 3, 220, 110, 0, 1770, 1771, 5, 157, 0, 0, 1771, 1772, 3, 226, 113, 0, 1772, 1781, 1, 0, 0, 0, 1773, 1774, 3, 220, 110, 0, 1774, 1775, 5, 157, 0, 0, 1775, 1776, 5, 163, 0, 0, 1776, 1777, 3, 154, 77, 0, 1777, 1778, 5, 183, 0, 0, 1778, 1781, 1, 0, 0, 0, 1779, 1781, 3, 220, 110, 0, 1780, 1769, 1, 0, 0, 0, 1780, 1773, 1, 0, 0, 0, 1780, 1779, 1, 0, 0, 0, 1781, 169, 1, 0, 0, 0, 1782, 1787, 3, 172, 86, 0, 1783, 1784, 5, 151, 0, 0, 1784, 1786, 3, 172, 86, 0, 1785, 1783, 1, 0, 0, 0, 1786, 1789, 1, 0, 0, 0, 1787, 1785, 1, 0, 0, 0, 1787, 1788, 1, 0, 0, 0, 1788, 1791, 1, 0, 0, 0, 1789, 1787, 1, 0, 0, 0, 1790, 1792, 5, 151, 0, 0, 1791, 1790, 1, 0, 0, 0, 1791, 1792, 1, 0, 0, 0, 1792, 171, 1, 0, 0, 0, 1793, 1795, 3, 220, 110, 0, 1794, 1796, 3, 174, 87, 0, 1795, 1794, 1, 0, 0, 0, 1795, 1796, 1, 0, 0, 0, 1796, 1800, 1, 0, 0, 0, 1797, 1798, 5, 123, 0, 0, 1798, 1799, 5, 59, 0, 0, 1799, 1801, 3, 174, 87, 0, 1800, 1797, 1, 0, 0, 0, 1800, 1801, 1, 0, 0, 0, 1801, 1802, 1, 0, 0, 0, 1802, 1807, 5, 6, 0, 0, 1803, 1805, 5, 73, 0, 0, 1804, 1803, 1, 0, 0, 0, 1804, 1805, 1, 0, 0, 0, 1805, 1806, 1, 0, 0, 0, 1806, 1808, 5, 67, 0, 0, 1807, 1804, 1, 0, 0, 0, 1807, 1808, 1, 0, 0, 0, 1808, 1809, 1, 0, 0, 0, 1809, 1810, 5, 165, 0, 0, 1810, 1811, 3, 48, 24, 0, 1811, 1812, 5, 185, 0, 0, 1812, 1818, 1, 0, 0, 0, 1813, 1814, 3, 154, 77, 0, 1814, 1815, 5, 6, 0, 0, 1815, 1816, 3, 220, 110, 0, 1816, 1818, 1, 0, 0, 0, 1817, 1793, 1, 0, 0, 0, 1817, 1813, 1, 0, 0, 0, 1818, 173, 1, 0, 0, 0, 1819, 1820, 5, 165, 0, 0, 1820, 1825, 3, 220, 110, 0, 1821, 1822, 5, 151, 0, 0, 1822, 1824, 3, 220, 110, 0, 1823, 1821, 1, 0, 0, 0, 1824, 1827, 1, 0, 0, 0, 1825, 1823, 1, 0, 0, 0, 1825, 1826, 1, 0, 0, 0, 1826, 1828, 1, 0, 0, 0, 1827, 1825, 1, 0, 0, 0, 1828, 1829, 5, 185, 0, 0, 1829, 175, 1, 0, 0, 0, 1830, 1838, 3, 224, 112, 0, 1831, 1832, 3, 196, 98, 0, 1832, 1833, 5, 155, 0, 0, 1833, 1835, 1, 0, 0, 0, 1834, 1831, 1, 0, 0, 0, 1834, 1835, 1, 0, 0, 0, 1835, 1836, 1, 0, 0, 0, 1836, 1838, 3, 178, 89, 0, 1837, 1830, 1, 0, 0, 0, 1837, 1834, 1, 0, 0, 0, 1838, 177, 1, 0, 0, 0, 1839, 1844, 3, 220, 110, 0, 1840, 1841, 5, 155, 0, 0, 1841, 1843, 3, 220, 110, 0, 1842, 1840, 1, 0, 0, 0, 1843, 1846, 1, 0, 0, 0, 1844, 1842, 1, 0, 0, 0, 1844, 1845, 1, 0, 0, 0, 1845, 179, 1, 0, 0, 0, 1846, 1844, 1, 0, 0, 0, 1847, 1848, 6, 90, -1, 0, 1848, 1861, 3, 196, 98, 0, 1849, 1861, 3, 194, 97, 0, 1850, 1851, 5, 165, 0, 0, 1851, 1852, 3, 48, 24, 0, 1852, 1853, 5, 185, 0, 0, 1853, 1861, 1, 0, 0, 0, 1854, 1855, 5, 165, 0, 0, 1855, 1856, 3, 92, 46, 0, 1856, 1857, 5, 185, 0, 0, 1857, 1861, 1, 0, 0, 0, 1858, 1861, 3, 166, 83, 0, 1859, 1861, 3, 224, 112, 0, 1860, 1847, 1, 0, 0, 0, 1860, 1849, 1, 0, 0, 0, 1860, 1850, 1, 0, 0, 0, 1860, 1854, 1, 0, 0, 0, 1860, 1858, 1, 0, 0, 0, 1860, 1859, 1, 0, 0, 0, 1861, 1895, 1, 0, 0, 0, 1862, 1863, 10, 5, 0, 0, 1863, 1864, 5, 83, 0, 0, 1864, 1865, 5, 165, 0, 0, 1865, 1866, 3, 146, 73, 0, 1866, 1870, 3, 182, 91, 0, 1867, 1868, 5, 42, 0, 0, 1868, 1869, 5, 11, 0, 0, 1869, 1871, 3, 146, 73, 0, 1870, 1867, 1, 0, 0, 0, 1870, 1871, 1, 0, 0, 0, 1871, 1872, 1, 0, 0, 0, 1872, 1873, 5, 185, 0, 0, 1873, 1894, 1, 0, 0, 0, 1874, 1875, 10, 4, 0, 0, 1875, 1878, 5, 122, 0, 0, 1876, 1877, 5, 50, 0, 0, 1877, 1879, 5, 75, 0, 0, 1878, 1876, 1, 0, 0, 0, 1878, 1879, 1, 0, 0, 0, 1879, 1880, 1, 0, 0, 0, 1880, 1881, 5, 165, 0, 0, 1881, 1882, 3, 186, 93, 0, 1882, 1883, 5, 185, 0, 0, 1883, 1894, 1, 0, 0, 0, 1884, 1888, 10, 3, 0, 0, 1885, 1889, 3, 216, 108, 0, 1886, 1887, 5, 6, 0, 0, 1887, 1889, 3, 220, 110, 0, 1888, 1885, 1, 0, 0, 0, 1888, 1886, 1, 0, 0, 0, 1889, 1891, 1, 0, 0, 0, 1890, 1892, 3, 192, 96, 0, 1891, 1890, 1, 0, 0, 0, 1891, 1892, 1, 0, 0, 0, 1892, 1894, 1, 0, 0, 0, 1893, 1862, 1, 0, 0, 0, 1893, 1874, 1, 0, 0, 0, 1893, 1884, 1, 0, 0, 0, 1894, 1897, 1, 0, 0, 0, 1895, 1893, 1, 0, 0, 0, 1895, 1896, 1, 0, 0, 0, 1896, 181, 1, 0, 0, 0, 1897, 1895, 1, 0, 0, 0, 1898, 1900, 5, 38, 0, 0, 1899, 1901, 3, 184, 92, 0, 1900, 1899, 1, 0, 0, 0, 1901, 1902, 1, 0, 0, 0, 1902, 1900, 1, 0, 0, 0, 1902, 1903, 1, 0, 0, 0, 1903, 183, 1, 0, 0, 0, 1904, 1905, 3, 190, 95, 0, 1905, 1906, 5, 51, 0, 0, 1906, 1907, 5, 165, 0, 0, 1907, 1908, 3, 146, 73, 0, 1908, 1909, 5, 185, 0, 0, 1909, 185, 1, 0, 0, 0, 1910, 1915, 3, 188, 94, 0, 1911, 1912, 5, 151, 0, 0, 1912, 1914, 3, 188, 94, 0, 1913, 1911, 1, 0, 0, 0, 1914, 1917, 1, 0, 0, 0, 1915, 1913, 1, 0, 0, 0, 1915, 1916, 1, 0, 0, 0, 1916, 1919, 1, 0, 0, 0, 1917, 1915, 1, 0, 0, 0, 1918, 1920, 5, 151, 0, 0, 1919, 1918, 1, 0, 0, 0, 1919, 1920, 1, 0, 0, 0, 1920, 187, 1, 0, 0, 0, 1921, 1922, 3, 190, 95, 0, 1922, 1923, 5, 38, 0, 0, 1923, 1924, 3, 190, 95, 0, 1924, 1925, 5, 51, 0, 0, 1925, 1926, 5, 165, 0, 0, 1926, 1927, 3, 146, 73, 0, 1927, 1936, 5, 185, 0, 0, 1928, 1929, 3, 190, 95, 0, 1929, 1930, 5, 51, 0, 0, 1930, 1931, 5, 165, 0, 0, 1931, 1932, 3, 146, 73, 0, 1932, 1933, 5, 185, 0, 0, 1933, 1935, 1, 0, 0, 0, 1934, 1928, 1, 0, 0, 0, 1935, 1938, 1, 0, 0, 0, 1936, 1934, 1, 0, 0, 0, 1936, 1937, 1, 0, 0, 0, 1937, 189, 1, 0, 0, 0, 1938, 1936, 1, 0, 0, 0, 1939, 1940, 5, 165, 0, 0, 1940, 1941, 3, 146, 73, 0, 1941, 1942, 5, 185, 0, 0, 1942, 1945, 1, 0, 0, 0, 1943, 1945, 3, 154, 77, 0, 1944, 1939, 1, 0, 0, 0, 1944, 1943, 1, 0, 0, 0, 1945, 191, 1, 0, 0, 0, 1946, 1947, 5, 165, 0, 0, 1947, 1952, 3, 220, 110, 0, 1948, 1949, 5, 151, 0, 0, 1949, 1951, 3, 220, 110, 0, 1950, 1948, 1, 0, 0, 0, 1951, 1954, 1, 0, 0, 0, 1952, 1950, 1, 0, 0, 0, 1952, 1953, 1, 0, 0, 0, 1953, 1955, 1, 0, 0, 0, 1954, 1952, 1, 0, 0, 0, 1955, 1956, 5, 185, 0, 0, 1956, 193, 1, 0, 0, 0, 1957, 1958, 3, 220, 110, 0, 1958, 1960, 5, 165, 0, 0, 1959, 1961, 3, 198, 99, 0, 1960, 1959, 1, 0, 0, 0, 1960, 1961, 1, 0, 0, 0, 1961, 1962, 1, 0, 0, 0, 1962, 1963, 5, 185, 0, 0, 1963, 195, 1, 0, 0, 0, 1964, 1965, 3, 200, 100, 0, 1965, 1966, 5, 155, 0, 0, 1966, 1968, 1, 0, 0, 0, 1967, 1964, 1, 0, 0, 0, 1967, 1968, 1, 0, 0, 0, 1968, 1969, 1, 0, 0, 0, 1969, 1970, 3, 178, 89, 0, 1970, 197, 1, 0, 0, 0, 1971, 1976, 3, 154, 77, 0, 1972, 1973, 5, 151, 0, 0, 1973, 1975, 3, 154, 77, 0, 1974, 1972, 1, 0, 0, 0, 1975, 1978, 1, 0, 0, 0, 1976, 1974, 1, 0, 0, 0, 1976, 1977, 1, 0, 0, 0, 1977, 1980, 1, 0, 0, 0, 1978, 1976, 1, 0, 0, 0, 1979, 1981, 5, 151, 0, 0, 1980, 1979, 1, 0, 0, 0, 1980, 1981, 1, 0, 0, 0, 1981, 199, 1, 0, 0, 0, 1982, 1983, 3, 220, 110, 0, 1983, 201, 1, 0, 0, 0, 1984, 1993, 5, 136, 0, 0, 1985, 1986, 5, 155, 0, 0, 1986, 1993, 7, 14, 0, 0, 1987, 1988, 5, 139, 0, 0, 1988, 1990, 5, 155, 0, 0, 1989, 1991, 7, 14, 0, 0, 1990, 1989, 1, 0, 0, 0, 1990, 1991, 1, 0, 0, 0, 1991, 1993, 1, 0, 0, 0, 1992, 1984, 1, 0, 0, 0, 1992, 1985, 1, 0, 0, 0, 1992, 1987, 1, 0, 0, 0, 1993, 203, 1, 0, 0, 0, 1994, 1996, 7, 15, 0, 0, 1995, 1994, 1, 0, 0, 0, 1995, 1996, 1, 0, 0, 0, 1996, 2005, 1, 0, 0, 0, 1997, 2006, 3, 202, 101, 0, 1998, 2006, 5, 137, 0, 0, 1999, 2006, 5, 138, 0, 0, 2000, 2006, 5, 141, 0, 0, 2001, 2006, 5, 139, 0, 0, 2002, 2006, 5, 140, 0, 0, 2003, 2006, 5, 52, 0, 0, 2004, 2006, 5, 72, 0, 0, 2005, 1997, 1, 0, 0, 0, 2005, 1998, 1, 0, 0, 0, 2005, 1999, 1, 0, 0, 0, 2005, 2000, 1, 0, 0, 0, 2005, 2001, 1, 0, 0, 0, 2005, 2002, 1, 0, 0, 0, 2005, 2003, 1, 0, 0, 0, 2005, 2004, 1, 0, 0, 0, 2006, 205, 1, 0, 0, 0, 2007, 2011, 3, 204, 102, 0, 2008, 2011, 5, 143, 0, 0, 2009, 2011, 5, 74, 0, 0, 2010, 2007, 1, 0, 0, 0, 2010, 2008, 1, 0, 0, 0, 2010, 2009, 1, 0, 0, 0, 2011, 207, 1, 0, 0, 0, 2012, 2013, 7, 16, 0, 0, 2013, 209, 1, 0, 0, 0, 2014, 2015, 7, 17, 0, 0, 2015, 211, 1, 0, 0, 0, 2016, 2017, 7, 18, 0, 0, 2017, 213, 1, 0, 0, 0, 2018, 2019, 7, 19, 0, 0, 2019, 215, 1, 0, 0, 0, 2020, 2024, 5, 134, 0, 0, 2021, 2024, 5, 135, 0, 0, 2022, 2024, 3, 212, 106, 0, 2023, 2020, 1, 0, 0, 0, 2023, 2021, 1, 0, 0, 0, 2023, 2022, 1, 0, 0, 0, 2024, 217, 1, 0, 0, 0, 2025, 2029, 5, 134, 0, 0, 2026, 2029, 5, 135, 0, 0, 2027, 2029, 3, 214, 107, 0, 2028, 2025, 1, 0, 0, 0, 2028, 2026, 1, 0, 0, 0, 2028, 2027, 1, 0, 0, 0, 2029, 219, 1, 0, 0, 0, 2030, 2035, 5, 134, 0, 0, 2031, 2035, 5, 135, 0, 0, 2032, 2035, 3, 208, 104, 0, 2033, 2035, 3, 210, 105, 0, 2034, 2030, 1, 0, 0, 0, 2034, 2031, 1, 0, 0, 0, 2034, 2032, 1, 0, 0, 0, 2034, 2033, 1, 0, 0, 0, 2035, 221, 1, 0, 0, 0, 2036, 2037, 3, 226, 113, 0, 2037, 2038, 5, 157, 0, 0, 2038, 2039, 3, 204, 102, 0, 2039, 223, 1, 0, 0, 0, 2040, 2041, 5, 163, 0, 0, 2041, 2042, 3, 154, 77, 0, 2042, 2043, 5, 183, 0, 0, 2043, 225, 1, 0, 0, 0, 2044, 2047, 5, 143, 0, 0, 2045, 2047, 3, 228, 114, 0, 2046, 2044, 1, 0, 0, 0, 2046, 2045, 1, 0, 0, 0, 2047, 227, 1, 0, 0, 0, 2048, 2052, 5, 178, 0, 0, 2049, 2051, 3, 230, 115, 0, 2050, 2049, 1, 0, 0, 0, 2051, 2054, 1, 0, 0, 0, 2052, 2050, 1, 0, 0, 0, 2052, 2053, 1, 0, 0, 0, 2053, 2055, 1, 0, 0, 0, 2054, 2052, 1, 0, 0, 0, 2055, 2056, 5, 180, 0, 0, 2056, 229, 1, 0, 0, 0, 2057, 2058, 5, 195, 0, 0, 2058, 2059, 3, 154, 77, 0, 2059, 2060, 5, 183, 0, 0, 2060, 2063, 1, 0, 0, 0, 2061, 2063, 5, 194, 0, 0, 2062, 2057, 1, 0, 0, 0, 2062, 2061, 1, 0, 0, 0, 2063, 231, 1, 0, 0, 0, 2064, 2068, 5, 179, 0, 0, 2065, 2067, 3, 234, 117, 0, 2066, 2065, 1, 0, 0, 0, 2067, 2070, 1, 0, 0, 0, 2068, 2066, 1, 0, 0, 0, 2068, 2069, 1, 0, 0, 0, 2069, 2071, 1, 0, 0, 0, 2070, 2068, 1, 0, 0, 0, 2071, 2072, 5, 0, 0, 1, 2072, 233, 1, 0, 0, 0, 2073, 2074, 5, 197, 0, 0, 2074, 2075, 3, 154, 77, 0, 2075, 2076, 5, 183, 0, 0, 2076, 2079, 1, 0, 0, 0, 2077, 2079, 5, 196, 0, 0, 2078, 2073, 1, 0, 0, 0, 2078, 2077, 1, 0, 0, 0, 2079, 235, 1, 0, 0, 0, 259, 239, 246, 254, 261, 265, 278, 282, 285, 290, 297, 301, 310, 315, 324, 332, 339, 343, 349, 354, 362, 369, 375, 387, 390, 398, 412, 416, 421, 424, 439, 445, 450, 456, 462, 467, 473, 479, 484, 486, 494, 498, 501, 506, 510, 514, 519, 523, 530, 533, 537, 540, 544, 547, 550, 553, 556, 559, 562, 566, 570, 573, 576, 580, 583, 586, 589, 593, 596, 600, 608, 614, 635, 659, 666, 671, 685, 694, 699, 713, 717, 721, 726, 730, 735, 749, 758, 766, 769, 775, 783, 786, 791, 798, 808, 816, 822, 824, 828, 833, 840, 843, 847, 851, 854, 860, 862, 865, 869, 873, 876, 878, 880, 885, 896, 901, 905, 911, 916, 923, 928, 932, 936, 939, 945, 949, 953, 958, 964, 966, 973, 981, 984, 987, 1012, 1026, 1042, 1046, 1057, 1061, 1072, 1076, 1083, 1091, 1094, 1099, 1104, 1110, 1116, 1122, 1131, 1135, 1142, 1148, 1155, 1159, 1171, 1176, 1185, 1189, 1222, 1270, 1298, 1362, 1370, 1376, 1379, 1382, 1390, 1400, 1406, 1409, 1412, 1420, 1428, 1431, 1435, 1438, 1443, 1452, 1464, 1472, 1480, 1484, 1502, 1506, 1511, 1522, 1528, 1535, 1547, 1551, 1554, 1563, 1569, 1585, 1606, 1617, 1621, 1651, 1658, 1660, 1662, 1671, 1675, 1684, 1688, 1692, 1697, 1705, 1709, 1714, 1721, 1734, 1743, 1753, 1760, 1767, 1780, 1787, 1791, 1795, 1800, 1804, 1807, 1817, 1825, 1834, 1837, 1844, 1860, 1870, 1878, 1888, 1891, 1893, 1895, 1902, 1915, 1919, 1936, 1944, 1952, 1960, 1967, 1976, 1980, 1990, 1992, 1995, 2005, 2010, 2023, 2028, 2034, 2046, 2052, 2062, 2068, 2078]
\ No newline at end of file
+[4, 1, 205, 2081, 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, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103, 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, 108, 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 2, 111, 7, 111, 2, 112, 7, 112, 2, 113, 7, 113, 2, 114, 7, 114, 2, 115, 7, 115, 2, 116, 7, 116, 2, 117, 7, 117, 1, 0, 5, 0, 238, 8, 0, 10, 0, 12, 0, 241, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 247, 8, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 255, 8, 3, 1, 4, 1, 4, 1, 4, 5, 4, 260, 8, 4, 10, 4, 12, 4, 263, 9, 4, 1, 4, 3, 4, 266, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 279, 8, 5, 1, 6, 1, 6, 3, 6, 283, 8, 6, 1, 6, 3, 6, 286, 8, 6, 1, 7, 1, 7, 1, 7, 3, 7, 291, 8, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 298, 8, 8, 1, 8, 1, 8, 3, 8, 302, 8, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 5, 9, 309, 8, 9, 10, 9, 12, 9, 312, 9, 9, 1, 9, 1, 9, 3, 9, 316, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 325, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 333, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 340, 8, 12, 1, 12, 1, 12, 3, 12, 344, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 350, 8, 12, 1, 12, 1, 12, 1, 12, 3, 12, 355, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 363, 8, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 370, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 376, 8, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 3, 16, 388, 8, 16, 1, 16, 3, 16, 391, 8, 16, 1, 17, 1, 17, 1, 18, 1, 18, 5, 18, 397, 8, 18, 10, 18, 12, 18, 400, 9, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 5, 20, 411, 8, 20, 10, 20, 12, 20, 414, 9, 20, 1, 20, 3, 20, 417, 8, 20, 1, 21, 1, 21, 1, 21, 3, 21, 422, 8, 21, 1, 21, 3, 21, 425, 8, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 440, 8, 22, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 446, 8, 23, 1, 23, 1, 23, 1, 23, 3, 23, 451, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 457, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 463, 8, 23, 1, 23, 1, 23, 1, 23, 3, 23, 468, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 474, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 480, 8, 23, 1, 23, 1, 23, 1, 23, 3, 23, 485, 8, 23, 3, 23, 487, 8, 23, 1, 23, 1, 23, 1, 24, 1, 24, 5, 24, 493, 8, 24, 10, 24, 12, 24, 496, 9, 24, 1, 24, 3, 24, 499, 8, 24, 1, 24, 3, 24, 502, 8, 24, 1, 25, 1, 25, 1, 25, 3, 25, 507, 8, 25, 1, 25, 1, 25, 3, 25, 511, 8, 25, 1, 25, 1, 25, 3, 25, 515, 8, 25, 1, 25, 1, 25, 1, 25, 3, 25, 520, 8, 25, 1, 25, 1, 25, 3, 25, 524, 8, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 3, 25, 531, 8, 25, 1, 26, 3, 26, 534, 8, 26, 1, 26, 1, 26, 3, 26, 538, 8, 26, 1, 26, 3, 26, 541, 8, 26, 1, 26, 1, 26, 3, 26, 545, 8, 26, 1, 26, 3, 26, 548, 8, 26, 1, 26, 3, 26, 551, 8, 26, 1, 26, 3, 26, 554, 8, 26, 1, 26, 3, 26, 557, 8, 26, 1, 26, 3, 26, 560, 8, 26, 1, 26, 3, 26, 563, 8, 26, 1, 26, 1, 26, 3, 26, 567, 8, 26, 1, 26, 1, 26, 3, 26, 571, 8, 26, 1, 26, 3, 26, 574, 8, 26, 1, 26, 3, 26, 577, 8, 26, 1, 26, 1, 26, 3, 26, 581, 8, 26, 1, 26, 3, 26, 584, 8, 26, 1, 26, 3, 26, 587, 8, 26, 1, 26, 3, 26, 590, 8, 26, 1, 26, 1, 26, 3, 26, 594, 8, 26, 1, 26, 3, 26, 597, 8, 26, 1, 27, 1, 27, 3, 27, 601, 8, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 3, 28, 609, 8, 28, 1, 29, 1, 29, 1, 29, 1, 30, 3, 30, 615, 8, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 5, 31, 634, 8, 31, 10, 31, 12, 31, 637, 9, 31, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 3, 34, 660, 8, 34, 1, 35, 1, 35, 1, 35, 5, 35, 665, 8, 35, 10, 35, 12, 35, 668, 9, 35, 1, 36, 1, 36, 3, 36, 672, 8, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 3, 39, 686, 8, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 5, 40, 693, 8, 40, 10, 40, 12, 40, 696, 9, 40, 1, 40, 1, 40, 3, 40, 700, 8, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 3, 43, 714, 8, 43, 1, 43, 1, 43, 3, 43, 718, 8, 43, 1, 43, 1, 43, 3, 43, 722, 8, 43, 1, 43, 1, 43, 1, 43, 3, 43, 727, 8, 43, 1, 43, 1, 43, 3, 43, 731, 8, 43, 1, 43, 1, 43, 1, 43, 3, 43, 736, 8, 43, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, 5, 46, 748, 8, 46, 10, 46, 12, 46, 751, 9, 46, 1, 47, 1, 47, 1, 47, 1, 47, 5, 47, 757, 8, 47, 10, 47, 12, 47, 760, 9, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 3, 48, 767, 8, 48, 1, 48, 3, 48, 770, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 776, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 784, 8, 48, 1, 48, 3, 48, 787, 8, 48, 1, 48, 1, 48, 1, 48, 3, 48, 792, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 799, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 809, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 817, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 5, 48, 823, 8, 48, 10, 48, 12, 48, 826, 9, 48, 1, 49, 3, 49, 829, 8, 49, 1, 49, 1, 49, 1, 49, 3, 49, 834, 8, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 841, 8, 49, 1, 49, 3, 49, 844, 8, 49, 1, 49, 1, 49, 3, 49, 848, 8, 49, 1, 49, 1, 49, 3, 49, 852, 8, 49, 1, 49, 3, 49, 855, 8, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 861, 8, 49, 3, 49, 863, 8, 49, 1, 49, 3, 49, 866, 8, 49, 1, 49, 1, 49, 3, 49, 870, 8, 49, 1, 49, 1, 49, 3, 49, 874, 8, 49, 1, 49, 3, 49, 877, 8, 49, 3, 49, 879, 8, 49, 3, 49, 881, 8, 49, 1, 50, 1, 50, 1, 50, 3, 50, 886, 8, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 3, 51, 897, 8, 51, 1, 52, 1, 52, 1, 52, 3, 52, 902, 8, 52, 1, 52, 1, 52, 3, 52, 906, 8, 52, 1, 52, 1, 52, 1, 52, 1, 52, 3, 52, 912, 8, 52, 1, 53, 1, 53, 1, 53, 3, 53, 917, 8, 53, 1, 54, 1, 54, 1, 54, 5, 54, 922, 8, 54, 10, 54, 12, 54, 925, 9, 54, 1, 55, 1, 55, 3, 55, 929, 8, 55, 1, 55, 1, 55, 3, 55, 933, 8, 55, 1, 55, 1, 55, 3, 55, 937, 8, 55, 1, 55, 3, 55, 940, 8, 55, 1, 56, 1, 56, 1, 56, 1, 56, 3, 56, 946, 8, 56, 1, 56, 1, 56, 3, 56, 950, 8, 56, 1, 56, 1, 56, 3, 56, 954, 8, 56, 1, 57, 1, 57, 1, 57, 3, 57, 959, 8, 57, 1, 58, 1, 58, 1, 58, 1, 58, 3, 58, 965, 8, 58, 3, 58, 967, 8, 58, 1, 59, 1, 59, 1, 59, 5, 59, 972, 8, 59, 10, 59, 12, 59, 975, 9, 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 61, 3, 61, 982, 8, 61, 1, 61, 3, 61, 985, 8, 61, 1, 61, 3, 61, 988, 8, 61, 1, 62, 1, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 65, 1, 65, 1, 65, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 3, 66, 1013, 8, 66, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 3, 67, 1027, 8, 67, 1, 68, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 5, 69, 1041, 8, 69, 10, 69, 12, 69, 1044, 9, 69, 1, 69, 3, 69, 1047, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 5, 69, 1056, 8, 69, 10, 69, 12, 69, 1059, 9, 69, 1, 69, 3, 69, 1062, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 5, 69, 1071, 8, 69, 10, 69, 12, 69, 1074, 9, 69, 1, 69, 3, 69, 1077, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 3, 69, 1084, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 4, 69, 1090, 8, 69, 11, 69, 12, 69, 1091, 1, 69, 3, 69, 1095, 8, 69, 1, 69, 1, 69, 1, 69, 3, 69, 1100, 8, 69, 1, 69, 5, 69, 1103, 8, 69, 10, 69, 12, 69, 1106, 9, 69, 1, 70, 1, 70, 1, 70, 3, 70, 1111, 8, 70, 1, 70, 1, 70, 1, 70, 1, 70, 3, 70, 1117, 8, 70, 1, 71, 1, 71, 1, 71, 1, 71, 3, 71, 1123, 8, 71, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 5, 73, 1130, 8, 73, 10, 73, 12, 73, 1133, 9, 73, 1, 73, 3, 73, 1136, 8, 73, 1, 74, 1, 74, 1, 74, 5, 74, 1141, 8, 74, 10, 74, 12, 74, 1144, 9, 74, 1, 74, 1, 74, 1, 74, 3, 74, 1149, 8, 74, 1, 75, 1, 75, 1, 75, 5, 75, 1154, 8, 75, 10, 75, 12, 75, 1157, 9, 75, 1, 75, 3, 75, 1160, 8, 75, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 3, 76, 1172, 8, 76, 1, 77, 1, 77, 1, 77, 3, 77, 1177, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 4, 77, 1184, 8, 77, 11, 77, 12, 77, 1185, 1, 77, 1, 77, 3, 77, 1190, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1223, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1271, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1299, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1363, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1371, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1377, 8, 77, 1, 77, 3, 77, 1380, 8, 77, 1, 77, 3, 77, 1383, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1391, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1401, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1407, 8, 77, 1, 77, 3, 77, 1410, 8, 77, 1, 77, 3, 77, 1413, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1421, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1429, 8, 77, 1, 77, 3, 77, 1432, 8, 77, 1, 77, 1, 77, 3, 77, 1436, 8, 77, 1, 77, 3, 77, 1439, 8, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1444, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1453, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1465, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1473, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 5, 77, 1479, 8, 77, 10, 77, 12, 77, 1482, 9, 77, 1, 77, 3, 77, 1485, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1503, 8, 77, 1, 77, 1, 77, 3, 77, 1507, 8, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1512, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1523, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1529, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1536, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1548, 8, 77, 1, 77, 1, 77, 3, 77, 1552, 8, 77, 1, 77, 3, 77, 1555, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1564, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1570, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1586, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1607, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1618, 8, 77, 1, 77, 1, 77, 3, 77, 1622, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1652, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1659, 8, 77, 5, 77, 1661, 8, 77, 10, 77, 12, 77, 1664, 9, 77, 1, 78, 1, 78, 1, 78, 1, 78, 5, 78, 1670, 8, 78, 10, 78, 12, 78, 1673, 9, 78, 1, 78, 3, 78, 1676, 8, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 5, 78, 1683, 8, 78, 10, 78, 12, 78, 1686, 9, 78, 1, 78, 3, 78, 1689, 8, 78, 1, 78, 1, 78, 3, 78, 1693, 8, 78, 1, 78, 1, 78, 1, 78, 3, 78, 1698, 8, 78, 1, 78, 1, 78, 1, 78, 1, 78, 5, 78, 1704, 8, 78, 10, 78, 12, 78, 1707, 9, 78, 1, 78, 3, 78, 1710, 8, 78, 1, 78, 1, 78, 1, 78, 3, 78, 1715, 8, 78, 1, 79, 1, 79, 1, 79, 5, 79, 1720, 8, 79, 10, 79, 12, 79, 1723, 9, 79, 1, 80, 1, 80, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 3, 81, 1735, 8, 81, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 5, 83, 1742, 8, 83, 10, 83, 12, 83, 1745, 9, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 5, 83, 1752, 8, 83, 10, 83, 12, 83, 1755, 9, 83, 1, 83, 1, 83, 5, 83, 1759, 8, 83, 10, 83, 12, 83, 1762, 9, 83, 1, 83, 1, 83, 1, 83, 1, 83, 3, 83, 1768, 8, 83, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 3, 84, 1781, 8, 84, 1, 85, 1, 85, 1, 85, 5, 85, 1786, 8, 85, 10, 85, 12, 85, 1789, 9, 85, 1, 85, 3, 85, 1792, 8, 85, 1, 86, 1, 86, 3, 86, 1796, 8, 86, 1, 86, 1, 86, 1, 86, 3, 86, 1801, 8, 86, 1, 86, 1, 86, 3, 86, 1805, 8, 86, 1, 86, 3, 86, 1808, 8, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 3, 86, 1818, 8, 86, 1, 87, 1, 87, 1, 87, 1, 87, 5, 87, 1824, 8, 87, 10, 87, 12, 87, 1827, 9, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, 1, 88, 3, 88, 1835, 8, 88, 1, 88, 3, 88, 1838, 8, 88, 1, 89, 1, 89, 1, 89, 5, 89, 1843, 8, 89, 10, 89, 12, 89, 1846, 9, 89, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1861, 8, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1871, 8, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1879, 8, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1889, 8, 90, 1, 90, 3, 90, 1892, 8, 90, 5, 90, 1894, 8, 90, 10, 90, 12, 90, 1897, 9, 90, 1, 91, 1, 91, 4, 91, 1901, 8, 91, 11, 91, 12, 91, 1902, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 93, 1, 93, 1, 93, 5, 93, 1914, 8, 93, 10, 93, 12, 93, 1917, 9, 93, 1, 93, 3, 93, 1920, 8, 93, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 5, 94, 1935, 8, 94, 10, 94, 12, 94, 1938, 9, 94, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 3, 95, 1945, 8, 95, 1, 96, 1, 96, 1, 96, 1, 96, 5, 96, 1951, 8, 96, 10, 96, 12, 96, 1954, 9, 96, 1, 96, 1, 96, 1, 97, 1, 97, 1, 97, 3, 97, 1961, 8, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 3, 98, 1968, 8, 98, 1, 98, 1, 98, 1, 99, 1, 99, 1, 99, 5, 99, 1975, 8, 99, 10, 99, 12, 99, 1978, 9, 99, 1, 99, 3, 99, 1981, 8, 99, 1, 100, 1, 100, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 3, 101, 1991, 8, 101, 3, 101, 1993, 8, 101, 1, 102, 3, 102, 1996, 8, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 3, 102, 2006, 8, 102, 1, 103, 1, 103, 1, 103, 3, 103, 2011, 8, 103, 1, 104, 1, 104, 1, 105, 1, 105, 1, 106, 1, 106, 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, 3, 108, 2024, 8, 108, 1, 109, 1, 109, 1, 109, 3, 109, 2029, 8, 109, 1, 110, 1, 110, 1, 110, 1, 110, 3, 110, 2035, 8, 110, 1, 111, 1, 111, 1, 111, 1, 111, 1, 112, 1, 112, 1, 112, 1, 112, 1, 113, 1, 113, 3, 113, 2047, 8, 113, 1, 114, 1, 114, 5, 114, 2051, 8, 114, 10, 114, 12, 114, 2054, 9, 114, 1, 114, 1, 114, 1, 115, 1, 115, 1, 115, 1, 115, 1, 115, 3, 115, 2063, 8, 115, 1, 116, 1, 116, 5, 116, 2067, 8, 116, 10, 116, 12, 116, 2070, 9, 116, 1, 116, 1, 116, 1, 117, 1, 117, 1, 117, 1, 117, 1, 117, 3, 117, 2079, 8, 117, 1, 117, 0, 4, 96, 138, 154, 180, 118, 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, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 0, 20, 2, 0, 36, 36, 41, 41, 2, 0, 19, 19, 94, 94, 2, 0, 53, 53, 63, 63, 3, 0, 1, 1, 4, 4, 8, 8, 2, 0, 3, 3, 100, 100, 4, 0, 1, 1, 3, 4, 8, 8, 100, 100, 2, 0, 63, 63, 93, 93, 2, 0, 76, 76, 151, 151, 2, 0, 7, 7, 23, 24, 2, 0, 35, 35, 61, 61, 2, 0, 89, 89, 96, 96, 3, 0, 21, 21, 56, 56, 108, 109, 3, 0, 10, 10, 62, 62, 115, 115, 2, 0, 48, 48, 65, 65, 1, 0, 138, 139, 2, 0, 153, 153, 175, 175, 7, 0, 22, 22, 45, 45, 68, 69, 88, 88, 98, 98, 125, 125, 132, 132, 20, 0, 1, 13, 15, 21, 23, 27, 29, 33, 35, 35, 37, 40, 42, 44, 46, 51, 53, 53, 55, 63, 65, 66, 70, 71, 73, 73, 75, 87, 89, 97, 99, 105, 107, 117, 119, 124, 126, 127, 129, 130, 4, 0, 21, 21, 35, 35, 46, 46, 59, 59, 8, 0, 7, 7, 15, 15, 21, 21, 24, 24, 31, 31, 46, 46, 92, 92, 113, 114, 2362, 0, 239, 1, 0, 0, 0, 2, 246, 1, 0, 0, 0, 4, 248, 1, 0, 0, 0, 6, 250, 1, 0, 0, 0, 8, 256, 1, 0, 0, 0, 10, 278, 1, 0, 0, 0, 12, 280, 1, 0, 0, 0, 14, 287, 1, 0, 0, 0, 16, 292, 1, 0, 0, 0, 18, 305, 1, 0, 0, 0, 20, 317, 1, 0, 0, 0, 22, 326, 1, 0, 0, 0, 24, 334, 1, 0, 0, 0, 26, 356, 1, 0, 0, 0, 28, 371, 1, 0, 0, 0, 30, 380, 1, 0, 0, 0, 32, 384, 1, 0, 0, 0, 34, 392, 1, 0, 0, 0, 36, 394, 1, 0, 0, 0, 38, 403, 1, 0, 0, 0, 40, 407, 1, 0, 0, 0, 42, 421, 1, 0, 0, 0, 44, 439, 1, 0, 0, 0, 46, 486, 1, 0, 0, 0, 48, 490, 1, 0, 0, 0, 50, 530, 1, 0, 0, 0, 52, 533, 1, 0, 0, 0, 54, 598, 1, 0, 0, 0, 56, 604, 1, 0, 0, 0, 58, 610, 1, 0, 0, 0, 60, 614, 1, 0, 0, 0, 62, 620, 1, 0, 0, 0, 64, 638, 1, 0, 0, 0, 66, 641, 1, 0, 0, 0, 68, 644, 1, 0, 0, 0, 70, 661, 1, 0, 0, 0, 72, 669, 1, 0, 0, 0, 74, 675, 1, 0, 0, 0, 76, 678, 1, 0, 0, 0, 78, 681, 1, 0, 0, 0, 80, 687, 1, 0, 0, 0, 82, 701, 1, 0, 0, 0, 84, 705, 1, 0, 0, 0, 86, 735, 1, 0, 0, 0, 88, 737, 1, 0, 0, 0, 90, 740, 1, 0, 0, 0, 92, 743, 1, 0, 0, 0, 94, 752, 1, 0, 0, 0, 96, 775, 1, 0, 0, 0, 98, 880, 1, 0, 0, 0, 100, 885, 1, 0, 0, 0, 102, 896, 1, 0, 0, 0, 104, 898, 1, 0, 0, 0, 106, 913, 1, 0, 0, 0, 108, 918, 1, 0, 0, 0, 110, 926, 1, 0, 0, 0, 112, 941, 1, 0, 0, 0, 114, 955, 1, 0, 0, 0, 116, 966, 1, 0, 0, 0, 118, 968, 1, 0, 0, 0, 120, 976, 1, 0, 0, 0, 122, 981, 1, 0, 0, 0, 124, 989, 1, 0, 0, 0, 126, 993, 1, 0, 0, 0, 128, 997, 1, 0, 0, 0, 130, 1003, 1, 0, 0, 0, 132, 1012, 1, 0, 0, 0, 134, 1026, 1, 0, 0, 0, 136, 1028, 1, 0, 0, 0, 138, 1094, 1, 0, 0, 0, 140, 1116, 1, 0, 0, 0, 142, 1122, 1, 0, 0, 0, 144, 1124, 1, 0, 0, 0, 146, 1126, 1, 0, 0, 0, 148, 1148, 1, 0, 0, 0, 150, 1150, 1, 0, 0, 0, 152, 1171, 1, 0, 0, 0, 154, 1522, 1, 0, 0, 0, 156, 1714, 1, 0, 0, 0, 158, 1716, 1, 0, 0, 0, 160, 1724, 1, 0, 0, 0, 162, 1734, 1, 0, 0, 0, 164, 1736, 1, 0, 0, 0, 166, 1767, 1, 0, 0, 0, 168, 1780, 1, 0, 0, 0, 170, 1782, 1, 0, 0, 0, 172, 1817, 1, 0, 0, 0, 174, 1819, 1, 0, 0, 0, 176, 1837, 1, 0, 0, 0, 178, 1839, 1, 0, 0, 0, 180, 1860, 1, 0, 0, 0, 182, 1898, 1, 0, 0, 0, 184, 1904, 1, 0, 0, 0, 186, 1910, 1, 0, 0, 0, 188, 1921, 1, 0, 0, 0, 190, 1944, 1, 0, 0, 0, 192, 1946, 1, 0, 0, 0, 194, 1957, 1, 0, 0, 0, 196, 1967, 1, 0, 0, 0, 198, 1971, 1, 0, 0, 0, 200, 1982, 1, 0, 0, 0, 202, 1992, 1, 0, 0, 0, 204, 1995, 1, 0, 0, 0, 206, 2010, 1, 0, 0, 0, 208, 2012, 1, 0, 0, 0, 210, 2014, 1, 0, 0, 0, 212, 2016, 1, 0, 0, 0, 214, 2018, 1, 0, 0, 0, 216, 2023, 1, 0, 0, 0, 218, 2028, 1, 0, 0, 0, 220, 2034, 1, 0, 0, 0, 222, 2036, 1, 0, 0, 0, 224, 2040, 1, 0, 0, 0, 226, 2046, 1, 0, 0, 0, 228, 2048, 1, 0, 0, 0, 230, 2062, 1, 0, 0, 0, 232, 2064, 1, 0, 0, 0, 234, 2078, 1, 0, 0, 0, 236, 238, 3, 2, 1, 0, 237, 236, 1, 0, 0, 0, 238, 241, 1, 0, 0, 0, 239, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 242, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 242, 243, 5, 0, 0, 1, 243, 1, 1, 0, 0, 0, 244, 247, 3, 6, 3, 0, 245, 247, 3, 10, 5, 0, 246, 244, 1, 0, 0, 0, 246, 245, 1, 0, 0, 0, 247, 3, 1, 0, 0, 0, 248, 249, 3, 154, 77, 0, 249, 5, 1, 0, 0, 0, 250, 251, 5, 64, 0, 0, 251, 254, 3, 220, 110, 0, 252, 253, 5, 149, 0, 0, 253, 255, 3, 4, 2, 0, 254, 252, 1, 0, 0, 0, 254, 255, 1, 0, 0, 0, 255, 7, 1, 0, 0, 0, 256, 261, 3, 178, 89, 0, 257, 258, 5, 151, 0, 0, 258, 260, 3, 178, 89, 0, 259, 257, 1, 0, 0, 0, 260, 263, 1, 0, 0, 0, 261, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 265, 1, 0, 0, 0, 263, 261, 1, 0, 0, 0, 264, 266, 5, 151, 0, 0, 265, 264, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, 9, 1, 0, 0, 0, 267, 279, 3, 12, 6, 0, 268, 279, 3, 14, 7, 0, 269, 279, 3, 18, 9, 0, 270, 279, 3, 20, 10, 0, 271, 279, 3, 22, 11, 0, 272, 279, 3, 26, 13, 0, 273, 279, 3, 24, 12, 0, 274, 279, 3, 28, 14, 0, 275, 279, 3, 36, 18, 0, 276, 279, 3, 32, 16, 0, 277, 279, 3, 34, 17, 0, 278, 267, 1, 0, 0, 0, 278, 268, 1, 0, 0, 0, 278, 269, 1, 0, 0, 0, 278, 270, 1, 0, 0, 0, 278, 271, 1, 0, 0, 0, 278, 272, 1, 0, 0, 0, 278, 273, 1, 0, 0, 0, 278, 274, 1, 0, 0, 0, 278, 275, 1, 0, 0, 0, 278, 276, 1, 0, 0, 0, 278, 277, 1, 0, 0, 0, 279, 11, 1, 0, 0, 0, 280, 282, 5, 92, 0, 0, 281, 283, 3, 4, 2, 0, 282, 281, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 285, 1, 0, 0, 0, 284, 286, 5, 186, 0, 0, 285, 284, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 13, 1, 0, 0, 0, 287, 288, 5, 106, 0, 0, 288, 290, 3, 4, 2, 0, 289, 291, 5, 186, 0, 0, 290, 289, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 15, 1, 0, 0, 0, 292, 301, 5, 14, 0, 0, 293, 294, 5, 165, 0, 0, 294, 297, 3, 220, 110, 0, 295, 296, 5, 150, 0, 0, 296, 298, 3, 220, 110, 0, 297, 295, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 300, 5, 185, 0, 0, 300, 302, 1, 0, 0, 0, 301, 293, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, 304, 3, 36, 18, 0, 304, 17, 1, 0, 0, 0, 305, 306, 5, 118, 0, 0, 306, 310, 3, 36, 18, 0, 307, 309, 3, 16, 8, 0, 308, 307, 1, 0, 0, 0, 309, 312, 1, 0, 0, 0, 310, 308, 1, 0, 0, 0, 310, 311, 1, 0, 0, 0, 311, 315, 1, 0, 0, 0, 312, 310, 1, 0, 0, 0, 313, 314, 5, 34, 0, 0, 314, 316, 3, 36, 18, 0, 315, 313, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, 19, 1, 0, 0, 0, 317, 318, 5, 47, 0, 0, 318, 319, 5, 165, 0, 0, 319, 320, 3, 4, 2, 0, 320, 321, 5, 185, 0, 0, 321, 324, 3, 10, 5, 0, 322, 323, 5, 26, 0, 0, 323, 325, 3, 10, 5, 0, 324, 322, 1, 0, 0, 0, 324, 325, 1, 0, 0, 0, 325, 21, 1, 0, 0, 0, 326, 327, 5, 128, 0, 0, 327, 328, 5, 165, 0, 0, 328, 329, 3, 4, 2, 0, 329, 330, 5, 185, 0, 0, 330, 332, 3, 10, 5, 0, 331, 333, 5, 186, 0, 0, 332, 331, 1, 0, 0, 0, 332, 333, 1, 0, 0, 0, 333, 23, 1, 0, 0, 0, 334, 335, 5, 38, 0, 0, 335, 339, 5, 165, 0, 0, 336, 340, 3, 6, 3, 0, 337, 340, 3, 30, 15, 0, 338, 340, 3, 4, 2, 0, 339, 336, 1, 0, 0, 0, 339, 337, 1, 0, 0, 0, 339, 338, 1, 0, 0, 0, 339, 340, 1, 0, 0, 0, 340, 341, 1, 0, 0, 0, 341, 343, 5, 186, 0, 0, 342, 344, 3, 4, 2, 0, 343, 342, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 349, 5, 186, 0, 0, 346, 350, 3, 6, 3, 0, 347, 350, 3, 30, 15, 0, 348, 350, 3, 4, 2, 0, 349, 346, 1, 0, 0, 0, 349, 347, 1, 0, 0, 0, 349, 348, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 352, 5, 185, 0, 0, 352, 354, 3, 10, 5, 0, 353, 355, 5, 186, 0, 0, 354, 353, 1, 0, 0, 0, 354, 355, 1, 0, 0, 0, 355, 25, 1, 0, 0, 0, 356, 357, 5, 38, 0, 0, 357, 358, 5, 165, 0, 0, 358, 359, 5, 64, 0, 0, 359, 362, 3, 220, 110, 0, 360, 361, 5, 151, 0, 0, 361, 363, 3, 220, 110, 0, 362, 360, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, 365, 5, 51, 0, 0, 365, 366, 3, 4, 2, 0, 366, 367, 5, 185, 0, 0, 367, 369, 3, 10, 5, 0, 368, 370, 5, 186, 0, 0, 369, 368, 1, 0, 0, 0, 369, 370, 1, 0, 0, 0, 370, 27, 1, 0, 0, 0, 371, 372, 7, 0, 0, 0, 372, 373, 3, 220, 110, 0, 373, 375, 5, 165, 0, 0, 374, 376, 3, 8, 4, 0, 375, 374, 1, 0, 0, 0, 375, 376, 1, 0, 0, 0, 376, 377, 1, 0, 0, 0, 377, 378, 5, 185, 0, 0, 378, 379, 3, 36, 18, 0, 379, 29, 1, 0, 0, 0, 380, 381, 3, 4, 2, 0, 381, 382, 5, 149, 0, 0, 382, 383, 3, 4, 2, 0, 383, 31, 1, 0, 0, 0, 384, 387, 3, 4, 2, 0, 385, 386, 5, 149, 0, 0, 386, 388, 3, 4, 2, 0, 387, 385, 1, 0, 0, 0, 387, 388, 1, 0, 0, 0, 388, 390, 1, 0, 0, 0, 389, 391, 5, 186, 0, 0, 390, 389, 1, 0, 0, 0, 390, 391, 1, 0, 0, 0, 391, 33, 1, 0, 0, 0, 392, 393, 5, 186, 0, 0, 393, 35, 1, 0, 0, 0, 394, 398, 5, 163, 0, 0, 395, 397, 3, 2, 1, 0, 396, 395, 1, 0, 0, 0, 397, 400, 1, 0, 0, 0, 398, 396, 1, 0, 0, 0, 398, 399, 1, 0, 0, 0, 399, 401, 1, 0, 0, 0, 400, 398, 1, 0, 0, 0, 401, 402, 5, 183, 0, 0, 402, 37, 1, 0, 0, 0, 403, 404, 3, 4, 2, 0, 404, 405, 5, 150, 0, 0, 405, 406, 3, 4, 2, 0, 406, 39, 1, 0, 0, 0, 407, 412, 3, 38, 19, 0, 408, 409, 5, 151, 0, 0, 409, 411, 3, 38, 19, 0, 410, 408, 1, 0, 0, 0, 411, 414, 1, 0, 0, 0, 412, 410, 1, 0, 0, 0, 412, 413, 1, 0, 0, 0, 413, 416, 1, 0, 0, 0, 414, 412, 1, 0, 0, 0, 415, 417, 5, 151, 0, 0, 416, 415, 1, 0, 0, 0, 416, 417, 1, 0, 0, 0, 417, 41, 1, 0, 0, 0, 418, 422, 3, 48, 24, 0, 419, 422, 3, 52, 26, 0, 420, 422, 3, 166, 83, 0, 421, 418, 1, 0, 0, 0, 421, 419, 1, 0, 0, 0, 421, 420, 1, 0, 0, 0, 422, 424, 1, 0, 0, 0, 423, 425, 5, 186, 0, 0, 424, 423, 1, 0, 0, 0, 424, 425, 1, 0, 0, 0, 425, 426, 1, 0, 0, 0, 426, 427, 5, 0, 0, 1, 427, 43, 1, 0, 0, 0, 428, 440, 3, 52, 26, 0, 429, 430, 3, 54, 27, 0, 430, 431, 5, 165, 0, 0, 431, 432, 3, 48, 24, 0, 432, 433, 5, 185, 0, 0, 433, 440, 1, 0, 0, 0, 434, 435, 5, 165, 0, 0, 435, 436, 3, 48, 24, 0, 436, 437, 5, 185, 0, 0, 437, 440, 1, 0, 0, 0, 438, 440, 3, 224, 112, 0, 439, 428, 1, 0, 0, 0, 439, 429, 1, 0, 0, 0, 439, 434, 1, 0, 0, 0, 439, 438, 1, 0, 0, 0, 440, 45, 1, 0, 0, 0, 441, 442, 5, 28, 0, 0, 442, 445, 5, 1, 0, 0, 443, 444, 5, 11, 0, 0, 444, 446, 5, 70, 0, 0, 445, 443, 1, 0, 0, 0, 445, 446, 1, 0, 0, 0, 446, 487, 1, 0, 0, 0, 447, 450, 5, 28, 0, 0, 448, 449, 5, 11, 0, 0, 449, 451, 5, 70, 0, 0, 450, 448, 1, 0, 0, 0, 450, 451, 1, 0, 0, 0, 451, 487, 1, 0, 0, 0, 452, 453, 5, 121, 0, 0, 453, 456, 5, 1, 0, 0, 454, 455, 5, 11, 0, 0, 455, 457, 5, 70, 0, 0, 456, 454, 1, 0, 0, 0, 456, 457, 1, 0, 0, 0, 457, 487, 1, 0, 0, 0, 458, 459, 5, 121, 0, 0, 459, 462, 5, 25, 0, 0, 460, 461, 5, 11, 0, 0, 461, 463, 5, 70, 0, 0, 462, 460, 1, 0, 0, 0, 462, 463, 1, 0, 0, 0, 463, 487, 1, 0, 0, 0, 464, 467, 5, 121, 0, 0, 465, 466, 5, 11, 0, 0, 466, 468, 5, 70, 0, 0, 467, 465, 1, 0, 0, 0, 467, 468, 1, 0, 0, 0, 468, 487, 1, 0, 0, 0, 469, 470, 5, 54, 0, 0, 470, 473, 5, 1, 0, 0, 471, 472, 5, 11, 0, 0, 472, 474, 5, 70, 0, 0, 473, 471, 1, 0, 0, 0, 473, 474, 1, 0, 0, 0, 474, 487, 1, 0, 0, 0, 475, 476, 5, 54, 0, 0, 476, 479, 5, 25, 0, 0, 477, 478, 5, 11, 0, 0, 478, 480, 5, 70, 0, 0, 479, 477, 1, 0, 0, 0, 479, 480, 1, 0, 0, 0, 480, 487, 1, 0, 0, 0, 481, 484, 5, 54, 0, 0, 482, 483, 5, 11, 0, 0, 483, 485, 5, 70, 0, 0, 484, 482, 1, 0, 0, 0, 484, 485, 1, 0, 0, 0, 485, 487, 1, 0, 0, 0, 486, 441, 1, 0, 0, 0, 486, 447, 1, 0, 0, 0, 486, 452, 1, 0, 0, 0, 486, 458, 1, 0, 0, 0, 486, 464, 1, 0, 0, 0, 486, 469, 1, 0, 0, 0, 486, 475, 1, 0, 0, 0, 486, 481, 1, 0, 0, 0, 487, 488, 1, 0, 0, 0, 488, 489, 3, 44, 22, 0, 489, 47, 1, 0, 0, 0, 490, 494, 3, 44, 22, 0, 491, 493, 3, 46, 23, 0, 492, 491, 1, 0, 0, 0, 493, 496, 1, 0, 0, 0, 494, 492, 1, 0, 0, 0, 494, 495, 1, 0, 0, 0, 495, 498, 1, 0, 0, 0, 496, 494, 1, 0, 0, 0, 497, 499, 3, 78, 39, 0, 498, 497, 1, 0, 0, 0, 498, 499, 1, 0, 0, 0, 499, 501, 1, 0, 0, 0, 500, 502, 3, 50, 25, 0, 501, 500, 1, 0, 0, 0, 501, 502, 1, 0, 0, 0, 502, 49, 1, 0, 0, 0, 503, 504, 5, 66, 0, 0, 504, 506, 3, 154, 77, 0, 505, 507, 5, 174, 0, 0, 506, 505, 1, 0, 0, 0, 506, 507, 1, 0, 0, 0, 507, 510, 1, 0, 0, 0, 508, 509, 5, 151, 0, 0, 509, 511, 3, 154, 77, 0, 510, 508, 1, 0, 0, 0, 510, 511, 1, 0, 0, 0, 511, 514, 1, 0, 0, 0, 512, 513, 5, 130, 0, 0, 513, 515, 5, 107, 0, 0, 514, 512, 1, 0, 0, 0, 514, 515, 1, 0, 0, 0, 515, 531, 1, 0, 0, 0, 516, 517, 5, 66, 0, 0, 517, 519, 3, 154, 77, 0, 518, 520, 5, 174, 0, 0, 519, 518, 1, 0, 0, 0, 519, 520, 1, 0, 0, 0, 520, 523, 1, 0, 0, 0, 521, 522, 5, 130, 0, 0, 522, 524, 5, 107, 0, 0, 523, 521, 1, 0, 0, 0, 523, 524, 1, 0, 0, 0, 524, 525, 1, 0, 0, 0, 525, 526, 5, 76, 0, 0, 526, 527, 3, 154, 77, 0, 527, 531, 1, 0, 0, 0, 528, 529, 5, 76, 0, 0, 529, 531, 3, 154, 77, 0, 530, 503, 1, 0, 0, 0, 530, 516, 1, 0, 0, 0, 530, 528, 1, 0, 0, 0, 531, 51, 1, 0, 0, 0, 532, 534, 3, 54, 27, 0, 533, 532, 1, 0, 0, 0, 533, 534, 1, 0, 0, 0, 534, 535, 1, 0, 0, 0, 535, 537, 5, 99, 0, 0, 536, 538, 5, 25, 0, 0, 537, 536, 1, 0, 0, 0, 537, 538, 1, 0, 0, 0, 538, 540, 1, 0, 0, 0, 539, 541, 3, 56, 28, 0, 540, 539, 1, 0, 0, 0, 540, 541, 1, 0, 0, 0, 541, 542, 1, 0, 0, 0, 542, 544, 3, 148, 74, 0, 543, 545, 3, 58, 29, 0, 544, 543, 1, 0, 0, 0, 544, 545, 1, 0, 0, 0, 545, 547, 1, 0, 0, 0, 546, 548, 3, 60, 30, 0, 547, 546, 1, 0, 0, 0, 547, 548, 1, 0, 0, 0, 548, 550, 1, 0, 0, 0, 549, 551, 3, 64, 32, 0, 550, 549, 1, 0, 0, 0, 550, 551, 1, 0, 0, 0, 551, 553, 1, 0, 0, 0, 552, 554, 3, 66, 33, 0, 553, 552, 1, 0, 0, 0, 553, 554, 1, 0, 0, 0, 554, 559, 1, 0, 0, 0, 555, 557, 5, 123, 0, 0, 556, 555, 1, 0, 0, 0, 556, 557, 1, 0, 0, 0, 557, 558, 1, 0, 0, 0, 558, 560, 3, 104, 52, 0, 559, 556, 1, 0, 0, 0, 559, 560, 1, 0, 0, 0, 560, 562, 1, 0, 0, 0, 561, 563, 3, 68, 34, 0, 562, 561, 1, 0, 0, 0, 562, 563, 1, 0, 0, 0, 563, 566, 1, 0, 0, 0, 564, 565, 5, 130, 0, 0, 565, 567, 7, 1, 0, 0, 566, 564, 1, 0, 0, 0, 566, 567, 1, 0, 0, 0, 567, 570, 1, 0, 0, 0, 568, 569, 5, 130, 0, 0, 569, 571, 5, 114, 0, 0, 570, 568, 1, 0, 0, 0, 570, 571, 1, 0, 0, 0, 571, 573, 1, 0, 0, 0, 572, 574, 3, 74, 37, 0, 573, 572, 1, 0, 0, 0, 573, 574, 1, 0, 0, 0, 574, 576, 1, 0, 0, 0, 575, 577, 3, 76, 38, 0, 576, 575, 1, 0, 0, 0, 576, 577, 1, 0, 0, 0, 577, 580, 1, 0, 0, 0, 578, 579, 5, 123, 0, 0, 579, 581, 3, 104, 52, 0, 580, 578, 1, 0, 0, 0, 580, 581, 1, 0, 0, 0, 581, 583, 1, 0, 0, 0, 582, 584, 3, 62, 31, 0, 583, 582, 1, 0, 0, 0, 583, 584, 1, 0, 0, 0, 584, 586, 1, 0, 0, 0, 585, 587, 3, 78, 39, 0, 586, 585, 1, 0, 0, 0, 586, 587, 1, 0, 0, 0, 587, 589, 1, 0, 0, 0, 588, 590, 3, 84, 42, 0, 589, 588, 1, 0, 0, 0, 589, 590, 1, 0, 0, 0, 590, 593, 1, 0, 0, 0, 591, 594, 3, 86, 43, 0, 592, 594, 3, 88, 44, 0, 593, 591, 1, 0, 0, 0, 593, 592, 1, 0, 0, 0, 593, 594, 1, 0, 0, 0, 594, 596, 1, 0, 0, 0, 595, 597, 3, 90, 45, 0, 596, 595, 1, 0, 0, 0, 596, 597, 1, 0, 0, 0, 597, 53, 1, 0, 0, 0, 598, 600, 5, 130, 0, 0, 599, 601, 5, 90, 0, 0, 600, 599, 1, 0, 0, 0, 600, 601, 1, 0, 0, 0, 601, 602, 1, 0, 0, 0, 602, 603, 3, 170, 85, 0, 603, 55, 1, 0, 0, 0, 604, 605, 5, 113, 0, 0, 605, 608, 5, 139, 0, 0, 606, 607, 5, 130, 0, 0, 607, 609, 5, 107, 0, 0, 608, 606, 1, 0, 0, 0, 608, 609, 1, 0, 0, 0, 609, 57, 1, 0, 0, 0, 610, 611, 5, 39, 0, 0, 611, 612, 3, 96, 48, 0, 612, 59, 1, 0, 0, 0, 613, 615, 7, 2, 0, 0, 614, 613, 1, 0, 0, 0, 614, 615, 1, 0, 0, 0, 615, 616, 1, 0, 0, 0, 616, 617, 5, 5, 0, 0, 617, 618, 5, 58, 0, 0, 618, 619, 3, 146, 73, 0, 619, 61, 1, 0, 0, 0, 620, 621, 5, 129, 0, 0, 621, 622, 3, 220, 110, 0, 622, 623, 5, 6, 0, 0, 623, 624, 5, 165, 0, 0, 624, 625, 3, 122, 61, 0, 625, 635, 5, 185, 0, 0, 626, 627, 5, 151, 0, 0, 627, 628, 3, 220, 110, 0, 628, 629, 5, 6, 0, 0, 629, 630, 5, 165, 0, 0, 630, 631, 3, 122, 61, 0, 631, 632, 5, 185, 0, 0, 632, 634, 1, 0, 0, 0, 633, 626, 1, 0, 0, 0, 634, 637, 1, 0, 0, 0, 635, 633, 1, 0, 0, 0, 635, 636, 1, 0, 0, 0, 636, 63, 1, 0, 0, 0, 637, 635, 1, 0, 0, 0, 638, 639, 5, 86, 0, 0, 639, 640, 3, 154, 77, 0, 640, 65, 1, 0, 0, 0, 641, 642, 5, 127, 0, 0, 642, 643, 3, 154, 77, 0, 643, 67, 1, 0, 0, 0, 644, 645, 5, 42, 0, 0, 645, 659, 5, 11, 0, 0, 646, 660, 5, 1, 0, 0, 647, 648, 7, 1, 0, 0, 648, 649, 5, 165, 0, 0, 649, 650, 3, 146, 73, 0, 650, 651, 5, 185, 0, 0, 651, 660, 1, 0, 0, 0, 652, 653, 5, 43, 0, 0, 653, 654, 5, 101, 0, 0, 654, 655, 5, 165, 0, 0, 655, 656, 3, 70, 35, 0, 656, 657, 5, 185, 0, 0, 657, 660, 1, 0, 0, 0, 658, 660, 3, 146, 73, 0, 659, 646, 1, 0, 0, 0, 659, 647, 1, 0, 0, 0, 659, 652, 1, 0, 0, 0, 659, 658, 1, 0, 0, 0, 660, 69, 1, 0, 0, 0, 661, 666, 3, 72, 36, 0, 662, 663, 5, 151, 0, 0, 663, 665, 3, 72, 36, 0, 664, 662, 1, 0, 0, 0, 665, 668, 1, 0, 0, 0, 666, 664, 1, 0, 0, 0, 666, 667, 1, 0, 0, 0, 667, 71, 1, 0, 0, 0, 668, 666, 1, 0, 0, 0, 669, 671, 5, 165, 0, 0, 670, 672, 3, 146, 73, 0, 671, 670, 1, 0, 0, 0, 671, 672, 1, 0, 0, 0, 672, 673, 1, 0, 0, 0, 673, 674, 5, 185, 0, 0, 674, 73, 1, 0, 0, 0, 675, 676, 5, 44, 0, 0, 676, 677, 3, 154, 77, 0, 677, 75, 1, 0, 0, 0, 678, 679, 5, 87, 0, 0, 679, 680, 3, 154, 77, 0, 680, 77, 1, 0, 0, 0, 681, 682, 5, 79, 0, 0, 682, 683, 5, 11, 0, 0, 683, 685, 3, 108, 54, 0, 684, 686, 3, 80, 40, 0, 685, 684, 1, 0, 0, 0, 685, 686, 1, 0, 0, 0, 686, 79, 1, 0, 0, 0, 687, 699, 5, 55, 0, 0, 688, 689, 5, 165, 0, 0, 689, 694, 3, 114, 57, 0, 690, 691, 5, 151, 0, 0, 691, 693, 3, 114, 57, 0, 692, 690, 1, 0, 0, 0, 693, 696, 1, 0, 0, 0, 694, 692, 1, 0, 0, 0, 694, 695, 1, 0, 0, 0, 695, 697, 1, 0, 0, 0, 696, 694, 1, 0, 0, 0, 697, 698, 5, 185, 0, 0, 698, 700, 1, 0, 0, 0, 699, 688, 1, 0, 0, 0, 699, 700, 1, 0, 0, 0, 700, 81, 1, 0, 0, 0, 701, 702, 5, 79, 0, 0, 702, 703, 5, 11, 0, 0, 703, 704, 3, 146, 73, 0, 704, 83, 1, 0, 0, 0, 705, 706, 5, 66, 0, 0, 706, 707, 3, 106, 53, 0, 707, 708, 5, 11, 0, 0, 708, 709, 3, 146, 73, 0, 709, 85, 1, 0, 0, 0, 710, 711, 5, 66, 0, 0, 711, 713, 3, 154, 77, 0, 712, 714, 5, 174, 0, 0, 713, 712, 1, 0, 0, 0, 713, 714, 1, 0, 0, 0, 714, 717, 1, 0, 0, 0, 715, 716, 5, 151, 0, 0, 716, 718, 3, 154, 77, 0, 717, 715, 1, 0, 0, 0, 717, 718, 1, 0, 0, 0, 718, 721, 1, 0, 0, 0, 719, 720, 5, 130, 0, 0, 720, 722, 5, 107, 0, 0, 721, 719, 1, 0, 0, 0, 721, 722, 1, 0, 0, 0, 722, 736, 1, 0, 0, 0, 723, 724, 5, 66, 0, 0, 724, 726, 3, 154, 77, 0, 725, 727, 5, 174, 0, 0, 726, 725, 1, 0, 0, 0, 726, 727, 1, 0, 0, 0, 727, 730, 1, 0, 0, 0, 728, 729, 5, 130, 0, 0, 729, 731, 5, 107, 0, 0, 730, 728, 1, 0, 0, 0, 730, 731, 1, 0, 0, 0, 731, 732, 1, 0, 0, 0, 732, 733, 5, 76, 0, 0, 733, 734, 3, 154, 77, 0, 734, 736, 1, 0, 0, 0, 735, 710, 1, 0, 0, 0, 735, 723, 1, 0, 0, 0, 736, 87, 1, 0, 0, 0, 737, 738, 5, 76, 0, 0, 738, 739, 3, 154, 77, 0, 739, 89, 1, 0, 0, 0, 740, 741, 5, 102, 0, 0, 741, 742, 3, 118, 59, 0, 742, 91, 1, 0, 0, 0, 743, 744, 5, 124, 0, 0, 744, 749, 3, 94, 47, 0, 745, 746, 5, 151, 0, 0, 746, 748, 3, 94, 47, 0, 747, 745, 1, 0, 0, 0, 748, 751, 1, 0, 0, 0, 749, 747, 1, 0, 0, 0, 749, 750, 1, 0, 0, 0, 750, 93, 1, 0, 0, 0, 751, 749, 1, 0, 0, 0, 752, 753, 5, 165, 0, 0, 753, 758, 3, 154, 77, 0, 754, 755, 5, 151, 0, 0, 755, 757, 3, 154, 77, 0, 756, 754, 1, 0, 0, 0, 757, 760, 1, 0, 0, 0, 758, 756, 1, 0, 0, 0, 758, 759, 1, 0, 0, 0, 759, 761, 1, 0, 0, 0, 760, 758, 1, 0, 0, 0, 761, 762, 5, 185, 0, 0, 762, 95, 1, 0, 0, 0, 763, 764, 6, 48, -1, 0, 764, 766, 3, 180, 90, 0, 765, 767, 5, 31, 0, 0, 766, 765, 1, 0, 0, 0, 766, 767, 1, 0, 0, 0, 767, 769, 1, 0, 0, 0, 768, 770, 3, 104, 52, 0, 769, 768, 1, 0, 0, 0, 769, 770, 1, 0, 0, 0, 770, 776, 1, 0, 0, 0, 771, 772, 5, 165, 0, 0, 772, 773, 3, 96, 48, 0, 773, 774, 5, 185, 0, 0, 774, 776, 1, 0, 0, 0, 775, 763, 1, 0, 0, 0, 775, 771, 1, 0, 0, 0, 776, 824, 1, 0, 0, 0, 777, 778, 10, 5, 0, 0, 778, 779, 3, 100, 50, 0, 779, 780, 3, 96, 48, 6, 780, 823, 1, 0, 0, 0, 781, 783, 10, 7, 0, 0, 782, 784, 5, 71, 0, 0, 783, 782, 1, 0, 0, 0, 783, 784, 1, 0, 0, 0, 784, 786, 1, 0, 0, 0, 785, 787, 3, 98, 49, 0, 786, 785, 1, 0, 0, 0, 786, 787, 1, 0, 0, 0, 787, 788, 1, 0, 0, 0, 788, 789, 5, 58, 0, 0, 789, 791, 3, 96, 48, 0, 790, 792, 3, 102, 51, 0, 791, 790, 1, 0, 0, 0, 791, 792, 1, 0, 0, 0, 792, 823, 1, 0, 0, 0, 793, 794, 10, 6, 0, 0, 794, 795, 5, 84, 0, 0, 795, 796, 5, 58, 0, 0, 796, 798, 3, 96, 48, 0, 797, 799, 3, 102, 51, 0, 798, 797, 1, 0, 0, 0, 798, 799, 1, 0, 0, 0, 799, 823, 1, 0, 0, 0, 800, 801, 10, 4, 0, 0, 801, 802, 5, 83, 0, 0, 802, 803, 5, 165, 0, 0, 803, 804, 3, 146, 73, 0, 804, 808, 3, 182, 91, 0, 805, 806, 5, 42, 0, 0, 806, 807, 5, 11, 0, 0, 807, 809, 3, 146, 73, 0, 808, 805, 1, 0, 0, 0, 808, 809, 1, 0, 0, 0, 809, 810, 1, 0, 0, 0, 810, 811, 5, 185, 0, 0, 811, 823, 1, 0, 0, 0, 812, 813, 10, 3, 0, 0, 813, 816, 5, 122, 0, 0, 814, 815, 5, 50, 0, 0, 815, 817, 5, 75, 0, 0, 816, 814, 1, 0, 0, 0, 816, 817, 1, 0, 0, 0, 817, 818, 1, 0, 0, 0, 818, 819, 5, 165, 0, 0, 819, 820, 3, 186, 93, 0, 820, 821, 5, 185, 0, 0, 821, 823, 1, 0, 0, 0, 822, 777, 1, 0, 0, 0, 822, 781, 1, 0, 0, 0, 822, 793, 1, 0, 0, 0, 822, 800, 1, 0, 0, 0, 822, 812, 1, 0, 0, 0, 823, 826, 1, 0, 0, 0, 824, 822, 1, 0, 0, 0, 824, 825, 1, 0, 0, 0, 825, 97, 1, 0, 0, 0, 826, 824, 1, 0, 0, 0, 827, 829, 7, 3, 0, 0, 828, 827, 1, 0, 0, 0, 828, 829, 1, 0, 0, 0, 829, 830, 1, 0, 0, 0, 830, 841, 5, 53, 0, 0, 831, 833, 5, 53, 0, 0, 832, 834, 7, 3, 0, 0, 833, 832, 1, 0, 0, 0, 833, 834, 1, 0, 0, 0, 834, 841, 1, 0, 0, 0, 835, 841, 7, 3, 0, 0, 836, 841, 5, 3, 0, 0, 837, 841, 5, 100, 0, 0, 838, 839, 5, 8, 0, 0, 839, 841, 7, 4, 0, 0, 840, 828, 1, 0, 0, 0, 840, 831, 1, 0, 0, 0, 840, 835, 1, 0, 0, 0, 840, 836, 1, 0, 0, 0, 840, 837, 1, 0, 0, 0, 840, 838, 1, 0, 0, 0, 841, 881, 1, 0, 0, 0, 842, 844, 7, 5, 0, 0, 843, 842, 1, 0, 0, 0, 843, 844, 1, 0, 0, 0, 844, 845, 1, 0, 0, 0, 845, 847, 7, 6, 0, 0, 846, 848, 5, 80, 0, 0, 847, 846, 1, 0, 0, 0, 847, 848, 1, 0, 0, 0, 848, 863, 1, 0, 0, 0, 849, 851, 7, 6, 0, 0, 850, 852, 5, 80, 0, 0, 851, 850, 1, 0, 0, 0, 851, 852, 1, 0, 0, 0, 852, 854, 1, 0, 0, 0, 853, 855, 7, 5, 0, 0, 854, 853, 1, 0, 0, 0, 854, 855, 1, 0, 0, 0, 855, 863, 1, 0, 0, 0, 856, 857, 5, 8, 0, 0, 857, 858, 7, 4, 0, 0, 858, 860, 7, 6, 0, 0, 859, 861, 5, 80, 0, 0, 860, 859, 1, 0, 0, 0, 860, 861, 1, 0, 0, 0, 861, 863, 1, 0, 0, 0, 862, 843, 1, 0, 0, 0, 862, 849, 1, 0, 0, 0, 862, 856, 1, 0, 0, 0, 863, 881, 1, 0, 0, 0, 864, 866, 7, 3, 0, 0, 865, 864, 1, 0, 0, 0, 865, 866, 1, 0, 0, 0, 866, 867, 1, 0, 0, 0, 867, 869, 5, 40, 0, 0, 868, 870, 5, 80, 0, 0, 869, 868, 1, 0, 0, 0, 869, 870, 1, 0, 0, 0, 870, 879, 1, 0, 0, 0, 871, 873, 5, 40, 0, 0, 872, 874, 5, 80, 0, 0, 873, 872, 1, 0, 0, 0, 873, 874, 1, 0, 0, 0, 874, 876, 1, 0, 0, 0, 875, 877, 7, 3, 0, 0, 876, 875, 1, 0, 0, 0, 876, 877, 1, 0, 0, 0, 877, 879, 1, 0, 0, 0, 878, 865, 1, 0, 0, 0, 878, 871, 1, 0, 0, 0, 879, 881, 1, 0, 0, 0, 880, 840, 1, 0, 0, 0, 880, 862, 1, 0, 0, 0, 880, 878, 1, 0, 0, 0, 881, 99, 1, 0, 0, 0, 882, 883, 5, 18, 0, 0, 883, 886, 5, 58, 0, 0, 884, 886, 5, 151, 0, 0, 885, 882, 1, 0, 0, 0, 885, 884, 1, 0, 0, 0, 886, 101, 1, 0, 0, 0, 887, 888, 5, 77, 0, 0, 888, 897, 3, 146, 73, 0, 889, 890, 5, 123, 0, 0, 890, 891, 5, 165, 0, 0, 891, 892, 3, 146, 73, 0, 892, 893, 5, 185, 0, 0, 893, 897, 1, 0, 0, 0, 894, 895, 5, 123, 0, 0, 895, 897, 3, 146, 73, 0, 896, 887, 1, 0, 0, 0, 896, 889, 1, 0, 0, 0, 896, 894, 1, 0, 0, 0, 897, 103, 1, 0, 0, 0, 898, 899, 5, 97, 0, 0, 899, 901, 3, 116, 58, 0, 900, 902, 5, 174, 0, 0, 901, 900, 1, 0, 0, 0, 901, 902, 1, 0, 0, 0, 902, 905, 1, 0, 0, 0, 903, 904, 5, 76, 0, 0, 904, 906, 3, 116, 58, 0, 905, 903, 1, 0, 0, 0, 905, 906, 1, 0, 0, 0, 906, 911, 1, 0, 0, 0, 907, 908, 5, 165, 0, 0, 908, 909, 3, 220, 110, 0, 909, 910, 5, 185, 0, 0, 910, 912, 1, 0, 0, 0, 911, 907, 1, 0, 0, 0, 911, 912, 1, 0, 0, 0, 912, 105, 1, 0, 0, 0, 913, 916, 3, 154, 77, 0, 914, 915, 7, 7, 0, 0, 915, 917, 3, 154, 77, 0, 916, 914, 1, 0, 0, 0, 916, 917, 1, 0, 0, 0, 917, 107, 1, 0, 0, 0, 918, 923, 3, 110, 55, 0, 919, 920, 5, 151, 0, 0, 920, 922, 3, 110, 55, 0, 921, 919, 1, 0, 0, 0, 922, 925, 1, 0, 0, 0, 923, 921, 1, 0, 0, 0, 923, 924, 1, 0, 0, 0, 924, 109, 1, 0, 0, 0, 925, 923, 1, 0, 0, 0, 926, 928, 3, 154, 77, 0, 927, 929, 7, 8, 0, 0, 928, 927, 1, 0, 0, 0, 928, 929, 1, 0, 0, 0, 929, 932, 1, 0, 0, 0, 930, 931, 5, 75, 0, 0, 931, 933, 7, 9, 0, 0, 932, 930, 1, 0, 0, 0, 932, 933, 1, 0, 0, 0, 933, 936, 1, 0, 0, 0, 934, 935, 5, 16, 0, 0, 935, 937, 5, 143, 0, 0, 936, 934, 1, 0, 0, 0, 936, 937, 1, 0, 0, 0, 937, 939, 1, 0, 0, 0, 938, 940, 3, 112, 56, 0, 939, 938, 1, 0, 0, 0, 939, 940, 1, 0, 0, 0, 940, 111, 1, 0, 0, 0, 941, 942, 5, 130, 0, 0, 942, 945, 5, 32, 0, 0, 943, 944, 5, 39, 0, 0, 944, 946, 3, 154, 77, 0, 945, 943, 1, 0, 0, 0, 945, 946, 1, 0, 0, 0, 946, 949, 1, 0, 0, 0, 947, 948, 5, 112, 0, 0, 948, 950, 3, 154, 77, 0, 949, 947, 1, 0, 0, 0, 949, 950, 1, 0, 0, 0, 950, 953, 1, 0, 0, 0, 951, 952, 5, 103, 0, 0, 952, 954, 3, 154, 77, 0, 953, 951, 1, 0, 0, 0, 953, 954, 1, 0, 0, 0, 954, 113, 1, 0, 0, 0, 955, 958, 3, 154, 77, 0, 956, 957, 5, 6, 0, 0, 957, 959, 3, 154, 77, 0, 958, 956, 1, 0, 0, 0, 958, 959, 1, 0, 0, 0, 959, 115, 1, 0, 0, 0, 960, 967, 3, 224, 112, 0, 961, 964, 3, 204, 102, 0, 962, 963, 5, 187, 0, 0, 963, 965, 3, 204, 102, 0, 964, 962, 1, 0, 0, 0, 964, 965, 1, 0, 0, 0, 965, 967, 1, 0, 0, 0, 966, 960, 1, 0, 0, 0, 966, 961, 1, 0, 0, 0, 967, 117, 1, 0, 0, 0, 968, 973, 3, 120, 60, 0, 969, 970, 5, 151, 0, 0, 970, 972, 3, 120, 60, 0, 971, 969, 1, 0, 0, 0, 972, 975, 1, 0, 0, 0, 973, 971, 1, 0, 0, 0, 973, 974, 1, 0, 0, 0, 974, 119, 1, 0, 0, 0, 975, 973, 1, 0, 0, 0, 976, 977, 3, 220, 110, 0, 977, 978, 5, 157, 0, 0, 978, 979, 3, 206, 103, 0, 979, 121, 1, 0, 0, 0, 980, 982, 3, 124, 62, 0, 981, 980, 1, 0, 0, 0, 981, 982, 1, 0, 0, 0, 982, 984, 1, 0, 0, 0, 983, 985, 3, 126, 63, 0, 984, 983, 1, 0, 0, 0, 984, 985, 1, 0, 0, 0, 985, 987, 1, 0, 0, 0, 986, 988, 3, 130, 65, 0, 987, 986, 1, 0, 0, 0, 987, 988, 1, 0, 0, 0, 988, 123, 1, 0, 0, 0, 989, 990, 5, 82, 0, 0, 990, 991, 5, 11, 0, 0, 991, 992, 3, 146, 73, 0, 992, 125, 1, 0, 0, 0, 993, 994, 5, 79, 0, 0, 994, 995, 5, 11, 0, 0, 995, 996, 3, 108, 54, 0, 996, 127, 1, 0, 0, 0, 997, 998, 5, 131, 0, 0, 998, 999, 5, 42, 0, 0, 999, 1000, 5, 165, 0, 0, 1000, 1001, 3, 78, 39, 0, 1001, 1002, 5, 185, 0, 0, 1002, 129, 1, 0, 0, 0, 1003, 1004, 7, 10, 0, 0, 1004, 1005, 3, 132, 66, 0, 1005, 131, 1, 0, 0, 0, 1006, 1013, 3, 134, 67, 0, 1007, 1008, 5, 9, 0, 0, 1008, 1009, 3, 134, 67, 0, 1009, 1010, 5, 2, 0, 0, 1010, 1011, 3, 134, 67, 0, 1011, 1013, 1, 0, 0, 0, 1012, 1006, 1, 0, 0, 0, 1012, 1007, 1, 0, 0, 0, 1013, 133, 1, 0, 0, 0, 1014, 1015, 5, 20, 0, 0, 1015, 1027, 5, 95, 0, 0, 1016, 1017, 5, 120, 0, 0, 1017, 1027, 5, 85, 0, 0, 1018, 1019, 5, 120, 0, 0, 1019, 1027, 5, 37, 0, 0, 1020, 1021, 3, 154, 77, 0, 1021, 1022, 5, 85, 0, 0, 1022, 1027, 1, 0, 0, 0, 1023, 1024, 3, 154, 77, 0, 1024, 1025, 5, 37, 0, 0, 1025, 1027, 1, 0, 0, 0, 1026, 1014, 1, 0, 0, 0, 1026, 1016, 1, 0, 0, 0, 1026, 1018, 1, 0, 0, 0, 1026, 1020, 1, 0, 0, 0, 1026, 1023, 1, 0, 0, 0, 1027, 135, 1, 0, 0, 0, 1028, 1029, 3, 154, 77, 0, 1029, 1030, 5, 0, 0, 1, 1030, 137, 1, 0, 0, 0, 1031, 1032, 6, 69, -1, 0, 1032, 1033, 3, 220, 110, 0, 1033, 1034, 5, 165, 0, 0, 1034, 1035, 3, 220, 110, 0, 1035, 1042, 3, 138, 69, 0, 1036, 1037, 5, 151, 0, 0, 1037, 1038, 3, 220, 110, 0, 1038, 1039, 3, 138, 69, 0, 1039, 1041, 1, 0, 0, 0, 1040, 1036, 1, 0, 0, 0, 1041, 1044, 1, 0, 0, 0, 1042, 1040, 1, 0, 0, 0, 1042, 1043, 1, 0, 0, 0, 1043, 1046, 1, 0, 0, 0, 1044, 1042, 1, 0, 0, 0, 1045, 1047, 5, 151, 0, 0, 1046, 1045, 1, 0, 0, 0, 1046, 1047, 1, 0, 0, 0, 1047, 1048, 1, 0, 0, 0, 1048, 1049, 5, 185, 0, 0, 1049, 1095, 1, 0, 0, 0, 1050, 1051, 3, 220, 110, 0, 1051, 1052, 5, 165, 0, 0, 1052, 1057, 3, 222, 111, 0, 1053, 1054, 5, 151, 0, 0, 1054, 1056, 3, 222, 111, 0, 1055, 1053, 1, 0, 0, 0, 1056, 1059, 1, 0, 0, 0, 1057, 1055, 1, 0, 0, 0, 1057, 1058, 1, 0, 0, 0, 1058, 1061, 1, 0, 0, 0, 1059, 1057, 1, 0, 0, 0, 1060, 1062, 5, 151, 0, 0, 1061, 1060, 1, 0, 0, 0, 1061, 1062, 1, 0, 0, 0, 1062, 1063, 1, 0, 0, 0, 1063, 1064, 5, 185, 0, 0, 1064, 1095, 1, 0, 0, 0, 1065, 1066, 3, 220, 110, 0, 1066, 1067, 5, 165, 0, 0, 1067, 1072, 3, 138, 69, 0, 1068, 1069, 5, 151, 0, 0, 1069, 1071, 3, 138, 69, 0, 1070, 1068, 1, 0, 0, 0, 1071, 1074, 1, 0, 0, 0, 1072, 1070, 1, 0, 0, 0, 1072, 1073, 1, 0, 0, 0, 1073, 1076, 1, 0, 0, 0, 1074, 1072, 1, 0, 0, 0, 1075, 1077, 5, 151, 0, 0, 1076, 1075, 1, 0, 0, 0, 1076, 1077, 1, 0, 0, 0, 1077, 1078, 1, 0, 0, 0, 1078, 1079, 5, 185, 0, 0, 1079, 1095, 1, 0, 0, 0, 1080, 1081, 3, 220, 110, 0, 1081, 1083, 5, 165, 0, 0, 1082, 1084, 3, 146, 73, 0, 1083, 1082, 1, 0, 0, 0, 1083, 1084, 1, 0, 0, 0, 1084, 1085, 1, 0, 0, 0, 1085, 1086, 5, 185, 0, 0, 1086, 1095, 1, 0, 0, 0, 1087, 1089, 3, 220, 110, 0, 1088, 1090, 3, 220, 110, 0, 1089, 1088, 1, 0, 0, 0, 1090, 1091, 1, 0, 0, 0, 1091, 1089, 1, 0, 0, 0, 1091, 1092, 1, 0, 0, 0, 1092, 1095, 1, 0, 0, 0, 1093, 1095, 3, 220, 110, 0, 1094, 1031, 1, 0, 0, 0, 1094, 1050, 1, 0, 0, 0, 1094, 1065, 1, 0, 0, 0, 1094, 1080, 1, 0, 0, 0, 1094, 1087, 1, 0, 0, 0, 1094, 1093, 1, 0, 0, 0, 1095, 1104, 1, 0, 0, 0, 1096, 1097, 10, 7, 0, 0, 1097, 1099, 5, 164, 0, 0, 1098, 1100, 5, 139, 0, 0, 1099, 1098, 1, 0, 0, 0, 1099, 1100, 1, 0, 0, 0, 1100, 1101, 1, 0, 0, 0, 1101, 1103, 5, 184, 0, 0, 1102, 1096, 1, 0, 0, 0, 1103, 1106, 1, 0, 0, 0, 1104, 1102, 1, 0, 0, 0, 1104, 1105, 1, 0, 0, 0, 1105, 139, 1, 0, 0, 0, 1106, 1104, 1, 0, 0, 0, 1107, 1108, 3, 142, 71, 0, 1108, 1110, 5, 130, 0, 0, 1109, 1111, 5, 110, 0, 0, 1110, 1109, 1, 0, 0, 0, 1110, 1111, 1, 0, 0, 0, 1111, 1112, 1, 0, 0, 0, 1112, 1113, 5, 109, 0, 0, 1113, 1114, 5, 111, 0, 0, 1114, 1117, 1, 0, 0, 0, 1115, 1117, 3, 142, 71, 0, 1116, 1107, 1, 0, 0, 0, 1116, 1115, 1, 0, 0, 0, 1117, 141, 1, 0, 0, 0, 1118, 1123, 5, 134, 0, 0, 1119, 1123, 5, 135, 0, 0, 1120, 1123, 3, 208, 104, 0, 1121, 1123, 3, 144, 72, 0, 1122, 1118, 1, 0, 0, 0, 1122, 1119, 1, 0, 0, 0, 1122, 1120, 1, 0, 0, 0, 1122, 1121, 1, 0, 0, 0, 1123, 143, 1, 0, 0, 0, 1124, 1125, 7, 11, 0, 0, 1125, 145, 1, 0, 0, 0, 1126, 1131, 3, 154, 77, 0, 1127, 1128, 5, 151, 0, 0, 1128, 1130, 3, 154, 77, 0, 1129, 1127, 1, 0, 0, 0, 1130, 1133, 1, 0, 0, 0, 1131, 1129, 1, 0, 0, 0, 1131, 1132, 1, 0, 0, 0, 1132, 1135, 1, 0, 0, 0, 1133, 1131, 1, 0, 0, 0, 1134, 1136, 5, 151, 0, 0, 1135, 1134, 1, 0, 0, 0, 1135, 1136, 1, 0, 0, 0, 1136, 147, 1, 0, 0, 0, 1137, 1142, 3, 152, 76, 0, 1138, 1139, 5, 151, 0, 0, 1139, 1141, 3, 152, 76, 0, 1140, 1138, 1, 0, 0, 0, 1141, 1144, 1, 0, 0, 0, 1142, 1140, 1, 0, 0, 0, 1142, 1143, 1, 0, 0, 0, 1143, 1145, 1, 0, 0, 0, 1144, 1142, 1, 0, 0, 0, 1145, 1146, 5, 151, 0, 0, 1146, 1149, 1, 0, 0, 0, 1147, 1149, 3, 150, 75, 0, 1148, 1137, 1, 0, 0, 0, 1148, 1147, 1, 0, 0, 0, 1149, 149, 1, 0, 0, 0, 1150, 1155, 3, 152, 76, 0, 1151, 1152, 5, 151, 0, 0, 1152, 1154, 3, 152, 76, 0, 1153, 1151, 1, 0, 0, 0, 1154, 1157, 1, 0, 0, 0, 1155, 1153, 1, 0, 0, 0, 1155, 1156, 1, 0, 0, 0, 1156, 1159, 1, 0, 0, 0, 1157, 1155, 1, 0, 0, 0, 1158, 1160, 5, 151, 0, 0, 1159, 1158, 1, 0, 0, 0, 1159, 1160, 1, 0, 0, 0, 1160, 151, 1, 0, 0, 0, 1161, 1162, 3, 220, 110, 0, 1162, 1163, 5, 150, 0, 0, 1163, 1164, 3, 154, 77, 0, 1164, 1172, 1, 0, 0, 0, 1165, 1166, 5, 39, 0, 0, 1166, 1172, 3, 218, 109, 0, 1167, 1172, 3, 154, 77, 0, 1168, 1169, 3, 154, 77, 0, 1169, 1170, 3, 218, 109, 0, 1170, 1172, 1, 0, 0, 0, 1171, 1161, 1, 0, 0, 0, 1171, 1165, 1, 0, 0, 0, 1171, 1167, 1, 0, 0, 0, 1171, 1168, 1, 0, 0, 0, 1172, 153, 1, 0, 0, 0, 1173, 1174, 6, 77, -1, 0, 1174, 1176, 5, 12, 0, 0, 1175, 1177, 3, 154, 77, 0, 1176, 1175, 1, 0, 0, 0, 1176, 1177, 1, 0, 0, 0, 1177, 1183, 1, 0, 0, 0, 1178, 1179, 5, 126, 0, 0, 1179, 1180, 3, 154, 77, 0, 1180, 1181, 5, 105, 0, 0, 1181, 1182, 3, 154, 77, 0, 1182, 1184, 1, 0, 0, 0, 1183, 1178, 1, 0, 0, 0, 1184, 1185, 1, 0, 0, 0, 1185, 1183, 1, 0, 0, 0, 1185, 1186, 1, 0, 0, 0, 1186, 1189, 1, 0, 0, 0, 1187, 1188, 5, 26, 0, 0, 1188, 1190, 3, 154, 77, 0, 1189, 1187, 1, 0, 0, 0, 1189, 1190, 1, 0, 0, 0, 1190, 1191, 1, 0, 0, 0, 1191, 1192, 5, 27, 0, 0, 1192, 1523, 1, 0, 0, 0, 1193, 1194, 5, 13, 0, 0, 1194, 1195, 5, 165, 0, 0, 1195, 1196, 3, 154, 77, 0, 1196, 1197, 5, 6, 0, 0, 1197, 1198, 3, 138, 69, 0, 1198, 1199, 5, 185, 0, 0, 1199, 1523, 1, 0, 0, 0, 1200, 1201, 5, 119, 0, 0, 1201, 1202, 5, 165, 0, 0, 1202, 1203, 3, 154, 77, 0, 1203, 1204, 5, 6, 0, 0, 1204, 1205, 3, 138, 69, 0, 1205, 1206, 5, 185, 0, 0, 1206, 1523, 1, 0, 0, 0, 1207, 1208, 5, 21, 0, 0, 1208, 1523, 5, 143, 0, 0, 1209, 1210, 5, 56, 0, 0, 1210, 1523, 5, 143, 0, 0, 1211, 1212, 5, 56, 0, 0, 1212, 1213, 3, 154, 77, 0, 1213, 1214, 3, 208, 104, 0, 1214, 1523, 1, 0, 0, 0, 1215, 1216, 5, 104, 0, 0, 1216, 1217, 5, 165, 0, 0, 1217, 1218, 3, 154, 77, 0, 1218, 1219, 5, 39, 0, 0, 1219, 1222, 3, 154, 77, 0, 1220, 1221, 5, 38, 0, 0, 1221, 1223, 3, 154, 77, 0, 1222, 1220, 1, 0, 0, 0, 1222, 1223, 1, 0, 0, 0, 1223, 1224, 1, 0, 0, 0, 1224, 1225, 5, 185, 0, 0, 1225, 1523, 1, 0, 0, 0, 1226, 1227, 5, 108, 0, 0, 1227, 1523, 5, 143, 0, 0, 1228, 1229, 5, 116, 0, 0, 1229, 1230, 5, 165, 0, 0, 1230, 1231, 7, 12, 0, 0, 1231, 1232, 3, 226, 113, 0, 1232, 1233, 5, 39, 0, 0, 1233, 1234, 3, 154, 77, 0, 1234, 1235, 5, 185, 0, 0, 1235, 1523, 1, 0, 0, 0, 1236, 1237, 5, 17, 0, 0, 1237, 1238, 5, 165, 0, 0, 1238, 1239, 5, 143, 0, 0, 1239, 1523, 5, 185, 0, 0, 1240, 1241, 5, 17, 0, 0, 1241, 1242, 5, 165, 0, 0, 1242, 1243, 3, 146, 73, 0, 1243, 1244, 5, 185, 0, 0, 1244, 1523, 1, 0, 0, 0, 1245, 1246, 5, 17, 0, 0, 1246, 1247, 5, 165, 0, 0, 1247, 1248, 5, 145, 0, 0, 1248, 1249, 5, 29, 0, 0, 1249, 1250, 5, 165, 0, 0, 1250, 1251, 3, 8, 4, 0, 1251, 1252, 5, 185, 0, 0, 1252, 1253, 5, 91, 0, 0, 1253, 1254, 5, 165, 0, 0, 1254, 1255, 3, 158, 79, 0, 1255, 1256, 5, 185, 0, 0, 1256, 1257, 5, 185, 0, 0, 1257, 1271, 1, 0, 0, 0, 1258, 1259, 5, 165, 0, 0, 1259, 1260, 5, 145, 0, 0, 1260, 1261, 5, 29, 0, 0, 1261, 1262, 5, 165, 0, 0, 1262, 1263, 3, 8, 4, 0, 1263, 1264, 5, 185, 0, 0, 1264, 1265, 5, 91, 0, 0, 1265, 1266, 5, 165, 0, 0, 1266, 1267, 3, 158, 79, 0, 1267, 1268, 5, 185, 0, 0, 1268, 1269, 5, 185, 0, 0, 1269, 1271, 1, 0, 0, 0, 1270, 1245, 1, 0, 0, 0, 1270, 1258, 1, 0, 0, 0, 1271, 1523, 1, 0, 0, 0, 1272, 1273, 5, 17, 0, 0, 1273, 1274, 5, 165, 0, 0, 1274, 1275, 5, 145, 0, 0, 1275, 1276, 5, 29, 0, 0, 1276, 1277, 5, 165, 0, 0, 1277, 1278, 3, 8, 4, 0, 1278, 1279, 5, 185, 0, 0, 1279, 1280, 5, 185, 0, 0, 1280, 1523, 1, 0, 0, 0, 1281, 1282, 5, 17, 0, 0, 1282, 1283, 5, 165, 0, 0, 1283, 1284, 5, 145, 0, 0, 1284, 1285, 5, 91, 0, 0, 1285, 1286, 5, 165, 0, 0, 1286, 1287, 3, 158, 79, 0, 1287, 1288, 5, 185, 0, 0, 1288, 1289, 5, 185, 0, 0, 1289, 1299, 1, 0, 0, 0, 1290, 1291, 5, 165, 0, 0, 1291, 1292, 5, 145, 0, 0, 1292, 1293, 5, 91, 0, 0, 1293, 1294, 5, 165, 0, 0, 1294, 1295, 3, 158, 79, 0, 1295, 1296, 5, 185, 0, 0, 1296, 1297, 5, 185, 0, 0, 1297, 1299, 1, 0, 0, 0, 1298, 1281, 1, 0, 0, 0, 1298, 1290, 1, 0, 0, 0, 1299, 1523, 1, 0, 0, 0, 1300, 1301, 5, 17, 0, 0, 1301, 1302, 5, 165, 0, 0, 1302, 1303, 5, 145, 0, 0, 1303, 1523, 5, 185, 0, 0, 1304, 1305, 5, 17, 0, 0, 1305, 1306, 5, 165, 0, 0, 1306, 1307, 3, 220, 110, 0, 1307, 1308, 5, 155, 0, 0, 1308, 1309, 5, 145, 0, 0, 1309, 1310, 5, 29, 0, 0, 1310, 1311, 5, 165, 0, 0, 1311, 1312, 3, 8, 4, 0, 1312, 1313, 5, 185, 0, 0, 1313, 1314, 5, 91, 0, 0, 1314, 1315, 5, 165, 0, 0, 1315, 1316, 3, 158, 79, 0, 1316, 1317, 5, 185, 0, 0, 1317, 1318, 5, 185, 0, 0, 1318, 1523, 1, 0, 0, 0, 1319, 1320, 5, 17, 0, 0, 1320, 1321, 5, 165, 0, 0, 1321, 1322, 3, 220, 110, 0, 1322, 1323, 5, 155, 0, 0, 1323, 1324, 5, 145, 0, 0, 1324, 1325, 5, 29, 0, 0, 1325, 1326, 5, 165, 0, 0, 1326, 1327, 3, 8, 4, 0, 1327, 1328, 5, 185, 0, 0, 1328, 1329, 5, 185, 0, 0, 1329, 1523, 1, 0, 0, 0, 1330, 1331, 5, 17, 0, 0, 1331, 1332, 5, 165, 0, 0, 1332, 1333, 3, 220, 110, 0, 1333, 1334, 5, 155, 0, 0, 1334, 1335, 5, 145, 0, 0, 1335, 1336, 5, 91, 0, 0, 1336, 1337, 5, 165, 0, 0, 1337, 1338, 3, 158, 79, 0, 1338, 1339, 5, 185, 0, 0, 1339, 1340, 5, 185, 0, 0, 1340, 1523, 1, 0, 0, 0, 1341, 1342, 5, 17, 0, 0, 1342, 1343, 5, 165, 0, 0, 1343, 1344, 3, 220, 110, 0, 1344, 1345, 5, 155, 0, 0, 1345, 1346, 5, 145, 0, 0, 1346, 1347, 5, 185, 0, 0, 1347, 1523, 1, 0, 0, 0, 1348, 1349, 5, 145, 0, 0, 1349, 1350, 5, 17, 0, 0, 1350, 1351, 5, 165, 0, 0, 1351, 1352, 5, 143, 0, 0, 1352, 1523, 5, 185, 0, 0, 1353, 1354, 5, 145, 0, 0, 1354, 1355, 5, 17, 0, 0, 1355, 1356, 5, 165, 0, 0, 1356, 1357, 3, 146, 73, 0, 1357, 1358, 5, 185, 0, 0, 1358, 1523, 1, 0, 0, 0, 1359, 1360, 3, 220, 110, 0, 1360, 1362, 5, 165, 0, 0, 1361, 1363, 3, 146, 73, 0, 1362, 1361, 1, 0, 0, 0, 1362, 1363, 1, 0, 0, 0, 1363, 1364, 1, 0, 0, 0, 1364, 1365, 5, 185, 0, 0, 1365, 1366, 3, 128, 64, 0, 1366, 1523, 1, 0, 0, 0, 1367, 1368, 3, 220, 110, 0, 1368, 1370, 5, 165, 0, 0, 1369, 1371, 3, 146, 73, 0, 1370, 1369, 1, 0, 0, 0, 1370, 1371, 1, 0, 0, 0, 1371, 1372, 1, 0, 0, 0, 1372, 1373, 5, 185, 0, 0, 1373, 1382, 1, 0, 0, 0, 1374, 1376, 5, 165, 0, 0, 1375, 1377, 5, 25, 0, 0, 1376, 1375, 1, 0, 0, 0, 1376, 1377, 1, 0, 0, 0, 1377, 1379, 1, 0, 0, 0, 1378, 1380, 3, 146, 73, 0, 1379, 1378, 1, 0, 0, 0, 1379, 1380, 1, 0, 0, 0, 1380, 1381, 1, 0, 0, 0, 1381, 1383, 5, 185, 0, 0, 1382, 1374, 1, 0, 0, 0, 1382, 1383, 1, 0, 0, 0, 1383, 1390, 1, 0, 0, 0, 1384, 1385, 5, 33, 0, 0, 1385, 1386, 5, 165, 0, 0, 1386, 1387, 5, 127, 0, 0, 1387, 1388, 3, 154, 77, 0, 1388, 1389, 5, 185, 0, 0, 1389, 1391, 1, 0, 0, 0, 1390, 1384, 1, 0, 0, 0, 1390, 1391, 1, 0, 0, 0, 1391, 1392, 1, 0, 0, 0, 1392, 1393, 5, 81, 0, 0, 1393, 1394, 5, 165, 0, 0, 1394, 1395, 3, 122, 61, 0, 1395, 1396, 5, 185, 0, 0, 1396, 1523, 1, 0, 0, 0, 1397, 1398, 3, 220, 110, 0, 1398, 1400, 5, 165, 0, 0, 1399, 1401, 3, 146, 73, 0, 1400, 1399, 1, 0, 0, 0, 1400, 1401, 1, 0, 0, 0, 1401, 1402, 1, 0, 0, 0, 1402, 1403, 5, 185, 0, 0, 1403, 1412, 1, 0, 0, 0, 1404, 1406, 5, 165, 0, 0, 1405, 1407, 5, 25, 0, 0, 1406, 1405, 1, 0, 0, 0, 1406, 1407, 1, 0, 0, 0, 1407, 1409, 1, 0, 0, 0, 1408, 1410, 3, 146, 73, 0, 1409, 1408, 1, 0, 0, 0, 1409, 1410, 1, 0, 0, 0, 1410, 1411, 1, 0, 0, 0, 1411, 1413, 5, 185, 0, 0, 1412, 1404, 1, 0, 0, 0, 1412, 1413, 1, 0, 0, 0, 1413, 1420, 1, 0, 0, 0, 1414, 1415, 5, 33, 0, 0, 1415, 1416, 5, 165, 0, 0, 1416, 1417, 5, 127, 0, 0, 1417, 1418, 3, 154, 77, 0, 1418, 1419, 5, 185, 0, 0, 1419, 1421, 1, 0, 0, 0, 1420, 1414, 1, 0, 0, 0, 1420, 1421, 1, 0, 0, 0, 1421, 1422, 1, 0, 0, 0, 1422, 1423, 5, 81, 0, 0, 1423, 1424, 3, 220, 110, 0, 1424, 1523, 1, 0, 0, 0, 1425, 1431, 3, 220, 110, 0, 1426, 1428, 5, 165, 0, 0, 1427, 1429, 3, 146, 73, 0, 1428, 1427, 1, 0, 0, 0, 1428, 1429, 1, 0, 0, 0, 1429, 1430, 1, 0, 0, 0, 1430, 1432, 5, 185, 0, 0, 1431, 1426, 1, 0, 0, 0, 1431, 1432, 1, 0, 0, 0, 1432, 1433, 1, 0, 0, 0, 1433, 1435, 5, 165, 0, 0, 1434, 1436, 5, 25, 0, 0, 1435, 1434, 1, 0, 0, 0, 1435, 1436, 1, 0, 0, 0, 1436, 1438, 1, 0, 0, 0, 1437, 1439, 3, 146, 73, 0, 1438, 1437, 1, 0, 0, 0, 1438, 1439, 1, 0, 0, 0, 1439, 1443, 1, 0, 0, 0, 1440, 1441, 5, 79, 0, 0, 1441, 1442, 5, 11, 0, 0, 1442, 1444, 3, 108, 54, 0, 1443, 1440, 1, 0, 0, 0, 1443, 1444, 1, 0, 0, 0, 1444, 1445, 1, 0, 0, 0, 1445, 1452, 5, 185, 0, 0, 1446, 1447, 5, 33, 0, 0, 1447, 1448, 5, 165, 0, 0, 1448, 1449, 5, 127, 0, 0, 1449, 1450, 3, 154, 77, 0, 1450, 1451, 5, 185, 0, 0, 1451, 1453, 1, 0, 0, 0, 1452, 1446, 1, 0, 0, 0, 1452, 1453, 1, 0, 0, 0, 1453, 1523, 1, 0, 0, 0, 1454, 1523, 3, 166, 83, 0, 1455, 1523, 3, 228, 114, 0, 1456, 1523, 3, 206, 103, 0, 1457, 1458, 5, 153, 0, 0, 1458, 1523, 3, 154, 77, 25, 1459, 1460, 5, 73, 0, 0, 1460, 1523, 3, 154, 77, 17, 1461, 1462, 3, 196, 98, 0, 1462, 1463, 5, 155, 0, 0, 1463, 1465, 1, 0, 0, 0, 1464, 1461, 1, 0, 0, 0, 1464, 1465, 1, 0, 0, 0, 1465, 1466, 1, 0, 0, 0, 1466, 1472, 5, 145, 0, 0, 1467, 1468, 5, 29, 0, 0, 1468, 1469, 5, 165, 0, 0, 1469, 1470, 3, 8, 4, 0, 1470, 1471, 5, 185, 0, 0, 1471, 1473, 1, 0, 0, 0, 1472, 1467, 1, 0, 0, 0, 1472, 1473, 1, 0, 0, 0, 1473, 1523, 1, 0, 0, 0, 1474, 1475, 5, 60, 0, 0, 1475, 1480, 3, 220, 110, 0, 1476, 1477, 5, 151, 0, 0, 1477, 1479, 3, 220, 110, 0, 1478, 1476, 1, 0, 0, 0, 1479, 1482, 1, 0, 0, 0, 1480, 1478, 1, 0, 0, 0, 1480, 1481, 1, 0, 0, 0, 1481, 1484, 1, 0, 0, 0, 1482, 1480, 1, 0, 0, 0, 1483, 1485, 5, 151, 0, 0, 1484, 1483, 1, 0, 0, 0, 1484, 1485, 1, 0, 0, 0, 1485, 1486, 1, 0, 0, 0, 1486, 1487, 5, 150, 0, 0, 1487, 1488, 3, 154, 77, 10, 1488, 1523, 1, 0, 0, 0, 1489, 1490, 5, 165, 0, 0, 1490, 1491, 3, 48, 24, 0, 1491, 1492, 5, 185, 0, 0, 1492, 1523, 1, 0, 0, 0, 1493, 1494, 5, 165, 0, 0, 1494, 1495, 3, 154, 77, 0, 1495, 1496, 5, 185, 0, 0, 1496, 1523, 1, 0, 0, 0, 1497, 1498, 5, 165, 0, 0, 1498, 1499, 3, 146, 73, 0, 1499, 1500, 5, 185, 0, 0, 1500, 1523, 1, 0, 0, 0, 1501, 1503, 5, 5, 0, 0, 1502, 1501, 1, 0, 0, 0, 1502, 1503, 1, 0, 0, 0, 1503, 1504, 1, 0, 0, 0, 1504, 1506, 5, 164, 0, 0, 1505, 1507, 3, 146, 73, 0, 1506, 1505, 1, 0, 0, 0, 1506, 1507, 1, 0, 0, 0, 1507, 1508, 1, 0, 0, 0, 1508, 1523, 5, 184, 0, 0, 1509, 1511, 5, 163, 0, 0, 1510, 1512, 3, 40, 20, 0, 1511, 1510, 1, 0, 0, 0, 1511, 1512, 1, 0, 0, 0, 1512, 1513, 1, 0, 0, 0, 1513, 1523, 5, 183, 0, 0, 1514, 1523, 3, 156, 78, 0, 1515, 1516, 3, 220, 110, 0, 1516, 1517, 5, 149, 0, 0, 1517, 1518, 3, 154, 77, 3, 1518, 1523, 1, 0, 0, 0, 1519, 1520, 5, 160, 0, 0, 1520, 1523, 5, 139, 0, 0, 1521, 1523, 3, 176, 88, 0, 1522, 1173, 1, 0, 0, 0, 1522, 1193, 1, 0, 0, 0, 1522, 1200, 1, 0, 0, 0, 1522, 1207, 1, 0, 0, 0, 1522, 1209, 1, 0, 0, 0, 1522, 1211, 1, 0, 0, 0, 1522, 1215, 1, 0, 0, 0, 1522, 1226, 1, 0, 0, 0, 1522, 1228, 1, 0, 0, 0, 1522, 1236, 1, 0, 0, 0, 1522, 1240, 1, 0, 0, 0, 1522, 1270, 1, 0, 0, 0, 1522, 1272, 1, 0, 0, 0, 1522, 1298, 1, 0, 0, 0, 1522, 1300, 1, 0, 0, 0, 1522, 1304, 1, 0, 0, 0, 1522, 1319, 1, 0, 0, 0, 1522, 1330, 1, 0, 0, 0, 1522, 1341, 1, 0, 0, 0, 1522, 1348, 1, 0, 0, 0, 1522, 1353, 1, 0, 0, 0, 1522, 1359, 1, 0, 0, 0, 1522, 1367, 1, 0, 0, 0, 1522, 1397, 1, 0, 0, 0, 1522, 1425, 1, 0, 0, 0, 1522, 1454, 1, 0, 0, 0, 1522, 1455, 1, 0, 0, 0, 1522, 1456, 1, 0, 0, 0, 1522, 1457, 1, 0, 0, 0, 1522, 1459, 1, 0, 0, 0, 1522, 1464, 1, 0, 0, 0, 1522, 1474, 1, 0, 0, 0, 1522, 1489, 1, 0, 0, 0, 1522, 1493, 1, 0, 0, 0, 1522, 1497, 1, 0, 0, 0, 1522, 1502, 1, 0, 0, 0, 1522, 1509, 1, 0, 0, 0, 1522, 1514, 1, 0, 0, 0, 1522, 1515, 1, 0, 0, 0, 1522, 1519, 1, 0, 0, 0, 1522, 1521, 1, 0, 0, 0, 1523, 1662, 1, 0, 0, 0, 1524, 1528, 10, 24, 0, 0, 1525, 1529, 5, 145, 0, 0, 1526, 1529, 5, 187, 0, 0, 1527, 1529, 5, 174, 0, 0, 1528, 1525, 1, 0, 0, 0, 1528, 1526, 1, 0, 0, 0, 1528, 1527, 1, 0, 0, 0, 1529, 1530, 1, 0, 0, 0, 1530, 1661, 3, 154, 77, 25, 1531, 1535, 10, 23, 0, 0, 1532, 1536, 5, 175, 0, 0, 1533, 1536, 5, 153, 0, 0, 1534, 1536, 5, 152, 0, 0, 1535, 1532, 1, 0, 0, 0, 1535, 1533, 1, 0, 0, 0, 1535, 1534, 1, 0, 0, 0, 1536, 1537, 1, 0, 0, 0, 1537, 1661, 3, 154, 77, 24, 1538, 1563, 10, 22, 0, 0, 1539, 1564, 5, 156, 0, 0, 1540, 1564, 5, 157, 0, 0, 1541, 1564, 5, 169, 0, 0, 1542, 1564, 5, 166, 0, 0, 1543, 1564, 5, 167, 0, 0, 1544, 1564, 5, 158, 0, 0, 1545, 1564, 5, 159, 0, 0, 1546, 1548, 5, 73, 0, 0, 1547, 1546, 1, 0, 0, 0, 1547, 1548, 1, 0, 0, 0, 1548, 1549, 1, 0, 0, 0, 1549, 1551, 5, 51, 0, 0, 1550, 1552, 5, 15, 0, 0, 1551, 1550, 1, 0, 0, 0, 1551, 1552, 1, 0, 0, 0, 1552, 1564, 1, 0, 0, 0, 1553, 1555, 5, 73, 0, 0, 1554, 1553, 1, 0, 0, 0, 1554, 1555, 1, 0, 0, 0, 1555, 1556, 1, 0, 0, 0, 1556, 1564, 7, 13, 0, 0, 1557, 1564, 5, 181, 0, 0, 1558, 1564, 5, 182, 0, 0, 1559, 1564, 5, 171, 0, 0, 1560, 1564, 5, 161, 0, 0, 1561, 1564, 5, 162, 0, 0, 1562, 1564, 5, 170, 0, 0, 1563, 1539, 1, 0, 0, 0, 1563, 1540, 1, 0, 0, 0, 1563, 1541, 1, 0, 0, 0, 1563, 1542, 1, 0, 0, 0, 1563, 1543, 1, 0, 0, 0, 1563, 1544, 1, 0, 0, 0, 1563, 1545, 1, 0, 0, 0, 1563, 1547, 1, 0, 0, 0, 1563, 1554, 1, 0, 0, 0, 1563, 1557, 1, 0, 0, 0, 1563, 1558, 1, 0, 0, 0, 1563, 1559, 1, 0, 0, 0, 1563, 1560, 1, 0, 0, 0, 1563, 1561, 1, 0, 0, 0, 1563, 1562, 1, 0, 0, 0, 1564, 1565, 1, 0, 0, 0, 1565, 1661, 3, 154, 77, 23, 1566, 1567, 10, 19, 0, 0, 1567, 1569, 5, 57, 0, 0, 1568, 1570, 5, 73, 0, 0, 1569, 1568, 1, 0, 0, 0, 1569, 1570, 1, 0, 0, 0, 1570, 1571, 1, 0, 0, 0, 1571, 1572, 5, 25, 0, 0, 1572, 1573, 5, 39, 0, 0, 1573, 1661, 3, 154, 77, 20, 1574, 1575, 10, 18, 0, 0, 1575, 1576, 5, 173, 0, 0, 1576, 1661, 3, 154, 77, 19, 1577, 1578, 10, 16, 0, 0, 1578, 1579, 5, 2, 0, 0, 1579, 1661, 3, 154, 77, 17, 1580, 1581, 10, 15, 0, 0, 1581, 1582, 5, 78, 0, 0, 1582, 1661, 3, 154, 77, 16, 1583, 1585, 10, 14, 0, 0, 1584, 1586, 5, 73, 0, 0, 1585, 1584, 1, 0, 0, 0, 1585, 1586, 1, 0, 0, 0, 1586, 1587, 1, 0, 0, 0, 1587, 1588, 5, 9, 0, 0, 1588, 1589, 3, 154, 77, 0, 1589, 1590, 5, 2, 0, 0, 1590, 1591, 3, 154, 77, 15, 1591, 1661, 1, 0, 0, 0, 1592, 1593, 10, 13, 0, 0, 1593, 1594, 5, 176, 0, 0, 1594, 1595, 3, 154, 77, 0, 1595, 1596, 5, 150, 0, 0, 1596, 1597, 3, 154, 77, 13, 1597, 1661, 1, 0, 0, 0, 1598, 1599, 10, 38, 0, 0, 1599, 1600, 5, 165, 0, 0, 1600, 1601, 3, 48, 24, 0, 1601, 1602, 5, 185, 0, 0, 1602, 1661, 1, 0, 0, 0, 1603, 1604, 10, 37, 0, 0, 1604, 1606, 5, 165, 0, 0, 1605, 1607, 3, 146, 73, 0, 1606, 1605, 1, 0, 0, 0, 1606, 1607, 1, 0, 0, 0, 1607, 1608, 1, 0, 0, 0, 1608, 1661, 5, 185, 0, 0, 1609, 1610, 10, 33, 0, 0, 1610, 1611, 5, 164, 0, 0, 1611, 1612, 3, 154, 77, 0, 1612, 1613, 5, 184, 0, 0, 1613, 1661, 1, 0, 0, 0, 1614, 1615, 10, 32, 0, 0, 1615, 1617, 5, 164, 0, 0, 1616, 1618, 3, 154, 77, 0, 1617, 1616, 1, 0, 0, 0, 1617, 1618, 1, 0, 0, 0, 1618, 1619, 1, 0, 0, 0, 1619, 1621, 5, 150, 0, 0, 1620, 1622, 3, 154, 77, 0, 1621, 1620, 1, 0, 0, 0, 1621, 1622, 1, 0, 0, 0, 1622, 1623, 1, 0, 0, 0, 1623, 1661, 5, 184, 0, 0, 1624, 1625, 10, 31, 0, 0, 1625, 1626, 5, 155, 0, 0, 1626, 1661, 5, 139, 0, 0, 1627, 1628, 10, 30, 0, 0, 1628, 1629, 5, 155, 0, 0, 1629, 1661, 3, 220, 110, 0, 1630, 1631, 10, 29, 0, 0, 1631, 1632, 5, 172, 0, 0, 1632, 1633, 5, 164, 0, 0, 1633, 1634, 3, 154, 77, 0, 1634, 1635, 5, 184, 0, 0, 1635, 1661, 1, 0, 0, 0, 1636, 1637, 10, 28, 0, 0, 1637, 1638, 5, 172, 0, 0, 1638, 1661, 5, 139, 0, 0, 1639, 1640, 10, 27, 0, 0, 1640, 1641, 5, 172, 0, 0, 1641, 1661, 3, 220, 110, 0, 1642, 1643, 10, 26, 0, 0, 1643, 1644, 5, 148, 0, 0, 1644, 1661, 3, 140, 70, 0, 1645, 1646, 10, 21, 0, 0, 1646, 1647, 5, 49, 0, 0, 1647, 1661, 5, 75, 0, 0, 1648, 1649, 10, 20, 0, 0, 1649, 1651, 5, 57, 0, 0, 1650, 1652, 5, 73, 0, 0, 1651, 1650, 1, 0, 0, 0, 1651, 1652, 1, 0, 0, 0, 1652, 1653, 1, 0, 0, 0, 1653, 1661, 5, 74, 0, 0, 1654, 1655, 10, 12, 0, 0, 1655, 1658, 5, 6, 0, 0, 1656, 1659, 3, 220, 110, 0, 1657, 1659, 5, 143, 0, 0, 1658, 1656, 1, 0, 0, 0, 1658, 1657, 1, 0, 0, 0, 1659, 1661, 1, 0, 0, 0, 1660, 1524, 1, 0, 0, 0, 1660, 1531, 1, 0, 0, 0, 1660, 1538, 1, 0, 0, 0, 1660, 1566, 1, 0, 0, 0, 1660, 1574, 1, 0, 0, 0, 1660, 1577, 1, 0, 0, 0, 1660, 1580, 1, 0, 0, 0, 1660, 1583, 1, 0, 0, 0, 1660, 1592, 1, 0, 0, 0, 1660, 1598, 1, 0, 0, 0, 1660, 1603, 1, 0, 0, 0, 1660, 1609, 1, 0, 0, 0, 1660, 1614, 1, 0, 0, 0, 1660, 1624, 1, 0, 0, 0, 1660, 1627, 1, 0, 0, 0, 1660, 1630, 1, 0, 0, 0, 1660, 1636, 1, 0, 0, 0, 1660, 1639, 1, 0, 0, 0, 1660, 1642, 1, 0, 0, 0, 1660, 1645, 1, 0, 0, 0, 1660, 1648, 1, 0, 0, 0, 1660, 1654, 1, 0, 0, 0, 1661, 1664, 1, 0, 0, 0, 1662, 1660, 1, 0, 0, 0, 1662, 1663, 1, 0, 0, 0, 1663, 155, 1, 0, 0, 0, 1664, 1662, 1, 0, 0, 0, 1665, 1666, 5, 165, 0, 0, 1666, 1671, 3, 220, 110, 0, 1667, 1668, 5, 151, 0, 0, 1668, 1670, 3, 220, 110, 0, 1669, 1667, 1, 0, 0, 0, 1670, 1673, 1, 0, 0, 0, 1671, 1669, 1, 0, 0, 0, 1671, 1672, 1, 0, 0, 0, 1672, 1675, 1, 0, 0, 0, 1673, 1671, 1, 0, 0, 0, 1674, 1676, 5, 151, 0, 0, 1675, 1674, 1, 0, 0, 0, 1675, 1676, 1, 0, 0, 0, 1676, 1677, 1, 0, 0, 0, 1677, 1678, 5, 185, 0, 0, 1678, 1693, 1, 0, 0, 0, 1679, 1684, 3, 220, 110, 0, 1680, 1681, 5, 151, 0, 0, 1681, 1683, 3, 220, 110, 0, 1682, 1680, 1, 0, 0, 0, 1683, 1686, 1, 0, 0, 0, 1684, 1682, 1, 0, 0, 0, 1684, 1685, 1, 0, 0, 0, 1685, 1688, 1, 0, 0, 0, 1686, 1684, 1, 0, 0, 0, 1687, 1689, 5, 151, 0, 0, 1688, 1687, 1, 0, 0, 0, 1688, 1689, 1, 0, 0, 0, 1689, 1693, 1, 0, 0, 0, 1690, 1691, 5, 165, 0, 0, 1691, 1693, 5, 185, 0, 0, 1692, 1665, 1, 0, 0, 0, 1692, 1679, 1, 0, 0, 0, 1692, 1690, 1, 0, 0, 0, 1693, 1694, 1, 0, 0, 0, 1694, 1697, 5, 144, 0, 0, 1695, 1698, 3, 154, 77, 0, 1696, 1698, 3, 36, 18, 0, 1697, 1695, 1, 0, 0, 0, 1697, 1696, 1, 0, 0, 0, 1698, 1715, 1, 0, 0, 0, 1699, 1700, 5, 60, 0, 0, 1700, 1705, 3, 220, 110, 0, 1701, 1702, 5, 151, 0, 0, 1702, 1704, 3, 220, 110, 0, 1703, 1701, 1, 0, 0, 0, 1704, 1707, 1, 0, 0, 0, 1705, 1703, 1, 0, 0, 0, 1705, 1706, 1, 0, 0, 0, 1706, 1709, 1, 0, 0, 0, 1707, 1705, 1, 0, 0, 0, 1708, 1710, 5, 151, 0, 0, 1709, 1708, 1, 0, 0, 0, 1709, 1710, 1, 0, 0, 0, 1710, 1711, 1, 0, 0, 0, 1711, 1712, 5, 150, 0, 0, 1712, 1713, 3, 154, 77, 0, 1713, 1715, 1, 0, 0, 0, 1714, 1692, 1, 0, 0, 0, 1714, 1699, 1, 0, 0, 0, 1715, 157, 1, 0, 0, 0, 1716, 1721, 3, 160, 80, 0, 1717, 1718, 5, 151, 0, 0, 1718, 1720, 3, 160, 80, 0, 1719, 1717, 1, 0, 0, 0, 1720, 1723, 1, 0, 0, 0, 1721, 1719, 1, 0, 0, 0, 1721, 1722, 1, 0, 0, 0, 1722, 159, 1, 0, 0, 0, 1723, 1721, 1, 0, 0, 0, 1724, 1725, 3, 154, 77, 0, 1725, 1726, 5, 6, 0, 0, 1726, 1727, 3, 220, 110, 0, 1727, 161, 1, 0, 0, 0, 1728, 1735, 3, 166, 83, 0, 1729, 1735, 3, 164, 82, 0, 1730, 1731, 5, 163, 0, 0, 1731, 1732, 3, 154, 77, 0, 1732, 1733, 5, 183, 0, 0, 1733, 1735, 1, 0, 0, 0, 1734, 1728, 1, 0, 0, 0, 1734, 1729, 1, 0, 0, 0, 1734, 1730, 1, 0, 0, 0, 1735, 163, 1, 0, 0, 0, 1736, 1737, 5, 204, 0, 0, 1737, 165, 1, 0, 0, 0, 1738, 1739, 5, 167, 0, 0, 1739, 1743, 3, 220, 110, 0, 1740, 1742, 3, 168, 84, 0, 1741, 1740, 1, 0, 0, 0, 1742, 1745, 1, 0, 0, 0, 1743, 1741, 1, 0, 0, 0, 1743, 1744, 1, 0, 0, 0, 1744, 1746, 1, 0, 0, 0, 1745, 1743, 1, 0, 0, 0, 1746, 1747, 5, 188, 0, 0, 1747, 1768, 1, 0, 0, 0, 1748, 1749, 5, 167, 0, 0, 1749, 1753, 3, 220, 110, 0, 1750, 1752, 3, 168, 84, 0, 1751, 1750, 1, 0, 0, 0, 1752, 1755, 1, 0, 0, 0, 1753, 1751, 1, 0, 0, 0, 1753, 1754, 1, 0, 0, 0, 1754, 1756, 1, 0, 0, 0, 1755, 1753, 1, 0, 0, 0, 1756, 1760, 5, 159, 0, 0, 1757, 1759, 3, 162, 81, 0, 1758, 1757, 1, 0, 0, 0, 1759, 1762, 1, 0, 0, 0, 1760, 1758, 1, 0, 0, 0, 1760, 1761, 1, 0, 0, 0, 1761, 1763, 1, 0, 0, 0, 1762, 1760, 1, 0, 0, 0, 1763, 1764, 5, 168, 0, 0, 1764, 1765, 3, 220, 110, 0, 1765, 1766, 5, 159, 0, 0, 1766, 1768, 1, 0, 0, 0, 1767, 1738, 1, 0, 0, 0, 1767, 1748, 1, 0, 0, 0, 1768, 167, 1, 0, 0, 0, 1769, 1770, 3, 220, 110, 0, 1770, 1771, 5, 157, 0, 0, 1771, 1772, 3, 226, 113, 0, 1772, 1781, 1, 0, 0, 0, 1773, 1774, 3, 220, 110, 0, 1774, 1775, 5, 157, 0, 0, 1775, 1776, 5, 163, 0, 0, 1776, 1777, 3, 154, 77, 0, 1777, 1778, 5, 183, 0, 0, 1778, 1781, 1, 0, 0, 0, 1779, 1781, 3, 220, 110, 0, 1780, 1769, 1, 0, 0, 0, 1780, 1773, 1, 0, 0, 0, 1780, 1779, 1, 0, 0, 0, 1781, 169, 1, 0, 0, 0, 1782, 1787, 3, 172, 86, 0, 1783, 1784, 5, 151, 0, 0, 1784, 1786, 3, 172, 86, 0, 1785, 1783, 1, 0, 0, 0, 1786, 1789, 1, 0, 0, 0, 1787, 1785, 1, 0, 0, 0, 1787, 1788, 1, 0, 0, 0, 1788, 1791, 1, 0, 0, 0, 1789, 1787, 1, 0, 0, 0, 1790, 1792, 5, 151, 0, 0, 1791, 1790, 1, 0, 0, 0, 1791, 1792, 1, 0, 0, 0, 1792, 171, 1, 0, 0, 0, 1793, 1795, 3, 220, 110, 0, 1794, 1796, 3, 174, 87, 0, 1795, 1794, 1, 0, 0, 0, 1795, 1796, 1, 0, 0, 0, 1796, 1800, 1, 0, 0, 0, 1797, 1798, 5, 123, 0, 0, 1798, 1799, 5, 59, 0, 0, 1799, 1801, 3, 174, 87, 0, 1800, 1797, 1, 0, 0, 0, 1800, 1801, 1, 0, 0, 0, 1801, 1802, 1, 0, 0, 0, 1802, 1807, 5, 6, 0, 0, 1803, 1805, 5, 73, 0, 0, 1804, 1803, 1, 0, 0, 0, 1804, 1805, 1, 0, 0, 0, 1805, 1806, 1, 0, 0, 0, 1806, 1808, 5, 67, 0, 0, 1807, 1804, 1, 0, 0, 0, 1807, 1808, 1, 0, 0, 0, 1808, 1809, 1, 0, 0, 0, 1809, 1810, 5, 165, 0, 0, 1810, 1811, 3, 48, 24, 0, 1811, 1812, 5, 185, 0, 0, 1812, 1818, 1, 0, 0, 0, 1813, 1814, 3, 154, 77, 0, 1814, 1815, 5, 6, 0, 0, 1815, 1816, 3, 220, 110, 0, 1816, 1818, 1, 0, 0, 0, 1817, 1793, 1, 0, 0, 0, 1817, 1813, 1, 0, 0, 0, 1818, 173, 1, 0, 0, 0, 1819, 1820, 5, 165, 0, 0, 1820, 1825, 3, 220, 110, 0, 1821, 1822, 5, 151, 0, 0, 1822, 1824, 3, 220, 110, 0, 1823, 1821, 1, 0, 0, 0, 1824, 1827, 1, 0, 0, 0, 1825, 1823, 1, 0, 0, 0, 1825, 1826, 1, 0, 0, 0, 1826, 1828, 1, 0, 0, 0, 1827, 1825, 1, 0, 0, 0, 1828, 1829, 5, 185, 0, 0, 1829, 175, 1, 0, 0, 0, 1830, 1838, 3, 224, 112, 0, 1831, 1832, 3, 196, 98, 0, 1832, 1833, 5, 155, 0, 0, 1833, 1835, 1, 0, 0, 0, 1834, 1831, 1, 0, 0, 0, 1834, 1835, 1, 0, 0, 0, 1835, 1836, 1, 0, 0, 0, 1836, 1838, 3, 178, 89, 0, 1837, 1830, 1, 0, 0, 0, 1837, 1834, 1, 0, 0, 0, 1838, 177, 1, 0, 0, 0, 1839, 1844, 3, 220, 110, 0, 1840, 1841, 5, 155, 0, 0, 1841, 1843, 3, 220, 110, 0, 1842, 1840, 1, 0, 0, 0, 1843, 1846, 1, 0, 0, 0, 1844, 1842, 1, 0, 0, 0, 1844, 1845, 1, 0, 0, 0, 1845, 179, 1, 0, 0, 0, 1846, 1844, 1, 0, 0, 0, 1847, 1848, 6, 90, -1, 0, 1848, 1861, 3, 196, 98, 0, 1849, 1861, 3, 194, 97, 0, 1850, 1851, 5, 165, 0, 0, 1851, 1852, 3, 48, 24, 0, 1852, 1853, 5, 185, 0, 0, 1853, 1861, 1, 0, 0, 0, 1854, 1855, 5, 165, 0, 0, 1855, 1856, 3, 92, 46, 0, 1856, 1857, 5, 185, 0, 0, 1857, 1861, 1, 0, 0, 0, 1858, 1861, 3, 166, 83, 0, 1859, 1861, 3, 224, 112, 0, 1860, 1847, 1, 0, 0, 0, 1860, 1849, 1, 0, 0, 0, 1860, 1850, 1, 0, 0, 0, 1860, 1854, 1, 0, 0, 0, 1860, 1858, 1, 0, 0, 0, 1860, 1859, 1, 0, 0, 0, 1861, 1895, 1, 0, 0, 0, 1862, 1863, 10, 5, 0, 0, 1863, 1864, 5, 83, 0, 0, 1864, 1865, 5, 165, 0, 0, 1865, 1866, 3, 146, 73, 0, 1866, 1870, 3, 182, 91, 0, 1867, 1868, 5, 42, 0, 0, 1868, 1869, 5, 11, 0, 0, 1869, 1871, 3, 146, 73, 0, 1870, 1867, 1, 0, 0, 0, 1870, 1871, 1, 0, 0, 0, 1871, 1872, 1, 0, 0, 0, 1872, 1873, 5, 185, 0, 0, 1873, 1894, 1, 0, 0, 0, 1874, 1875, 10, 4, 0, 0, 1875, 1878, 5, 122, 0, 0, 1876, 1877, 5, 50, 0, 0, 1877, 1879, 5, 75, 0, 0, 1878, 1876, 1, 0, 0, 0, 1878, 1879, 1, 0, 0, 0, 1879, 1880, 1, 0, 0, 0, 1880, 1881, 5, 165, 0, 0, 1881, 1882, 3, 186, 93, 0, 1882, 1883, 5, 185, 0, 0, 1883, 1894, 1, 0, 0, 0, 1884, 1888, 10, 3, 0, 0, 1885, 1889, 3, 216, 108, 0, 1886, 1887, 5, 6, 0, 0, 1887, 1889, 3, 220, 110, 0, 1888, 1885, 1, 0, 0, 0, 1888, 1886, 1, 0, 0, 0, 1889, 1891, 1, 0, 0, 0, 1890, 1892, 3, 192, 96, 0, 1891, 1890, 1, 0, 0, 0, 1891, 1892, 1, 0, 0, 0, 1892, 1894, 1, 0, 0, 0, 1893, 1862, 1, 0, 0, 0, 1893, 1874, 1, 0, 0, 0, 1893, 1884, 1, 0, 0, 0, 1894, 1897, 1, 0, 0, 0, 1895, 1893, 1, 0, 0, 0, 1895, 1896, 1, 0, 0, 0, 1896, 181, 1, 0, 0, 0, 1897, 1895, 1, 0, 0, 0, 1898, 1900, 5, 38, 0, 0, 1899, 1901, 3, 184, 92, 0, 1900, 1899, 1, 0, 0, 0, 1901, 1902, 1, 0, 0, 0, 1902, 1900, 1, 0, 0, 0, 1902, 1903, 1, 0, 0, 0, 1903, 183, 1, 0, 0, 0, 1904, 1905, 3, 190, 95, 0, 1905, 1906, 5, 51, 0, 0, 1906, 1907, 5, 165, 0, 0, 1907, 1908, 3, 146, 73, 0, 1908, 1909, 5, 185, 0, 0, 1909, 185, 1, 0, 0, 0, 1910, 1915, 3, 188, 94, 0, 1911, 1912, 5, 151, 0, 0, 1912, 1914, 3, 188, 94, 0, 1913, 1911, 1, 0, 0, 0, 1914, 1917, 1, 0, 0, 0, 1915, 1913, 1, 0, 0, 0, 1915, 1916, 1, 0, 0, 0, 1916, 1919, 1, 0, 0, 0, 1917, 1915, 1, 0, 0, 0, 1918, 1920, 5, 151, 0, 0, 1919, 1918, 1, 0, 0, 0, 1919, 1920, 1, 0, 0, 0, 1920, 187, 1, 0, 0, 0, 1921, 1922, 3, 190, 95, 0, 1922, 1923, 5, 38, 0, 0, 1923, 1924, 3, 190, 95, 0, 1924, 1925, 5, 51, 0, 0, 1925, 1926, 5, 165, 0, 0, 1926, 1927, 3, 146, 73, 0, 1927, 1936, 5, 185, 0, 0, 1928, 1929, 3, 190, 95, 0, 1929, 1930, 5, 51, 0, 0, 1930, 1931, 5, 165, 0, 0, 1931, 1932, 3, 146, 73, 0, 1932, 1933, 5, 185, 0, 0, 1933, 1935, 1, 0, 0, 0, 1934, 1928, 1, 0, 0, 0, 1935, 1938, 1, 0, 0, 0, 1936, 1934, 1, 0, 0, 0, 1936, 1937, 1, 0, 0, 0, 1937, 189, 1, 0, 0, 0, 1938, 1936, 1, 0, 0, 0, 1939, 1940, 5, 165, 0, 0, 1940, 1941, 3, 146, 73, 0, 1941, 1942, 5, 185, 0, 0, 1942, 1945, 1, 0, 0, 0, 1943, 1945, 3, 154, 77, 0, 1944, 1939, 1, 0, 0, 0, 1944, 1943, 1, 0, 0, 0, 1945, 191, 1, 0, 0, 0, 1946, 1947, 5, 165, 0, 0, 1947, 1952, 3, 220, 110, 0, 1948, 1949, 5, 151, 0, 0, 1949, 1951, 3, 220, 110, 0, 1950, 1948, 1, 0, 0, 0, 1951, 1954, 1, 0, 0, 0, 1952, 1950, 1, 0, 0, 0, 1952, 1953, 1, 0, 0, 0, 1953, 1955, 1, 0, 0, 0, 1954, 1952, 1, 0, 0, 0, 1955, 1956, 5, 185, 0, 0, 1956, 193, 1, 0, 0, 0, 1957, 1958, 3, 220, 110, 0, 1958, 1960, 5, 165, 0, 0, 1959, 1961, 3, 198, 99, 0, 1960, 1959, 1, 0, 0, 0, 1960, 1961, 1, 0, 0, 0, 1961, 1962, 1, 0, 0, 0, 1962, 1963, 5, 185, 0, 0, 1963, 195, 1, 0, 0, 0, 1964, 1965, 3, 200, 100, 0, 1965, 1966, 5, 155, 0, 0, 1966, 1968, 1, 0, 0, 0, 1967, 1964, 1, 0, 0, 0, 1967, 1968, 1, 0, 0, 0, 1968, 1969, 1, 0, 0, 0, 1969, 1970, 3, 178, 89, 0, 1970, 197, 1, 0, 0, 0, 1971, 1976, 3, 154, 77, 0, 1972, 1973, 5, 151, 0, 0, 1973, 1975, 3, 154, 77, 0, 1974, 1972, 1, 0, 0, 0, 1975, 1978, 1, 0, 0, 0, 1976, 1974, 1, 0, 0, 0, 1976, 1977, 1, 0, 0, 0, 1977, 1980, 1, 0, 0, 0, 1978, 1976, 1, 0, 0, 0, 1979, 1981, 5, 151, 0, 0, 1980, 1979, 1, 0, 0, 0, 1980, 1981, 1, 0, 0, 0, 1981, 199, 1, 0, 0, 0, 1982, 1983, 3, 220, 110, 0, 1983, 201, 1, 0, 0, 0, 1984, 1993, 5, 136, 0, 0, 1985, 1986, 5, 155, 0, 0, 1986, 1993, 7, 14, 0, 0, 1987, 1988, 5, 139, 0, 0, 1988, 1990, 5, 155, 0, 0, 1989, 1991, 7, 14, 0, 0, 1990, 1989, 1, 0, 0, 0, 1990, 1991, 1, 0, 0, 0, 1991, 1993, 1, 0, 0, 0, 1992, 1984, 1, 0, 0, 0, 1992, 1985, 1, 0, 0, 0, 1992, 1987, 1, 0, 0, 0, 1993, 203, 1, 0, 0, 0, 1994, 1996, 7, 15, 0, 0, 1995, 1994, 1, 0, 0, 0, 1995, 1996, 1, 0, 0, 0, 1996, 2005, 1, 0, 0, 0, 1997, 2006, 3, 202, 101, 0, 1998, 2006, 5, 137, 0, 0, 1999, 2006, 5, 138, 0, 0, 2000, 2006, 5, 141, 0, 0, 2001, 2006, 5, 139, 0, 0, 2002, 2006, 5, 140, 0, 0, 2003, 2006, 5, 52, 0, 0, 2004, 2006, 5, 72, 0, 0, 2005, 1997, 1, 0, 0, 0, 2005, 1998, 1, 0, 0, 0, 2005, 1999, 1, 0, 0, 0, 2005, 2000, 1, 0, 0, 0, 2005, 2001, 1, 0, 0, 0, 2005, 2002, 1, 0, 0, 0, 2005, 2003, 1, 0, 0, 0, 2005, 2004, 1, 0, 0, 0, 2006, 205, 1, 0, 0, 0, 2007, 2011, 3, 204, 102, 0, 2008, 2011, 5, 143, 0, 0, 2009, 2011, 5, 74, 0, 0, 2010, 2007, 1, 0, 0, 0, 2010, 2008, 1, 0, 0, 0, 2010, 2009, 1, 0, 0, 0, 2011, 207, 1, 0, 0, 0, 2012, 2013, 7, 16, 0, 0, 2013, 209, 1, 0, 0, 0, 2014, 2015, 7, 17, 0, 0, 2015, 211, 1, 0, 0, 0, 2016, 2017, 7, 18, 0, 0, 2017, 213, 1, 0, 0, 0, 2018, 2019, 7, 19, 0, 0, 2019, 215, 1, 0, 0, 0, 2020, 2024, 5, 134, 0, 0, 2021, 2024, 5, 135, 0, 0, 2022, 2024, 3, 212, 106, 0, 2023, 2020, 1, 0, 0, 0, 2023, 2021, 1, 0, 0, 0, 2023, 2022, 1, 0, 0, 0, 2024, 217, 1, 0, 0, 0, 2025, 2029, 5, 134, 0, 0, 2026, 2029, 5, 135, 0, 0, 2027, 2029, 3, 214, 107, 0, 2028, 2025, 1, 0, 0, 0, 2028, 2026, 1, 0, 0, 0, 2028, 2027, 1, 0, 0, 0, 2029, 219, 1, 0, 0, 0, 2030, 2035, 5, 134, 0, 0, 2031, 2035, 5, 135, 0, 0, 2032, 2035, 3, 208, 104, 0, 2033, 2035, 3, 210, 105, 0, 2034, 2030, 1, 0, 0, 0, 2034, 2031, 1, 0, 0, 0, 2034, 2032, 1, 0, 0, 0, 2034, 2033, 1, 0, 0, 0, 2035, 221, 1, 0, 0, 0, 2036, 2037, 3, 226, 113, 0, 2037, 2038, 5, 157, 0, 0, 2038, 2039, 3, 204, 102, 0, 2039, 223, 1, 0, 0, 0, 2040, 2041, 5, 163, 0, 0, 2041, 2042, 3, 154, 77, 0, 2042, 2043, 5, 183, 0, 0, 2043, 225, 1, 0, 0, 0, 2044, 2047, 5, 143, 0, 0, 2045, 2047, 3, 228, 114, 0, 2046, 2044, 1, 0, 0, 0, 2046, 2045, 1, 0, 0, 0, 2047, 227, 1, 0, 0, 0, 2048, 2052, 5, 178, 0, 0, 2049, 2051, 3, 230, 115, 0, 2050, 2049, 1, 0, 0, 0, 2051, 2054, 1, 0, 0, 0, 2052, 2050, 1, 0, 0, 0, 2052, 2053, 1, 0, 0, 0, 2053, 2055, 1, 0, 0, 0, 2054, 2052, 1, 0, 0, 0, 2055, 2056, 5, 180, 0, 0, 2056, 229, 1, 0, 0, 0, 2057, 2058, 5, 195, 0, 0, 2058, 2059, 3, 154, 77, 0, 2059, 2060, 5, 183, 0, 0, 2060, 2063, 1, 0, 0, 0, 2061, 2063, 5, 194, 0, 0, 2062, 2057, 1, 0, 0, 0, 2062, 2061, 1, 0, 0, 0, 2063, 231, 1, 0, 0, 0, 2064, 2068, 5, 179, 0, 0, 2065, 2067, 3, 234, 117, 0, 2066, 2065, 1, 0, 0, 0, 2067, 2070, 1, 0, 0, 0, 2068, 2066, 1, 0, 0, 0, 2068, 2069, 1, 0, 0, 0, 2069, 2071, 1, 0, 0, 0, 2070, 2068, 1, 0, 0, 0, 2071, 2072, 5, 0, 0, 1, 2072, 233, 1, 0, 0, 0, 2073, 2074, 5, 197, 0, 0, 2074, 2075, 3, 154, 77, 0, 2075, 2076, 5, 183, 0, 0, 2076, 2079, 1, 0, 0, 0, 2077, 2079, 5, 196, 0, 0, 2078, 2073, 1, 0, 0, 0, 2078, 2077, 1, 0, 0, 0, 2079, 235, 1, 0, 0, 0, 259, 239, 246, 254, 261, 265, 278, 282, 285, 290, 297, 301, 310, 315, 324, 332, 339, 343, 349, 354, 362, 369, 375, 387, 390, 398, 412, 416, 421, 424, 439, 445, 450, 456, 462, 467, 473, 479, 484, 486, 494, 498, 501, 506, 510, 514, 519, 523, 530, 533, 537, 540, 544, 547, 550, 553, 556, 559, 562, 566, 570, 573, 576, 580, 583, 586, 589, 593, 596, 600, 608, 614, 635, 659, 666, 671, 685, 694, 699, 713, 717, 721, 726, 730, 735, 749, 758, 766, 769, 775, 783, 786, 791, 798, 808, 816, 822, 824, 828, 833, 840, 843, 847, 851, 854, 860, 862, 865, 869, 873, 876, 878, 880, 885, 896, 901, 905, 911, 916, 923, 928, 932, 936, 939, 945, 949, 953, 958, 964, 966, 973, 981, 984, 987, 1012, 1026, 1042, 1046, 1057, 1061, 1072, 1076, 1083, 1091, 1094, 1099, 1104, 1110, 1116, 1122, 1131, 1135, 1142, 1148, 1155, 1159, 1171, 1176, 1185, 1189, 1222, 1270, 1298, 1362, 1370, 1376, 1379, 1382, 1390, 1400, 1406, 1409, 1412, 1420, 1428, 1431, 1435, 1438, 1443, 1452, 1464, 1472, 1480, 1484, 1502, 1506, 1511, 1522, 1528, 1535, 1547, 1551, 1554, 1563, 1569, 1585, 1606, 1617, 1621, 1651, 1658, 1660, 1662, 1671, 1675, 1684, 1688, 1692, 1697, 1705, 1709, 1714, 1721, 1734, 1743, 1753, 1760, 1767, 1780, 1787, 1791, 1795, 1800, 1804, 1807, 1817, 1825, 1834, 1837, 1844, 1860, 1870, 1878, 1888, 1891, 1893, 1895, 1902, 1915, 1919, 1936, 1944, 1952, 1960, 1967, 1976, 1980, 1990, 1992, 1995, 2005, 2010, 2023, 2028, 2034, 2046, 2052, 2062, 2068, 2078]
\ No newline at end of file
diff --git a/common/hogql_parser/HogQLParser.tokens b/common/hogql_parser/HogQLParser.tokens
index 0c367d1ea732..73381877cef8 100644
--- a/common/hogql_parser/HogQLParser.tokens
+++ b/common/hogql_parser/HogQLParser.tokens
@@ -195,10 +195,14 @@ STRING_TEXT=194
STRING_ESCAPE_TRIGGER=195
FULL_STRING_TEXT=196
FULL_STRING_ESCAPE_TRIGGER=197
-TAG_WS=198
-TAGC_WS=199
-HOGQLX_TEXT_TEXT=200
-HOGQLX_TEXT_WS=201
+TAG_MULTI_LINE_COMMENT=198
+TAG_SINGLE_LINE_COMMENT=199
+TAG_WS=200
+TAGC_MULTI_LINE_COMMENT=201
+TAGC_SINGLE_LINE_COMMENT=202
+TAGC_WS=203
+HOGQLX_TEXT_TEXT=204
+HOGQLX_TEXT_WS=205
'->'=144
'*'=145
'`'=146
diff --git a/common/hogql_parser/package.json b/common/hogql_parser/package.json
index 44e019c12ba8..9de55d990f94 100644
--- a/common/hogql_parser/package.json
+++ b/common/hogql_parser/package.json
@@ -1,6 +1,6 @@
{
"name": "@posthog/hogql-parser",
- "version": "1.3.53",
+ "version": "1.3.65",
"description": "WebAssembly HogQL Parser - Parse HogQL queries in JavaScript/TypeScript",
"keywords": [
"antlr4",
diff --git a/common/hogql_parser/parser_json.cpp b/common/hogql_parser/parser_json.cpp
index 2e0bf1143a0c..3737beebc8f7 100644
--- a/common/hogql_parser/parser_json.cpp
+++ b/common/hogql_parser/parser_json.cpp
@@ -2,7 +2,10 @@
// This file contains the core parser logic that returns JSON representations of ASTs.
// It can be compiled for Python (via parser_python.cpp), WebAssembly, or other platforms.
+#include <cerrno>
+#include <cmath>
#include <cstdint>
+#include <cstdlib>
#include <sstream>
#include <string>
#include <unordered_map>
@@ -2874,11 +2877,21 @@ class HogQLParseTreeJSONConverter : public HogQLParserBaseVisitor {
}
json["value_type"] = "number";
} else if (!is_hex && !is_binary && (text.find(".") != string::npos || text.find("e") != string::npos)) {
- try {
- json["value"] = Json(stod(text)); // Float
- } catch (const std::out_of_range&) {
+ // `stod` collapses overflow + underflow into the same `out_of_range`; use `strtod` + errno to keep them apart.
+ errno = 0;
+ const char* c_str = text.c_str();
+ char* end = nullptr;
+ double value = std::strtod(c_str, &end);
+ bool consumed_all = end == c_str + text.size();
+ if (!consumed_all) {
+ // Malformed input — defer to `stod` so callers see the historical SyntaxError shape.
+ json["value"] = Json(stod(text));
+ } else if (errno == ERANGE && (value == HUGE_VAL || value == -HUGE_VAL)) {
json["value"] = (text[0] == '-') ? "-Infinity" : "Infinity";
json["value_type"] = "number";
+ } else {
+ // No errno (in range) or `ERANGE` underflow (subnormal / 0) — keep the value.
+ json["value"] = Json(value);
}
return json;
} else if (is_binary) {
@@ -2905,18 +2918,19 @@ class HogQLParseTreeJSONConverter : public HogQLParserBaseVisitor {
json["value"] = static_cast<int64_t>(magnitude);
}
return json;
+ } else if (is_hex && ctx->floatingLiteral() != nullptr) {
+ // Hex-float literal (e.g. `0x1p4`) — route through `stod`; the integer path's `stoll` would drop the exponent.
+ json["value"] = Json(stod(text));
+ return json;
} else {
try {
// base 10 (not strtoll base 0): leading zeros are no-ops, never octal — "017" → 17, "09" → 9.
int base = is_hex ? 16 : 10;
json["value"] = static_cast<int64_t>(stoll(text, nullptr, base)); // Integer
} catch (const std::out_of_range&) {
- try {
- json["value"] = Json(stod(text)); // Too large for int64, use float
- } catch (const std::out_of_range&) {
- json["value"] = (text[0] == '-') ? "-Infinity" : "Infinity";
- json["value_type"] = "number";
- }
+ // Beyond Int64 — keep the literal lossless via the `value_type: "number"` string envelope; the deserialiser rebuilds an arbitrary-precision Python int.
+ json["value"] = text;
+ json["value_type"] = "number";
}
return json;
}
diff --git a/common/hogql_parser/setup.py b/common/hogql_parser/setup.py
index 0183a02fe366..924463bd14c7 100644
--- a/common/hogql_parser/setup.py
+++ b/common/hogql_parser/setup.py
@@ -36,7 +36,7 @@ module = Extension(
setup(
name="hogql_parser",
- version="1.3.53",
+ version="1.3.65",
url="https://github.com/PostHog/posthog/tree/master/common/hogql_parser",
description="HogQL parser for internal PostHog use",
author="PostHog Inc.",
diff --git a/frontend/package.json b/frontend/package.json
index a0ba88a58c50..3afe5452ead9 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -66,7 +66,7 @@
"@posthog/docs-onboarding": "workspace:*",
"@posthog/esbuilder": "workspace:*",
"@posthog/hedgehog-mode": "^0.0.48",
- "@posthog/hogql-parser": "1.3.53",
+ "@posthog/hogql-parser": "1.3.61",
"@posthog/hogvm": "workspace:*",
"@posthog/icons": "^0.36.6",
"@posthog/products-access-control": "workspace:*",
diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.json
index dd76e2ebe217..3d696f1507ca 100644
--- a/frontend/src/queries/schema.json
+++ b/frontend/src/queries/schema.json
@@ -20988,6 +20988,11 @@
"optimizeProjections": {
"type": "boolean"
},
+ "parserMode": {
+ "description": "HogQL parser backend; absent → `cpp_only`. `*_shadow` modes return the primary result and sample-compare against the other parser, reporting divergences without failing the request.",
+ "enum": ["cpp_only", "cpp_with_rust_shadow", "rust_with_cpp_shadow", "rust_only"],
+ "type": "string"
+ },
"personsArgMaxVersion": {
"enum": ["auto", "v1", "v2"],
"type": "string"
diff --git a/frontend/src/queries/schema/schema-general.ts b/frontend/src/queries/schema/schema-general.ts
index 2ca779565401..a6c1ff9d4673 100644
--- a/frontend/src/queries/schema/schema-general.ts
+++ b/frontend/src/queries/schema/schema-general.ts
@@ -451,6 +451,8 @@ export interface HogQLQueryModifiers {
/** If these are provided, the query will fail if these skip indexes are not used */
forceClickhouseDataSkippingIndexes?: string[]
inlineCohortCalculation?: 'off' | 'auto' | 'always'
+ /** HogQL parser backend; absent → `cpp_only`. `*_shadow` modes return the primary result and sample-compare against the other parser, reporting divergences without failing the request. */
+ parserMode?: 'cpp_only' | 'cpp_with_rust_shadow' | 'rust_with_cpp_shadow' | 'rust_only'
}
export interface DataWarehouseEventsModifier {
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 0b8163cbca9c..1d49b997a399 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -593,8 +593,8 @@ importers:
specifier: ^0.0.48
'@posthog/hogql-parser':
- specifier: 1.3.53
- version: 1.3.53
+ specifier: 1.3.61
+ version: 1.3.61
'@posthog/hogvm':
specifier: workspace:*
version: link:../common/hogvm/typescript
@@ -9005,8 +9005,8 @@ packages:
react: 18.3.1
react-dom: 18.3.1
- '@posthog/[email protected]':
- resolution: {integrity: sha512-JFwarCrGE+h4c6jq6oC5IgophVNGMdVYYNuJIspwCEc5z/GnPZwT1oOLpodwyibXXlfw4LJXmgZkFAi9NfAdhw==}
+ '@posthog/[email protected]':
+ resolution: {integrity: sha512-QrTmMt2ztVqzN8bPifNG71sC1D6qCPiU5l9crC4JP+1t1Mj+ttZ//bJLphMGH2OWUtuhOdnyh65vxIncMPUELA==}
'@posthog/[email protected]':
resolution: {integrity: sha512-xnusbGNz/5vSMUWdEViWuai7D/gxiMZSDDnP6s/acndMqzN+W4asPUgUNnTUps7OyAS1IKaO9zxhdikFrtooJA==}
@@ -32298,7 +32298,7 @@ snapshots:
transitivePeerDependencies:
- prop-types
- '@posthog/[email protected]': {}
+ '@posthog/[email protected]': {}
dependencies:
diff --git a/posthog/hogql/constants.py b/posthog/hogql/constants.py
index 07ad81d97231..ae284dc92ed7 100644
--- a/posthog/hogql/constants.py
+++ b/posthog/hogql/constants.py
@@ -48,7 +48,7 @@ BREAKDOWN_VALUE_MAX_LENGTH = 400
type HogQLDialect = Literal["hogql", "clickhouse", "postgres", "duckdb"]
-type HogQLParserBackend = Literal["python", "cpp-json"]
+type HogQLParserBackend = Literal["python", "cpp-json", "rust-json"]
class LimitContext(StrEnum):
diff --git a/posthog/hogql/grammar/HogQLLexer.common.g4 b/posthog/hogql/grammar/HogQLLexer.common.g4
index 6e19318dac80..3383ee968934 100644
--- a/posthog/hogql/grammar/HogQLLexer.common.g4
+++ b/posthog/hogql/grammar/HogQLLexer.common.g4
@@ -162,8 +162,9 @@ QUOTED_IDENTIFIER
| QUOTE_DOUBLE ( ~([\\"]) | ESCAPE_CHAR_COMMON | BACKSLASH QUOTE_DOUBLE | (QUOTE_DOUBLE QUOTE_DOUBLE) )* QUOTE_DOUBLE
;
FLOATING_LITERAL
- : HEXADECIMAL_LITERAL DOT HEX_DIGIT* (P | E) (PLUS | DASH)? DEC_DIGIT+
- | HEXADECIMAL_LITERAL (P | E) (PLUS | DASH)? DEC_DIGIT+
+ // Hex-float exponent: strict C99 `p`/`P` only — `e`/`E` stays a hex digit, so `0x1e5` is 485, not a float.
+ : HEXADECIMAL_LITERAL DOT HEX_DIGIT* P (PLUS | DASH)? DEC_DIGIT+
+ | HEXADECIMAL_LITERAL P (PLUS | DASH)? DEC_DIGIT+
| DECIMAL_LITERAL DOT DEC_DIGIT* E (PLUS | DASH)? DEC_DIGIT+
| DOT DECIMAL_LITERAL E (PLUS | DASH)? DEC_DIGIT+
| DECIMAL_LITERAL E (PLUS | DASH)? DEC_DIGIT+
@@ -308,20 +309,29 @@ mode HOGQLX_TAG_OPEN;
TAG_SELF_CLOSE_GT : '/>' -> type(SLASH_GT), popMode; // <tag …/>
TAG_OPEN_GT : '>' -> type(GT), popMode, pushMode(HOGQLX_TEXT); // <tag …>
+// Skip comments between attributes — without these, the recoverable lexer error drops the delimiters and re-tokenises the body as phantom attributes.
+TAG_MULTI_LINE_COMMENT : '/*' .*? '*/' -> skip;
+TAG_SINGLE_LINE_COMMENT : ('--' | '//') ~('\n'|'\r')* ('\n' | '\r' | EOF) -> skip;
+
// minimal token set; map everything back to the default token types
TAG_IDENT : [a-zA-Z_][a-zA-Z0-9_-]* -> type(IDENTIFIER);
TAG_EQ : '=' -> type(EQ_SINGLE);
TAG_STRING : STRING_LITERAL -> type(STRING_LITERAL);
TAG_WS : [ \t\r\n]+ -> channel(HIDDEN);
TAG_LBRACE : '{' -> type(LBRACE), pushMode(DEFAULT_MODE);
+// Catch-all for unmatched bytes (e.g. `#`, `&`, `@`) so the parser fails loudly instead of silently re-tokenising the surrounding text.
+TAG_UNEXPECTED : . -> type(UNEXPECTED_CHARACTER);
// ───────── HOGQLX TAG MODE for closing tags ─────────
mode HOGQLX_TAG_CLOSE;
TAGC_GT : '>' -> type(GT), popMode; // *** no TEXT push ***
+TAGC_MULTI_LINE_COMMENT : '/*' .*? '*/' -> skip;
+TAGC_SINGLE_LINE_COMMENT : ('--' | '//') ~('\n'|'\r')* ('\n' | '\r' | EOF) -> skip;
TAGC_IDENT : [a-zA-Z_][a-zA-Z0-9_-]* -> type(IDENTIFIER);
TAGC_WS : [ \t\r\n]+ -> channel(HIDDEN);
+TAGC_UNEXPECTED : . -> type(UNEXPECTED_CHARACTER);
// ───────── HOGQLX TEXT MODE ─────────
diff --git a/posthog/hogql/grammar/HogQLLexer.interp b/posthog/hogql/grammar/HogQLLexer.interp
index b293f47605b9..1a5faea7ed8e 100644
--- a/posthog/hogql/grammar/HogQLLexer.interp
+++ b/posthog/hogql/grammar/HogQLLexer.interp
@@ -201,6 +201,10 @@ null
null
null
null
+null
+null
+null
+null
token symbolic names:
null
@@ -401,7 +405,11 @@ STRING_TEXT
STRING_ESCAPE_TRIGGER
FULL_STRING_TEXT
FULL_STRING_ESCAPE_TRIGGER
+TAG_MULTI_LINE_COMMENT
+TAG_SINGLE_LINE_COMMENT
TAG_WS
+TAGC_MULTI_LINE_COMMENT
+TAGC_SINGLE_LINE_COMMENT
TAGC_WS
HOGQLX_TEXT_TEXT
HOGQLX_TEXT_WS
@@ -640,14 +648,20 @@ FULL_STRING_TEXT
FULL_STRING_ESCAPE_TRIGGER
TAG_SELF_CLOSE_GT
TAG_OPEN_GT
+TAG_MULTI_LINE_COMMENT
+TAG_SINGLE_LINE_COMMENT
TAG_IDENT
TAG_EQ
TAG_STRING
TAG_WS
TAG_LBRACE
+TAG_UNEXPECTED
TAGC_GT
+TAGC_MULTI_LINE_COMMENT
+TAGC_SINGLE_LINE_COMMENT
TAGC_IDENT
TAGC_WS
+TAGC_UNEXPECTED
HOGQLX_TEXT_TEXT
HOGQLX_TEXT_LBRACE
HOGQLX_TEXT_LT_SLASH
@@ -667,4 +681,4 @@ HOGQLX_TAG_CLOSE
HOGQLX_TEXT
atn:
-[4, 0, 201, 1927, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 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, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103, 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, 108, 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 2, 111, 7, 111, 2, 112, 7, 112, 2, 113, 7, 113, 2, 114, 7, 114, 2, 115, 7, 115, 2, 116, 7, 116, 2, 117, 7, 117, 2, 118, 7, 118, 2, 119, 7, 119, 2, 120, 7, 120, 2, 121, 7, 121, 2, 122, 7, 122, 2, 123, 7, 123, 2, 124, 7, 124, 2, 125, 7, 125, 2, 126, 7, 126, 2, 127, 7, 127, 2, 128, 7, 128, 2, 129, 7, 129, 2, 130, 7, 130, 2, 131, 7, 131, 2, 132, 7, 132, 2, 133, 7, 133, 2, 134, 7, 134, 2, 135, 7, 135, 2, 136, 7, 136, 2, 137, 7, 137, 2, 138, 7, 138, 2, 139, 7, 139, 2, 140, 7, 140, 2, 141, 7, 141, 2, 142, 7, 142, 2, 143, 7, 143, 2, 144, 7, 144, 2, 145, 7, 145, 2, 146, 7, 146, 2, 147, 7, 147, 2, 148, 7, 148, 2, 149, 7, 149, 2, 150, 7, 150, 2, 151, 7, 151, 2, 152, 7, 152, 2, 153, 7, 153, 2, 154, 7, 154, 2, 155, 7, 155, 2, 156, 7, 156, 2, 157, 7, 157, 2, 158, 7, 158, 2, 159, 7, 159, 2, 160, 7, 160, 2, 161, 7, 161, 2, 162, 7, 162, 2, 163, 7, 163, 2, 164, 7, 164, 2, 165, 7, 165, 2, 166, 7, 166, 2, 167, 7, 167, 2, 168, 7, 168, 2, 169, 7, 169, 2, 170, 7, 170, 2, 171, 7, 171, 2, 172, 7, 172, 2, 173, 7, 173, 2, 174, 7, 174, 2, 175, 7, 175, 2, 176, 7, 176, 2, 177, 7, 177, 2, 178, 7, 178, 2, 179, 7, 179, 2, 180, 7, 180, 2, 181, 7, 181, 2, 182, 7, 182, 2, 183, 7, 183, 2, 184, 7, 184, 2, 185, 7, 185, 2, 186, 7, 186, 2, 187, 7, 187, 2, 188, 7, 188, 2, 189, 7, 189, 2, 190, 7, 190, 2, 191, 7, 191, 2, 192, 7, 192, 2, 193, 7, 193, 2, 194, 7, 194, 2, 195, 7, 195, 2, 196, 7, 196, 2, 197, 7, 197, 2, 198, 7, 198, 2, 199, 7, 199, 2, 200, 7, 200, 2, 201, 7, 201, 2, 202, 7, 202, 2, 203, 7, 203, 2, 204, 7, 204, 2, 205, 7, 205, 2, 206, 7, 206, 2, 207, 7, 207, 2, 208, 7, 208, 2, 209, 7, 209, 2, 210, 7, 210, 2, 211, 7, 211, 2, 212, 7, 212, 2, 213, 7, 213, 2, 214, 7, 214, 2, 215, 7, 215, 2, 216, 7, 216, 2, 217, 7, 217, 2, 218, 7, 218, 2, 219, 7, 219, 2, 220, 7, 220, 2, 221, 7, 221, 2, 222, 7, 222, 2, 223, 7, 223, 2, 224, 7, 224, 2, 225, 7, 225, 2, 226, 7, 226, 2, 227, 7, 227, 2, 228, 7, 228, 2, 229, 7, 229, 2, 230, 7, 230, 2, 231, 7, 231, 2, 232, 7, 232, 2, 233, 7, 233, 2, 234, 7, 234, 2, 235, 7, 235, 2, 236, 7, 236, 2, 237, 7, 237, 2, 238, 7, 238, 2, 239, 7, 239, 2, 240, 7, 240, 2, 241, 7, 241, 2, 242, 7, 242, 2, 243, 7, 243, 2, 244, 7, 244, 2, 245, 7, 245, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 539, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 50, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 3, 51, 819, 8, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 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, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 56, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, 1, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 62, 1, 62, 1, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 71, 1, 71, 1, 71, 1, 71, 1, 72, 1, 72, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 75, 1, 75, 1, 75, 1, 75, 1, 75, 1, 75, 1, 75, 1, 76, 1, 76, 1, 76, 1, 77, 1, 77, 1, 77, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 82, 1, 82, 1, 82, 1, 82, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 94, 1, 94, 1, 94, 1, 94, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 109, 1, 109, 1, 109, 1, 109, 1, 109, 1, 109, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 111, 1, 111, 1, 111, 1, 112, 1, 112, 1, 112, 1, 112, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 115, 1, 115, 1, 115, 1, 115, 1, 115, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 117, 1, 117, 1, 117, 1, 117, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 120, 1, 120, 1, 120, 1, 120, 1, 120, 1, 120, 1, 121, 1, 121, 1, 121, 1, 121, 1, 121, 1, 121, 1, 121, 1, 121, 1, 122, 1, 122, 1, 122, 1, 122, 1, 122, 1, 122, 1, 123, 1, 123, 1, 123, 1, 123, 1, 123, 1, 123, 1, 123, 1, 124, 1, 124, 1, 124, 1, 124, 1, 124, 1, 125, 1, 125, 1, 125, 1, 125, 1, 125, 1, 126, 1, 126, 1, 126, 1, 126, 1, 126, 1, 126, 1, 127, 1, 127, 1, 127, 1, 127, 1, 127, 1, 127, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 1, 129, 1, 129, 1, 129, 1, 129, 1, 129, 1, 130, 1, 130, 1, 130, 1, 130, 1, 130, 1, 130, 1, 130, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 3, 131, 1348, 8, 131, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 3, 132, 1382, 8, 132, 1, 133, 1, 133, 1, 133, 3, 133, 1387, 8, 133, 1, 133, 1, 133, 1, 133, 1, 133, 5, 133, 1393, 8, 133, 10, 133, 12, 133, 1396, 9, 133, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 5, 134, 1407, 8, 134, 10, 134, 12, 134, 1410, 9, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 5, 134, 1423, 8, 134, 10, 134, 12, 134, 1426, 9, 134, 1, 134, 1, 134, 3, 134, 1430, 8, 134, 1, 135, 1, 135, 1, 135, 5, 135, 1435, 8, 135, 10, 135, 12, 135, 1438, 9, 135, 1, 135, 1, 135, 3, 135, 1442, 8, 135, 1, 135, 1, 135, 3, 135, 1446, 8, 135, 1, 135, 4, 135, 1449, 8, 135, 11, 135, 12, 135, 1450, 1, 135, 1, 135, 1, 135, 3, 135, 1456, 8, 135, 1, 135, 1, 135, 3, 135, 1460, 8, 135, 1, 135, 4, 135, 1463, 8, 135, 11, 135, 12, 135, 1464, 1, 135, 1, 135, 1, 135, 5, 135, 1470, 8, 135, 10, 135, 12, 135, 1473, 9, 135, 1, 135, 1, 135, 1, 135, 3, 135, 1478, 8, 135, 1, 135, 4, 135, 1481, 8, 135, 11, 135, 12, 135, 1482, 1, 135, 1, 135, 1, 135, 1, 135, 1, 135, 3, 135, 1490, 8, 135, 1, 135, 4, 135, 1493, 8, 135, 11, 135, 12, 135, 1494, 1, 135, 1, 135, 1, 135, 1, 135, 3, 135, 1501, 8, 135, 1, 135, 4, 135, 1504, 8, 135, 11, 135, 12, 135, 1505, 3, 135, 1508, 8, 135, 1, 136, 1, 136, 1, 136, 4, 136, 1513, 8, 136, 11, 136, 12, 136, 1514, 1, 137, 1, 137, 4, 137, 1519, 8, 137, 11, 137, 12, 137, 1520, 1, 138, 4, 138, 1524, 8, 138, 11, 138, 12, 138, 1525, 1, 139, 1, 139, 1, 139, 4, 139, 1531, 8, 139, 11, 139, 12, 139, 1532, 1, 140, 1, 140, 1, 140, 4, 140, 1538, 8, 140, 11, 140, 12, 140, 1539, 1, 141, 1, 141, 1, 141, 4, 141, 1545, 8, 141, 11, 141, 12, 141, 1546, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 5, 142, 1558, 8, 142, 10, 142, 12, 142, 1561, 9, 142, 1, 142, 1, 142, 1, 143, 1, 143, 1, 144, 1, 144, 1, 145, 1, 145, 1, 146, 1, 146, 1, 147, 1, 147, 1, 148, 1, 148, 1, 149, 1, 149, 1, 150, 1, 150, 1, 151, 1, 151, 1, 152, 1, 152, 1, 153, 1, 153, 1, 154, 1, 154, 1, 155, 1, 155, 1, 156, 1, 156, 1, 157, 1, 157, 1, 158, 1, 158, 1, 159, 1, 159, 1, 160, 1, 160, 1, 161, 1, 161, 1, 162, 1, 162, 1, 163, 1, 163, 1, 164, 1, 164, 1, 165, 1, 165, 1, 166, 1, 166, 1, 167, 1, 167, 1, 168, 1, 168, 1, 169, 1, 169, 1, 170, 1, 170, 1, 171, 1, 171, 1, 172, 1, 172, 1, 173, 1, 173, 1, 174, 1, 174, 1, 174, 1, 175, 1, 175, 1, 176, 1, 176, 1, 177, 1, 177, 1, 178, 1, 178, 1, 178, 1, 179, 1, 179, 1, 179, 1, 180, 1, 180, 1, 181, 1, 181, 1, 182, 1, 182, 1, 182, 1, 183, 1, 183, 1, 184, 1, 184, 1, 185, 1, 185, 1, 186, 1, 186, 1, 186, 1, 187, 1, 187, 1, 188, 1, 188, 1, 188, 1, 189, 1, 189, 1, 190, 1, 190, 1, 191, 1, 191, 1, 191, 1, 192, 1, 192, 1, 192, 1, 192, 1, 193, 1, 193, 1, 193, 1, 193, 1, 194, 1, 194, 1, 195, 1, 195, 1, 196, 1, 196, 1, 196, 1, 197, 1, 197, 1, 197, 1, 197, 1, 197, 1, 197, 1, 198, 1, 198, 1, 198, 1, 198, 1, 198, 1, 198, 1, 199, 1, 199, 1, 200, 1, 200, 1, 200, 1, 201, 1, 201, 1, 201, 1, 201, 3, 201, 1706, 8, 201, 1, 202, 1, 202, 1, 202, 1, 202, 1, 203, 1, 203, 1, 203, 1, 204, 1, 204, 1, 204, 1, 205, 1, 205, 1, 205, 1, 206, 1, 206, 1, 207, 1, 207, 1, 208, 1, 208, 1, 209, 1, 209, 1, 210, 1, 210, 1, 210, 1, 210, 1, 210, 1, 211, 1, 211, 1, 211, 1, 211, 1, 211, 1, 212, 1, 212, 1, 213, 1, 213, 1, 214, 1, 214, 1, 214, 1, 215, 1, 215, 1, 215, 1, 215, 1, 216, 1, 216, 1, 217, 1, 217, 1, 218, 1, 218, 1, 219, 1, 219, 1, 220, 1, 220, 1, 220, 1, 221, 1, 221, 1, 222, 1, 222, 1, 222, 1, 222, 5, 222, 1767, 8, 222, 10, 222, 12, 222, 1770, 9, 222, 1, 222, 1, 222, 1, 222, 1, 222, 1, 222, 1, 223, 1, 223, 1, 223, 1, 223, 3, 223, 1781, 8, 223, 1, 223, 5, 223, 1784, 8, 223, 10, 223, 12, 223, 1787, 9, 223, 1, 223, 3, 223, 1790, 8, 223, 1, 223, 1, 223, 1, 224, 1, 224, 1, 224, 1, 224, 1, 225, 1, 225, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 4, 226, 1811, 8, 226, 11, 226, 12, 226, 1812, 1, 227, 1, 227, 1, 227, 1, 227, 1, 228, 1, 228, 1, 228, 1, 228, 1, 228, 1, 229, 1, 229, 1, 229, 1, 229, 1, 229, 4, 229, 1829, 8, 229, 11, 229, 12, 229, 1830, 1, 230, 1, 230, 1, 230, 1, 230, 1, 231, 1, 231, 1, 231, 1, 231, 1, 231, 1, 231, 1, 232, 1, 232, 1, 232, 1, 232, 1, 232, 1, 232, 1, 233, 1, 233, 5, 233, 1851, 8, 233, 10, 233, 12, 233, 1854, 9, 233, 1, 233, 1, 233, 1, 234, 1, 234, 1, 234, 1, 234, 1, 235, 1, 235, 1, 235, 1, 235, 1, 236, 4, 236, 1867, 8, 236, 11, 236, 12, 236, 1868, 1, 236, 1, 236, 1, 237, 1, 237, 1, 237, 1, 237, 1, 237, 1, 238, 1, 238, 1, 238, 1, 238, 1, 238, 1, 239, 1, 239, 5, 239, 1885, 8, 239, 10, 239, 12, 239, 1888, 9, 239, 1, 239, 1, 239, 1, 240, 4, 240, 1893, 8, 240, 11, 240, 12, 240, 1894, 1, 240, 1, 240, 1, 241, 4, 241, 1900, 8, 241, 11, 241, 12, 241, 1901, 1, 242, 1, 242, 1, 242, 1, 242, 1, 242, 1, 243, 1, 243, 1, 243, 1, 243, 1, 243, 1, 243, 1, 243, 1, 244, 1, 244, 1, 244, 1, 244, 1, 244, 1, 245, 4, 245, 1922, 8, 245, 11, 245, 12, 245, 1923, 1, 245, 1, 245, 1, 1768, 0, 246, 6, 1, 8, 2, 10, 3, 12, 4, 14, 5, 16, 6, 18, 7, 20, 8, 22, 9, 24, 10, 26, 11, 28, 12, 30, 13, 32, 14, 34, 15, 36, 16, 38, 17, 40, 18, 42, 19, 44, 20, 46, 21, 48, 22, 50, 23, 52, 24, 54, 25, 56, 26, 58, 27, 60, 28, 62, 29, 64, 30, 66, 31, 68, 32, 70, 33, 72, 34, 74, 35, 76, 36, 78, 37, 80, 38, 82, 39, 84, 40, 86, 41, 88, 42, 90, 43, 92, 44, 94, 45, 96, 46, 98, 47, 100, 48, 102, 49, 104, 50, 106, 51, 108, 52, 110, 53, 112, 54, 114, 55, 116, 56, 118, 57, 120, 58, 122, 59, 124, 60, 126, 61, 128, 62, 130, 63, 132, 64, 134, 65, 136, 66, 138, 67, 140, 68, 142, 69, 144, 70, 146, 71, 148, 72, 150, 73, 152, 74, 154, 75, 156, 76, 158, 77, 160, 78, 162, 79, 164, 80, 166, 81, 168, 82, 170, 83, 172, 84, 174, 85, 176, 86, 178, 87, 180, 88, 182, 89, 184, 90, 186, 91, 188, 92, 190, 93, 192, 94, 194, 95, 196, 96, 198, 97, 200, 98, 202, 99, 204, 100, 206, 101, 208, 102, 210, 103, 212, 104, 214, 105, 216, 106, 218, 107, 220, 108, 222, 109, 224, 110, 226, 111, 228, 112, 230, 113, 232, 114, 234, 115, 236, 116, 238, 117, 240, 118, 242, 119, 244, 120, 246, 121, 248, 122, 250, 123, 252, 124, 254, 125, 256, 126, 258, 127, 260, 128, 262, 129, 264, 130, 266, 131, 268, 132, 270, 133, 272, 134, 274, 135, 276, 136, 278, 137, 280, 138, 282, 139, 284, 140, 286, 141, 288, 142, 290, 143, 292, 0, 294, 0, 296, 0, 298, 0, 300, 0, 302, 0, 304, 0, 306, 0, 308, 0, 310, 0, 312, 0, 314, 0, 316, 0, 318, 0, 320, 0, 322, 0, 324, 0, 326, 0, 328, 0, 330, 0, 332, 0, 334, 0, 336, 0, 338, 0, 340, 0, 342, 0, 344, 0, 346, 0, 348, 0, 350, 0, 352, 0, 354, 144, 356, 145, 358, 146, 360, 147, 362, 148, 364, 149, 366, 150, 368, 151, 370, 152, 372, 153, 374, 154, 376, 155, 378, 156, 380, 157, 382, 158, 384, 159, 386, 160, 388, 161, 390, 162, 392, 163, 394, 164, 396, 165, 398, 166, 400, 0, 402, 0, 404, 167, 406, 168, 408, 169, 410, 170, 412, 171, 414, 172, 416, 173, 418, 174, 420, 175, 422, 176, 424, 177, 426, 178, 428, 179, 430, 180, 432, 181, 434, 182, 436, 183, 438, 184, 440, 185, 442, 186, 444, 187, 446, 188, 448, 189, 450, 190, 452, 191, 454, 192, 456, 193, 458, 194, 460, 195, 462, 0, 464, 196, 466, 197, 468, 0, 470, 0, 472, 0, 474, 0, 476, 0, 478, 198, 480, 0, 482, 0, 484, 0, 486, 199, 488, 200, 490, 0, 492, 0, 494, 0, 496, 201, 6, 0, 1, 2, 3, 4, 5, 43, 2, 0, 92, 92, 96, 96, 2, 0, 34, 34, 92, 92, 2, 0, 79, 79, 111, 111, 2, 0, 66, 66, 98, 98, 2, 0, 39, 39, 92, 92, 2, 0, 65, 65, 97, 97, 2, 0, 67, 67, 99, 99, 2, 0, 68, 68, 100, 100, 2, 0, 69, 69, 101, 101, 2, 0, 70, 70, 102, 102, 2, 0, 71, 71, 103, 103, 2, 0, 72, 72, 104, 104, 2, 0, 73, 73, 105, 105, 2, 0, 74, 74, 106, 106, 2, 0, 75, 75, 107, 107, 2, 0, 76, 76, 108, 108, 2, 0, 77, 77, 109, 109, 2, 0, 78, 78, 110, 110, 2, 0, 80, 80, 112, 112, 2, 0, 81, 81, 113, 113, 2, 0, 82, 82, 114, 114, 2, 0, 83, 83, 115, 115, 2, 0, 84, 84, 116, 116, 2, 0, 85, 85, 117, 117, 2, 0, 86, 86, 118, 118, 2, 0, 87, 87, 119, 119, 2, 0, 88, 88, 120, 120, 2, 0, 89, 89, 121, 121, 2, 0, 90, 90, 122, 122, 2, 0, 65, 90, 97, 122, 1, 0, 48, 49, 1, 0, 48, 55, 1, 0, 48, 57, 3, 0, 48, 57, 65, 70, 97, 102, 2, 0, 10, 10, 13, 13, 2, 1, 10, 10, 13, 13, 11, 0, 9, 13, 32, 32, 133, 133, 160, 160, 5760, 5760, 8192, 8202, 8232, 8233, 8239, 8239, 8287, 8287, 12288, 12288, 65279, 65279, 3, 0, 39, 39, 92, 92, 123, 123, 1, 0, 123, 123, 3, 0, 65, 90, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, 95, 95, 97, 122, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 60, 60, 123, 123, 1968, 0, 6, 1, 0, 0, 0, 0, 8, 1, 0, 0, 0, 0, 10, 1, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 14, 1, 0, 0, 0, 0, 16, 1, 0, 0, 0, 0, 18, 1, 0, 0, 0, 0, 20, 1, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 24, 1, 0, 0, 0, 0, 26, 1, 0, 0, 0, 0, 28, 1, 0, 0, 0, 0, 30, 1, 0, 0, 0, 0, 32, 1, 0, 0, 0, 0, 34, 1, 0, 0, 0, 0, 36, 1, 0, 0, 0, 0, 38, 1, 0, 0, 0, 0, 40, 1, 0, 0, 0, 0, 42, 1, 0, 0, 0, 0, 44, 1, 0, 0, 0, 0, 46, 1, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 50, 1, 0, 0, 0, 0, 52, 1, 0, 0, 0, 0, 54, 1, 0, 0, 0, 0, 56, 1, 0, 0, 0, 0, 58, 1, 0, 0, 0, 0, 60, 1, 0, 0, 0, 0, 62, 1, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 66, 1, 0, 0, 0, 0, 68, 1, 0, 0, 0, 0, 70, 1, 0, 0, 0, 0, 72, 1, 0, 0, 0, 0, 74, 1, 0, 0, 0, 0, 76, 1, 0, 0, 0, 0, 78, 1, 0, 0, 0, 0, 80, 1, 0, 0, 0, 0, 82, 1, 0, 0, 0, 0, 84, 1, 0, 0, 0, 0, 86, 1, 0, 0, 0, 0, 88, 1, 0, 0, 0, 0, 90, 1, 0, 0, 0, 0, 92, 1, 0, 0, 0, 0, 94, 1, 0, 0, 0, 0, 96, 1, 0, 0, 0, 0, 98, 1, 0, 0, 0, 0, 100, 1, 0, 0, 0, 0, 102, 1, 0, 0, 0, 0, 104, 1, 0, 0, 0, 0, 106, 1, 0, 0, 0, 0, 108, 1, 0, 0, 0, 0, 110, 1, 0, 0, 0, 0, 112, 1, 0, 0, 0, 0, 114, 1, 0, 0, 0, 0, 116, 1, 0, 0, 0, 0, 118, 1, 0, 0, 0, 0, 120, 1, 0, 0, 0, 0, 122, 1, 0, 0, 0, 0, 124, 1, 0, 0, 0, 0, 126, 1, 0, 0, 0, 0, 128, 1, 0, 0, 0, 0, 130, 1, 0, 0, 0, 0, 132, 1, 0, 0, 0, 0, 134, 1, 0, 0, 0, 0, 136, 1, 0, 0, 0, 0, 138, 1, 0, 0, 0, 0, 140, 1, 0, 0, 0, 0, 142, 1, 0, 0, 0, 0, 144, 1, 0, 0, 0, 0, 146, 1, 0, 0, 0, 0, 148, 1, 0, 0, 0, 0, 150, 1, 0, 0, 0, 0, 152, 1, 0, 0, 0, 0, 154, 1, 0, 0, 0, 0, 156, 1, 0, 0, 0, 0, 158, 1, 0, 0, 0, 0, 160, 1, 0, 0, 0, 0, 162, 1, 0, 0, 0, 0, 164, 1, 0, 0, 0, 0, 166, 1, 0, 0, 0, 0, 168, 1, 0, 0, 0, 0, 170, 1, 0, 0, 0, 0, 172, 1, 0, 0, 0, 0, 174, 1, 0, 0, 0, 0, 176, 1, 0, 0, 0, 0, 178, 1, 0, 0, 0, 0, 180, 1, 0, 0, 0, 0, 182, 1, 0, 0, 0, 0, 184, 1, 0, 0, 0, 0, 186, 1, 0, 0, 0, 0, 188, 1, 0, 0, 0, 0, 190, 1, 0, 0, 0, 0, 192, 1, 0, 0, 0, 0, 194, 1, 0, 0, 0, 0, 196, 1, 0, 0, 0, 0, 198, 1, 0, 0, 0, 0, 200, 1, 0, 0, 0, 0, 202, 1, 0, 0, 0, 0, 204, 1, 0, 0, 0, 0, 206, 1, 0, 0, 0, 0, 208, 1, 0, 0, 0, 0, 210, 1, 0, 0, 0, 0, 212, 1, 0, 0, 0, 0, 214, 1, 0, 0, 0, 0, 216, 1, 0, 0, 0, 0, 218, 1, 0, 0, 0, 0, 220, 1, 0, 0, 0, 0, 222, 1, 0, 0, 0, 0, 224, 1, 0, 0, 0, 0, 226, 1, 0, 0, 0, 0, 228, 1, 0, 0, 0, 0, 230, 1, 0, 0, 0, 0, 232, 1, 0, 0, 0, 0, 234, 1, 0, 0, 0, 0, 236, 1, 0, 0, 0, 0, 238, 1, 0, 0, 0, 0, 240, 1, 0, 0, 0, 0, 242, 1, 0, 0, 0, 0, 244, 1, 0, 0, 0, 0, 246, 1, 0, 0, 0, 0, 248, 1, 0, 0, 0, 0, 250, 1, 0, 0, 0, 0, 252, 1, 0, 0, 0, 0, 254, 1, 0, 0, 0, 0, 256, 1, 0, 0, 0, 0, 258, 1, 0, 0, 0, 0, 260, 1, 0, 0, 0, 0, 262, 1, 0, 0, 0, 0, 264, 1, 0, 0, 0, 0, 266, 1, 0, 0, 0, 0, 268, 1, 0, 0, 0, 0, 270, 1, 0, 0, 0, 0, 272, 1, 0, 0, 0, 0, 274, 1, 0, 0, 0, 0, 276, 1, 0, 0, 0, 0, 278, 1, 0, 0, 0, 0, 280, 1, 0, 0, 0, 0, 282, 1, 0, 0, 0, 0, 284, 1, 0, 0, 0, 0, 286, 1, 0, 0, 0, 0, 288, 1, 0, 0, 0, 0, 290, 1, 0, 0, 0, 0, 354, 1, 0, 0, 0, 0, 356, 1, 0, 0, 0, 0, 358, 1, 0, 0, 0, 0, 360, 1, 0, 0, 0, 0, 362, 1, 0, 0, 0, 0, 364, 1, 0, 0, 0, 0, 366, 1, 0, 0, 0, 0, 368, 1, 0, 0, 0, 0, 370, 1, 0, 0, 0, 0, 372, 1, 0, 0, 0, 0, 374, 1, 0, 0, 0, 0, 376, 1, 0, 0, 0, 0, 378, 1, 0, 0, 0, 0, 380, 1, 0, 0, 0, 0, 382, 1, 0, 0, 0, 0, 384, 1, 0, 0, 0, 0, 386, 1, 0, 0, 0, 0, 388, 1, 0, 0, 0, 0, 390, 1, 0, 0, 0, 0, 392, 1, 0, 0, 0, 0, 394, 1, 0, 0, 0, 0, 396, 1, 0, 0, 0, 0, 398, 1, 0, 0, 0, 0, 400, 1, 0, 0, 0, 0, 402, 1, 0, 0, 0, 0, 404, 1, 0, 0, 0, 0, 406, 1, 0, 0, 0, 0, 408, 1, 0, 0, 0, 0, 410, 1, 0, 0, 0, 0, 412, 1, 0, 0, 0, 0, 414, 1, 0, 0, 0, 0, 416, 1, 0, 0, 0, 0, 418, 1, 0, 0, 0, 0, 420, 1, 0, 0, 0, 0, 422, 1, 0, 0, 0, 0, 424, 1, 0, 0, 0, 0, 426, 1, 0, 0, 0, 0, 428, 1, 0, 0, 0, 0, 430, 1, 0, 0, 0, 0, 432, 1, 0, 0, 0, 0, 434, 1, 0, 0, 0, 0, 436, 1, 0, 0, 0, 0, 438, 1, 0, 0, 0, 0, 440, 1, 0, 0, 0, 0, 442, 1, 0, 0, 0, 0, 444, 1, 0, 0, 0, 0, 446, 1, 0, 0, 0, 0, 448, 1, 0, 0, 0, 0, 450, 1, 0, 0, 0, 0, 452, 1, 0, 0, 0, 0, 454, 1, 0, 0, 0, 0, 456, 1, 0, 0, 0, 1, 458, 1, 0, 0, 0, 1, 460, 1, 0, 0, 0, 1, 462, 1, 0, 0, 0, 2, 464, 1, 0, 0, 0, 2, 466, 1, 0, 0, 0, 3, 468, 1, 0, 0, 0, 3, 470, 1, 0, 0, 0, 3, 472, 1, 0, 0, 0, 3, 474, 1, 0, 0, 0, 3, 476, 1, 0, 0, 0, 3, 478, 1, 0, 0, 0, 3, 480, 1, 0, 0, 0, 4, 482, 1, 0, 0, 0, 4, 484, 1, 0, 0, 0, 4, 486, 1, 0, 0, 0, 5, 488, 1, 0, 0, 0, 5, 490, 1, 0, 0, 0, 5, 492, 1, 0, 0, 0, 5, 494, 1, 0, 0, 0, 5, 496, 1, 0, 0, 0, 6, 498, 1, 0, 0, 0, 8, 502, 1, 0, 0, 0, 10, 506, 1, 0, 0, 0, 12, 511, 1, 0, 0, 0, 14, 515, 1, 0, 0, 0, 16, 521, 1, 0, 0, 0, 18, 538, 1, 0, 0, 0, 20, 540, 1, 0, 0, 0, 22, 545, 1, 0, 0, 0, 24, 553, 1, 0, 0, 0, 26, 558, 1, 0, 0, 0, 28, 561, 1, 0, 0, 0, 30, 566, 1, 0, 0, 0, 32, 571, 1, 0, 0, 0, 34, 577, 1, 0, 0, 0, 36, 584, 1, 0, 0, 0, 38, 592, 1, 0, 0, 0, 40, 600, 1, 0, 0, 0, 42, 606, 1, 0, 0, 0, 44, 611, 1, 0, 0, 0, 46, 619, 1, 0, 0, 0, 48, 624, 1, 0, 0, 0, 50, 628, 1, 0, 0, 0, 52, 633, 1, 0, 0, 0, 54, 644, 1, 0, 0, 0, 56, 653, 1, 0, 0, 0, 58, 658, 1, 0, 0, 0, 60, 662, 1, 0, 0, 0, 62, 669, 1, 0, 0, 0, 64, 677, 1, 0, 0, 0, 66, 685, 1, 0, 0, 0, 68, 691, 1, 0, 0, 0, 70, 696, 1, 0, 0, 0, 72, 703, 1, 0, 0, 0, 74, 711, 1, 0, 0, 0, 76, 717, 1, 0, 0, 0, 78, 720, 1, 0, 0, 0, 80, 730, 1, 0, 0, 0, 82, 734, 1, 0, 0, 0, 84, 739, 1, 0, 0, 0, 86, 744, 1, 0, 0, 0, 88, 748, 1, 0, 0, 0, 90, 754, 1, 0, 0, 0, 92, 763, 1, 0, 0, 0, 94, 770, 1, 0, 0, 0, 96, 775, 1, 0, 0, 0, 98, 778, 1, 0, 0, 0, 100, 781, 1, 0, 0, 0, 102, 787, 1, 0, 0, 0, 104, 794, 1, 0, 0, 0, 106, 802, 1, 0, 0, 0, 108, 818, 1, 0, 0, 0, 110, 820, 1, 0, 0, 0, 112, 826, 1, 0, 0, 0, 114, 836, 1, 0, 0, 0, 116, 848, 1, 0, 0, 0, 118, 857, 1, 0, 0, 0, 120, 860, 1, 0, 0, 0, 122, 865, 1, 0, 0, 0, 124, 869, 1, 0, 0, 0, 126, 876, 1, 0, 0, 0, 128, 881, 1, 0, 0, 0, 130, 889, 1, 0, 0, 0, 132, 894, 1, 0, 0, 0, 134, 898, 1, 0, 0, 0, 136, 903, 1, 0, 0, 0, 138, 909, 1, 0, 0, 0, 140, 922, 1, 0, 0, 0, 142, 929, 1, 0, 0, 0, 144, 935, 1, 0, 0, 0, 146, 940, 1, 0, 0, 0, 148, 948, 1, 0, 0, 0, 150, 952, 1, 0, 0, 0, 152, 956, 1, 0, 0, 0, 154, 961, 1, 0, 0, 0, 156, 967, 1, 0, 0, 0, 158, 974, 1, 0, 0, 0, 160, 977, 1, 0, 0, 0, 162, 980, 1, 0, 0, 0, 164, 986, 1, 0, 0, 0, 166, 992, 1, 0, 0, 0, 168, 997, 1, 0, 0, 0, 170, 1007, 1, 0, 0, 0, 172, 1013, 1, 0, 0, 0, 174, 1024, 1, 0, 0, 0, 176, 1034, 1, 0, 0, 0, 178, 1043, 1, 0, 0, 0, 180, 1051, 1, 0, 0, 0, 182, 1059, 1, 0, 0, 0, 184, 1065, 1, 0, 0, 0, 186, 1075, 1, 0, 0, 0, 188, 1083, 1, 0, 0, 0, 190, 1090, 1, 0, 0, 0, 192, 1096, 1, 0, 0, 0, 194, 1103, 1, 0, 0, 0, 196, 1107, 1, 0, 0, 0, 198, 1112, 1, 0, 0, 0, 200, 1119, 1, 0, 0, 0, 202, 1126, 1, 0, 0, 0, 204, 1133, 1, 0, 0, 0, 206, 1138, 1, 0, 0, 0, 208, 1143, 1, 0, 0, 0, 210, 1152, 1, 0, 0, 0, 212, 1157, 1, 0, 0, 0, 214, 1167, 1, 0, 0, 0, 216, 1172, 1, 0, 0, 0, 218, 1178, 1, 0, 0, 0, 220, 1183, 1, 0, 0, 0, 222, 1193, 1, 0, 0, 0, 224, 1198, 1, 0, 0, 0, 226, 1204, 1, 0, 0, 0, 228, 1209, 1, 0, 0, 0, 230, 1212, 1, 0, 0, 0, 232, 1216, 1, 0, 0, 0, 234, 1223, 1, 0, 0, 0, 236, 1232, 1, 0, 0, 0, 238, 1237, 1, 0, 0, 0, 240, 1246, 1, 0, 0, 0, 242, 1250, 1, 0, 0, 0, 244, 1259, 1, 0, 0, 0, 246, 1269, 1, 0, 0, 0, 248, 1275, 1, 0, 0, 0, 250, 1283, 1, 0, 0, 0, 252, 1289, 1, 0, 0, 0, 254, 1296, 1, 0, 0, 0, 256, 1301, 1, 0, 0, 0, 258, 1306, 1, 0, 0, 0, 260, 1312, 1, 0, 0, 0, 262, 1318, 1, 0, 0, 0, 264, 1325, 1, 0, 0, 0, 266, 1330, 1, 0, 0, 0, 268, 1347, 1, 0, 0, 0, 270, 1381, 1, 0, 0, 0, 272, 1386, 1, 0, 0, 0, 274, 1429, 1, 0, 0, 0, 276, 1507, 1, 0, 0, 0, 278, 1509, 1, 0, 0, 0, 280, 1516, 1, 0, 0, 0, 282, 1523, 1, 0, 0, 0, 284, 1527, 1, 0, 0, 0, 286, 1534, 1, 0, 0, 0, 288, 1541, 1, 0, 0, 0, 290, 1548, 1, 0, 0, 0, 292, 1564, 1, 0, 0, 0, 294, 1566, 1, 0, 0, 0, 296, 1568, 1, 0, 0, 0, 298, 1570, 1, 0, 0, 0, 300, 1572, 1, 0, 0, 0, 302, 1574, 1, 0, 0, 0, 304, 1576, 1, 0, 0, 0, 306, 1578, 1, 0, 0, 0, 308, 1580, 1, 0, 0, 0, 310, 1582, 1, 0, 0, 0, 312, 1584, 1, 0, 0, 0, 314, 1586, 1, 0, 0, 0, 316, 1588, 1, 0, 0, 0, 318, 1590, 1, 0, 0, 0, 320, 1592, 1, 0, 0, 0, 322, 1594, 1, 0, 0, 0, 324, 1596, 1, 0, 0, 0, 326, 1598, 1, 0, 0, 0, 328, 1600, 1, 0, 0, 0, 330, 1602, 1, 0, 0, 0, 332, 1604, 1, 0, 0, 0, 334, 1606, 1, 0, 0, 0, 336, 1608, 1, 0, 0, 0, 338, 1610, 1, 0, 0, 0, 340, 1612, 1, 0, 0, 0, 342, 1614, 1, 0, 0, 0, 344, 1616, 1, 0, 0, 0, 346, 1618, 1, 0, 0, 0, 348, 1620, 1, 0, 0, 0, 350, 1622, 1, 0, 0, 0, 352, 1624, 1, 0, 0, 0, 354, 1626, 1, 0, 0, 0, 356, 1629, 1, 0, 0, 0, 358, 1631, 1, 0, 0, 0, 360, 1633, 1, 0, 0, 0, 362, 1635, 1, 0, 0, 0, 364, 1638, 1, 0, 0, 0, 366, 1641, 1, 0, 0, 0, 368, 1643, 1, 0, 0, 0, 370, 1645, 1, 0, 0, 0, 372, 1648, 1, 0, 0, 0, 374, 1650, 1, 0, 0, 0, 376, 1652, 1, 0, 0, 0, 378, 1654, 1, 0, 0, 0, 380, 1657, 1, 0, 0, 0, 382, 1659, 1, 0, 0, 0, 384, 1662, 1, 0, 0, 0, 386, 1664, 1, 0, 0, 0, 388, 1666, 1, 0, 0, 0, 390, 1669, 1, 0, 0, 0, 392, 1673, 1, 0, 0, 0, 394, 1677, 1, 0, 0, 0, 396, 1679, 1, 0, 0, 0, 398, 1681, 1, 0, 0, 0, 400, 1684, 1, 0, 0, 0, 402, 1690, 1, 0, 0, 0, 404, 1696, 1, 0, 0, 0, 406, 1698, 1, 0, 0, 0, 408, 1705, 1, 0, 0, 0, 410, 1707, 1, 0, 0, 0, 412, 1711, 1, 0, 0, 0, 414, 1714, 1, 0, 0, 0, 416, 1717, 1, 0, 0, 0, 418, 1720, 1, 0, 0, 0, 420, 1722, 1, 0, 0, 0, 422, 1724, 1, 0, 0, 0, 424, 1726, 1, 0, 0, 0, 426, 1728, 1, 0, 0, 0, 428, 1733, 1, 0, 0, 0, 430, 1738, 1, 0, 0, 0, 432, 1740, 1, 0, 0, 0, 434, 1742, 1, 0, 0, 0, 436, 1745, 1, 0, 0, 0, 438, 1749, 1, 0, 0, 0, 440, 1751, 1, 0, 0, 0, 442, 1753, 1, 0, 0, 0, 444, 1755, 1, 0, 0, 0, 446, 1757, 1, 0, 0, 0, 448, 1760, 1, 0, 0, 0, 450, 1762, 1, 0, 0, 0, 452, 1780, 1, 0, 0, 0, 454, 1793, 1, 0, 0, 0, 456, 1797, 1, 0, 0, 0, 458, 1810, 1, 0, 0, 0, 460, 1814, 1, 0, 0, 0, 462, 1818, 1, 0, 0, 0, 464, 1828, 1, 0, 0, 0, 466, 1832, 1, 0, 0, 0, 468, 1836, 1, 0, 0, 0, 470, 1842, 1, 0, 0, 0, 472, 1848, 1, 0, 0, 0, 474, 1857, 1, 0, 0, 0, 476, 1861, 1, 0, 0, 0, 478, 1866, 1, 0, 0, 0, 480, 1872, 1, 0, 0, 0, 482, 1877, 1, 0, 0, 0, 484, 1882, 1, 0, 0, 0, 486, 1892, 1, 0, 0, 0, 488, 1899, 1, 0, 0, 0, 490, 1903, 1, 0, 0, 0, 492, 1908, 1, 0, 0, 0, 494, 1915, 1, 0, 0, 0, 496, 1921, 1, 0, 0, 0, 498, 499, 3, 292, 143, 0, 499, 500, 3, 314, 154, 0, 500, 501, 3, 314, 154, 0, 501, 7, 1, 0, 0, 0, 502, 503, 3, 292, 143, 0, 503, 504, 3, 318, 156, 0, 504, 505, 3, 298, 146, 0, 505, 9, 1, 0, 0, 0, 506, 507, 3, 292, 143, 0, 507, 508, 3, 318, 156, 0, 508, 509, 3, 330, 162, 0, 509, 510, 3, 308, 151, 0, 510, 11, 1, 0, 0, 0, 511, 512, 3, 292, 143, 0, 512, 513, 3, 318, 156, 0, 513, 514, 3, 340, 167, 0, 514, 13, 1, 0, 0, 0, 515, 516, 3, 292, 143, 0, 516, 517, 3, 326, 160, 0, 517, 518, 3, 326, 160, 0, 518, 519, 3, 292, 143, 0, 519, 520, 3, 340, 167, 0, 520, 15, 1, 0, 0, 0, 521, 522, 3, 292, 143, 0, 522, 523, 3, 328, 161, 0, 523, 17, 1, 0, 0, 0, 524, 525, 3, 292, 143, 0, 525, 526, 3, 328, 161, 0, 526, 527, 3, 296, 145, 0, 527, 539, 1, 0, 0, 0, 528, 529, 3, 292, 143, 0, 529, 530, 3, 328, 161, 0, 530, 531, 3, 296, 145, 0, 531, 532, 3, 300, 147, 0, 532, 533, 3, 318, 156, 0, 533, 534, 3, 298, 146, 0, 534, 535, 3, 308, 151, 0, 535, 536, 3, 318, 156, 0, 536, 537, 3, 304, 149, 0, 537, 539, 1, 0, 0, 0, 538, 524, 1, 0, 0, 0, 538, 528, 1, 0, 0, 0, 539, 19, 1, 0, 0, 0, 540, 541, 3, 292, 143, 0, 541, 542, 3, 328, 161, 0, 542, 543, 3, 320, 157, 0, 543, 544, 3, 302, 148, 0, 544, 21, 1, 0, 0, 0, 545, 546, 3, 294, 144, 0, 546, 547, 3, 300, 147, 0, 547, 548, 3, 330, 162, 0, 548, 549, 3, 336, 165, 0, 549, 550, 3, 300, 147, 0, 550, 551, 3, 300, 147, 0, 551, 552, 3, 318, 156, 0, 552, 23, 1, 0, 0, 0, 553, 554, 3, 294, 144, 0, 554, 555, 3, 320, 157, 0, 555, 556, 3, 330, 162, 0, 556, 557, 3, 306, 150, 0, 557, 25, 1, 0, 0, 0, 558, 559, 3, 294, 144, 0, 559, 560, 3, 340, 167, 0, 560, 27, 1, 0, 0, 0, 561, 562, 3, 296, 145, 0, 562, 563, 3, 292, 143, 0, 563, 564, 3, 328, 161, 0, 564, 565, 3, 300, 147, 0, 565, 29, 1, 0, 0, 0, 566, 567, 3, 296, 145, 0, 567, 568, 3, 292, 143, 0, 568, 569, 3, 328, 161, 0, 569, 570, 3, 330, 162, 0, 570, 31, 1, 0, 0, 0, 571, 572, 3, 296, 145, 0, 572, 573, 3, 292, 143, 0, 573, 574, 3, 330, 162, 0, 574, 575, 3, 296, 145, 0, 575, 576, 3, 306, 150, 0, 576, 33, 1, 0, 0, 0, 577, 578, 3, 296, 145, 0, 578, 579, 3, 320, 157, 0, 579, 580, 3, 306, 150, 0, 580, 581, 3, 320, 157, 0, 581, 582, 3, 326, 160, 0, 582, 583, 3, 330, 162, 0, 583, 35, 1, 0, 0, 0, 584, 585, 3, 296, 145, 0, 585, 586, 3, 320, 157, 0, 586, 587, 3, 314, 154, 0, 587, 588, 3, 314, 154, 0, 588, 589, 3, 292, 143, 0, 589, 590, 3, 330, 162, 0, 590, 591, 3, 300, 147, 0, 591, 37, 1, 0, 0, 0, 592, 593, 3, 296, 145, 0, 593, 594, 3, 320, 157, 0, 594, 595, 3, 314, 154, 0, 595, 596, 3, 332, 163, 0, 596, 597, 3, 316, 155, 0, 597, 598, 3, 318, 156, 0, 598, 599, 3, 328, 161, 0, 599, 39, 1, 0, 0, 0, 600, 601, 3, 296, 145, 0, 601, 602, 3, 326, 160, 0, 602, 603, 3, 320, 157, 0, 603, 604, 3, 328, 161, 0, 604, 605, 3, 328, 161, 0, 605, 41, 1, 0, 0, 0, 606, 607, 3, 296, 145, 0, 607, 608, 3, 332, 163, 0, 608, 609, 3, 294, 144, 0, 609, 610, 3, 300, 147, 0, 610, 43, 1, 0, 0, 0, 611, 612, 3, 296, 145, 0, 612, 613, 3, 332, 163, 0, 613, 614, 3, 326, 160, 0, 614, 615, 3, 326, 160, 0, 615, 616, 3, 300, 147, 0, 616, 617, 3, 318, 156, 0, 617, 618, 3, 330, 162, 0, 618, 45, 1, 0, 0, 0, 619, 620, 3, 298, 146, 0, 620, 621, 3, 292, 143, 0, 621, 622, 3, 330, 162, 0, 622, 623, 3, 300, 147, 0, 623, 47, 1, 0, 0, 0, 624, 625, 3, 298, 146, 0, 625, 626, 3, 292, 143, 0, 626, 627, 3, 340, 167, 0, 627, 49, 1, 0, 0, 0, 628, 629, 3, 298, 146, 0, 629, 630, 3, 300, 147, 0, 630, 631, 3, 328, 161, 0, 631, 632, 3, 296, 145, 0, 632, 51, 1, 0, 0, 0, 633, 634, 3, 298, 146, 0, 634, 635, 3, 300, 147, 0, 635, 636, 3, 328, 161, 0, 636, 637, 3, 296, 145, 0, 637, 638, 3, 300, 147, 0, 638, 639, 3, 318, 156, 0, 639, 640, 3, 298, 146, 0, 640, 641, 3, 308, 151, 0, 641, 642, 3, 318, 156, 0, 642, 643, 3, 304, 149, 0, 643, 53, 1, 0, 0, 0, 644, 645, 3, 298, 146, 0, 645, 646, 3, 308, 151, 0, 646, 647, 3, 328, 161, 0, 647, 648, 3, 330, 162, 0, 648, 649, 3, 308, 151, 0, 649, 650, 3, 318, 156, 0, 650, 651, 3, 296, 145, 0, 651, 652, 3, 330, 162, 0, 652, 55, 1, 0, 0, 0, 653, 654, 3, 300, 147, 0, 654, 655, 3, 314, 154, 0, 655, 656, 3, 328, 161, 0, 656, 657, 3, 300, 147, 0, 657, 57, 1, 0, 0, 0, 658, 659, 3, 300, 147, 0, 659, 660, 3, 318, 156, 0, 660, 661, 3, 298, 146, 0, 661, 59, 1, 0, 0, 0, 662, 663, 3, 300, 147, 0, 663, 664, 3, 338, 166, 0, 664, 665, 3, 296, 145, 0, 665, 666, 3, 300, 147, 0, 666, 667, 3, 322, 158, 0, 667, 668, 3, 330, 162, 0, 668, 61, 1, 0, 0, 0, 669, 670, 3, 300, 147, 0, 670, 671, 3, 338, 166, 0, 671, 672, 3, 296, 145, 0, 672, 673, 3, 314, 154, 0, 673, 674, 3, 332, 163, 0, 674, 675, 3, 298, 146, 0, 675, 676, 3, 300, 147, 0, 676, 63, 1, 0, 0, 0, 677, 678, 3, 300, 147, 0, 678, 679, 3, 338, 166, 0, 679, 680, 3, 330, 162, 0, 680, 681, 3, 326, 160, 0, 681, 682, 3, 292, 143, 0, 682, 683, 3, 296, 145, 0, 683, 684, 3, 330, 162, 0, 684, 65, 1, 0, 0, 0, 685, 686, 3, 302, 148, 0, 686, 687, 3, 308, 151, 0, 687, 688, 3, 318, 156, 0, 688, 689, 3, 292, 143, 0, 689, 690, 3, 314, 154, 0, 690, 67, 1, 0, 0, 0, 691, 692, 3, 302, 148, 0, 692, 693, 3, 308, 151, 0, 693, 694, 3, 314, 154, 0, 694, 695, 3, 314, 154, 0, 695, 69, 1, 0, 0, 0, 696, 697, 3, 302, 148, 0, 697, 698, 3, 308, 151, 0, 698, 699, 3, 314, 154, 0, 699, 700, 3, 330, 162, 0, 700, 701, 3, 300, 147, 0, 701, 702, 3, 326, 160, 0, 702, 71, 1, 0, 0, 0, 703, 704, 3, 302, 148, 0, 704, 705, 3, 308, 151, 0, 705, 706, 3, 318, 156, 0, 706, 707, 3, 292, 143, 0, 707, 708, 3, 314, 154, 0, 708, 709, 3, 314, 154, 0, 709, 710, 3, 340, 167, 0, 710, 73, 1, 0, 0, 0, 711, 712, 3, 302, 148, 0, 712, 713, 3, 308, 151, 0, 713, 714, 3, 326, 160, 0, 714, 715, 3, 328, 161, 0, 715, 716, 3, 330, 162, 0, 716, 75, 1, 0, 0, 0, 717, 718, 3, 302, 148, 0, 718, 719, 3, 318, 156, 0, 719, 77, 1, 0, 0, 0, 720, 721, 3, 302, 148, 0, 721, 722, 3, 320, 157, 0, 722, 723, 3, 314, 154, 0, 723, 724, 3, 314, 154, 0, 724, 725, 3, 320, 157, 0, 725, 726, 3, 336, 165, 0, 726, 727, 3, 308, 151, 0, 727, 728, 3, 318, 156, 0, 728, 729, 3, 304, 149, 0, 729, 79, 1, 0, 0, 0, 730, 731, 3, 302, 148, 0, 731, 732, 3, 320, 157, 0, 732, 733, 3, 326, 160, 0, 733, 81, 1, 0, 0, 0, 734, 735, 3, 302, 148, 0, 735, 736, 3, 326, 160, 0, 736, 737, 3, 320, 157, 0, 737, 738, 3, 316, 155, 0, 738, 83, 1, 0, 0, 0, 739, 740, 3, 302, 148, 0, 740, 741, 3, 332, 163, 0, 741, 742, 3, 314, 154, 0, 742, 743, 3, 314, 154, 0, 743, 85, 1, 0, 0, 0, 744, 745, 3, 302, 148, 0, 745, 746, 3, 332, 163, 0, 746, 747, 3, 318, 156, 0, 747, 87, 1, 0, 0, 0, 748, 749, 3, 304, 149, 0, 749, 750, 3, 326, 160, 0, 750, 751, 3, 320, 157, 0, 751, 752, 3, 332, 163, 0, 752, 753, 3, 322, 158, 0, 753, 89, 1, 0, 0, 0, 754, 755, 3, 304, 149, 0, 755, 756, 3, 326, 160, 0, 756, 757, 3, 320, 157, 0, 757, 758, 3, 332, 163, 0, 758, 759, 3, 322, 158, 0, 759, 760, 3, 308, 151, 0, 760, 761, 3, 318, 156, 0, 761, 762, 3, 304, 149, 0, 762, 91, 1, 0, 0, 0, 763, 764, 3, 306, 150, 0, 764, 765, 3, 292, 143, 0, 765, 766, 3, 334, 164, 0, 766, 767, 3, 308, 151, 0, 767, 768, 3, 318, 156, 0, 768, 769, 3, 304, 149, 0, 769, 93, 1, 0, 0, 0, 770, 771, 3, 306, 150, 0, 771, 772, 3, 320, 157, 0, 772, 773, 3, 332, 163, 0, 773, 774, 3, 326, 160, 0, 774, 95, 1, 0, 0, 0, 775, 776, 3, 308, 151, 0, 776, 777, 3, 298, 146, 0, 777, 97, 1, 0, 0, 0, 778, 779, 3, 308, 151, 0, 779, 780, 3, 302, 148, 0, 780, 99, 1, 0, 0, 0, 781, 782, 3, 308, 151, 0, 782, 783, 3, 314, 154, 0, 783, 784, 3, 308, 151, 0, 784, 785, 3, 312, 153, 0, 785, 786, 3, 300, 147, 0, 786, 101, 1, 0, 0, 0, 787, 788, 3, 308, 151, 0, 788, 789, 3, 304, 149, 0, 789, 790, 3, 318, 156, 0, 790, 791, 3, 320, 157, 0, 791, 792, 3, 326, 160, 0, 792, 793, 3, 300, 147, 0, 793, 103, 1, 0, 0, 0, 794, 795, 3, 308, 151, 0, 795, 796, 3, 318, 156, 0, 796, 797, 3, 296, 145, 0, 797, 798, 3, 314, 154, 0, 798, 799, 3, 332, 163, 0, 799, 800, 3, 298, 146, 0, 800, 801, 3, 300, 147, 0, 801, 105, 1, 0, 0, 0, 802, 803, 3, 308, 151, 0, 803, 804, 3, 318, 156, 0, 804, 107, 1, 0, 0, 0, 805, 806, 3, 308, 151, 0, 806, 807, 3, 318, 156, 0, 807, 808, 3, 302, 148, 0, 808, 819, 1, 0, 0, 0, 809, 810, 3, 308, 151, 0, 810, 811, 3, 318, 156, 0, 811, 812, 3, 302, 148, 0, 812, 813, 3, 308, 151, 0, 813, 814, 3, 318, 156, 0, 814, 815, 3, 308, 151, 0, 815, 816, 3, 330, 162, 0, 816, 817, 3, 340, 167, 0, 817, 819, 1, 0, 0, 0, 818, 805, 1, 0, 0, 0, 818, 809, 1, 0, 0, 0, 819, 109, 1, 0, 0, 0, 820, 821, 3, 308, 151, 0, 821, 822, 3, 318, 156, 0, 822, 823, 3, 318, 156, 0, 823, 824, 3, 300, 147, 0, 824, 825, 3, 326, 160, 0, 825, 111, 1, 0, 0, 0, 826, 827, 3, 308, 151, 0, 827, 828, 3, 318, 156, 0, 828, 829, 3, 330, 162, 0, 829, 830, 3, 300, 147, 0, 830, 831, 3, 326, 160, 0, 831, 832, 3, 328, 161, 0, 832, 833, 3, 300, 147, 0, 833, 834, 3, 296, 145, 0, 834, 835, 3, 330, 162, 0, 835, 113, 1, 0, 0, 0, 836, 837, 3, 308, 151, 0, 837, 838, 3, 318, 156, 0, 838, 839, 3, 330, 162, 0, 839, 840, 3, 300, 147, 0, 840, 841, 3, 326, 160, 0, 841, 842, 3, 322, 158, 0, 842, 843, 3, 320, 157, 0, 843, 844, 3, 314, 154, 0, 844, 845, 3, 292, 143, 0, 845, 846, 3, 330, 162, 0, 846, 847, 3, 300, 147, 0, 847, 115, 1, 0, 0, 0, 848, 849, 3, 308, 151, 0, 849, 850, 3, 318, 156, 0, 850, 851, 3, 330, 162, 0, 851, 852, 3, 300, 147, 0, 852, 853, 3, 326, 160, 0, 853, 854, 3, 334, 164, 0, 854, 855, 3, 292, 143, 0, 855, 856, 3, 314, 154, 0, 856, 117, 1, 0, 0, 0, 857, 858, 3, 308, 151, 0, 858, 859, 3, 328, 161, 0, 859, 119, 1, 0, 0, 0, 860, 861, 3, 310, 152, 0, 861, 862, 3, 320, 157, 0, 862, 863, 3, 308, 151, 0, 863, 864, 3, 318, 156, 0, 864, 121, 1, 0, 0, 0, 865, 866, 3, 312, 153, 0, 866, 867, 3, 300, 147, 0, 867, 868, 3, 340, 167, 0, 868, 123, 1, 0, 0, 0, 869, 870, 3, 314, 154, 0, 870, 871, 3, 292, 143, 0, 871, 872, 3, 316, 155, 0, 872, 873, 3, 294, 144, 0, 873, 874, 3, 298, 146, 0, 874, 875, 3, 292, 143, 0, 875, 125, 1, 0, 0, 0, 876, 877, 3, 314, 154, 0, 877, 878, 3, 292, 143, 0, 878, 879, 3, 328, 161, 0, 879, 880, 3, 330, 162, 0, 880, 127, 1, 0, 0, 0, 881, 882, 3, 314, 154, 0, 882, 883, 3, 300, 147, 0, 883, 884, 3, 292, 143, 0, 884, 885, 3, 298, 146, 0, 885, 886, 3, 308, 151, 0, 886, 887, 3, 318, 156, 0, 887, 888, 3, 304, 149, 0, 888, 129, 1, 0, 0, 0, 889, 890, 3, 314, 154, 0, 890, 891, 3, 300, 147, 0, 891, 892, 3, 302, 148, 0, 892, 893, 3, 330, 162, 0, 893, 131, 1, 0, 0, 0, 894, 895, 3, 314, 154, 0, 895, 896, 3, 300, 147, 0, 896, 897, 3, 330, 162, 0, 897, 133, 1, 0, 0, 0, 898, 899, 3, 314, 154, 0, 899, 900, 3, 308, 151, 0, 900, 901, 3, 312, 153, 0, 901, 902, 3, 300, 147, 0, 902, 135, 1, 0, 0, 0, 903, 904, 3, 314, 154, 0, 904, 905, 3, 308, 151, 0, 905, 906, 3, 316, 155, 0, 906, 907, 3, 308, 151, 0, 907, 908, 3, 330, 162, 0, 908, 137, 1, 0, 0, 0, 909, 910, 3, 316, 155, 0, 910, 911, 3, 292, 143, 0, 911, 912, 3, 330, 162, 0, 912, 913, 3, 300, 147, 0, 913, 914, 3, 326, 160, 0, 914, 915, 3, 308, 151, 0, 915, 916, 3, 292, 143, 0, 916, 917, 3, 314, 154, 0, 917, 918, 3, 308, 151, 0, 918, 919, 3, 342, 168, 0, 919, 920, 3, 300, 147, 0, 920, 921, 3, 298, 146, 0, 921, 139, 1, 0, 0, 0, 922, 923, 3, 316, 155, 0, 923, 924, 3, 308, 151, 0, 924, 925, 3, 318, 156, 0, 925, 926, 3, 332, 163, 0, 926, 927, 3, 330, 162, 0, 927, 928, 3, 300, 147, 0, 928, 141, 1, 0, 0, 0, 929, 930, 3, 316, 155, 0, 930, 931, 3, 320, 157, 0, 931, 932, 3, 318, 156, 0, 932, 933, 3, 330, 162, 0, 933, 934, 3, 306, 150, 0, 934, 143, 1, 0, 0, 0, 935, 936, 3, 318, 156, 0, 936, 937, 3, 292, 143, 0, 937, 938, 3, 316, 155, 0, 938, 939, 3, 300, 147, 0, 939, 145, 1, 0, 0, 0, 940, 941, 3, 318, 156, 0, 941, 942, 3, 292, 143, 0, 942, 943, 3, 330, 162, 0, 943, 944, 3, 332, 163, 0, 944, 945, 3, 326, 160, 0, 945, 946, 3, 292, 143, 0, 946, 947, 3, 314, 154, 0, 947, 147, 1, 0, 0, 0, 948, 949, 3, 318, 156, 0, 949, 950, 3, 292, 143, 0, 950, 951, 3, 318, 156, 0, 951, 149, 1, 0, 0, 0, 952, 953, 3, 318, 156, 0, 953, 954, 3, 320, 157, 0, 954, 955, 3, 330, 162, 0, 955, 151, 1, 0, 0, 0, 956, 957, 3, 318, 156, 0, 957, 958, 3, 332, 163, 0, 958, 959, 3, 314, 154, 0, 959, 960, 3, 314, 154, 0, 960, 153, 1, 0, 0, 0, 961, 962, 3, 318, 156, 0, 962, 963, 3, 332, 163, 0, 963, 964, 3, 314, 154, 0, 964, 965, 3, 314, 154, 0, 965, 966, 3, 328, 161, 0, 966, 155, 1, 0, 0, 0, 967, 968, 3, 320, 157, 0, 968, 969, 3, 302, 148, 0, 969, 970, 3, 302, 148, 0, 970, 971, 3, 328, 161, 0, 971, 972, 3, 300, 147, 0, 972, 973, 3, 330, 162, 0, 973, 157, 1, 0, 0, 0, 974, 975, 3, 320, 157, 0, 975, 976, 3, 318, 156, 0, 976, 159, 1, 0, 0, 0, 977, 978, 3, 320, 157, 0, 978, 979, 3, 326, 160, 0, 979, 161, 1, 0, 0, 0, 980, 981, 3, 320, 157, 0, 981, 982, 3, 326, 160, 0, 982, 983, 3, 298, 146, 0, 983, 984, 3, 300, 147, 0, 984, 985, 3, 326, 160, 0, 985, 163, 1, 0, 0, 0, 986, 987, 3, 320, 157, 0, 987, 988, 3, 332, 163, 0, 988, 989, 3, 330, 162, 0, 989, 990, 3, 300, 147, 0, 990, 991, 3, 326, 160, 0, 991, 165, 1, 0, 0, 0, 992, 993, 3, 320, 157, 0, 993, 994, 3, 334, 164, 0, 994, 995, 3, 300, 147, 0, 995, 996, 3, 326, 160, 0, 996, 167, 1, 0, 0, 0, 997, 998, 3, 322, 158, 0, 998, 999, 3, 292, 143, 0, 999, 1000, 3, 326, 160, 0, 1000, 1001, 3, 330, 162, 0, 1001, 1002, 3, 308, 151, 0, 1002, 1003, 3, 330, 162, 0, 1003, 1004, 3, 308, 151, 0, 1004, 1005, 3, 320, 157, 0, 1005, 1006, 3, 318, 156, 0, 1006, 169, 1, 0, 0, 0, 1007, 1008, 3, 322, 158, 0, 1008, 1009, 3, 308, 151, 0, 1009, 1010, 3, 334, 164, 0, 1010, 1011, 3, 320, 157, 0, 1011, 1012, 3, 330, 162, 0, 1012, 171, 1, 0, 0, 0, 1013, 1014, 3, 322, 158, 0, 1014, 1015, 3, 320, 157, 0, 1015, 1016, 3, 328, 161, 0, 1016, 1017, 3, 308, 151, 0, 1017, 1018, 3, 330, 162, 0, 1018, 1019, 3, 308, 151, 0, 1019, 1020, 3, 320, 157, 0, 1020, 1021, 3, 318, 156, 0, 1021, 1022, 3, 292, 143, 0, 1022, 1023, 3, 314, 154, 0, 1023, 173, 1, 0, 0, 0, 1024, 1025, 3, 322, 158, 0, 1025, 1026, 3, 326, 160, 0, 1026, 1027, 3, 300, 147, 0, 1027, 1028, 3, 296, 145, 0, 1028, 1029, 3, 300, 147, 0, 1029, 1030, 3, 298, 146, 0, 1030, 1031, 3, 308, 151, 0, 1031, 1032, 3, 318, 156, 0, 1032, 1033, 3, 304, 149, 0, 1033, 175, 1, 0, 0, 0, 1034, 1035, 3, 322, 158, 0, 1035, 1036, 3, 326, 160, 0, 1036, 1037, 3, 300, 147, 0, 1037, 1038, 3, 336, 165, 0, 1038, 1039, 3, 306, 150, 0, 1039, 1040, 3, 300, 147, 0, 1040, 1041, 3, 326, 160, 0, 1041, 1042, 3, 300, 147, 0, 1042, 177, 1, 0, 0, 0, 1043, 1044, 3, 324, 159, 0, 1044, 1045, 3, 332, 163, 0, 1045, 1046, 3, 292, 143, 0, 1046, 1047, 3, 314, 154, 0, 1047, 1048, 3, 308, 151, 0, 1048, 1049, 3, 302, 148, 0, 1049, 1050, 3, 340, 167, 0, 1050, 179, 1, 0, 0, 0, 1051, 1052, 3, 324, 159, 0, 1052, 1053, 3, 332, 163, 0, 1053, 1054, 3, 292, 143, 0, 1054, 1055, 3, 326, 160, 0, 1055, 1056, 3, 330, 162, 0, 1056, 1057, 3, 300, 147, 0, 1057, 1058, 3, 326, 160, 0, 1058, 181, 1, 0, 0, 0, 1059, 1060, 3, 326, 160, 0, 1060, 1061, 3, 292, 143, 0, 1061, 1062, 3, 318, 156, 0, 1062, 1063, 3, 304, 149, 0, 1063, 1064, 3, 300, 147, 0, 1064, 183, 1, 0, 0, 0, 1065, 1066, 3, 326, 160, 0, 1066, 1067, 3, 300, 147, 0, 1067, 1068, 3, 296, 145, 0, 1068, 1069, 3, 332, 163, 0, 1069, 1070, 3, 326, 160, 0, 1070, 1071, 3, 328, 161, 0, 1071, 1072, 3, 308, 151, 0, 1072, 1073, 3, 334, 164, 0, 1073, 1074, 3, 300, 147, 0, 1074, 185, 1, 0, 0, 0, 1075, 1076, 3, 326, 160, 0, 1076, 1077, 3, 300, 147, 0, 1077, 1078, 3, 322, 158, 0, 1078, 1079, 3, 314, 154, 0, 1079, 1080, 3, 292, 143, 0, 1080, 1081, 3, 296, 145, 0, 1081, 1082, 3, 300, 147, 0, 1082, 187, 1, 0, 0, 0, 1083, 1084, 3, 326, 160, 0, 1084, 1085, 3, 300, 147, 0, 1085, 1086, 3, 330, 162, 0, 1086, 1087, 3, 332, 163, 0, 1087, 1088, 3, 326, 160, 0, 1088, 1089, 3, 318, 156, 0, 1089, 189, 1, 0, 0, 0, 1090, 1091, 3, 326, 160, 0, 1091, 1092, 3, 308, 151, 0, 1092, 1093, 3, 304, 149, 0, 1093, 1094, 3, 306, 150, 0, 1094, 1095, 3, 330, 162, 0, 1095, 191, 1, 0, 0, 0, 1096, 1097, 3, 326, 160, 0, 1097, 1098, 3, 320, 157, 0, 1098, 1099, 3, 314, 154, 0, 1099, 1100, 3, 314, 154, 0, 1100, 1101, 3, 332, 163, 0, 1101, 1102, 3, 322, 158, 0, 1102, 193, 1, 0, 0, 0, 1103, 1104, 3, 326, 160, 0, 1104, 1105, 3, 320, 157, 0, 1105, 1106, 3, 336, 165, 0, 1106, 195, 1, 0, 0, 0, 1107, 1108, 3, 326, 160, 0, 1108, 1109, 3, 320, 157, 0, 1109, 1110, 3, 336, 165, 0, 1110, 1111, 3, 328, 161, 0, 1111, 197, 1, 0, 0, 0, 1112, 1113, 3, 328, 161, 0, 1113, 1114, 3, 292, 143, 0, 1114, 1115, 3, 316, 155, 0, 1115, 1116, 3, 322, 158, 0, 1116, 1117, 3, 314, 154, 0, 1117, 1118, 3, 300, 147, 0, 1118, 199, 1, 0, 0, 0, 1119, 1120, 3, 328, 161, 0, 1120, 1121, 3, 300, 147, 0, 1121, 1122, 3, 296, 145, 0, 1122, 1123, 3, 320, 157, 0, 1123, 1124, 3, 318, 156, 0, 1124, 1125, 3, 298, 146, 0, 1125, 201, 1, 0, 0, 0, 1126, 1127, 3, 328, 161, 0, 1127, 1128, 3, 300, 147, 0, 1128, 1129, 3, 314, 154, 0, 1129, 1130, 3, 300, 147, 0, 1130, 1131, 3, 296, 145, 0, 1131, 1132, 3, 330, 162, 0, 1132, 203, 1, 0, 0, 0, 1133, 1134, 3, 328, 161, 0, 1134, 1135, 3, 300, 147, 0, 1135, 1136, 3, 316, 155, 0, 1136, 1137, 3, 308, 151, 0, 1137, 205, 1, 0, 0, 0, 1138, 1139, 3, 328, 161, 0, 1139, 1140, 3, 300, 147, 0, 1140, 1141, 3, 330, 162, 0, 1141, 1142, 3, 328, 161, 0, 1142, 207, 1, 0, 0, 0, 1143, 1144, 3, 328, 161, 0, 1144, 1145, 3, 300, 147, 0, 1145, 1146, 3, 330, 162, 0, 1146, 1147, 3, 330, 162, 0, 1147, 1148, 3, 308, 151, 0, 1148, 1149, 3, 318, 156, 0, 1149, 1150, 3, 304, 149, 0, 1150, 1151, 3, 328, 161, 0, 1151, 209, 1, 0, 0, 0, 1152, 1153, 3, 328, 161, 0, 1153, 1154, 3, 330, 162, 0, 1154, 1155, 3, 300, 147, 0, 1155, 1156, 3, 322, 158, 0, 1156, 211, 1, 0, 0, 0, 1157, 1158, 3, 328, 161, 0, 1158, 1159, 3, 332, 163, 0, 1159, 1160, 3, 294, 144, 0, 1160, 1161, 3, 328, 161, 0, 1161, 1162, 3, 330, 162, 0, 1162, 1163, 3, 326, 160, 0, 1163, 1164, 3, 308, 151, 0, 1164, 1165, 3, 318, 156, 0, 1165, 1166, 3, 304, 149, 0, 1166, 213, 1, 0, 0, 0, 1167, 1168, 3, 330, 162, 0, 1168, 1169, 3, 306, 150, 0, 1169, 1170, 3, 300, 147, 0, 1170, 1171, 3, 318, 156, 0, 1171, 215, 1, 0, 0, 0, 1172, 1173, 3, 330, 162, 0, 1173, 1174, 3, 306, 150, 0, 1174, 1175, 3, 326, 160, 0, 1175, 1176, 3, 320, 157, 0, 1176, 1177, 3, 336, 165, 0, 1177, 217, 1, 0, 0, 0, 1178, 1179, 3, 330, 162, 0, 1179, 1180, 3, 308, 151, 0, 1180, 1181, 3, 300, 147, 0, 1181, 1182, 3, 328, 161, 0, 1182, 219, 1, 0, 0, 0, 1183, 1184, 3, 330, 162, 0, 1184, 1185, 3, 308, 151, 0, 1185, 1186, 3, 316, 155, 0, 1186, 1187, 3, 300, 147, 0, 1187, 1188, 3, 328, 161, 0, 1188, 1189, 3, 330, 162, 0, 1189, 1190, 3, 292, 143, 0, 1190, 1191, 3, 316, 155, 0, 1191, 1192, 3, 322, 158, 0, 1192, 221, 1, 0, 0, 0, 1193, 1194, 3, 330, 162, 0, 1194, 1195, 3, 308, 151, 0, 1195, 1196, 3, 316, 155, 0, 1196, 1197, 3, 300, 147, 0, 1197, 223, 1, 0, 0, 0, 1198, 1199, 3, 314, 154, 0, 1199, 1200, 3, 320, 157, 0, 1200, 1201, 3, 296, 145, 0, 1201, 1202, 3, 292, 143, 0, 1202, 1203, 3, 314, 154, 0, 1203, 225, 1, 0, 0, 0, 1204, 1205, 3, 342, 168, 0, 1205, 1206, 3, 320, 157, 0, 1206, 1207, 3, 318, 156, 0, 1207, 1208, 3, 300, 147, 0, 1208, 227, 1, 0, 0, 0, 1209, 1210, 3, 330, 162, 0, 1210, 1211, 3, 320, 157, 0, 1211, 229, 1, 0, 0, 0, 1212, 1213, 3, 330, 162, 0, 1213, 1214, 3, 320, 157, 0, 1214, 1215, 3, 322, 158, 0, 1215, 231, 1, 0, 0, 0, 1216, 1217, 3, 330, 162, 0, 1217, 1218, 3, 320, 157, 0, 1218, 1219, 3, 330, 162, 0, 1219, 1220, 3, 292, 143, 0, 1220, 1221, 3, 314, 154, 0, 1221, 1222, 3, 328, 161, 0, 1222, 233, 1, 0, 0, 0, 1223, 1224, 3, 330, 162, 0, 1224, 1225, 3, 326, 160, 0, 1225, 1226, 3, 292, 143, 0, 1226, 1227, 3, 308, 151, 0, 1227, 1228, 3, 314, 154, 0, 1228, 1229, 3, 308, 151, 0, 1229, 1230, 3, 318, 156, 0, 1230, 1231, 3, 304, 149, 0, 1231, 235, 1, 0, 0, 0, 1232, 1233, 3, 330, 162, 0, 1233, 1234, 3, 326, 160, 0, 1234, 1235, 3, 308, 151, 0, 1235, 1236, 3, 316, 155, 0, 1236, 237, 1, 0, 0, 0, 1237, 1238, 3, 330, 162, 0, 1238, 1239, 3, 326, 160, 0, 1239, 1240, 3, 332, 163, 0, 1240, 1241, 3, 318, 156, 0, 1241, 1242, 3, 296, 145, 0, 1242, 1243, 3, 292, 143, 0, 1243, 1244, 3, 330, 162, 0, 1244, 1245, 3, 300, 147, 0, 1245, 239, 1, 0, 0, 0, 1246, 1247, 3, 330, 162, 0, 1247, 1248, 3, 326, 160, 0, 1248, 1249, 3, 340, 167, 0, 1249, 241, 1, 0, 0, 0, 1250, 1251, 3, 330, 162, 0, 1251, 1252, 3, 326, 160, 0, 1252, 1253, 3, 340, 167, 0, 1253, 1254, 5, 95, 0, 0, 1254, 1255, 3, 296, 145, 0, 1255, 1256, 3, 292, 143, 0, 1256, 1257, 3, 328, 161, 0, 1257, 1258, 3, 330, 162, 0, 1258, 243, 1, 0, 0, 0, 1259, 1260, 3, 332, 163, 0, 1260, 1261, 3, 318, 156, 0, 1261, 1262, 3, 294, 144, 0, 1262, 1263, 3, 320, 157, 0, 1263, 1264, 3, 332, 163, 0, 1264, 1265, 3, 318, 156, 0, 1265, 1266, 3, 298, 146, 0, 1266, 1267, 3, 300, 147, 0, 1267, 1268, 3, 298, 146, 0, 1268, 245, 1, 0, 0, 0, 1269, 1270, 3, 332, 163, 0, 1270, 1271, 3, 318, 156, 0, 1271, 1272, 3, 308, 151, 0, 1272, 1273, 3, 320, 157, 0, 1273, 1274, 3, 318, 156, 0, 1274, 247, 1, 0, 0, 0, 1275, 1276, 3, 332, 163, 0, 1276, 1277, 3, 318, 156, 0, 1277, 1278, 3, 322, 158, 0, 1278, 1279, 3, 308, 151, 0, 1279, 1280, 3, 334, 164, 0, 1280, 1281, 3, 320, 157, 0, 1281, 1282, 3, 330, 162, 0, 1282, 249, 1, 0, 0, 0, 1283, 1284, 3, 332, 163, 0, 1284, 1285, 3, 328, 161, 0, 1285, 1286, 3, 308, 151, 0, 1286, 1287, 3, 318, 156, 0, 1287, 1288, 3, 304, 149, 0, 1288, 251, 1, 0, 0, 0, 1289, 1290, 3, 334, 164, 0, 1290, 1291, 3, 292, 143, 0, 1291, 1292, 3, 314, 154, 0, 1292, 1293, 3, 332, 163, 0, 1293, 1294, 3, 300, 147, 0, 1294, 1295, 3, 328, 161, 0, 1295, 253, 1, 0, 0, 0, 1296, 1297, 3, 336, 165, 0, 1297, 1298, 3, 300, 147, 0, 1298, 1299, 3, 300, 147, 0, 1299, 1300, 3, 312, 153, 0, 1300, 255, 1, 0, 0, 0, 1301, 1302, 3, 336, 165, 0, 1302, 1303, 3, 306, 150, 0, 1303, 1304, 3, 300, 147, 0, 1304, 1305, 3, 318, 156, 0, 1305, 257, 1, 0, 0, 0, 1306, 1307, 3, 336, 165, 0, 1307, 1308, 3, 306, 150, 0, 1308, 1309, 3, 300, 147, 0, 1309, 1310, 3, 326, 160, 0, 1310, 1311, 3, 300, 147, 0, 1311, 259, 1, 0, 0, 0, 1312, 1313, 3, 336, 165, 0, 1313, 1314, 3, 306, 150, 0, 1314, 1315, 3, 308, 151, 0, 1315, 1316, 3, 314, 154, 0, 1316, 1317, 3, 300, 147, 0, 1317, 261, 1, 0, 0, 0, 1318, 1319, 3, 336, 165, 0, 1319, 1320, 3, 308, 151, 0, 1320, 1321, 3, 318, 156, 0, 1321, 1322, 3, 298, 146, 0, 1322, 1323, 3, 320, 157, 0, 1323, 1324, 3, 336, 165, 0, 1324, 263, 1, 0, 0, 0, 1325, 1326, 3, 336, 165, 0, 1326, 1327, 3, 308, 151, 0, 1327, 1328, 3, 330, 162, 0, 1328, 1329, 3, 306, 150, 0, 1329, 265, 1, 0, 0, 0, 1330, 1331, 3, 336, 165, 0, 1331, 1332, 3, 308, 151, 0, 1332, 1333, 3, 330, 162, 0, 1333, 1334, 3, 306, 150, 0, 1334, 1335, 3, 308, 151, 0, 1335, 1336, 3, 318, 156, 0, 1336, 267, 1, 0, 0, 0, 1337, 1338, 3, 340, 167, 0, 1338, 1339, 3, 300, 147, 0, 1339, 1340, 3, 292, 143, 0, 1340, 1341, 3, 326, 160, 0, 1341, 1348, 1, 0, 0, 0, 1342, 1343, 3, 340, 167, 0, 1343, 1344, 3, 340, 167, 0, 1344, 1345, 3, 340, 167, 0, 1345, 1346, 3, 340, 167, 0, 1346, 1348, 1, 0, 0, 0, 1347, 1337, 1, 0, 0, 0, 1347, 1342, 1, 0, 0, 0, 1348, 269, 1, 0, 0, 0, 1349, 1350, 3, 360, 177, 0, 1350, 1351, 3, 294, 144, 0, 1351, 1382, 1, 0, 0, 0, 1352, 1353, 3, 360, 177, 0, 1353, 1354, 3, 302, 148, 0, 1354, 1382, 1, 0, 0, 0, 1355, 1356, 3, 360, 177, 0, 1356, 1357, 3, 326, 160, 0, 1357, 1382, 1, 0, 0, 0, 1358, 1359, 3, 360, 177, 0, 1359, 1360, 3, 318, 156, 0, 1360, 1382, 1, 0, 0, 0, 1361, 1362, 3, 360, 177, 0, 1362, 1363, 3, 330, 162, 0, 1363, 1382, 1, 0, 0, 0, 1364, 1365, 3, 360, 177, 0, 1365, 1366, 5, 48, 0, 0, 1366, 1382, 1, 0, 0, 0, 1367, 1368, 3, 360, 177, 0, 1368, 1369, 3, 292, 143, 0, 1369, 1382, 1, 0, 0, 0, 1370, 1371, 3, 360, 177, 0, 1371, 1372, 3, 334, 164, 0, 1372, 1382, 1, 0, 0, 0, 1373, 1374, 3, 360, 177, 0, 1374, 1375, 3, 360, 177, 0, 1375, 1382, 1, 0, 0, 0, 1376, 1377, 3, 360, 177, 0, 1377, 1378, 3, 338, 166, 0, 1378, 1379, 3, 352, 173, 0, 1379, 1380, 3, 352, 173, 0, 1380, 1382, 1, 0, 0, 0, 1381, 1349, 1, 0, 0, 0, 1381, 1352, 1, 0, 0, 0, 1381, 1355, 1, 0, 0, 0, 1381, 1358, 1, 0, 0, 0, 1381, 1361, 1, 0, 0, 0, 1381, 1364, 1, 0, 0, 0, 1381, 1367, 1, 0, 0, 0, 1381, 1370, 1, 0, 0, 0, 1381, 1373, 1, 0, 0, 0, 1381, 1376, 1, 0, 0, 0, 1382, 271, 1, 0, 0, 0, 1383, 1387, 3, 344, 169, 0, 1384, 1387, 3, 448, 221, 0, 1385, 1387, 3, 374, 184, 0, 1386, 1383, 1, 0, 0, 0, 1386, 1384, 1, 0, 0, 0, 1386, 1385, 1, 0, 0, 0, 1387, 1394, 1, 0, 0, 0, 1388, 1393, 3, 344, 169, 0, 1389, 1393, 3, 448, 221, 0, 1390, 1393, 3, 350, 172, 0, 1391, 1393, 3, 374, 184, 0, 1392, 1388, 1, 0, 0, 0, 1392, 1389, 1, 0, 0, 0, 1392, 1390, 1, 0, 0, 0, 1392, 1391, 1, 0, 0, 0, 1393, 1396, 1, 0, 0, 0, 1394, 1392, 1, 0, 0, 0, 1394, 1395, 1, 0, 0, 0, 1395, 273, 1, 0, 0, 0, 1396, 1394, 1, 0, 0, 0, 1397, 1408, 3, 358, 176, 0, 1398, 1407, 8, 0, 0, 0, 1399, 1407, 3, 270, 132, 0, 1400, 1401, 3, 360, 177, 0, 1401, 1402, 3, 430, 212, 0, 1402, 1407, 1, 0, 0, 0, 1403, 1404, 3, 358, 176, 0, 1404, 1405, 3, 358, 176, 0, 1405, 1407, 1, 0, 0, 0, 1406, 1398, 1, 0, 0, 0, 1406, 1399, 1, 0, 0, 0, 1406, 1400, 1, 0, 0, 0, 1406, 1403, 1, 0, 0, 0, 1407, 1410, 1, 0, 0, 0, 1408, 1406, 1, 0, 0, 0, 1408, 1409, 1, 0, 0, 0, 1409, 1411, 1, 0, 0, 0, 1410, 1408, 1, 0, 0, 0, 1411, 1412, 3, 358, 176, 0, 1412, 1430, 1, 0, 0, 0, 1413, 1424, 3, 424, 209, 0, 1414, 1423, 8, 1, 0, 0, 1415, 1423, 3, 270, 132, 0, 1416, 1417, 3, 360, 177, 0, 1417, 1418, 3, 424, 209, 0, 1418, 1423, 1, 0, 0, 0, 1419, 1420, 3, 424, 209, 0, 1420, 1421, 3, 424, 209, 0, 1421, 1423, 1, 0, 0, 0, 1422, 1414, 1, 0, 0, 0, 1422, 1415, 1, 0, 0, 0, 1422, 1416, 1, 0, 0, 0, 1422, 1419, 1, 0, 0, 0, 1423, 1426, 1, 0, 0, 0, 1424, 1422, 1, 0, 0, 0, 1424, 1425, 1, 0, 0, 0, 1425, 1427, 1, 0, 0, 0, 1426, 1424, 1, 0, 0, 0, 1427, 1428, 3, 424, 209, 0, 1428, 1430, 1, 0, 0, 0, 1429, 1397, 1, 0, 0, 0, 1429, 1413, 1, 0, 0, 0, 1430, 275, 1, 0, 0, 0, 1431, 1432, 3, 284, 139, 0, 1432, 1436, 3, 376, 185, 0, 1433, 1435, 3, 352, 173, 0, 1434, 1433, 1, 0, 0, 0, 1435, 1438, 1, 0, 0, 0, 1436, 1434, 1, 0, 0, 0, 1436, 1437, 1, 0, 0, 0, 1437, 1441, 1, 0, 0, 0, 1438, 1436, 1, 0, 0, 0, 1439, 1442, 3, 322, 158, 0, 1440, 1442, 3, 300, 147, 0, 1441, 1439, 1, 0, 0, 0, 1441, 1440, 1, 0, 0, 0, 1442, 1445, 1, 0, 0, 0, 1443, 1446, 3, 420, 207, 0, 1444, 1446, 3, 372, 183, 0, 1445, 1443, 1, 0, 0, 0, 1445, 1444, 1, 0, 0, 0, 1445, 1446, 1, 0, 0, 0, 1446, 1448, 1, 0, 0, 0, 1447, 1449, 3, 350, 172, 0, 1448, 1447, 1, 0, 0, 0, 1449, 1450, 1, 0, 0, 0, 1450, 1448, 1, 0, 0, 0, 1450, 1451, 1, 0, 0, 0, 1451, 1508, 1, 0, 0, 0, 1452, 1455, 3, 284, 139, 0, 1453, 1456, 3, 322, 158, 0, 1454, 1456, 3, 300, 147, 0, 1455, 1453, 1, 0, 0, 0, 1455, 1454, 1, 0, 0, 0, 1456, 1459, 1, 0, 0, 0, 1457, 1460, 3, 420, 207, 0, 1458, 1460, 3, 372, 183, 0, 1459, 1457, 1, 0, 0, 0, 1459, 1458, 1, 0, 0, 0, 1459, 1460, 1, 0, 0, 0, 1460, 1462, 1, 0, 0, 0, 1461, 1463, 3, 350, 172, 0, 1462, 1461, 1, 0, 0, 0, 1463, 1464, 1, 0, 0, 0, 1464, 1462, 1, 0, 0, 0, 1464, 1465, 1, 0, 0, 0, 1465, 1508, 1, 0, 0, 0, 1466, 1467, 3, 282, 138, 0, 1467, 1471, 3, 376, 185, 0, 1468, 1470, 3, 350, 172, 0, 1469, 1468, 1, 0, 0, 0, 1470, 1473, 1, 0, 0, 0, 1471, 1469, 1, 0, 0, 0, 1471, 1472, 1, 0, 0, 0, 1472, 1474, 1, 0, 0, 0, 1473, 1471, 1, 0, 0, 0, 1474, 1477, 3, 300, 147, 0, 1475, 1478, 3, 420, 207, 0, 1476, 1478, 3, 372, 183, 0, 1477, 1475, 1, 0, 0, 0, 1477, 1476, 1, 0, 0, 0, 1477, 1478, 1, 0, 0, 0, 1478, 1480, 1, 0, 0, 0, 1479, 1481, 3, 350, 172, 0, 1480, 1479, 1, 0, 0, 0, 1481, 1482, 1, 0, 0, 0, 1482, 1480, 1, 0, 0, 0, 1482, 1483, 1, 0, 0, 0, 1483, 1508, 1, 0, 0, 0, 1484, 1485, 3, 376, 185, 0, 1485, 1486, 3, 282, 138, 0, 1486, 1489, 3, 300, 147, 0, 1487, 1490, 3, 420, 207, 0, 1488, 1490, 3, 372, 183, 0, 1489, 1487, 1, 0, 0, 0, 1489, 1488, 1, 0, 0, 0, 1489, 1490, 1, 0, 0, 0, 1490, 1492, 1, 0, 0, 0, 1491, 1493, 3, 350, 172, 0, 1492, 1491, 1, 0, 0, 0, 1493, 1494, 1, 0, 0, 0, 1494, 1492, 1, 0, 0, 0, 1494, 1495, 1, 0, 0, 0, 1495, 1508, 1, 0, 0, 0, 1496, 1497, 3, 282, 138, 0, 1497, 1500, 3, 300, 147, 0, 1498, 1501, 3, 420, 207, 0, 1499, 1501, 3, 372, 183, 0, 1500, 1498, 1, 0, 0, 0, 1500, 1499, 1, 0, 0, 0, 1500, 1501, 1, 0, 0, 0, 1501, 1503, 1, 0, 0, 0, 1502, 1504, 3, 350, 172, 0, 1503, 1502, 1, 0, 0, 0, 1504, 1505, 1, 0, 0, 0, 1505, 1503, 1, 0, 0, 0, 1505, 1506, 1, 0, 0, 0, 1506, 1508, 1, 0, 0, 0, 1507, 1431, 1, 0, 0, 0, 1507, 1452, 1, 0, 0, 0, 1507, 1466, 1, 0, 0, 0, 1507, 1484, 1, 0, 0, 0, 1507, 1496, 1, 0, 0, 0, 1508, 277, 1, 0, 0, 0, 1509, 1510, 5, 48, 0, 0, 1510, 1512, 3, 294, 144, 0, 1511, 1513, 3, 346, 170, 0, 1512, 1511, 1, 0, 0, 0, 1513, 1514, 1, 0, 0, 0, 1514, 1512, 1, 0, 0, 0, 1514, 1515, 1, 0, 0, 0, 1515, 279, 1, 0, 0, 0, 1516, 1518, 5, 48, 0, 0, 1517, 1519, 3, 348, 171, 0, 1518, 1517, 1, 0, 0, 0, 1519, 1520, 1, 0, 0, 0, 1520, 1518, 1, 0, 0, 0, 1520, 1521, 1, 0, 0, 0, 1521, 281, 1, 0, 0, 0, 1522, 1524, 3, 350, 172, 0, 1523, 1522, 1, 0, 0, 0, 1524, 1525, 1, 0, 0, 0, 1525, 1523, 1, 0, 0, 0, 1525, 1526, 1, 0, 0, 0, 1526, 283, 1, 0, 0, 0, 1527, 1528, 5, 48, 0, 0, 1528, 1530, 3, 338, 166, 0, 1529, 1531, 3, 352, 173, 0, 1530, 1529, 1, 0, 0, 0, 1531, 1532, 1, 0, 0, 0, 1532, 1530, 1, 0, 0, 0, 1532, 1533, 1, 0, 0, 0, 1533, 285, 1, 0, 0, 0, 1534, 1535, 5, 48, 0, 0, 1535, 1537, 7, 2, 0, 0, 1536, 1538, 3, 350, 172, 0, 1537, 1536, 1, 0, 0, 0, 1538, 1539, 1, 0, 0, 0, 1539, 1537, 1, 0, 0, 0, 1539, 1540, 1, 0, 0, 0, 1540, 287, 1, 0, 0, 0, 1541, 1542, 5, 48, 0, 0, 1542, 1544, 7, 3, 0, 0, 1543, 1545, 3, 350, 172, 0, 1544, 1543, 1, 0, 0, 0, 1545, 1546, 1, 0, 0, 0, 1546, 1544, 1, 0, 0, 0, 1546, 1547, 1, 0, 0, 0, 1547, 289, 1, 0, 0, 0, 1548, 1559, 3, 430, 212, 0, 1549, 1558, 8, 4, 0, 0, 1550, 1558, 3, 270, 132, 0, 1551, 1552, 3, 360, 177, 0, 1552, 1553, 3, 430, 212, 0, 1553, 1558, 1, 0, 0, 0, 1554, 1555, 3, 430, 212, 0, 1555, 1556, 3, 430, 212, 0, 1556, 1558, 1, 0, 0, 0, 1557, 1549, 1, 0, 0, 0, 1557, 1550, 1, 0, 0, 0, 1557, 1551, 1, 0, 0, 0, 1557, 1554, 1, 0, 0, 0, 1558, 1561, 1, 0, 0, 0, 1559, 1557, 1, 0, 0, 0, 1559, 1560, 1, 0, 0, 0, 1560, 1562, 1, 0, 0, 0, 1561, 1559, 1, 0, 0, 0, 1562, 1563, 3, 430, 212, 0, 1563, 291, 1, 0, 0, 0, 1564, 1565, 7, 5, 0, 0, 1565, 293, 1, 0, 0, 0, 1566, 1567, 7, 3, 0, 0, 1567, 295, 1, 0, 0, 0, 1568, 1569, 7, 6, 0, 0, 1569, 297, 1, 0, 0, 0, 1570, 1571, 7, 7, 0, 0, 1571, 299, 1, 0, 0, 0, 1572, 1573, 7, 8, 0, 0, 1573, 301, 1, 0, 0, 0, 1574, 1575, 7, 9, 0, 0, 1575, 303, 1, 0, 0, 0, 1576, 1577, 7, 10, 0, 0, 1577, 305, 1, 0, 0, 0, 1578, 1579, 7, 11, 0, 0, 1579, 307, 1, 0, 0, 0, 1580, 1581, 7, 12, 0, 0, 1581, 309, 1, 0, 0, 0, 1582, 1583, 7, 13, 0, 0, 1583, 311, 1, 0, 0, 0, 1584, 1585, 7, 14, 0, 0, 1585, 313, 1, 0, 0, 0, 1586, 1587, 7, 15, 0, 0, 1587, 315, 1, 0, 0, 0, 1588, 1589, 7, 16, 0, 0, 1589, 317, 1, 0, 0, 0, 1590, 1591, 7, 17, 0, 0, 1591, 319, 1, 0, 0, 0, 1592, 1593, 7, 2, 0, 0, 1593, 321, 1, 0, 0, 0, 1594, 1595, 7, 18, 0, 0, 1595, 323, 1, 0, 0, 0, 1596, 1597, 7, 19, 0, 0, 1597, 325, 1, 0, 0, 0, 1598, 1599, 7, 20, 0, 0, 1599, 327, 1, 0, 0, 0, 1600, 1601, 7, 21, 0, 0, 1601, 329, 1, 0, 0, 0, 1602, 1603, 7, 22, 0, 0, 1603, 331, 1, 0, 0, 0, 1604, 1605, 7, 23, 0, 0, 1605, 333, 1, 0, 0, 0, 1606, 1607, 7, 24, 0, 0, 1607, 335, 1, 0, 0, 0, 1608, 1609, 7, 25, 0, 0, 1609, 337, 1, 0, 0, 0, 1610, 1611, 7, 26, 0, 0, 1611, 339, 1, 0, 0, 0, 1612, 1613, 7, 27, 0, 0, 1613, 341, 1, 0, 0, 0, 1614, 1615, 7, 28, 0, 0, 1615, 343, 1, 0, 0, 0, 1616, 1617, 7, 29, 0, 0, 1617, 345, 1, 0, 0, 0, 1618, 1619, 7, 30, 0, 0, 1619, 347, 1, 0, 0, 0, 1620, 1621, 7, 31, 0, 0, 1621, 349, 1, 0, 0, 0, 1622, 1623, 7, 32, 0, 0, 1623, 351, 1, 0, 0, 0, 1624, 1625, 7, 33, 0, 0, 1625, 353, 1, 0, 0, 0, 1626, 1627, 5, 45, 0, 0, 1627, 1628, 5, 62, 0, 0, 1628, 355, 1, 0, 0, 0, 1629, 1630, 5, 42, 0, 0, 1630, 357, 1, 0, 0, 0, 1631, 1632, 5, 96, 0, 0, 1632, 359, 1, 0, 0, 0, 1633, 1634, 5, 92, 0, 0, 1634, 361, 1, 0, 0, 0, 1635, 1636, 5, 58, 0, 0, 1636, 1637, 5, 58, 0, 0, 1637, 363, 1, 0, 0, 0, 1638, 1639, 5, 58, 0, 0, 1639, 1640, 5, 61, 0, 0, 1640, 365, 1, 0, 0, 0, 1641, 1642, 5, 58, 0, 0, 1642, 367, 1, 0, 0, 0, 1643, 1644, 5, 44, 0, 0, 1644, 369, 1, 0, 0, 0, 1645, 1646, 5, 124, 0, 0, 1646, 1647, 5, 124, 0, 0, 1647, 371, 1, 0, 0, 0, 1648, 1649, 5, 45, 0, 0, 1649, 373, 1, 0, 0, 0, 1650, 1651, 5, 36, 0, 0, 1651, 375, 1, 0, 0, 0, 1652, 1653, 5, 46, 0, 0, 1653, 377, 1, 0, 0, 0, 1654, 1655, 5, 61, 0, 0, 1655, 1656, 5, 61, 0, 0, 1656, 379, 1, 0, 0, 0, 1657, 1658, 5, 61, 0, 0, 1658, 381, 1, 0, 0, 0, 1659, 1660, 5, 62, 0, 0, 1660, 1661, 5, 61, 0, 0, 1661, 383, 1, 0, 0, 0, 1662, 1663, 5, 62, 0, 0, 1663, 385, 1, 0, 0, 0, 1664, 1665, 5, 35, 0, 0, 1665, 387, 1, 0, 0, 0, 1666, 1667, 5, 126, 0, 0, 1667, 1668, 5, 42, 0, 0, 1668, 389, 1, 0, 0, 0, 1669, 1670, 5, 61, 0, 0, 1670, 1671, 5, 126, 0, 0, 1671, 1672, 5, 42, 0, 0, 1672, 391, 1, 0, 0, 0, 1673, 1674, 5, 123, 0, 0, 1674, 1675, 1, 0, 0, 0, 1675, 1676, 6, 193, 0, 0, 1676, 393, 1, 0, 0, 0, 1677, 1678, 5, 91, 0, 0, 1678, 395, 1, 0, 0, 0, 1679, 1680, 5, 40, 0, 0, 1680, 397, 1, 0, 0, 0, 1681, 1682, 5, 60, 0, 0, 1682, 1683, 5, 61, 0, 0, 1683, 399, 1, 0, 0, 0, 1684, 1685, 5, 60, 0, 0, 1685, 1686, 5, 47, 0, 0, 1686, 1687, 1, 0, 0, 0, 1687, 1688, 6, 197, 1, 0, 1688, 1689, 6, 197, 2, 0, 1689, 401, 1, 0, 0, 0, 1690, 1691, 5, 60, 0, 0, 1691, 1692, 4, 198, 0, 0, 1692, 1693, 1, 0, 0, 0, 1693, 1694, 6, 198, 3, 0, 1694, 1695, 6, 198, 4, 0, 1695, 403, 1, 0, 0, 0, 1696, 1697, 5, 60, 0, 0, 1697, 405, 1, 0, 0, 0, 1698, 1699, 5, 60, 0, 0, 1699, 1700, 5, 47, 0, 0, 1700, 407, 1, 0, 0, 0, 1701, 1702, 5, 33, 0, 0, 1702, 1706, 5, 61, 0, 0, 1703, 1704, 5, 60, 0, 0, 1704, 1706, 5, 62, 0, 0, 1705, 1701, 1, 0, 0, 0, 1705, 1703, 1, 0, 0, 0, 1706, 409, 1, 0, 0, 0, 1707, 1708, 5, 33, 0, 0, 1708, 1709, 5, 126, 0, 0, 1709, 1710, 5, 42, 0, 0, 1710, 411, 1, 0, 0, 0, 1711, 1712, 5, 33, 0, 0, 1712, 1713, 5, 126, 0, 0, 1713, 413, 1, 0, 0, 0, 1714, 1715, 5, 63, 0, 0, 1715, 1716, 5, 46, 0, 0, 1716, 415, 1, 0, 0, 0, 1717, 1718, 5, 63, 0, 0, 1718, 1719, 5, 63, 0, 0, 1719, 417, 1, 0, 0, 0, 1720, 1721, 5, 37, 0, 0, 1721, 419, 1, 0, 0, 0, 1722, 1723, 5, 43, 0, 0, 1723, 421, 1, 0, 0, 0, 1724, 1725, 5, 63, 0, 0, 1725, 423, 1, 0, 0, 0, 1726, 1727, 5, 34, 0, 0, 1727, 425, 1, 0, 0, 0, 1728, 1729, 5, 102, 0, 0, 1729, 1730, 5, 39, 0, 0, 1730, 1731, 1, 0, 0, 0, 1731, 1732, 6, 210, 5, 0, 1732, 427, 1, 0, 0, 0, 1733, 1734, 5, 70, 0, 0, 1734, 1735, 5, 39, 0, 0, 1735, 1736, 1, 0, 0, 0, 1736, 1737, 6, 211, 6, 0, 1737, 429, 1, 0, 0, 0, 1738, 1739, 5, 39, 0, 0, 1739, 431, 1, 0, 0, 0, 1740, 1741, 5, 126, 0, 0, 1741, 433, 1, 0, 0, 0, 1742, 1743, 5, 61, 0, 0, 1743, 1744, 5, 126, 0, 0, 1744, 435, 1, 0, 0, 0, 1745, 1746, 5, 125, 0, 0, 1746, 1747, 1, 0, 0, 0, 1747, 1748, 6, 215, 7, 0, 1748, 437, 1, 0, 0, 0, 1749, 1750, 5, 93, 0, 0, 1750, 439, 1, 0, 0, 0, 1751, 1752, 5, 41, 0, 0, 1752, 441, 1, 0, 0, 0, 1753, 1754, 5, 59, 0, 0, 1754, 443, 1, 0, 0, 0, 1755, 1756, 5, 47, 0, 0, 1756, 445, 1, 0, 0, 0, 1757, 1758, 5, 47, 0, 0, 1758, 1759, 5, 62, 0, 0, 1759, 447, 1, 0, 0, 0, 1760, 1761, 5, 95, 0, 0, 1761, 449, 1, 0, 0, 0, 1762, 1763, 5, 47, 0, 0, 1763, 1764, 5, 42, 0, 0, 1764, 1768, 1, 0, 0, 0, 1765, 1767, 9, 0, 0, 0, 1766, 1765, 1, 0, 0, 0, 1767, 1770, 1, 0, 0, 0, 1768, 1769, 1, 0, 0, 0, 1768, 1766, 1, 0, 0, 0, 1769, 1771, 1, 0, 0, 0, 1770, 1768, 1, 0, 0, 0, 1771, 1772, 5, 42, 0, 0, 1772, 1773, 5, 47, 0, 0, 1773, 1774, 1, 0, 0, 0, 1774, 1775, 6, 222, 8, 0, 1775, 451, 1, 0, 0, 0, 1776, 1777, 5, 45, 0, 0, 1777, 1781, 5, 45, 0, 0, 1778, 1779, 5, 47, 0, 0, 1779, 1781, 5, 47, 0, 0, 1780, 1776, 1, 0, 0, 0, 1780, 1778, 1, 0, 0, 0, 1781, 1785, 1, 0, 0, 0, 1782, 1784, 8, 34, 0, 0, 1783, 1782, 1, 0, 0, 0, 1784, 1787, 1, 0, 0, 0, 1785, 1783, 1, 0, 0, 0, 1785, 1786, 1, 0, 0, 0, 1786, 1789, 1, 0, 0, 0, 1787, 1785, 1, 0, 0, 0, 1788, 1790, 7, 35, 0, 0, 1789, 1788, 1, 0, 0, 0, 1790, 1791, 1, 0, 0, 0, 1791, 1792, 6, 223, 8, 0, 1792, 453, 1, 0, 0, 0, 1793, 1794, 7, 36, 0, 0, 1794, 1795, 1, 0, 0, 0, 1795, 1796, 6, 224, 9, 0, 1796, 455, 1, 0, 0, 0, 1797, 1798, 9, 0, 0, 0, 1798, 457, 1, 0, 0, 0, 1799, 1811, 8, 37, 0, 0, 1800, 1811, 3, 270, 132, 0, 1801, 1802, 3, 360, 177, 0, 1802, 1803, 3, 430, 212, 0, 1803, 1811, 1, 0, 0, 0, 1804, 1805, 3, 360, 177, 0, 1805, 1806, 3, 392, 193, 0, 1806, 1811, 1, 0, 0, 0, 1807, 1808, 3, 430, 212, 0, 1808, 1809, 3, 430, 212, 0, 1809, 1811, 1, 0, 0, 0, 1810, 1799, 1, 0, 0, 0, 1810, 1800, 1, 0, 0, 0, 1810, 1801, 1, 0, 0, 0, 1810, 1804, 1, 0, 0, 0, 1810, 1807, 1, 0, 0, 0, 1811, 1812, 1, 0, 0, 0, 1812, 1810, 1, 0, 0, 0, 1812, 1813, 1, 0, 0, 0, 1813, 459, 1, 0, 0, 0, 1814, 1815, 3, 392, 193, 0, 1815, 1816, 1, 0, 0, 0, 1816, 1817, 6, 227, 0, 0, 1817, 461, 1, 0, 0, 0, 1818, 1819, 3, 430, 212, 0, 1819, 1820, 1, 0, 0, 0, 1820, 1821, 6, 228, 10, 0, 1821, 1822, 6, 228, 7, 0, 1822, 463, 1, 0, 0, 0, 1823, 1829, 8, 38, 0, 0, 1824, 1829, 3, 270, 132, 0, 1825, 1826, 3, 360, 177, 0, 1826, 1827, 3, 392, 193, 0, 1827, 1829, 1, 0, 0, 0, 1828, 1823, 1, 0, 0, 0, 1828, 1824, 1, 0, 0, 0, 1828, 1825, 1, 0, 0, 0, 1829, 1830, 1, 0, 0, 0, 1830, 1828, 1, 0, 0, 0, 1830, 1831, 1, 0, 0, 0, 1831, 465, 1, 0, 0, 0, 1832, 1833, 3, 392, 193, 0, 1833, 1834, 1, 0, 0, 0, 1834, 1835, 6, 230, 0, 0, 1835, 467, 1, 0, 0, 0, 1836, 1837, 5, 47, 0, 0, 1837, 1838, 5, 62, 0, 0, 1838, 1839, 1, 0, 0, 0, 1839, 1840, 6, 231, 11, 0, 1840, 1841, 6, 231, 7, 0, 1841, 469, 1, 0, 0, 0, 1842, 1843, 5, 62, 0, 0, 1843, 1844, 1, 0, 0, 0, 1844, 1845, 6, 232, 12, 0, 1845, 1846, 6, 232, 7, 0, 1846, 1847, 6, 232, 13, 0, 1847, 471, 1, 0, 0, 0, 1848, 1852, 7, 39, 0, 0, 1849, 1851, 7, 40, 0, 0, 1850, 1849, 1, 0, 0, 0, 1851, 1854, 1, 0, 0, 0, 1852, 1850, 1, 0, 0, 0, 1852, 1853, 1, 0, 0, 0, 1853, 1855, 1, 0, 0, 0, 1854, 1852, 1, 0, 0, 0, 1855, 1856, 6, 233, 14, 0, 1856, 473, 1, 0, 0, 0, 1857, 1858, 5, 61, 0, 0, 1858, 1859, 1, 0, 0, 0, 1859, 1860, 6, 234, 15, 0, 1860, 475, 1, 0, 0, 0, 1861, 1862, 3, 290, 142, 0, 1862, 1863, 1, 0, 0, 0, 1863, 1864, 6, 235, 16, 0, 1864, 477, 1, 0, 0, 0, 1865, 1867, 7, 41, 0, 0, 1866, 1865, 1, 0, 0, 0, 1867, 1868, 1, 0, 0, 0, 1868, 1866, 1, 0, 0, 0, 1868, 1869, 1, 0, 0, 0, 1869, 1870, 1, 0, 0, 0, 1870, 1871, 6, 236, 9, 0, 1871, 479, 1, 0, 0, 0, 1872, 1873, 5, 123, 0, 0, 1873, 1874, 1, 0, 0, 0, 1874, 1875, 6, 237, 17, 0, 1875, 1876, 6, 237, 0, 0, 1876, 481, 1, 0, 0, 0, 1877, 1878, 5, 62, 0, 0, 1878, 1879, 1, 0, 0, 0, 1879, 1880, 6, 238, 12, 0, 1880, 1881, 6, 238, 7, 0, 1881, 483, 1, 0, 0, 0, 1882, 1886, 7, 39, 0, 0, 1883, 1885, 7, 40, 0, 0, 1884, 1883, 1, 0, 0, 0, 1885, 1888, 1, 0, 0, 0, 1886, 1884, 1, 0, 0, 0, 1886, 1887, 1, 0, 0, 0, 1887, 1889, 1, 0, 0, 0, 1888, 1886, 1, 0, 0, 0, 1889, 1890, 6, 239, 14, 0, 1890, 485, 1, 0, 0, 0, 1891, 1893, 7, 41, 0, 0, 1892, 1891, 1, 0, 0, 0, 1893, 1894, 1, 0, 0, 0, 1894, 1892, 1, 0, 0, 0, 1894, 1895, 1, 0, 0, 0, 1895, 1896, 1, 0, 0, 0, 1896, 1897, 6, 240, 9, 0, 1897, 487, 1, 0, 0, 0, 1898, 1900, 8, 42, 0, 0, 1899, 1898, 1, 0, 0, 0, 1900, 1901, 1, 0, 0, 0, 1901, 1899, 1, 0, 0, 0, 1901, 1902, 1, 0, 0, 0, 1902, 489, 1, 0, 0, 0, 1903, 1904, 5, 123, 0, 0, 1904, 1905, 1, 0, 0, 0, 1905, 1906, 6, 242, 17, 0, 1906, 1907, 6, 242, 0, 0, 1907, 491, 1, 0, 0, 0, 1908, 1909, 5, 60, 0, 0, 1909, 1910, 5, 47, 0, 0, 1910, 1911, 1, 0, 0, 0, 1911, 1912, 6, 243, 1, 0, 1912, 1913, 6, 243, 7, 0, 1913, 1914, 6, 243, 2, 0, 1914, 493, 1, 0, 0, 0, 1915, 1916, 5, 60, 0, 0, 1916, 1917, 1, 0, 0, 0, 1917, 1918, 6, 244, 3, 0, 1918, 1919, 6, 244, 4, 0, 1919, 495, 1, 0, 0, 0, 1920, 1922, 7, 41, 0, 0, 1921, 1920, 1, 0, 0, 0, 1922, 1923, 1, 0, 0, 0, 1923, 1921, 1, 0, 0, 0, 1923, 1924, 1, 0, 0, 0, 1924, 1925, 1, 0, 0, 0, 1925, 1926, 6, 245, 9, 0, 1926, 497, 1, 0, 0, 0, 56, 0, 1, 2, 3, 4, 5, 538, 818, 1347, 1381, 1386, 1392, 1394, 1406, 1408, 1422, 1424, 1429, 1436, 1441, 1445, 1450, 1455, 1459, 1464, 1471, 1477, 1482, 1489, 1494, 1500, 1505, 1507, 1514, 1520, 1525, 1532, 1539, 1546, 1557, 1559, 1705, 1768, 1780, 1785, 1789, 1810, 1812, 1828, 1830, 1852, 1868, 1886, 1894, 1901, 1923, 18, 5, 0, 0, 7, 168, 0, 5, 4, 0, 7, 167, 0, 5, 3, 0, 5, 1, 0, 5, 2, 0, 4, 0, 0, 6, 0, 0, 0, 1, 0, 7, 180, 0, 7, 188, 0, 7, 159, 0, 5, 5, 0, 7, 134, 0, 7, 157, 0, 7, 143, 0, 7, 163, 0]
\ No newline at end of file
+[4, 0, 205, 2003, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 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, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103, 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, 108, 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 2, 111, 7, 111, 2, 112, 7, 112, 2, 113, 7, 113, 2, 114, 7, 114, 2, 115, 7, 115, 2, 116, 7, 116, 2, 117, 7, 117, 2, 118, 7, 118, 2, 119, 7, 119, 2, 120, 7, 120, 2, 121, 7, 121, 2, 122, 7, 122, 2, 123, 7, 123, 2, 124, 7, 124, 2, 125, 7, 125, 2, 126, 7, 126, 2, 127, 7, 127, 2, 128, 7, 128, 2, 129, 7, 129, 2, 130, 7, 130, 2, 131, 7, 131, 2, 132, 7, 132, 2, 133, 7, 133, 2, 134, 7, 134, 2, 135, 7, 135, 2, 136, 7, 136, 2, 137, 7, 137, 2, 138, 7, 138, 2, 139, 7, 139, 2, 140, 7, 140, 2, 141, 7, 141, 2, 142, 7, 142, 2, 143, 7, 143, 2, 144, 7, 144, 2, 145, 7, 145, 2, 146, 7, 146, 2, 147, 7, 147, 2, 148, 7, 148, 2, 149, 7, 149, 2, 150, 7, 150, 2, 151, 7, 151, 2, 152, 7, 152, 2, 153, 7, 153, 2, 154, 7, 154, 2, 155, 7, 155, 2, 156, 7, 156, 2, 157, 7, 157, 2, 158, 7, 158, 2, 159, 7, 159, 2, 160, 7, 160, 2, 161, 7, 161, 2, 162, 7, 162, 2, 163, 7, 163, 2, 164, 7, 164, 2, 165, 7, 165, 2, 166, 7, 166, 2, 167, 7, 167, 2, 168, 7, 168, 2, 169, 7, 169, 2, 170, 7, 170, 2, 171, 7, 171, 2, 172, 7, 172, 2, 173, 7, 173, 2, 174, 7, 174, 2, 175, 7, 175, 2, 176, 7, 176, 2, 177, 7, 177, 2, 178, 7, 178, 2, 179, 7, 179, 2, 180, 7, 180, 2, 181, 7, 181, 2, 182, 7, 182, 2, 183, 7, 183, 2, 184, 7, 184, 2, 185, 7, 185, 2, 186, 7, 186, 2, 187, 7, 187, 2, 188, 7, 188, 2, 189, 7, 189, 2, 190, 7, 190, 2, 191, 7, 191, 2, 192, 7, 192, 2, 193, 7, 193, 2, 194, 7, 194, 2, 195, 7, 195, 2, 196, 7, 196, 2, 197, 7, 197, 2, 198, 7, 198, 2, 199, 7, 199, 2, 200, 7, 200, 2, 201, 7, 201, 2, 202, 7, 202, 2, 203, 7, 203, 2, 204, 7, 204, 2, 205, 7, 205, 2, 206, 7, 206, 2, 207, 7, 207, 2, 208, 7, 208, 2, 209, 7, 209, 2, 210, 7, 210, 2, 211, 7, 211, 2, 212, 7, 212, 2, 213, 7, 213, 2, 214, 7, 214, 2, 215, 7, 215, 2, 216, 7, 216, 2, 217, 7, 217, 2, 218, 7, 218, 2, 219, 7, 219, 2, 220, 7, 220, 2, 221, 7, 221, 2, 222, 7, 222, 2, 223, 7, 223, 2, 224, 7, 224, 2, 225, 7, 225, 2, 226, 7, 226, 2, 227, 7, 227, 2, 228, 7, 228, 2, 229, 7, 229, 2, 230, 7, 230, 2, 231, 7, 231, 2, 232, 7, 232, 2, 233, 7, 233, 2, 234, 7, 234, 2, 235, 7, 235, 2, 236, 7, 236, 2, 237, 7, 237, 2, 238, 7, 238, 2, 239, 7, 239, 2, 240, 7, 240, 2, 241, 7, 241, 2, 242, 7, 242, 2, 243, 7, 243, 2, 244, 7, 244, 2, 245, 7, 245, 2, 246, 7, 246, 2, 247, 7, 247, 2, 248, 7, 248, 2, 249, 7, 249, 2, 250, 7, 250, 2, 251, 7, 251, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 551, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 50, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 3, 51, 831, 8, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 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, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 56, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, 1, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 62, 1, 62, 1, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 71, 1, 71, 1, 71, 1, 71, 1, 72, 1, 72, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 75, 1, 75, 1, 75, 1, 75, 1, 75, 1, 75, 1, 75, 1, 76, 1, 76, 1, 76, 1, 77, 1, 77, 1, 77, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 82, 1, 82, 1, 82, 1, 82, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 94, 1, 94, 1, 94, 1, 94, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 109, 1, 109, 1, 109, 1, 109, 1, 109, 1, 109, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 111, 1, 111, 1, 111, 1, 112, 1, 112, 1, 112, 1, 112, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 115, 1, 115, 1, 115, 1, 115, 1, 115, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 117, 1, 117, 1, 117, 1, 117, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 120, 1, 120, 1, 120, 1, 120, 1, 120, 1, 120, 1, 121, 1, 121, 1, 121, 1, 121, 1, 121, 1, 121, 1, 121, 1, 121, 1, 122, 1, 122, 1, 122, 1, 122, 1, 122, 1, 122, 1, 123, 1, 123, 1, 123, 1, 123, 1, 123, 1, 123, 1, 123, 1, 124, 1, 124, 1, 124, 1, 124, 1, 124, 1, 125, 1, 125, 1, 125, 1, 125, 1, 125, 1, 126, 1, 126, 1, 126, 1, 126, 1, 126, 1, 126, 1, 127, 1, 127, 1, 127, 1, 127, 1, 127, 1, 127, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 1, 129, 1, 129, 1, 129, 1, 129, 1, 129, 1, 130, 1, 130, 1, 130, 1, 130, 1, 130, 1, 130, 1, 130, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 3, 131, 1360, 8, 131, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 3, 132, 1394, 8, 132, 1, 133, 1, 133, 1, 133, 3, 133, 1399, 8, 133, 1, 133, 1, 133, 1, 133, 1, 133, 5, 133, 1405, 8, 133, 10, 133, 12, 133, 1408, 9, 133, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 5, 134, 1419, 8, 134, 10, 134, 12, 134, 1422, 9, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 5, 134, 1435, 8, 134, 10, 134, 12, 134, 1438, 9, 134, 1, 134, 1, 134, 3, 134, 1442, 8, 134, 1, 135, 1, 135, 1, 135, 5, 135, 1447, 8, 135, 10, 135, 12, 135, 1450, 9, 135, 1, 135, 1, 135, 1, 135, 3, 135, 1455, 8, 135, 1, 135, 4, 135, 1458, 8, 135, 11, 135, 12, 135, 1459, 1, 135, 1, 135, 1, 135, 1, 135, 3, 135, 1466, 8, 135, 1, 135, 4, 135, 1469, 8, 135, 11, 135, 12, 135, 1470, 1, 135, 1, 135, 1, 135, 5, 135, 1476, 8, 135, 10, 135, 12, 135, 1479, 9, 135, 1, 135, 1, 135, 1, 135, 3, 135, 1484, 8, 135, 1, 135, 4, 135, 1487, 8, 135, 11, 135, 12, 135, 1488, 1, 135, 1, 135, 1, 135, 1, 135, 1, 135, 3, 135, 1496, 8, 135, 1, 135, 4, 135, 1499, 8, 135, 11, 135, 12, 135, 1500, 1, 135, 1, 135, 1, 135, 1, 135, 3, 135, 1507, 8, 135, 1, 135, 4, 135, 1510, 8, 135, 11, 135, 12, 135, 1511, 3, 135, 1514, 8, 135, 1, 136, 1, 136, 1, 136, 4, 136, 1519, 8, 136, 11, 136, 12, 136, 1520, 1, 137, 1, 137, 4, 137, 1525, 8, 137, 11, 137, 12, 137, 1526, 1, 138, 4, 138, 1530, 8, 138, 11, 138, 12, 138, 1531, 1, 139, 1, 139, 1, 139, 4, 139, 1537, 8, 139, 11, 139, 12, 139, 1538, 1, 140, 1, 140, 1, 140, 4, 140, 1544, 8, 140, 11, 140, 12, 140, 1545, 1, 141, 1, 141, 1, 141, 4, 141, 1551, 8, 141, 11, 141, 12, 141, 1552, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 5, 142, 1564, 8, 142, 10, 142, 12, 142, 1567, 9, 142, 1, 142, 1, 142, 1, 143, 1, 143, 1, 144, 1, 144, 1, 145, 1, 145, 1, 146, 1, 146, 1, 147, 1, 147, 1, 148, 1, 148, 1, 149, 1, 149, 1, 150, 1, 150, 1, 151, 1, 151, 1, 152, 1, 152, 1, 153, 1, 153, 1, 154, 1, 154, 1, 155, 1, 155, 1, 156, 1, 156, 1, 157, 1, 157, 1, 158, 1, 158, 1, 159, 1, 159, 1, 160, 1, 160, 1, 161, 1, 161, 1, 162, 1, 162, 1, 163, 1, 163, 1, 164, 1, 164, 1, 165, 1, 165, 1, 166, 1, 166, 1, 167, 1, 167, 1, 168, 1, 168, 1, 169, 1, 169, 1, 170, 1, 170, 1, 171, 1, 171, 1, 172, 1, 172, 1, 173, 1, 173, 1, 174, 1, 174, 1, 174, 1, 175, 1, 175, 1, 176, 1, 176, 1, 177, 1, 177, 1, 178, 1, 178, 1, 178, 1, 179, 1, 179, 1, 179, 1, 180, 1, 180, 1, 181, 1, 181, 1, 182, 1, 182, 1, 182, 1, 183, 1, 183, 1, 184, 1, 184, 1, 185, 1, 185, 1, 186, 1, 186, 1, 186, 1, 187, 1, 187, 1, 188, 1, 188, 1, 188, 1, 189, 1, 189, 1, 190, 1, 190, 1, 191, 1, 191, 1, 191, 1, 192, 1, 192, 1, 192, 1, 192, 1, 193, 1, 193, 1, 193, 1, 193, 1, 194, 1, 194, 1, 195, 1, 195, 1, 196, 1, 196, 1, 196, 1, 197, 1, 197, 1, 197, 1, 197, 1, 197, 1, 197, 1, 198, 1, 198, 1, 198, 1, 198, 1, 198, 1, 198, 1, 199, 1, 199, 1, 200, 1, 200, 1, 200, 1, 201, 1, 201, 1, 201, 1, 201, 3, 201, 1712, 8, 201, 1, 202, 1, 202, 1, 202, 1, 202, 1, 203, 1, 203, 1, 203, 1, 204, 1, 204, 1, 204, 1, 205, 1, 205, 1, 205, 1, 206, 1, 206, 1, 207, 1, 207, 1, 208, 1, 208, 1, 209, 1, 209, 1, 210, 1, 210, 1, 210, 1, 210, 1, 210, 1, 211, 1, 211, 1, 211, 1, 211, 1, 211, 1, 212, 1, 212, 1, 213, 1, 213, 1, 214, 1, 214, 1, 214, 1, 215, 1, 215, 1, 215, 1, 215, 1, 216, 1, 216, 1, 217, 1, 217, 1, 218, 1, 218, 1, 219, 1, 219, 1, 220, 1, 220, 1, 220, 1, 221, 1, 221, 1, 222, 1, 222, 1, 222, 1, 222, 5, 222, 1773, 8, 222, 10, 222, 12, 222, 1776, 9, 222, 1, 222, 1, 222, 1, 222, 1, 222, 1, 222, 1, 223, 1, 223, 1, 223, 1, 223, 3, 223, 1787, 8, 223, 1, 223, 5, 223, 1790, 8, 223, 10, 223, 12, 223, 1793, 9, 223, 1, 223, 3, 223, 1796, 8, 223, 1, 223, 1, 223, 1, 224, 1, 224, 1, 224, 1, 224, 1, 225, 1, 225, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 4, 226, 1817, 8, 226, 11, 226, 12, 226, 1818, 1, 227, 1, 227, 1, 227, 1, 227, 1, 228, 1, 228, 1, 228, 1, 228, 1, 228, 1, 229, 1, 229, 1, 229, 1, 229, 1, 229, 4, 229, 1835, 8, 229, 11, 229, 12, 229, 1836, 1, 230, 1, 230, 1, 230, 1, 230, 1, 231, 1, 231, 1, 231, 1, 231, 1, 231, 1, 231, 1, 232, 1, 232, 1, 232, 1, 232, 1, 232, 1, 232, 1, 233, 1, 233, 1, 233, 1, 233, 5, 233, 1859, 8, 233, 10, 233, 12, 233, 1862, 9, 233, 1, 233, 1, 233, 1, 233, 1, 233, 1, 233, 1, 234, 1, 234, 1, 234, 1, 234, 3, 234, 1873, 8, 234, 1, 234, 5, 234, 1876, 8, 234, 10, 234, 12, 234, 1879, 9, 234, 1, 234, 3, 234, 1882, 8, 234, 1, 234, 1, 234, 1, 235, 1, 235, 5, 235, 1888, 8, 235, 10, 235, 12, 235, 1891, 9, 235, 1, 235, 1, 235, 1, 236, 1, 236, 1, 236, 1, 236, 1, 237, 1, 237, 1, 237, 1, 237, 1, 238, 4, 238, 1904, 8, 238, 11, 238, 12, 238, 1905, 1, 238, 1, 238, 1, 239, 1, 239, 1, 239, 1, 239, 1, 239, 1, 240, 1, 240, 1, 240, 1, 240, 1, 241, 1, 241, 1, 241, 1, 241, 1, 241, 1, 242, 1, 242, 1, 242, 1, 242, 5, 242, 1928, 8, 242, 10, 242, 12, 242, 1931, 9, 242, 1, 242, 1, 242, 1, 242, 1, 242, 1, 242, 1, 243, 1, 243, 1, 243, 1, 243, 3, 243, 1942, 8, 243, 1, 243, 5, 243, 1945, 8, 243, 10, 243, 12, 243, 1948, 9, 243, 1, 243, 3, 243, 1951, 8, 243, 1, 243, 1, 243, 1, 244, 1, 244, 5, 244, 1957, 8, 244, 10, 244, 12, 244, 1960, 9, 244, 1, 244, 1, 244, 1, 245, 4, 245, 1965, 8, 245, 11, 245, 12, 245, 1966, 1, 245, 1, 245, 1, 246, 1, 246, 1, 246, 1, 246, 1, 247, 4, 247, 1976, 8, 247, 11, 247, 12, 247, 1977, 1, 248, 1, 248, 1, 248, 1, 248, 1, 248, 1, 249, 1, 249, 1, 249, 1, 249, 1, 249, 1, 249, 1, 249, 1, 250, 1, 250, 1, 250, 1, 250, 1, 250, 1, 251, 4, 251, 1998, 8, 251, 11, 251, 12, 251, 1999, 1, 251, 1, 251, 3, 1774, 1860, 1929, 0, 252, 6, 1, 8, 2, 10, 3, 12, 4, 14, 5, 16, 6, 18, 7, 20, 8, 22, 9, 24, 10, 26, 11, 28, 12, 30, 13, 32, 14, 34, 15, 36, 16, 38, 17, 40, 18, 42, 19, 44, 20, 46, 21, 48, 22, 50, 23, 52, 24, 54, 25, 56, 26, 58, 27, 60, 28, 62, 29, 64, 30, 66, 31, 68, 32, 70, 33, 72, 34, 74, 35, 76, 36, 78, 37, 80, 38, 82, 39, 84, 40, 86, 41, 88, 42, 90, 43, 92, 44, 94, 45, 96, 46, 98, 47, 100, 48, 102, 49, 104, 50, 106, 51, 108, 52, 110, 53, 112, 54, 114, 55, 116, 56, 118, 57, 120, 58, 122, 59, 124, 60, 126, 61, 128, 62, 130, 63, 132, 64, 134, 65, 136, 66, 138, 67, 140, 68, 142, 69, 144, 70, 146, 71, 148, 72, 150, 73, 152, 74, 154, 75, 156, 76, 158, 77, 160, 78, 162, 79, 164, 80, 166, 81, 168, 82, 170, 83, 172, 84, 174, 85, 176, 86, 178, 87, 180, 88, 182, 89, 184, 90, 186, 91, 188, 92, 190, 93, 192, 94, 194, 95, 196, 96, 198, 97, 200, 98, 202, 99, 204, 100, 206, 101, 208, 102, 210, 103, 212, 104, 214, 105, 216, 106, 218, 107, 220, 108, 222, 109, 224, 110, 226, 111, 228, 112, 230, 113, 232, 114, 234, 115, 236, 116, 238, 117, 240, 118, 242, 119, 244, 120, 246, 121, 248, 122, 250, 123, 252, 124, 254, 125, 256, 126, 258, 127, 260, 128, 262, 129, 264, 130, 266, 131, 268, 132, 270, 133, 272, 134, 274, 135, 276, 136, 278, 137, 280, 138, 282, 139, 284, 140, 286, 141, 288, 142, 290, 143, 292, 0, 294, 0, 296, 0, 298, 0, 300, 0, 302, 0, 304, 0, 306, 0, 308, 0, 310, 0, 312, 0, 314, 0, 316, 0, 318, 0, 320, 0, 322, 0, 324, 0, 326, 0, 328, 0, 330, 0, 332, 0, 334, 0, 336, 0, 338, 0, 340, 0, 342, 0, 344, 0, 346, 0, 348, 0, 350, 0, 352, 0, 354, 144, 356, 145, 358, 146, 360, 147, 362, 148, 364, 149, 366, 150, 368, 151, 370, 152, 372, 153, 374, 154, 376, 155, 378, 156, 380, 157, 382, 158, 384, 159, 386, 160, 388, 161, 390, 162, 392, 163, 394, 164, 396, 165, 398, 166, 400, 0, 402, 0, 404, 167, 406, 168, 408, 169, 410, 170, 412, 171, 414, 172, 416, 173, 418, 174, 420, 175, 422, 176, 424, 177, 426, 178, 428, 179, 430, 180, 432, 181, 434, 182, 436, 183, 438, 184, 440, 185, 442, 186, 444, 187, 446, 188, 448, 189, 450, 190, 452, 191, 454, 192, 456, 193, 458, 194, 460, 195, 462, 0, 464, 196, 466, 197, 468, 0, 470, 0, 472, 198, 474, 199, 476, 0, 478, 0, 480, 0, 482, 200, 484, 0, 486, 0, 488, 0, 490, 201, 492, 202, 494, 0, 496, 203, 498, 0, 500, 204, 502, 0, 504, 0, 506, 0, 508, 205, 6, 0, 1, 2, 3, 4, 5, 43, 2, 0, 92, 92, 96, 96, 2, 0, 34, 34, 92, 92, 2, 0, 79, 79, 111, 111, 2, 0, 66, 66, 98, 98, 2, 0, 39, 39, 92, 92, 2, 0, 65, 65, 97, 97, 2, 0, 67, 67, 99, 99, 2, 0, 68, 68, 100, 100, 2, 0, 69, 69, 101, 101, 2, 0, 70, 70, 102, 102, 2, 0, 71, 71, 103, 103, 2, 0, 72, 72, 104, 104, 2, 0, 73, 73, 105, 105, 2, 0, 74, 74, 106, 106, 2, 0, 75, 75, 107, 107, 2, 0, 76, 76, 108, 108, 2, 0, 77, 77, 109, 109, 2, 0, 78, 78, 110, 110, 2, 0, 80, 80, 112, 112, 2, 0, 81, 81, 113, 113, 2, 0, 82, 82, 114, 114, 2, 0, 83, 83, 115, 115, 2, 0, 84, 84, 116, 116, 2, 0, 85, 85, 117, 117, 2, 0, 86, 86, 118, 118, 2, 0, 87, 87, 119, 119, 2, 0, 88, 88, 120, 120, 2, 0, 89, 89, 121, 121, 2, 0, 90, 90, 122, 122, 2, 0, 65, 90, 97, 122, 1, 0, 48, 49, 1, 0, 48, 55, 1, 0, 48, 57, 3, 0, 48, 57, 65, 70, 97, 102, 2, 0, 10, 10, 13, 13, 2, 1, 10, 10, 13, 13, 11, 0, 9, 13, 32, 32, 133, 133, 160, 160, 5760, 5760, 8192, 8202, 8232, 8233, 8239, 8239, 8287, 8287, 12288, 12288, 65279, 65279, 3, 0, 39, 39, 92, 92, 123, 123, 1, 0, 123, 123, 3, 0, 65, 90, 95, 95, 97, 122, 5, 0, 45, 45, 48, 57, 65, 90, 95, 95, 97, 122, 3, 0, 9, 10, 13, 13, 32, 32, 2, 0, 60, 60, 123, 123, 2048, 0, 6, 1, 0, 0, 0, 0, 8, 1, 0, 0, 0, 0, 10, 1, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 14, 1, 0, 0, 0, 0, 16, 1, 0, 0, 0, 0, 18, 1, 0, 0, 0, 0, 20, 1, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 24, 1, 0, 0, 0, 0, 26, 1, 0, 0, 0, 0, 28, 1, 0, 0, 0, 0, 30, 1, 0, 0, 0, 0, 32, 1, 0, 0, 0, 0, 34, 1, 0, 0, 0, 0, 36, 1, 0, 0, 0, 0, 38, 1, 0, 0, 0, 0, 40, 1, 0, 0, 0, 0, 42, 1, 0, 0, 0, 0, 44, 1, 0, 0, 0, 0, 46, 1, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 50, 1, 0, 0, 0, 0, 52, 1, 0, 0, 0, 0, 54, 1, 0, 0, 0, 0, 56, 1, 0, 0, 0, 0, 58, 1, 0, 0, 0, 0, 60, 1, 0, 0, 0, 0, 62, 1, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 66, 1, 0, 0, 0, 0, 68, 1, 0, 0, 0, 0, 70, 1, 0, 0, 0, 0, 72, 1, 0, 0, 0, 0, 74, 1, 0, 0, 0, 0, 76, 1, 0, 0, 0, 0, 78, 1, 0, 0, 0, 0, 80, 1, 0, 0, 0, 0, 82, 1, 0, 0, 0, 0, 84, 1, 0, 0, 0, 0, 86, 1, 0, 0, 0, 0, 88, 1, 0, 0, 0, 0, 90, 1, 0, 0, 0, 0, 92, 1, 0, 0, 0, 0, 94, 1, 0, 0, 0, 0, 96, 1, 0, 0, 0, 0, 98, 1, 0, 0, 0, 0, 100, 1, 0, 0, 0, 0, 102, 1, 0, 0, 0, 0, 104, 1, 0, 0, 0, 0, 106, 1, 0, 0, 0, 0, 108, 1, 0, 0, 0, 0, 110, 1, 0, 0, 0, 0, 112, 1, 0, 0, 0, 0, 114, 1, 0, 0, 0, 0, 116, 1, 0, 0, 0, 0, 118, 1, 0, 0, 0, 0, 120, 1, 0, 0, 0, 0, 122, 1, 0, 0, 0, 0, 124, 1, 0, 0, 0, 0, 126, 1, 0, 0, 0, 0, 128, 1, 0, 0, 0, 0, 130, 1, 0, 0, 0, 0, 132, 1, 0, 0, 0, 0, 134, 1, 0, 0, 0, 0, 136, 1, 0, 0, 0, 0, 138, 1, 0, 0, 0, 0, 140, 1, 0, 0, 0, 0, 142, 1, 0, 0, 0, 0, 144, 1, 0, 0, 0, 0, 146, 1, 0, 0, 0, 0, 148, 1, 0, 0, 0, 0, 150, 1, 0, 0, 0, 0, 152, 1, 0, 0, 0, 0, 154, 1, 0, 0, 0, 0, 156, 1, 0, 0, 0, 0, 158, 1, 0, 0, 0, 0, 160, 1, 0, 0, 0, 0, 162, 1, 0, 0, 0, 0, 164, 1, 0, 0, 0, 0, 166, 1, 0, 0, 0, 0, 168, 1, 0, 0, 0, 0, 170, 1, 0, 0, 0, 0, 172, 1, 0, 0, 0, 0, 174, 1, 0, 0, 0, 0, 176, 1, 0, 0, 0, 0, 178, 1, 0, 0, 0, 0, 180, 1, 0, 0, 0, 0, 182, 1, 0, 0, 0, 0, 184, 1, 0, 0, 0, 0, 186, 1, 0, 0, 0, 0, 188, 1, 0, 0, 0, 0, 190, 1, 0, 0, 0, 0, 192, 1, 0, 0, 0, 0, 194, 1, 0, 0, 0, 0, 196, 1, 0, 0, 0, 0, 198, 1, 0, 0, 0, 0, 200, 1, 0, 0, 0, 0, 202, 1, 0, 0, 0, 0, 204, 1, 0, 0, 0, 0, 206, 1, 0, 0, 0, 0, 208, 1, 0, 0, 0, 0, 210, 1, 0, 0, 0, 0, 212, 1, 0, 0, 0, 0, 214, 1, 0, 0, 0, 0, 216, 1, 0, 0, 0, 0, 218, 1, 0, 0, 0, 0, 220, 1, 0, 0, 0, 0, 222, 1, 0, 0, 0, 0, 224, 1, 0, 0, 0, 0, 226, 1, 0, 0, 0, 0, 228, 1, 0, 0, 0, 0, 230, 1, 0, 0, 0, 0, 232, 1, 0, 0, 0, 0, 234, 1, 0, 0, 0, 0, 236, 1, 0, 0, 0, 0, 238, 1, 0, 0, 0, 0, 240, 1, 0, 0, 0, 0, 242, 1, 0, 0, 0, 0, 244, 1, 0, 0, 0, 0, 246, 1, 0, 0, 0, 0, 248, 1, 0, 0, 0, 0, 250, 1, 0, 0, 0, 0, 252, 1, 0, 0, 0, 0, 254, 1, 0, 0, 0, 0, 256, 1, 0, 0, 0, 0, 258, 1, 0, 0, 0, 0, 260, 1, 0, 0, 0, 0, 262, 1, 0, 0, 0, 0, 264, 1, 0, 0, 0, 0, 266, 1, 0, 0, 0, 0, 268, 1, 0, 0, 0, 0, 270, 1, 0, 0, 0, 0, 272, 1, 0, 0, 0, 0, 274, 1, 0, 0, 0, 0, 276, 1, 0, 0, 0, 0, 278, 1, 0, 0, 0, 0, 280, 1, 0, 0, 0, 0, 282, 1, 0, 0, 0, 0, 284, 1, 0, 0, 0, 0, 286, 1, 0, 0, 0, 0, 288, 1, 0, 0, 0, 0, 290, 1, 0, 0, 0, 0, 354, 1, 0, 0, 0, 0, 356, 1, 0, 0, 0, 0, 358, 1, 0, 0, 0, 0, 360, 1, 0, 0, 0, 0, 362, 1, 0, 0, 0, 0, 364, 1, 0, 0, 0, 0, 366, 1, 0, 0, 0, 0, 368, 1, 0, 0, 0, 0, 370, 1, 0, 0, 0, 0, 372, 1, 0, 0, 0, 0, 374, 1, 0, 0, 0, 0, 376, 1, 0, 0, 0, 0, 378, 1, 0, 0, 0, 0, 380, 1, 0, 0, 0, 0, 382, 1, 0, 0, 0, 0, 384, 1, 0, 0, 0, 0, 386, 1, 0, 0, 0, 0, 388, 1, 0, 0, 0, 0, 390, 1, 0, 0, 0, 0, 392, 1, 0, 0, 0, 0, 394, 1, 0, 0, 0, 0, 396, 1, 0, 0, 0, 0, 398, 1, 0, 0, 0, 0, 400, 1, 0, 0, 0, 0, 402, 1, 0, 0, 0, 0, 404, 1, 0, 0, 0, 0, 406, 1, 0, 0, 0, 0, 408, 1, 0, 0, 0, 0, 410, 1, 0, 0, 0, 0, 412, 1, 0, 0, 0, 0, 414, 1, 0, 0, 0, 0, 416, 1, 0, 0, 0, 0, 418, 1, 0, 0, 0, 0, 420, 1, 0, 0, 0, 0, 422, 1, 0, 0, 0, 0, 424, 1, 0, 0, 0, 0, 426, 1, 0, 0, 0, 0, 428, 1, 0, 0, 0, 0, 430, 1, 0, 0, 0, 0, 432, 1, 0, 0, 0, 0, 434, 1, 0, 0, 0, 0, 436, 1, 0, 0, 0, 0, 438, 1, 0, 0, 0, 0, 440, 1, 0, 0, 0, 0, 442, 1, 0, 0, 0, 0, 444, 1, 0, 0, 0, 0, 446, 1, 0, 0, 0, 0, 448, 1, 0, 0, 0, 0, 450, 1, 0, 0, 0, 0, 452, 1, 0, 0, 0, 0, 454, 1, 0, 0, 0, 0, 456, 1, 0, 0, 0, 1, 458, 1, 0, 0, 0, 1, 460, 1, 0, 0, 0, 1, 462, 1, 0, 0, 0, 2, 464, 1, 0, 0, 0, 2, 466, 1, 0, 0, 0, 3, 468, 1, 0, 0, 0, 3, 470, 1, 0, 0, 0, 3, 472, 1, 0, 0, 0, 3, 474, 1, 0, 0, 0, 3, 476, 1, 0, 0, 0, 3, 478, 1, 0, 0, 0, 3, 480, 1, 0, 0, 0, 3, 482, 1, 0, 0, 0, 3, 484, 1, 0, 0, 0, 3, 486, 1, 0, 0, 0, 4, 488, 1, 0, 0, 0, 4, 490, 1, 0, 0, 0, 4, 492, 1, 0, 0, 0, 4, 494, 1, 0, 0, 0, 4, 496, 1, 0, 0, 0, 4, 498, 1, 0, 0, 0, 5, 500, 1, 0, 0, 0, 5, 502, 1, 0, 0, 0, 5, 504, 1, 0, 0, 0, 5, 506, 1, 0, 0, 0, 5, 508, 1, 0, 0, 0, 6, 510, 1, 0, 0, 0, 8, 514, 1, 0, 0, 0, 10, 518, 1, 0, 0, 0, 12, 523, 1, 0, 0, 0, 14, 527, 1, 0, 0, 0, 16, 533, 1, 0, 0, 0, 18, 550, 1, 0, 0, 0, 20, 552, 1, 0, 0, 0, 22, 557, 1, 0, 0, 0, 24, 565, 1, 0, 0, 0, 26, 570, 1, 0, 0, 0, 28, 573, 1, 0, 0, 0, 30, 578, 1, 0, 0, 0, 32, 583, 1, 0, 0, 0, 34, 589, 1, 0, 0, 0, 36, 596, 1, 0, 0, 0, 38, 604, 1, 0, 0, 0, 40, 612, 1, 0, 0, 0, 42, 618, 1, 0, 0, 0, 44, 623, 1, 0, 0, 0, 46, 631, 1, 0, 0, 0, 48, 636, 1, 0, 0, 0, 50, 640, 1, 0, 0, 0, 52, 645, 1, 0, 0, 0, 54, 656, 1, 0, 0, 0, 56, 665, 1, 0, 0, 0, 58, 670, 1, 0, 0, 0, 60, 674, 1, 0, 0, 0, 62, 681, 1, 0, 0, 0, 64, 689, 1, 0, 0, 0, 66, 697, 1, 0, 0, 0, 68, 703, 1, 0, 0, 0, 70, 708, 1, 0, 0, 0, 72, 715, 1, 0, 0, 0, 74, 723, 1, 0, 0, 0, 76, 729, 1, 0, 0, 0, 78, 732, 1, 0, 0, 0, 80, 742, 1, 0, 0, 0, 82, 746, 1, 0, 0, 0, 84, 751, 1, 0, 0, 0, 86, 756, 1, 0, 0, 0, 88, 760, 1, 0, 0, 0, 90, 766, 1, 0, 0, 0, 92, 775, 1, 0, 0, 0, 94, 782, 1, 0, 0, 0, 96, 787, 1, 0, 0, 0, 98, 790, 1, 0, 0, 0, 100, 793, 1, 0, 0, 0, 102, 799, 1, 0, 0, 0, 104, 806, 1, 0, 0, 0, 106, 814, 1, 0, 0, 0, 108, 830, 1, 0, 0, 0, 110, 832, 1, 0, 0, 0, 112, 838, 1, 0, 0, 0, 114, 848, 1, 0, 0, 0, 116, 860, 1, 0, 0, 0, 118, 869, 1, 0, 0, 0, 120, 872, 1, 0, 0, 0, 122, 877, 1, 0, 0, 0, 124, 881, 1, 0, 0, 0, 126, 888, 1, 0, 0, 0, 128, 893, 1, 0, 0, 0, 130, 901, 1, 0, 0, 0, 132, 906, 1, 0, 0, 0, 134, 910, 1, 0, 0, 0, 136, 915, 1, 0, 0, 0, 138, 921, 1, 0, 0, 0, 140, 934, 1, 0, 0, 0, 142, 941, 1, 0, 0, 0, 144, 947, 1, 0, 0, 0, 146, 952, 1, 0, 0, 0, 148, 960, 1, 0, 0, 0, 150, 964, 1, 0, 0, 0, 152, 968, 1, 0, 0, 0, 154, 973, 1, 0, 0, 0, 156, 979, 1, 0, 0, 0, 158, 986, 1, 0, 0, 0, 160, 989, 1, 0, 0, 0, 162, 992, 1, 0, 0, 0, 164, 998, 1, 0, 0, 0, 166, 1004, 1, 0, 0, 0, 168, 1009, 1, 0, 0, 0, 170, 1019, 1, 0, 0, 0, 172, 1025, 1, 0, 0, 0, 174, 1036, 1, 0, 0, 0, 176, 1046, 1, 0, 0, 0, 178, 1055, 1, 0, 0, 0, 180, 1063, 1, 0, 0, 0, 182, 1071, 1, 0, 0, 0, 184, 1077, 1, 0, 0, 0, 186, 1087, 1, 0, 0, 0, 188, 1095, 1, 0, 0, 0, 190, 1102, 1, 0, 0, 0, 192, 1108, 1, 0, 0, 0, 194, 1115, 1, 0, 0, 0, 196, 1119, 1, 0, 0, 0, 198, 1124, 1, 0, 0, 0, 200, 1131, 1, 0, 0, 0, 202, 1138, 1, 0, 0, 0, 204, 1145, 1, 0, 0, 0, 206, 1150, 1, 0, 0, 0, 208, 1155, 1, 0, 0, 0, 210, 1164, 1, 0, 0, 0, 212, 1169, 1, 0, 0, 0, 214, 1179, 1, 0, 0, 0, 216, 1184, 1, 0, 0, 0, 218, 1190, 1, 0, 0, 0, 220, 1195, 1, 0, 0, 0, 222, 1205, 1, 0, 0, 0, 224, 1210, 1, 0, 0, 0, 226, 1216, 1, 0, 0, 0, 228, 1221, 1, 0, 0, 0, 230, 1224, 1, 0, 0, 0, 232, 1228, 1, 0, 0, 0, 234, 1235, 1, 0, 0, 0, 236, 1244, 1, 0, 0, 0, 238, 1249, 1, 0, 0, 0, 240, 1258, 1, 0, 0, 0, 242, 1262, 1, 0, 0, 0, 244, 1271, 1, 0, 0, 0, 246, 1281, 1, 0, 0, 0, 248, 1287, 1, 0, 0, 0, 250, 1295, 1, 0, 0, 0, 252, 1301, 1, 0, 0, 0, 254, 1308, 1, 0, 0, 0, 256, 1313, 1, 0, 0, 0, 258, 1318, 1, 0, 0, 0, 260, 1324, 1, 0, 0, 0, 262, 1330, 1, 0, 0, 0, 264, 1337, 1, 0, 0, 0, 266, 1342, 1, 0, 0, 0, 268, 1359, 1, 0, 0, 0, 270, 1393, 1, 0, 0, 0, 272, 1398, 1, 0, 0, 0, 274, 1441, 1, 0, 0, 0, 276, 1513, 1, 0, 0, 0, 278, 1515, 1, 0, 0, 0, 280, 1522, 1, 0, 0, 0, 282, 1529, 1, 0, 0, 0, 284, 1533, 1, 0, 0, 0, 286, 1540, 1, 0, 0, 0, 288, 1547, 1, 0, 0, 0, 290, 1554, 1, 0, 0, 0, 292, 1570, 1, 0, 0, 0, 294, 1572, 1, 0, 0, 0, 296, 1574, 1, 0, 0, 0, 298, 1576, 1, 0, 0, 0, 300, 1578, 1, 0, 0, 0, 302, 1580, 1, 0, 0, 0, 304, 1582, 1, 0, 0, 0, 306, 1584, 1, 0, 0, 0, 308, 1586, 1, 0, 0, 0, 310, 1588, 1, 0, 0, 0, 312, 1590, 1, 0, 0, 0, 314, 1592, 1, 0, 0, 0, 316, 1594, 1, 0, 0, 0, 318, 1596, 1, 0, 0, 0, 320, 1598, 1, 0, 0, 0, 322, 1600, 1, 0, 0, 0, 324, 1602, 1, 0, 0, 0, 326, 1604, 1, 0, 0, 0, 328, 1606, 1, 0, 0, 0, 330, 1608, 1, 0, 0, 0, 332, 1610, 1, 0, 0, 0, 334, 1612, 1, 0, 0, 0, 336, 1614, 1, 0, 0, 0, 338, 1616, 1, 0, 0, 0, 340, 1618, 1, 0, 0, 0, 342, 1620, 1, 0, 0, 0, 344, 1622, 1, 0, 0, 0, 346, 1624, 1, 0, 0, 0, 348, 1626, 1, 0, 0, 0, 350, 1628, 1, 0, 0, 0, 352, 1630, 1, 0, 0, 0, 354, 1632, 1, 0, 0, 0, 356, 1635, 1, 0, 0, 0, 358, 1637, 1, 0, 0, 0, 360, 1639, 1, 0, 0, 0, 362, 1641, 1, 0, 0, 0, 364, 1644, 1, 0, 0, 0, 366, 1647, 1, 0, 0, 0, 368, 1649, 1, 0, 0, 0, 370, 1651, 1, 0, 0, 0, 372, 1654, 1, 0, 0, 0, 374, 1656, 1, 0, 0, 0, 376, 1658, 1, 0, 0, 0, 378, 1660, 1, 0, 0, 0, 380, 1663, 1, 0, 0, 0, 382, 1665, 1, 0, 0, 0, 384, 1668, 1, 0, 0, 0, 386, 1670, 1, 0, 0, 0, 388, 1672, 1, 0, 0, 0, 390, 1675, 1, 0, 0, 0, 392, 1679, 1, 0, 0, 0, 394, 1683, 1, 0, 0, 0, 396, 1685, 1, 0, 0, 0, 398, 1687, 1, 0, 0, 0, 400, 1690, 1, 0, 0, 0, 402, 1696, 1, 0, 0, 0, 404, 1702, 1, 0, 0, 0, 406, 1704, 1, 0, 0, 0, 408, 1711, 1, 0, 0, 0, 410, 1713, 1, 0, 0, 0, 412, 1717, 1, 0, 0, 0, 414, 1720, 1, 0, 0, 0, 416, 1723, 1, 0, 0, 0, 418, 1726, 1, 0, 0, 0, 420, 1728, 1, 0, 0, 0, 422, 1730, 1, 0, 0, 0, 424, 1732, 1, 0, 0, 0, 426, 1734, 1, 0, 0, 0, 428, 1739, 1, 0, 0, 0, 430, 1744, 1, 0, 0, 0, 432, 1746, 1, 0, 0, 0, 434, 1748, 1, 0, 0, 0, 436, 1751, 1, 0, 0, 0, 438, 1755, 1, 0, 0, 0, 440, 1757, 1, 0, 0, 0, 442, 1759, 1, 0, 0, 0, 444, 1761, 1, 0, 0, 0, 446, 1763, 1, 0, 0, 0, 448, 1766, 1, 0, 0, 0, 450, 1768, 1, 0, 0, 0, 452, 1786, 1, 0, 0, 0, 454, 1799, 1, 0, 0, 0, 456, 1803, 1, 0, 0, 0, 458, 1816, 1, 0, 0, 0, 460, 1820, 1, 0, 0, 0, 462, 1824, 1, 0, 0, 0, 464, 1834, 1, 0, 0, 0, 466, 1838, 1, 0, 0, 0, 468, 1842, 1, 0, 0, 0, 470, 1848, 1, 0, 0, 0, 472, 1854, 1, 0, 0, 0, 474, 1872, 1, 0, 0, 0, 476, 1885, 1, 0, 0, 0, 478, 1894, 1, 0, 0, 0, 480, 1898, 1, 0, 0, 0, 482, 1903, 1, 0, 0, 0, 484, 1909, 1, 0, 0, 0, 486, 1914, 1, 0, 0, 0, 488, 1918, 1, 0, 0, 0, 490, 1923, 1, 0, 0, 0, 492, 1941, 1, 0, 0, 0, 494, 1954, 1, 0, 0, 0, 496, 1964, 1, 0, 0, 0, 498, 1970, 1, 0, 0, 0, 500, 1975, 1, 0, 0, 0, 502, 1979, 1, 0, 0, 0, 504, 1984, 1, 0, 0, 0, 506, 1991, 1, 0, 0, 0, 508, 1997, 1, 0, 0, 0, 510, 511, 3, 292, 143, 0, 511, 512, 3, 314, 154, 0, 512, 513, 3, 314, 154, 0, 513, 7, 1, 0, 0, 0, 514, 515, 3, 292, 143, 0, 515, 516, 3, 318, 156, 0, 516, 517, 3, 298, 146, 0, 517, 9, 1, 0, 0, 0, 518, 519, 3, 292, 143, 0, 519, 520, 3, 318, 156, 0, 520, 521, 3, 330, 162, 0, 521, 522, 3, 308, 151, 0, 522, 11, 1, 0, 0, 0, 523, 524, 3, 292, 143, 0, 524, 525, 3, 318, 156, 0, 525, 526, 3, 340, 167, 0, 526, 13, 1, 0, 0, 0, 527, 528, 3, 292, 143, 0, 528, 529, 3, 326, 160, 0, 529, 530, 3, 326, 160, 0, 530, 531, 3, 292, 143, 0, 531, 532, 3, 340, 167, 0, 532, 15, 1, 0, 0, 0, 533, 534, 3, 292, 143, 0, 534, 535, 3, 328, 161, 0, 535, 17, 1, 0, 0, 0, 536, 537, 3, 292, 143, 0, 537, 538, 3, 328, 161, 0, 538, 539, 3, 296, 145, 0, 539, 551, 1, 0, 0, 0, 540, 541, 3, 292, 143, 0, 541, 542, 3, 328, 161, 0, 542, 543, 3, 296, 145, 0, 543, 544, 3, 300, 147, 0, 544, 545, 3, 318, 156, 0, 545, 546, 3, 298, 146, 0, 546, 547, 3, 308, 151, 0, 547, 548, 3, 318, 156, 0, 548, 549, 3, 304, 149, 0, 549, 551, 1, 0, 0, 0, 550, 536, 1, 0, 0, 0, 550, 540, 1, 0, 0, 0, 551, 19, 1, 0, 0, 0, 552, 553, 3, 292, 143, 0, 553, 554, 3, 328, 161, 0, 554, 555, 3, 320, 157, 0, 555, 556, 3, 302, 148, 0, 556, 21, 1, 0, 0, 0, 557, 558, 3, 294, 144, 0, 558, 559, 3, 300, 147, 0, 559, 560, 3, 330, 162, 0, 560, 561, 3, 336, 165, 0, 561, 562, 3, 300, 147, 0, 562, 563, 3, 300, 147, 0, 563, 564, 3, 318, 156, 0, 564, 23, 1, 0, 0, 0, 565, 566, 3, 294, 144, 0, 566, 567, 3, 320, 157, 0, 567, 568, 3, 330, 162, 0, 568, 569, 3, 306, 150, 0, 569, 25, 1, 0, 0, 0, 570, 571, 3, 294, 144, 0, 571, 572, 3, 340, 167, 0, 572, 27, 1, 0, 0, 0, 573, 574, 3, 296, 145, 0, 574, 575, 3, 292, 143, 0, 575, 576, 3, 328, 161, 0, 576, 577, 3, 300, 147, 0, 577, 29, 1, 0, 0, 0, 578, 579, 3, 296, 145, 0, 579, 580, 3, 292, 143, 0, 580, 581, 3, 328, 161, 0, 581, 582, 3, 330, 162, 0, 582, 31, 1, 0, 0, 0, 583, 584, 3, 296, 145, 0, 584, 585, 3, 292, 143, 0, 585, 586, 3, 330, 162, 0, 586, 587, 3, 296, 145, 0, 587, 588, 3, 306, 150, 0, 588, 33, 1, 0, 0, 0, 589, 590, 3, 296, 145, 0, 590, 591, 3, 320, 157, 0, 591, 592, 3, 306, 150, 0, 592, 593, 3, 320, 157, 0, 593, 594, 3, 326, 160, 0, 594, 595, 3, 330, 162, 0, 595, 35, 1, 0, 0, 0, 596, 597, 3, 296, 145, 0, 597, 598, 3, 320, 157, 0, 598, 599, 3, 314, 154, 0, 599, 600, 3, 314, 154, 0, 600, 601, 3, 292, 143, 0, 601, 602, 3, 330, 162, 0, 602, 603, 3, 300, 147, 0, 603, 37, 1, 0, 0, 0, 604, 605, 3, 296, 145, 0, 605, 606, 3, 320, 157, 0, 606, 607, 3, 314, 154, 0, 607, 608, 3, 332, 163, 0, 608, 609, 3, 316, 155, 0, 609, 610, 3, 318, 156, 0, 610, 611, 3, 328, 161, 0, 611, 39, 1, 0, 0, 0, 612, 613, 3, 296, 145, 0, 613, 614, 3, 326, 160, 0, 614, 615, 3, 320, 157, 0, 615, 616, 3, 328, 161, 0, 616, 617, 3, 328, 161, 0, 617, 41, 1, 0, 0, 0, 618, 619, 3, 296, 145, 0, 619, 620, 3, 332, 163, 0, 620, 621, 3, 294, 144, 0, 621, 622, 3, 300, 147, 0, 622, 43, 1, 0, 0, 0, 623, 624, 3, 296, 145, 0, 624, 625, 3, 332, 163, 0, 625, 626, 3, 326, 160, 0, 626, 627, 3, 326, 160, 0, 627, 628, 3, 300, 147, 0, 628, 629, 3, 318, 156, 0, 629, 630, 3, 330, 162, 0, 630, 45, 1, 0, 0, 0, 631, 632, 3, 298, 146, 0, 632, 633, 3, 292, 143, 0, 633, 634, 3, 330, 162, 0, 634, 635, 3, 300, 147, 0, 635, 47, 1, 0, 0, 0, 636, 637, 3, 298, 146, 0, 637, 638, 3, 292, 143, 0, 638, 639, 3, 340, 167, 0, 639, 49, 1, 0, 0, 0, 640, 641, 3, 298, 146, 0, 641, 642, 3, 300, 147, 0, 642, 643, 3, 328, 161, 0, 643, 644, 3, 296, 145, 0, 644, 51, 1, 0, 0, 0, 645, 646, 3, 298, 146, 0, 646, 647, 3, 300, 147, 0, 647, 648, 3, 328, 161, 0, 648, 649, 3, 296, 145, 0, 649, 650, 3, 300, 147, 0, 650, 651, 3, 318, 156, 0, 651, 652, 3, 298, 146, 0, 652, 653, 3, 308, 151, 0, 653, 654, 3, 318, 156, 0, 654, 655, 3, 304, 149, 0, 655, 53, 1, 0, 0, 0, 656, 657, 3, 298, 146, 0, 657, 658, 3, 308, 151, 0, 658, 659, 3, 328, 161, 0, 659, 660, 3, 330, 162, 0, 660, 661, 3, 308, 151, 0, 661, 662, 3, 318, 156, 0, 662, 663, 3, 296, 145, 0, 663, 664, 3, 330, 162, 0, 664, 55, 1, 0, 0, 0, 665, 666, 3, 300, 147, 0, 666, 667, 3, 314, 154, 0, 667, 668, 3, 328, 161, 0, 668, 669, 3, 300, 147, 0, 669, 57, 1, 0, 0, 0, 670, 671, 3, 300, 147, 0, 671, 672, 3, 318, 156, 0, 672, 673, 3, 298, 146, 0, 673, 59, 1, 0, 0, 0, 674, 675, 3, 300, 147, 0, 675, 676, 3, 338, 166, 0, 676, 677, 3, 296, 145, 0, 677, 678, 3, 300, 147, 0, 678, 679, 3, 322, 158, 0, 679, 680, 3, 330, 162, 0, 680, 61, 1, 0, 0, 0, 681, 682, 3, 300, 147, 0, 682, 683, 3, 338, 166, 0, 683, 684, 3, 296, 145, 0, 684, 685, 3, 314, 154, 0, 685, 686, 3, 332, 163, 0, 686, 687, 3, 298, 146, 0, 687, 688, 3, 300, 147, 0, 688, 63, 1, 0, 0, 0, 689, 690, 3, 300, 147, 0, 690, 691, 3, 338, 166, 0, 691, 692, 3, 330, 162, 0, 692, 693, 3, 326, 160, 0, 693, 694, 3, 292, 143, 0, 694, 695, 3, 296, 145, 0, 695, 696, 3, 330, 162, 0, 696, 65, 1, 0, 0, 0, 697, 698, 3, 302, 148, 0, 698, 699, 3, 308, 151, 0, 699, 700, 3, 318, 156, 0, 700, 701, 3, 292, 143, 0, 701, 702, 3, 314, 154, 0, 702, 67, 1, 0, 0, 0, 703, 704, 3, 302, 148, 0, 704, 705, 3, 308, 151, 0, 705, 706, 3, 314, 154, 0, 706, 707, 3, 314, 154, 0, 707, 69, 1, 0, 0, 0, 708, 709, 3, 302, 148, 0, 709, 710, 3, 308, 151, 0, 710, 711, 3, 314, 154, 0, 711, 712, 3, 330, 162, 0, 712, 713, 3, 300, 147, 0, 713, 714, 3, 326, 160, 0, 714, 71, 1, 0, 0, 0, 715, 716, 3, 302, 148, 0, 716, 717, 3, 308, 151, 0, 717, 718, 3, 318, 156, 0, 718, 719, 3, 292, 143, 0, 719, 720, 3, 314, 154, 0, 720, 721, 3, 314, 154, 0, 721, 722, 3, 340, 167, 0, 722, 73, 1, 0, 0, 0, 723, 724, 3, 302, 148, 0, 724, 725, 3, 308, 151, 0, 725, 726, 3, 326, 160, 0, 726, 727, 3, 328, 161, 0, 727, 728, 3, 330, 162, 0, 728, 75, 1, 0, 0, 0, 729, 730, 3, 302, 148, 0, 730, 731, 3, 318, 156, 0, 731, 77, 1, 0, 0, 0, 732, 733, 3, 302, 148, 0, 733, 734, 3, 320, 157, 0, 734, 735, 3, 314, 154, 0, 735, 736, 3, 314, 154, 0, 736, 737, 3, 320, 157, 0, 737, 738, 3, 336, 165, 0, 738, 739, 3, 308, 151, 0, 739, 740, 3, 318, 156, 0, 740, 741, 3, 304, 149, 0, 741, 79, 1, 0, 0, 0, 742, 743, 3, 302, 148, 0, 743, 744, 3, 320, 157, 0, 744, 745, 3, 326, 160, 0, 745, 81, 1, 0, 0, 0, 746, 747, 3, 302, 148, 0, 747, 748, 3, 326, 160, 0, 748, 749, 3, 320, 157, 0, 749, 750, 3, 316, 155, 0, 750, 83, 1, 0, 0, 0, 751, 752, 3, 302, 148, 0, 752, 753, 3, 332, 163, 0, 753, 754, 3, 314, 154, 0, 754, 755, 3, 314, 154, 0, 755, 85, 1, 0, 0, 0, 756, 757, 3, 302, 148, 0, 757, 758, 3, 332, 163, 0, 758, 759, 3, 318, 156, 0, 759, 87, 1, 0, 0, 0, 760, 761, 3, 304, 149, 0, 761, 762, 3, 326, 160, 0, 762, 763, 3, 320, 157, 0, 763, 764, 3, 332, 163, 0, 764, 765, 3, 322, 158, 0, 765, 89, 1, 0, 0, 0, 766, 767, 3, 304, 149, 0, 767, 768, 3, 326, 160, 0, 768, 769, 3, 320, 157, 0, 769, 770, 3, 332, 163, 0, 770, 771, 3, 322, 158, 0, 771, 772, 3, 308, 151, 0, 772, 773, 3, 318, 156, 0, 773, 774, 3, 304, 149, 0, 774, 91, 1, 0, 0, 0, 775, 776, 3, 306, 150, 0, 776, 777, 3, 292, 143, 0, 777, 778, 3, 334, 164, 0, 778, 779, 3, 308, 151, 0, 779, 780, 3, 318, 156, 0, 780, 781, 3, 304, 149, 0, 781, 93, 1, 0, 0, 0, 782, 783, 3, 306, 150, 0, 783, 784, 3, 320, 157, 0, 784, 785, 3, 332, 163, 0, 785, 786, 3, 326, 160, 0, 786, 95, 1, 0, 0, 0, 787, 788, 3, 308, 151, 0, 788, 789, 3, 298, 146, 0, 789, 97, 1, 0, 0, 0, 790, 791, 3, 308, 151, 0, 791, 792, 3, 302, 148, 0, 792, 99, 1, 0, 0, 0, 793, 794, 3, 308, 151, 0, 794, 795, 3, 314, 154, 0, 795, 796, 3, 308, 151, 0, 796, 797, 3, 312, 153, 0, 797, 798, 3, 300, 147, 0, 798, 101, 1, 0, 0, 0, 799, 800, 3, 308, 151, 0, 800, 801, 3, 304, 149, 0, 801, 802, 3, 318, 156, 0, 802, 803, 3, 320, 157, 0, 803, 804, 3, 326, 160, 0, 804, 805, 3, 300, 147, 0, 805, 103, 1, 0, 0, 0, 806, 807, 3, 308, 151, 0, 807, 808, 3, 318, 156, 0, 808, 809, 3, 296, 145, 0, 809, 810, 3, 314, 154, 0, 810, 811, 3, 332, 163, 0, 811, 812, 3, 298, 146, 0, 812, 813, 3, 300, 147, 0, 813, 105, 1, 0, 0, 0, 814, 815, 3, 308, 151, 0, 815, 816, 3, 318, 156, 0, 816, 107, 1, 0, 0, 0, 817, 818, 3, 308, 151, 0, 818, 819, 3, 318, 156, 0, 819, 820, 3, 302, 148, 0, 820, 831, 1, 0, 0, 0, 821, 822, 3, 308, 151, 0, 822, 823, 3, 318, 156, 0, 823, 824, 3, 302, 148, 0, 824, 825, 3, 308, 151, 0, 825, 826, 3, 318, 156, 0, 826, 827, 3, 308, 151, 0, 827, 828, 3, 330, 162, 0, 828, 829, 3, 340, 167, 0, 829, 831, 1, 0, 0, 0, 830, 817, 1, 0, 0, 0, 830, 821, 1, 0, 0, 0, 831, 109, 1, 0, 0, 0, 832, 833, 3, 308, 151, 0, 833, 834, 3, 318, 156, 0, 834, 835, 3, 318, 156, 0, 835, 836, 3, 300, 147, 0, 836, 837, 3, 326, 160, 0, 837, 111, 1, 0, 0, 0, 838, 839, 3, 308, 151, 0, 839, 840, 3, 318, 156, 0, 840, 841, 3, 330, 162, 0, 841, 842, 3, 300, 147, 0, 842, 843, 3, 326, 160, 0, 843, 844, 3, 328, 161, 0, 844, 845, 3, 300, 147, 0, 845, 846, 3, 296, 145, 0, 846, 847, 3, 330, 162, 0, 847, 113, 1, 0, 0, 0, 848, 849, 3, 308, 151, 0, 849, 850, 3, 318, 156, 0, 850, 851, 3, 330, 162, 0, 851, 852, 3, 300, 147, 0, 852, 853, 3, 326, 160, 0, 853, 854, 3, 322, 158, 0, 854, 855, 3, 320, 157, 0, 855, 856, 3, 314, 154, 0, 856, 857, 3, 292, 143, 0, 857, 858, 3, 330, 162, 0, 858, 859, 3, 300, 147, 0, 859, 115, 1, 0, 0, 0, 860, 861, 3, 308, 151, 0, 861, 862, 3, 318, 156, 0, 862, 863, 3, 330, 162, 0, 863, 864, 3, 300, 147, 0, 864, 865, 3, 326, 160, 0, 865, 866, 3, 334, 164, 0, 866, 867, 3, 292, 143, 0, 867, 868, 3, 314, 154, 0, 868, 117, 1, 0, 0, 0, 869, 870, 3, 308, 151, 0, 870, 871, 3, 328, 161, 0, 871, 119, 1, 0, 0, 0, 872, 873, 3, 310, 152, 0, 873, 874, 3, 320, 157, 0, 874, 875, 3, 308, 151, 0, 875, 876, 3, 318, 156, 0, 876, 121, 1, 0, 0, 0, 877, 878, 3, 312, 153, 0, 878, 879, 3, 300, 147, 0, 879, 880, 3, 340, 167, 0, 880, 123, 1, 0, 0, 0, 881, 882, 3, 314, 154, 0, 882, 883, 3, 292, 143, 0, 883, 884, 3, 316, 155, 0, 884, 885, 3, 294, 144, 0, 885, 886, 3, 298, 146, 0, 886, 887, 3, 292, 143, 0, 887, 125, 1, 0, 0, 0, 888, 889, 3, 314, 154, 0, 889, 890, 3, 292, 143, 0, 890, 891, 3, 328, 161, 0, 891, 892, 3, 330, 162, 0, 892, 127, 1, 0, 0, 0, 893, 894, 3, 314, 154, 0, 894, 895, 3, 300, 147, 0, 895, 896, 3, 292, 143, 0, 896, 897, 3, 298, 146, 0, 897, 898, 3, 308, 151, 0, 898, 899, 3, 318, 156, 0, 899, 900, 3, 304, 149, 0, 900, 129, 1, 0, 0, 0, 901, 902, 3, 314, 154, 0, 902, 903, 3, 300, 147, 0, 903, 904, 3, 302, 148, 0, 904, 905, 3, 330, 162, 0, 905, 131, 1, 0, 0, 0, 906, 907, 3, 314, 154, 0, 907, 908, 3, 300, 147, 0, 908, 909, 3, 330, 162, 0, 909, 133, 1, 0, 0, 0, 910, 911, 3, 314, 154, 0, 911, 912, 3, 308, 151, 0, 912, 913, 3, 312, 153, 0, 913, 914, 3, 300, 147, 0, 914, 135, 1, 0, 0, 0, 915, 916, 3, 314, 154, 0, 916, 917, 3, 308, 151, 0, 917, 918, 3, 316, 155, 0, 918, 919, 3, 308, 151, 0, 919, 920, 3, 330, 162, 0, 920, 137, 1, 0, 0, 0, 921, 922, 3, 316, 155, 0, 922, 923, 3, 292, 143, 0, 923, 924, 3, 330, 162, 0, 924, 925, 3, 300, 147, 0, 925, 926, 3, 326, 160, 0, 926, 927, 3, 308, 151, 0, 927, 928, 3, 292, 143, 0, 928, 929, 3, 314, 154, 0, 929, 930, 3, 308, 151, 0, 930, 931, 3, 342, 168, 0, 931, 932, 3, 300, 147, 0, 932, 933, 3, 298, 146, 0, 933, 139, 1, 0, 0, 0, 934, 935, 3, 316, 155, 0, 935, 936, 3, 308, 151, 0, 936, 937, 3, 318, 156, 0, 937, 938, 3, 332, 163, 0, 938, 939, 3, 330, 162, 0, 939, 940, 3, 300, 147, 0, 940, 141, 1, 0, 0, 0, 941, 942, 3, 316, 155, 0, 942, 943, 3, 320, 157, 0, 943, 944, 3, 318, 156, 0, 944, 945, 3, 330, 162, 0, 945, 946, 3, 306, 150, 0, 946, 143, 1, 0, 0, 0, 947, 948, 3, 318, 156, 0, 948, 949, 3, 292, 143, 0, 949, 950, 3, 316, 155, 0, 950, 951, 3, 300, 147, 0, 951, 145, 1, 0, 0, 0, 952, 953, 3, 318, 156, 0, 953, 954, 3, 292, 143, 0, 954, 955, 3, 330, 162, 0, 955, 956, 3, 332, 163, 0, 956, 957, 3, 326, 160, 0, 957, 958, 3, 292, 143, 0, 958, 959, 3, 314, 154, 0, 959, 147, 1, 0, 0, 0, 960, 961, 3, 318, 156, 0, 961, 962, 3, 292, 143, 0, 962, 963, 3, 318, 156, 0, 963, 149, 1, 0, 0, 0, 964, 965, 3, 318, 156, 0, 965, 966, 3, 320, 157, 0, 966, 967, 3, 330, 162, 0, 967, 151, 1, 0, 0, 0, 968, 969, 3, 318, 156, 0, 969, 970, 3, 332, 163, 0, 970, 971, 3, 314, 154, 0, 971, 972, 3, 314, 154, 0, 972, 153, 1, 0, 0, 0, 973, 974, 3, 318, 156, 0, 974, 975, 3, 332, 163, 0, 975, 976, 3, 314, 154, 0, 976, 977, 3, 314, 154, 0, 977, 978, 3, 328, 161, 0, 978, 155, 1, 0, 0, 0, 979, 980, 3, 320, 157, 0, 980, 981, 3, 302, 148, 0, 981, 982, 3, 302, 148, 0, 982, 983, 3, 328, 161, 0, 983, 984, 3, 300, 147, 0, 984, 985, 3, 330, 162, 0, 985, 157, 1, 0, 0, 0, 986, 987, 3, 320, 157, 0, 987, 988, 3, 318, 156, 0, 988, 159, 1, 0, 0, 0, 989, 990, 3, 320, 157, 0, 990, 991, 3, 326, 160, 0, 991, 161, 1, 0, 0, 0, 992, 993, 3, 320, 157, 0, 993, 994, 3, 326, 160, 0, 994, 995, 3, 298, 146, 0, 995, 996, 3, 300, 147, 0, 996, 997, 3, 326, 160, 0, 997, 163, 1, 0, 0, 0, 998, 999, 3, 320, 157, 0, 999, 1000, 3, 332, 163, 0, 1000, 1001, 3, 330, 162, 0, 1001, 1002, 3, 300, 147, 0, 1002, 1003, 3, 326, 160, 0, 1003, 165, 1, 0, 0, 0, 1004, 1005, 3, 320, 157, 0, 1005, 1006, 3, 334, 164, 0, 1006, 1007, 3, 300, 147, 0, 1007, 1008, 3, 326, 160, 0, 1008, 167, 1, 0, 0, 0, 1009, 1010, 3, 322, 158, 0, 1010, 1011, 3, 292, 143, 0, 1011, 1012, 3, 326, 160, 0, 1012, 1013, 3, 330, 162, 0, 1013, 1014, 3, 308, 151, 0, 1014, 1015, 3, 330, 162, 0, 1015, 1016, 3, 308, 151, 0, 1016, 1017, 3, 320, 157, 0, 1017, 1018, 3, 318, 156, 0, 1018, 169, 1, 0, 0, 0, 1019, 1020, 3, 322, 158, 0, 1020, 1021, 3, 308, 151, 0, 1021, 1022, 3, 334, 164, 0, 1022, 1023, 3, 320, 157, 0, 1023, 1024, 3, 330, 162, 0, 1024, 171, 1, 0, 0, 0, 1025, 1026, 3, 322, 158, 0, 1026, 1027, 3, 320, 157, 0, 1027, 1028, 3, 328, 161, 0, 1028, 1029, 3, 308, 151, 0, 1029, 1030, 3, 330, 162, 0, 1030, 1031, 3, 308, 151, 0, 1031, 1032, 3, 320, 157, 0, 1032, 1033, 3, 318, 156, 0, 1033, 1034, 3, 292, 143, 0, 1034, 1035, 3, 314, 154, 0, 1035, 173, 1, 0, 0, 0, 1036, 1037, 3, 322, 158, 0, 1037, 1038, 3, 326, 160, 0, 1038, 1039, 3, 300, 147, 0, 1039, 1040, 3, 296, 145, 0, 1040, 1041, 3, 300, 147, 0, 1041, 1042, 3, 298, 146, 0, 1042, 1043, 3, 308, 151, 0, 1043, 1044, 3, 318, 156, 0, 1044, 1045, 3, 304, 149, 0, 1045, 175, 1, 0, 0, 0, 1046, 1047, 3, 322, 158, 0, 1047, 1048, 3, 326, 160, 0, 1048, 1049, 3, 300, 147, 0, 1049, 1050, 3, 336, 165, 0, 1050, 1051, 3, 306, 150, 0, 1051, 1052, 3, 300, 147, 0, 1052, 1053, 3, 326, 160, 0, 1053, 1054, 3, 300, 147, 0, 1054, 177, 1, 0, 0, 0, 1055, 1056, 3, 324, 159, 0, 1056, 1057, 3, 332, 163, 0, 1057, 1058, 3, 292, 143, 0, 1058, 1059, 3, 314, 154, 0, 1059, 1060, 3, 308, 151, 0, 1060, 1061, 3, 302, 148, 0, 1061, 1062, 3, 340, 167, 0, 1062, 179, 1, 0, 0, 0, 1063, 1064, 3, 324, 159, 0, 1064, 1065, 3, 332, 163, 0, 1065, 1066, 3, 292, 143, 0, 1066, 1067, 3, 326, 160, 0, 1067, 1068, 3, 330, 162, 0, 1068, 1069, 3, 300, 147, 0, 1069, 1070, 3, 326, 160, 0, 1070, 181, 1, 0, 0, 0, 1071, 1072, 3, 326, 160, 0, 1072, 1073, 3, 292, 143, 0, 1073, 1074, 3, 318, 156, 0, 1074, 1075, 3, 304, 149, 0, 1075, 1076, 3, 300, 147, 0, 1076, 183, 1, 0, 0, 0, 1077, 1078, 3, 326, 160, 0, 1078, 1079, 3, 300, 147, 0, 1079, 1080, 3, 296, 145, 0, 1080, 1081, 3, 332, 163, 0, 1081, 1082, 3, 326, 160, 0, 1082, 1083, 3, 328, 161, 0, 1083, 1084, 3, 308, 151, 0, 1084, 1085, 3, 334, 164, 0, 1085, 1086, 3, 300, 147, 0, 1086, 185, 1, 0, 0, 0, 1087, 1088, 3, 326, 160, 0, 1088, 1089, 3, 300, 147, 0, 1089, 1090, 3, 322, 158, 0, 1090, 1091, 3, 314, 154, 0, 1091, 1092, 3, 292, 143, 0, 1092, 1093, 3, 296, 145, 0, 1093, 1094, 3, 300, 147, 0, 1094, 187, 1, 0, 0, 0, 1095, 1096, 3, 326, 160, 0, 1096, 1097, 3, 300, 147, 0, 1097, 1098, 3, 330, 162, 0, 1098, 1099, 3, 332, 163, 0, 1099, 1100, 3, 326, 160, 0, 1100, 1101, 3, 318, 156, 0, 1101, 189, 1, 0, 0, 0, 1102, 1103, 3, 326, 160, 0, 1103, 1104, 3, 308, 151, 0, 1104, 1105, 3, 304, 149, 0, 1105, 1106, 3, 306, 150, 0, 1106, 1107, 3, 330, 162, 0, 1107, 191, 1, 0, 0, 0, 1108, 1109, 3, 326, 160, 0, 1109, 1110, 3, 320, 157, 0, 1110, 1111, 3, 314, 154, 0, 1111, 1112, 3, 314, 154, 0, 1112, 1113, 3, 332, 163, 0, 1113, 1114, 3, 322, 158, 0, 1114, 193, 1, 0, 0, 0, 1115, 1116, 3, 326, 160, 0, 1116, 1117, 3, 320, 157, 0, 1117, 1118, 3, 336, 165, 0, 1118, 195, 1, 0, 0, 0, 1119, 1120, 3, 326, 160, 0, 1120, 1121, 3, 320, 157, 0, 1121, 1122, 3, 336, 165, 0, 1122, 1123, 3, 328, 161, 0, 1123, 197, 1, 0, 0, 0, 1124, 1125, 3, 328, 161, 0, 1125, 1126, 3, 292, 143, 0, 1126, 1127, 3, 316, 155, 0, 1127, 1128, 3, 322, 158, 0, 1128, 1129, 3, 314, 154, 0, 1129, 1130, 3, 300, 147, 0, 1130, 199, 1, 0, 0, 0, 1131, 1132, 3, 328, 161, 0, 1132, 1133, 3, 300, 147, 0, 1133, 1134, 3, 296, 145, 0, 1134, 1135, 3, 320, 157, 0, 1135, 1136, 3, 318, 156, 0, 1136, 1137, 3, 298, 146, 0, 1137, 201, 1, 0, 0, 0, 1138, 1139, 3, 328, 161, 0, 1139, 1140, 3, 300, 147, 0, 1140, 1141, 3, 314, 154, 0, 1141, 1142, 3, 300, 147, 0, 1142, 1143, 3, 296, 145, 0, 1143, 1144, 3, 330, 162, 0, 1144, 203, 1, 0, 0, 0, 1145, 1146, 3, 328, 161, 0, 1146, 1147, 3, 300, 147, 0, 1147, 1148, 3, 316, 155, 0, 1148, 1149, 3, 308, 151, 0, 1149, 205, 1, 0, 0, 0, 1150, 1151, 3, 328, 161, 0, 1151, 1152, 3, 300, 147, 0, 1152, 1153, 3, 330, 162, 0, 1153, 1154, 3, 328, 161, 0, 1154, 207, 1, 0, 0, 0, 1155, 1156, 3, 328, 161, 0, 1156, 1157, 3, 300, 147, 0, 1157, 1158, 3, 330, 162, 0, 1158, 1159, 3, 330, 162, 0, 1159, 1160, 3, 308, 151, 0, 1160, 1161, 3, 318, 156, 0, 1161, 1162, 3, 304, 149, 0, 1162, 1163, 3, 328, 161, 0, 1163, 209, 1, 0, 0, 0, 1164, 1165, 3, 328, 161, 0, 1165, 1166, 3, 330, 162, 0, 1166, 1167, 3, 300, 147, 0, 1167, 1168, 3, 322, 158, 0, 1168, 211, 1, 0, 0, 0, 1169, 1170, 3, 328, 161, 0, 1170, 1171, 3, 332, 163, 0, 1171, 1172, 3, 294, 144, 0, 1172, 1173, 3, 328, 161, 0, 1173, 1174, 3, 330, 162, 0, 1174, 1175, 3, 326, 160, 0, 1175, 1176, 3, 308, 151, 0, 1176, 1177, 3, 318, 156, 0, 1177, 1178, 3, 304, 149, 0, 1178, 213, 1, 0, 0, 0, 1179, 1180, 3, 330, 162, 0, 1180, 1181, 3, 306, 150, 0, 1181, 1182, 3, 300, 147, 0, 1182, 1183, 3, 318, 156, 0, 1183, 215, 1, 0, 0, 0, 1184, 1185, 3, 330, 162, 0, 1185, 1186, 3, 306, 150, 0, 1186, 1187, 3, 326, 160, 0, 1187, 1188, 3, 320, 157, 0, 1188, 1189, 3, 336, 165, 0, 1189, 217, 1, 0, 0, 0, 1190, 1191, 3, 330, 162, 0, 1191, 1192, 3, 308, 151, 0, 1192, 1193, 3, 300, 147, 0, 1193, 1194, 3, 328, 161, 0, 1194, 219, 1, 0, 0, 0, 1195, 1196, 3, 330, 162, 0, 1196, 1197, 3, 308, 151, 0, 1197, 1198, 3, 316, 155, 0, 1198, 1199, 3, 300, 147, 0, 1199, 1200, 3, 328, 161, 0, 1200, 1201, 3, 330, 162, 0, 1201, 1202, 3, 292, 143, 0, 1202, 1203, 3, 316, 155, 0, 1203, 1204, 3, 322, 158, 0, 1204, 221, 1, 0, 0, 0, 1205, 1206, 3, 330, 162, 0, 1206, 1207, 3, 308, 151, 0, 1207, 1208, 3, 316, 155, 0, 1208, 1209, 3, 300, 147, 0, 1209, 223, 1, 0, 0, 0, 1210, 1211, 3, 314, 154, 0, 1211, 1212, 3, 320, 157, 0, 1212, 1213, 3, 296, 145, 0, 1213, 1214, 3, 292, 143, 0, 1214, 1215, 3, 314, 154, 0, 1215, 225, 1, 0, 0, 0, 1216, 1217, 3, 342, 168, 0, 1217, 1218, 3, 320, 157, 0, 1218, 1219, 3, 318, 156, 0, 1219, 1220, 3, 300, 147, 0, 1220, 227, 1, 0, 0, 0, 1221, 1222, 3, 330, 162, 0, 1222, 1223, 3, 320, 157, 0, 1223, 229, 1, 0, 0, 0, 1224, 1225, 3, 330, 162, 0, 1225, 1226, 3, 320, 157, 0, 1226, 1227, 3, 322, 158, 0, 1227, 231, 1, 0, 0, 0, 1228, 1229, 3, 330, 162, 0, 1229, 1230, 3, 320, 157, 0, 1230, 1231, 3, 330, 162, 0, 1231, 1232, 3, 292, 143, 0, 1232, 1233, 3, 314, 154, 0, 1233, 1234, 3, 328, 161, 0, 1234, 233, 1, 0, 0, 0, 1235, 1236, 3, 330, 162, 0, 1236, 1237, 3, 326, 160, 0, 1237, 1238, 3, 292, 143, 0, 1238, 1239, 3, 308, 151, 0, 1239, 1240, 3, 314, 154, 0, 1240, 1241, 3, 308, 151, 0, 1241, 1242, 3, 318, 156, 0, 1242, 1243, 3, 304, 149, 0, 1243, 235, 1, 0, 0, 0, 1244, 1245, 3, 330, 162, 0, 1245, 1246, 3, 326, 160, 0, 1246, 1247, 3, 308, 151, 0, 1247, 1248, 3, 316, 155, 0, 1248, 237, 1, 0, 0, 0, 1249, 1250, 3, 330, 162, 0, 1250, 1251, 3, 326, 160, 0, 1251, 1252, 3, 332, 163, 0, 1252, 1253, 3, 318, 156, 0, 1253, 1254, 3, 296, 145, 0, 1254, 1255, 3, 292, 143, 0, 1255, 1256, 3, 330, 162, 0, 1256, 1257, 3, 300, 147, 0, 1257, 239, 1, 0, 0, 0, 1258, 1259, 3, 330, 162, 0, 1259, 1260, 3, 326, 160, 0, 1260, 1261, 3, 340, 167, 0, 1261, 241, 1, 0, 0, 0, 1262, 1263, 3, 330, 162, 0, 1263, 1264, 3, 326, 160, 0, 1264, 1265, 3, 340, 167, 0, 1265, 1266, 5, 95, 0, 0, 1266, 1267, 3, 296, 145, 0, 1267, 1268, 3, 292, 143, 0, 1268, 1269, 3, 328, 161, 0, 1269, 1270, 3, 330, 162, 0, 1270, 243, 1, 0, 0, 0, 1271, 1272, 3, 332, 163, 0, 1272, 1273, 3, 318, 156, 0, 1273, 1274, 3, 294, 144, 0, 1274, 1275, 3, 320, 157, 0, 1275, 1276, 3, 332, 163, 0, 1276, 1277, 3, 318, 156, 0, 1277, 1278, 3, 298, 146, 0, 1278, 1279, 3, 300, 147, 0, 1279, 1280, 3, 298, 146, 0, 1280, 245, 1, 0, 0, 0, 1281, 1282, 3, 332, 163, 0, 1282, 1283, 3, 318, 156, 0, 1283, 1284, 3, 308, 151, 0, 1284, 1285, 3, 320, 157, 0, 1285, 1286, 3, 318, 156, 0, 1286, 247, 1, 0, 0, 0, 1287, 1288, 3, 332, 163, 0, 1288, 1289, 3, 318, 156, 0, 1289, 1290, 3, 322, 158, 0, 1290, 1291, 3, 308, 151, 0, 1291, 1292, 3, 334, 164, 0, 1292, 1293, 3, 320, 157, 0, 1293, 1294, 3, 330, 162, 0, 1294, 249, 1, 0, 0, 0, 1295, 1296, 3, 332, 163, 0, 1296, 1297, 3, 328, 161, 0, 1297, 1298, 3, 308, 151, 0, 1298, 1299, 3, 318, 156, 0, 1299, 1300, 3, 304, 149, 0, 1300, 251, 1, 0, 0, 0, 1301, 1302, 3, 334, 164, 0, 1302, 1303, 3, 292, 143, 0, 1303, 1304, 3, 314, 154, 0, 1304, 1305, 3, 332, 163, 0, 1305, 1306, 3, 300, 147, 0, 1306, 1307, 3, 328, 161, 0, 1307, 253, 1, 0, 0, 0, 1308, 1309, 3, 336, 165, 0, 1309, 1310, 3, 300, 147, 0, 1310, 1311, 3, 300, 147, 0, 1311, 1312, 3, 312, 153, 0, 1312, 255, 1, 0, 0, 0, 1313, 1314, 3, 336, 165, 0, 1314, 1315, 3, 306, 150, 0, 1315, 1316, 3, 300, 147, 0, 1316, 1317, 3, 318, 156, 0, 1317, 257, 1, 0, 0, 0, 1318, 1319, 3, 336, 165, 0, 1319, 1320, 3, 306, 150, 0, 1320, 1321, 3, 300, 147, 0, 1321, 1322, 3, 326, 160, 0, 1322, 1323, 3, 300, 147, 0, 1323, 259, 1, 0, 0, 0, 1324, 1325, 3, 336, 165, 0, 1325, 1326, 3, 306, 150, 0, 1326, 1327, 3, 308, 151, 0, 1327, 1328, 3, 314, 154, 0, 1328, 1329, 3, 300, 147, 0, 1329, 261, 1, 0, 0, 0, 1330, 1331, 3, 336, 165, 0, 1331, 1332, 3, 308, 151, 0, 1332, 1333, 3, 318, 156, 0, 1333, 1334, 3, 298, 146, 0, 1334, 1335, 3, 320, 157, 0, 1335, 1336, 3, 336, 165, 0, 1336, 263, 1, 0, 0, 0, 1337, 1338, 3, 336, 165, 0, 1338, 1339, 3, 308, 151, 0, 1339, 1340, 3, 330, 162, 0, 1340, 1341, 3, 306, 150, 0, 1341, 265, 1, 0, 0, 0, 1342, 1343, 3, 336, 165, 0, 1343, 1344, 3, 308, 151, 0, 1344, 1345, 3, 330, 162, 0, 1345, 1346, 3, 306, 150, 0, 1346, 1347, 3, 308, 151, 0, 1347, 1348, 3, 318, 156, 0, 1348, 267, 1, 0, 0, 0, 1349, 1350, 3, 340, 167, 0, 1350, 1351, 3, 300, 147, 0, 1351, 1352, 3, 292, 143, 0, 1352, 1353, 3, 326, 160, 0, 1353, 1360, 1, 0, 0, 0, 1354, 1355, 3, 340, 167, 0, 1355, 1356, 3, 340, 167, 0, 1356, 1357, 3, 340, 167, 0, 1357, 1358, 3, 340, 167, 0, 1358, 1360, 1, 0, 0, 0, 1359, 1349, 1, 0, 0, 0, 1359, 1354, 1, 0, 0, 0, 1360, 269, 1, 0, 0, 0, 1361, 1362, 3, 360, 177, 0, 1362, 1363, 3, 294, 144, 0, 1363, 1394, 1, 0, 0, 0, 1364, 1365, 3, 360, 177, 0, 1365, 1366, 3, 302, 148, 0, 1366, 1394, 1, 0, 0, 0, 1367, 1368, 3, 360, 177, 0, 1368, 1369, 3, 326, 160, 0, 1369, 1394, 1, 0, 0, 0, 1370, 1371, 3, 360, 177, 0, 1371, 1372, 3, 318, 156, 0, 1372, 1394, 1, 0, 0, 0, 1373, 1374, 3, 360, 177, 0, 1374, 1375, 3, 330, 162, 0, 1375, 1394, 1, 0, 0, 0, 1376, 1377, 3, 360, 177, 0, 1377, 1378, 5, 48, 0, 0, 1378, 1394, 1, 0, 0, 0, 1379, 1380, 3, 360, 177, 0, 1380, 1381, 3, 292, 143, 0, 1381, 1394, 1, 0, 0, 0, 1382, 1383, 3, 360, 177, 0, 1383, 1384, 3, 334, 164, 0, 1384, 1394, 1, 0, 0, 0, 1385, 1386, 3, 360, 177, 0, 1386, 1387, 3, 360, 177, 0, 1387, 1394, 1, 0, 0, 0, 1388, 1389, 3, 360, 177, 0, 1389, 1390, 3, 338, 166, 0, 1390, 1391, 3, 352, 173, 0, 1391, 1392, 3, 352, 173, 0, 1392, 1394, 1, 0, 0, 0, 1393, 1361, 1, 0, 0, 0, 1393, 1364, 1, 0, 0, 0, 1393, 1367, 1, 0, 0, 0, 1393, 1370, 1, 0, 0, 0, 1393, 1373, 1, 0, 0, 0, 1393, 1376, 1, 0, 0, 0, 1393, 1379, 1, 0, 0, 0, 1393, 1382, 1, 0, 0, 0, 1393, 1385, 1, 0, 0, 0, 1393, 1388, 1, 0, 0, 0, 1394, 271, 1, 0, 0, 0, 1395, 1399, 3, 344, 169, 0, 1396, 1399, 3, 448, 221, 0, 1397, 1399, 3, 374, 184, 0, 1398, 1395, 1, 0, 0, 0, 1398, 1396, 1, 0, 0, 0, 1398, 1397, 1, 0, 0, 0, 1399, 1406, 1, 0, 0, 0, 1400, 1405, 3, 344, 169, 0, 1401, 1405, 3, 448, 221, 0, 1402, 1405, 3, 350, 172, 0, 1403, 1405, 3, 374, 184, 0, 1404, 1400, 1, 0, 0, 0, 1404, 1401, 1, 0, 0, 0, 1404, 1402, 1, 0, 0, 0, 1404, 1403, 1, 0, 0, 0, 1405, 1408, 1, 0, 0, 0, 1406, 1404, 1, 0, 0, 0, 1406, 1407, 1, 0, 0, 0, 1407, 273, 1, 0, 0, 0, 1408, 1406, 1, 0, 0, 0, 1409, 1420, 3, 358, 176, 0, 1410, 1419, 8, 0, 0, 0, 1411, 1419, 3, 270, 132, 0, 1412, 1413, 3, 360, 177, 0, 1413, 1414, 3, 430, 212, 0, 1414, 1419, 1, 0, 0, 0, 1415, 1416, 3, 358, 176, 0, 1416, 1417, 3, 358, 176, 0, 1417, 1419, 1, 0, 0, 0, 1418, 1410, 1, 0, 0, 0, 1418, 1411, 1, 0, 0, 0, 1418, 1412, 1, 0, 0, 0, 1418, 1415, 1, 0, 0, 0, 1419, 1422, 1, 0, 0, 0, 1420, 1418, 1, 0, 0, 0, 1420, 1421, 1, 0, 0, 0, 1421, 1423, 1, 0, 0, 0, 1422, 1420, 1, 0, 0, 0, 1423, 1424, 3, 358, 176, 0, 1424, 1442, 1, 0, 0, 0, 1425, 1436, 3, 424, 209, 0, 1426, 1435, 8, 1, 0, 0, 1427, 1435, 3, 270, 132, 0, 1428, 1429, 3, 360, 177, 0, 1429, 1430, 3, 424, 209, 0, 1430, 1435, 1, 0, 0, 0, 1431, 1432, 3, 424, 209, 0, 1432, 1433, 3, 424, 209, 0, 1433, 1435, 1, 0, 0, 0, 1434, 1426, 1, 0, 0, 0, 1434, 1427, 1, 0, 0, 0, 1434, 1428, 1, 0, 0, 0, 1434, 1431, 1, 0, 0, 0, 1435, 1438, 1, 0, 0, 0, 1436, 1434, 1, 0, 0, 0, 1436, 1437, 1, 0, 0, 0, 1437, 1439, 1, 0, 0, 0, 1438, 1436, 1, 0, 0, 0, 1439, 1440, 3, 424, 209, 0, 1440, 1442, 1, 0, 0, 0, 1441, 1409, 1, 0, 0, 0, 1441, 1425, 1, 0, 0, 0, 1442, 275, 1, 0, 0, 0, 1443, 1444, 3, 284, 139, 0, 1444, 1448, 3, 376, 185, 0, 1445, 1447, 3, 352, 173, 0, 1446, 1445, 1, 0, 0, 0, 1447, 1450, 1, 0, 0, 0, 1448, 1446, 1, 0, 0, 0, 1448, 1449, 1, 0, 0, 0, 1449, 1451, 1, 0, 0, 0, 1450, 1448, 1, 0, 0, 0, 1451, 1454, 3, 322, 158, 0, 1452, 1455, 3, 420, 207, 0, 1453, 1455, 3, 372, 183, 0, 1454, 1452, 1, 0, 0, 0, 1454, 1453, 1, 0, 0, 0, 1454, 1455, 1, 0, 0, 0, 1455, 1457, 1, 0, 0, 0, 1456, 1458, 3, 350, 172, 0, 1457, 1456, 1, 0, 0, 0, 1458, 1459, 1, 0, 0, 0, 1459, 1457, 1, 0, 0, 0, 1459, 1460, 1, 0, 0, 0, 1460, 1514, 1, 0, 0, 0, 1461, 1462, 3, 284, 139, 0, 1462, 1465, 3, 322, 158, 0, 1463, 1466, 3, 420, 207, 0, 1464, 1466, 3, 372, 183, 0, 1465, 1463, 1, 0, 0, 0, 1465, 1464, 1, 0, 0, 0, 1465, 1466, 1, 0, 0, 0, 1466, 1468, 1, 0, 0, 0, 1467, 1469, 3, 350, 172, 0, 1468, 1467, 1, 0, 0, 0, 1469, 1470, 1, 0, 0, 0, 1470, 1468, 1, 0, 0, 0, 1470, 1471, 1, 0, 0, 0, 1471, 1514, 1, 0, 0, 0, 1472, 1473, 3, 282, 138, 0, 1473, 1477, 3, 376, 185, 0, 1474, 1476, 3, 350, 172, 0, 1475, 1474, 1, 0, 0, 0, 1476, 1479, 1, 0, 0, 0, 1477, 1475, 1, 0, 0, 0, 1477, 1478, 1, 0, 0, 0, 1478, 1480, 1, 0, 0, 0, 1479, 1477, 1, 0, 0, 0, 1480, 1483, 3, 300, 147, 0, 1481, 1484, 3, 420, 207, 0, 1482, 1484, 3, 372, 183, 0, 1483, 1481, 1, 0, 0, 0, 1483, 1482, 1, 0, 0, 0, 1483, 1484, 1, 0, 0, 0, 1484, 1486, 1, 0, 0, 0, 1485, 1487, 3, 350, 172, 0, 1486, 1485, 1, 0, 0, 0, 1487, 1488, 1, 0, 0, 0, 1488, 1486, 1, 0, 0, 0, 1488, 1489, 1, 0, 0, 0, 1489, 1514, 1, 0, 0, 0, 1490, 1491, 3, 376, 185, 0, 1491, 1492, 3, 282, 138, 0, 1492, 1495, 3, 300, 147, 0, 1493, 1496, 3, 420, 207, 0, 1494, 1496, 3, 372, 183, 0, 1495, 1493, 1, 0, 0, 0, 1495, 1494, 1, 0, 0, 0, 1495, 1496, 1, 0, 0, 0, 1496, 1498, 1, 0, 0, 0, 1497, 1499, 3, 350, 172, 0, 1498, 1497, 1, 0, 0, 0, 1499, 1500, 1, 0, 0, 0, 1500, 1498, 1, 0, 0, 0, 1500, 1501, 1, 0, 0, 0, 1501, 1514, 1, 0, 0, 0, 1502, 1503, 3, 282, 138, 0, 1503, 1506, 3, 300, 147, 0, 1504, 1507, 3, 420, 207, 0, 1505, 1507, 3, 372, 183, 0, 1506, 1504, 1, 0, 0, 0, 1506, 1505, 1, 0, 0, 0, 1506, 1507, 1, 0, 0, 0, 1507, 1509, 1, 0, 0, 0, 1508, 1510, 3, 350, 172, 0, 1509, 1508, 1, 0, 0, 0, 1510, 1511, 1, 0, 0, 0, 1511, 1509, 1, 0, 0, 0, 1511, 1512, 1, 0, 0, 0, 1512, 1514, 1, 0, 0, 0, 1513, 1443, 1, 0, 0, 0, 1513, 1461, 1, 0, 0, 0, 1513, 1472, 1, 0, 0, 0, 1513, 1490, 1, 0, 0, 0, 1513, 1502, 1, 0, 0, 0, 1514, 277, 1, 0, 0, 0, 1515, 1516, 5, 48, 0, 0, 1516, 1518, 3, 294, 144, 0, 1517, 1519, 3, 346, 170, 0, 1518, 1517, 1, 0, 0, 0, 1519, 1520, 1, 0, 0, 0, 1520, 1518, 1, 0, 0, 0, 1520, 1521, 1, 0, 0, 0, 1521, 279, 1, 0, 0, 0, 1522, 1524, 5, 48, 0, 0, 1523, 1525, 3, 348, 171, 0, 1524, 1523, 1, 0, 0, 0, 1525, 1526, 1, 0, 0, 0, 1526, 1524, 1, 0, 0, 0, 1526, 1527, 1, 0, 0, 0, 1527, 281, 1, 0, 0, 0, 1528, 1530, 3, 350, 172, 0, 1529, 1528, 1, 0, 0, 0, 1530, 1531, 1, 0, 0, 0, 1531, 1529, 1, 0, 0, 0, 1531, 1532, 1, 0, 0, 0, 1532, 283, 1, 0, 0, 0, 1533, 1534, 5, 48, 0, 0, 1534, 1536, 3, 338, 166, 0, 1535, 1537, 3, 352, 173, 0, 1536, 1535, 1, 0, 0, 0, 1537, 1538, 1, 0, 0, 0, 1538, 1536, 1, 0, 0, 0, 1538, 1539, 1, 0, 0, 0, 1539, 285, 1, 0, 0, 0, 1540, 1541, 5, 48, 0, 0, 1541, 1543, 7, 2, 0, 0, 1542, 1544, 3, 350, 172, 0, 1543, 1542, 1, 0, 0, 0, 1544, 1545, 1, 0, 0, 0, 1545, 1543, 1, 0, 0, 0, 1545, 1546, 1, 0, 0, 0, 1546, 287, 1, 0, 0, 0, 1547, 1548, 5, 48, 0, 0, 1548, 1550, 7, 3, 0, 0, 1549, 1551, 3, 350, 172, 0, 1550, 1549, 1, 0, 0, 0, 1551, 1552, 1, 0, 0, 0, 1552, 1550, 1, 0, 0, 0, 1552, 1553, 1, 0, 0, 0, 1553, 289, 1, 0, 0, 0, 1554, 1565, 3, 430, 212, 0, 1555, 1564, 8, 4, 0, 0, 1556, 1564, 3, 270, 132, 0, 1557, 1558, 3, 360, 177, 0, 1558, 1559, 3, 430, 212, 0, 1559, 1564, 1, 0, 0, 0, 1560, 1561, 3, 430, 212, 0, 1561, 1562, 3, 430, 212, 0, 1562, 1564, 1, 0, 0, 0, 1563, 1555, 1, 0, 0, 0, 1563, 1556, 1, 0, 0, 0, 1563, 1557, 1, 0, 0, 0, 1563, 1560, 1, 0, 0, 0, 1564, 1567, 1, 0, 0, 0, 1565, 1563, 1, 0, 0, 0, 1565, 1566, 1, 0, 0, 0, 1566, 1568, 1, 0, 0, 0, 1567, 1565, 1, 0, 0, 0, 1568, 1569, 3, 430, 212, 0, 1569, 291, 1, 0, 0, 0, 1570, 1571, 7, 5, 0, 0, 1571, 293, 1, 0, 0, 0, 1572, 1573, 7, 3, 0, 0, 1573, 295, 1, 0, 0, 0, 1574, 1575, 7, 6, 0, 0, 1575, 297, 1, 0, 0, 0, 1576, 1577, 7, 7, 0, 0, 1577, 299, 1, 0, 0, 0, 1578, 1579, 7, 8, 0, 0, 1579, 301, 1, 0, 0, 0, 1580, 1581, 7, 9, 0, 0, 1581, 303, 1, 0, 0, 0, 1582, 1583, 7, 10, 0, 0, 1583, 305, 1, 0, 0, 0, 1584, 1585, 7, 11, 0, 0, 1585, 307, 1, 0, 0, 0, 1586, 1587, 7, 12, 0, 0, 1587, 309, 1, 0, 0, 0, 1588, 1589, 7, 13, 0, 0, 1589, 311, 1, 0, 0, 0, 1590, 1591, 7, 14, 0, 0, 1591, 313, 1, 0, 0, 0, 1592, 1593, 7, 15, 0, 0, 1593, 315, 1, 0, 0, 0, 1594, 1595, 7, 16, 0, 0, 1595, 317, 1, 0, 0, 0, 1596, 1597, 7, 17, 0, 0, 1597, 319, 1, 0, 0, 0, 1598, 1599, 7, 2, 0, 0, 1599, 321, 1, 0, 0, 0, 1600, 1601, 7, 18, 0, 0, 1601, 323, 1, 0, 0, 0, 1602, 1603, 7, 19, 0, 0, 1603, 325, 1, 0, 0, 0, 1604, 1605, 7, 20, 0, 0, 1605, 327, 1, 0, 0, 0, 1606, 1607, 7, 21, 0, 0, 1607, 329, 1, 0, 0, 0, 1608, 1609, 7, 22, 0, 0, 1609, 331, 1, 0, 0, 0, 1610, 1611, 7, 23, 0, 0, 1611, 333, 1, 0, 0, 0, 1612, 1613, 7, 24, 0, 0, 1613, 335, 1, 0, 0, 0, 1614, 1615, 7, 25, 0, 0, 1615, 337, 1, 0, 0, 0, 1616, 1617, 7, 26, 0, 0, 1617, 339, 1, 0, 0, 0, 1618, 1619, 7, 27, 0, 0, 1619, 341, 1, 0, 0, 0, 1620, 1621, 7, 28, 0, 0, 1621, 343, 1, 0, 0, 0, 1622, 1623, 7, 29, 0, 0, 1623, 345, 1, 0, 0, 0, 1624, 1625, 7, 30, 0, 0, 1625, 347, 1, 0, 0, 0, 1626, 1627, 7, 31, 0, 0, 1627, 349, 1, 0, 0, 0, 1628, 1629, 7, 32, 0, 0, 1629, 351, 1, 0, 0, 0, 1630, 1631, 7, 33, 0, 0, 1631, 353, 1, 0, 0, 0, 1632, 1633, 5, 45, 0, 0, 1633, 1634, 5, 62, 0, 0, 1634, 355, 1, 0, 0, 0, 1635, 1636, 5, 42, 0, 0, 1636, 357, 1, 0, 0, 0, 1637, 1638, 5, 96, 0, 0, 1638, 359, 1, 0, 0, 0, 1639, 1640, 5, 92, 0, 0, 1640, 361, 1, 0, 0, 0, 1641, 1642, 5, 58, 0, 0, 1642, 1643, 5, 58, 0, 0, 1643, 363, 1, 0, 0, 0, 1644, 1645, 5, 58, 0, 0, 1645, 1646, 5, 61, 0, 0, 1646, 365, 1, 0, 0, 0, 1647, 1648, 5, 58, 0, 0, 1648, 367, 1, 0, 0, 0, 1649, 1650, 5, 44, 0, 0, 1650, 369, 1, 0, 0, 0, 1651, 1652, 5, 124, 0, 0, 1652, 1653, 5, 124, 0, 0, 1653, 371, 1, 0, 0, 0, 1654, 1655, 5, 45, 0, 0, 1655, 373, 1, 0, 0, 0, 1656, 1657, 5, 36, 0, 0, 1657, 375, 1, 0, 0, 0, 1658, 1659, 5, 46, 0, 0, 1659, 377, 1, 0, 0, 0, 1660, 1661, 5, 61, 0, 0, 1661, 1662, 5, 61, 0, 0, 1662, 379, 1, 0, 0, 0, 1663, 1664, 5, 61, 0, 0, 1664, 381, 1, 0, 0, 0, 1665, 1666, 5, 62, 0, 0, 1666, 1667, 5, 61, 0, 0, 1667, 383, 1, 0, 0, 0, 1668, 1669, 5, 62, 0, 0, 1669, 385, 1, 0, 0, 0, 1670, 1671, 5, 35, 0, 0, 1671, 387, 1, 0, 0, 0, 1672, 1673, 5, 126, 0, 0, 1673, 1674, 5, 42, 0, 0, 1674, 389, 1, 0, 0, 0, 1675, 1676, 5, 61, 0, 0, 1676, 1677, 5, 126, 0, 0, 1677, 1678, 5, 42, 0, 0, 1678, 391, 1, 0, 0, 0, 1679, 1680, 5, 123, 0, 0, 1680, 1681, 1, 0, 0, 0, 1681, 1682, 6, 193, 0, 0, 1682, 393, 1, 0, 0, 0, 1683, 1684, 5, 91, 0, 0, 1684, 395, 1, 0, 0, 0, 1685, 1686, 5, 40, 0, 0, 1686, 397, 1, 0, 0, 0, 1687, 1688, 5, 60, 0, 0, 1688, 1689, 5, 61, 0, 0, 1689, 399, 1, 0, 0, 0, 1690, 1691, 5, 60, 0, 0, 1691, 1692, 5, 47, 0, 0, 1692, 1693, 1, 0, 0, 0, 1693, 1694, 6, 197, 1, 0, 1694, 1695, 6, 197, 2, 0, 1695, 401, 1, 0, 0, 0, 1696, 1697, 5, 60, 0, 0, 1697, 1698, 4, 198, 0, 0, 1698, 1699, 1, 0, 0, 0, 1699, 1700, 6, 198, 3, 0, 1700, 1701, 6, 198, 4, 0, 1701, 403, 1, 0, 0, 0, 1702, 1703, 5, 60, 0, 0, 1703, 405, 1, 0, 0, 0, 1704, 1705, 5, 60, 0, 0, 1705, 1706, 5, 47, 0, 0, 1706, 407, 1, 0, 0, 0, 1707, 1708, 5, 33, 0, 0, 1708, 1712, 5, 61, 0, 0, 1709, 1710, 5, 60, 0, 0, 1710, 1712, 5, 62, 0, 0, 1711, 1707, 1, 0, 0, 0, 1711, 1709, 1, 0, 0, 0, 1712, 409, 1, 0, 0, 0, 1713, 1714, 5, 33, 0, 0, 1714, 1715, 5, 126, 0, 0, 1715, 1716, 5, 42, 0, 0, 1716, 411, 1, 0, 0, 0, 1717, 1718, 5, 33, 0, 0, 1718, 1719, 5, 126, 0, 0, 1719, 413, 1, 0, 0, 0, 1720, 1721, 5, 63, 0, 0, 1721, 1722, 5, 46, 0, 0, 1722, 415, 1, 0, 0, 0, 1723, 1724, 5, 63, 0, 0, 1724, 1725, 5, 63, 0, 0, 1725, 417, 1, 0, 0, 0, 1726, 1727, 5, 37, 0, 0, 1727, 419, 1, 0, 0, 0, 1728, 1729, 5, 43, 0, 0, 1729, 421, 1, 0, 0, 0, 1730, 1731, 5, 63, 0, 0, 1731, 423, 1, 0, 0, 0, 1732, 1733, 5, 34, 0, 0, 1733, 425, 1, 0, 0, 0, 1734, 1735, 5, 102, 0, 0, 1735, 1736, 5, 39, 0, 0, 1736, 1737, 1, 0, 0, 0, 1737, 1738, 6, 210, 5, 0, 1738, 427, 1, 0, 0, 0, 1739, 1740, 5, 70, 0, 0, 1740, 1741, 5, 39, 0, 0, 1741, 1742, 1, 0, 0, 0, 1742, 1743, 6, 211, 6, 0, 1743, 429, 1, 0, 0, 0, 1744, 1745, 5, 39, 0, 0, 1745, 431, 1, 0, 0, 0, 1746, 1747, 5, 126, 0, 0, 1747, 433, 1, 0, 0, 0, 1748, 1749, 5, 61, 0, 0, 1749, 1750, 5, 126, 0, 0, 1750, 435, 1, 0, 0, 0, 1751, 1752, 5, 125, 0, 0, 1752, 1753, 1, 0, 0, 0, 1753, 1754, 6, 215, 7, 0, 1754, 437, 1, 0, 0, 0, 1755, 1756, 5, 93, 0, 0, 1756, 439, 1, 0, 0, 0, 1757, 1758, 5, 41, 0, 0, 1758, 441, 1, 0, 0, 0, 1759, 1760, 5, 59, 0, 0, 1760, 443, 1, 0, 0, 0, 1761, 1762, 5, 47, 0, 0, 1762, 445, 1, 0, 0, 0, 1763, 1764, 5, 47, 0, 0, 1764, 1765, 5, 62, 0, 0, 1765, 447, 1, 0, 0, 0, 1766, 1767, 5, 95, 0, 0, 1767, 449, 1, 0, 0, 0, 1768, 1769, 5, 47, 0, 0, 1769, 1770, 5, 42, 0, 0, 1770, 1774, 1, 0, 0, 0, 1771, 1773, 9, 0, 0, 0, 1772, 1771, 1, 0, 0, 0, 1773, 1776, 1, 0, 0, 0, 1774, 1775, 1, 0, 0, 0, 1774, 1772, 1, 0, 0, 0, 1775, 1777, 1, 0, 0, 0, 1776, 1774, 1, 0, 0, 0, 1777, 1778, 5, 42, 0, 0, 1778, 1779, 5, 47, 0, 0, 1779, 1780, 1, 0, 0, 0, 1780, 1781, 6, 222, 8, 0, 1781, 451, 1, 0, 0, 0, 1782, 1783, 5, 45, 0, 0, 1783, 1787, 5, 45, 0, 0, 1784, 1785, 5, 47, 0, 0, 1785, 1787, 5, 47, 0, 0, 1786, 1782, 1, 0, 0, 0, 1786, 1784, 1, 0, 0, 0, 1787, 1791, 1, 0, 0, 0, 1788, 1790, 8, 34, 0, 0, 1789, 1788, 1, 0, 0, 0, 1790, 1793, 1, 0, 0, 0, 1791, 1789, 1, 0, 0, 0, 1791, 1792, 1, 0, 0, 0, 1792, 1795, 1, 0, 0, 0, 1793, 1791, 1, 0, 0, 0, 1794, 1796, 7, 35, 0, 0, 1795, 1794, 1, 0, 0, 0, 1796, 1797, 1, 0, 0, 0, 1797, 1798, 6, 223, 8, 0, 1798, 453, 1, 0, 0, 0, 1799, 1800, 7, 36, 0, 0, 1800, 1801, 1, 0, 0, 0, 1801, 1802, 6, 224, 9, 0, 1802, 455, 1, 0, 0, 0, 1803, 1804, 9, 0, 0, 0, 1804, 457, 1, 0, 0, 0, 1805, 1817, 8, 37, 0, 0, 1806, 1817, 3, 270, 132, 0, 1807, 1808, 3, 360, 177, 0, 1808, 1809, 3, 430, 212, 0, 1809, 1817, 1, 0, 0, 0, 1810, 1811, 3, 360, 177, 0, 1811, 1812, 3, 392, 193, 0, 1812, 1817, 1, 0, 0, 0, 1813, 1814, 3, 430, 212, 0, 1814, 1815, 3, 430, 212, 0, 1815, 1817, 1, 0, 0, 0, 1816, 1805, 1, 0, 0, 0, 1816, 1806, 1, 0, 0, 0, 1816, 1807, 1, 0, 0, 0, 1816, 1810, 1, 0, 0, 0, 1816, 1813, 1, 0, 0, 0, 1817, 1818, 1, 0, 0, 0, 1818, 1816, 1, 0, 0, 0, 1818, 1819, 1, 0, 0, 0, 1819, 459, 1, 0, 0, 0, 1820, 1821, 3, 392, 193, 0, 1821, 1822, 1, 0, 0, 0, 1822, 1823, 6, 227, 0, 0, 1823, 461, 1, 0, 0, 0, 1824, 1825, 3, 430, 212, 0, 1825, 1826, 1, 0, 0, 0, 1826, 1827, 6, 228, 10, 0, 1827, 1828, 6, 228, 7, 0, 1828, 463, 1, 0, 0, 0, 1829, 1835, 8, 38, 0, 0, 1830, 1835, 3, 270, 132, 0, 1831, 1832, 3, 360, 177, 0, 1832, 1833, 3, 392, 193, 0, 1833, 1835, 1, 0, 0, 0, 1834, 1829, 1, 0, 0, 0, 1834, 1830, 1, 0, 0, 0, 1834, 1831, 1, 0, 0, 0, 1835, 1836, 1, 0, 0, 0, 1836, 1834, 1, 0, 0, 0, 1836, 1837, 1, 0, 0, 0, 1837, 465, 1, 0, 0, 0, 1838, 1839, 3, 392, 193, 0, 1839, 1840, 1, 0, 0, 0, 1840, 1841, 6, 230, 0, 0, 1841, 467, 1, 0, 0, 0, 1842, 1843, 5, 47, 0, 0, 1843, 1844, 5, 62, 0, 0, 1844, 1845, 1, 0, 0, 0, 1845, 1846, 6, 231, 11, 0, 1846, 1847, 6, 231, 7, 0, 1847, 469, 1, 0, 0, 0, 1848, 1849, 5, 62, 0, 0, 1849, 1850, 1, 0, 0, 0, 1850, 1851, 6, 232, 12, 0, 1851, 1852, 6, 232, 7, 0, 1852, 1853, 6, 232, 13, 0, 1853, 471, 1, 0, 0, 0, 1854, 1855, 5, 47, 0, 0, 1855, 1856, 5, 42, 0, 0, 1856, 1860, 1, 0, 0, 0, 1857, 1859, 9, 0, 0, 0, 1858, 1857, 1, 0, 0, 0, 1859, 1862, 1, 0, 0, 0, 1860, 1861, 1, 0, 0, 0, 1860, 1858, 1, 0, 0, 0, 1861, 1863, 1, 0, 0, 0, 1862, 1860, 1, 0, 0, 0, 1863, 1864, 5, 42, 0, 0, 1864, 1865, 5, 47, 0, 0, 1865, 1866, 1, 0, 0, 0, 1866, 1867, 6, 233, 8, 0, 1867, 473, 1, 0, 0, 0, 1868, 1869, 5, 45, 0, 0, 1869, 1873, 5, 45, 0, 0, 1870, 1871, 5, 47, 0, 0, 1871, 1873, 5, 47, 0, 0, 1872, 1868, 1, 0, 0, 0, 1872, 1870, 1, 0, 0, 0, 1873, 1877, 1, 0, 0, 0, 1874, 1876, 8, 34, 0, 0, 1875, 1874, 1, 0, 0, 0, 1876, 1879, 1, 0, 0, 0, 1877, 1875, 1, 0, 0, 0, 1877, 1878, 1, 0, 0, 0, 1878, 1881, 1, 0, 0, 0, 1879, 1877, 1, 0, 0, 0, 1880, 1882, 7, 35, 0, 0, 1881, 1880, 1, 0, 0, 0, 1882, 1883, 1, 0, 0, 0, 1883, 1884, 6, 234, 8, 0, 1884, 475, 1, 0, 0, 0, 1885, 1889, 7, 39, 0, 0, 1886, 1888, 7, 40, 0, 0, 1887, 1886, 1, 0, 0, 0, 1888, 1891, 1, 0, 0, 0, 1889, 1887, 1, 0, 0, 0, 1889, 1890, 1, 0, 0, 0, 1890, 1892, 1, 0, 0, 0, 1891, 1889, 1, 0, 0, 0, 1892, 1893, 6, 235, 14, 0, 1893, 477, 1, 0, 0, 0, 1894, 1895, 5, 61, 0, 0, 1895, 1896, 1, 0, 0, 0, 1896, 1897, 6, 236, 15, 0, 1897, 479, 1, 0, 0, 0, 1898, 1899, 3, 290, 142, 0, 1899, 1900, 1, 0, 0, 0, 1900, 1901, 6, 237, 16, 0, 1901, 481, 1, 0, 0, 0, 1902, 1904, 7, 41, 0, 0, 1903, 1902, 1, 0, 0, 0, 1904, 1905, 1, 0, 0, 0, 1905, 1903, 1, 0, 0, 0, 1905, 1906, 1, 0, 0, 0, 1906, 1907, 1, 0, 0, 0, 1907, 1908, 6, 238, 9, 0, 1908, 483, 1, 0, 0, 0, 1909, 1910, 5, 123, 0, 0, 1910, 1911, 1, 0, 0, 0, 1911, 1912, 6, 239, 17, 0, 1912, 1913, 6, 239, 0, 0, 1913, 485, 1, 0, 0, 0, 1914, 1915, 9, 0, 0, 0, 1915, 1916, 1, 0, 0, 0, 1916, 1917, 6, 240, 18, 0, 1917, 487, 1, 0, 0, 0, 1918, 1919, 5, 62, 0, 0, 1919, 1920, 1, 0, 0, 0, 1920, 1921, 6, 241, 12, 0, 1921, 1922, 6, 241, 7, 0, 1922, 489, 1, 0, 0, 0, 1923, 1924, 5, 47, 0, 0, 1924, 1925, 5, 42, 0, 0, 1925, 1929, 1, 0, 0, 0, 1926, 1928, 9, 0, 0, 0, 1927, 1926, 1, 0, 0, 0, 1928, 1931, 1, 0, 0, 0, 1929, 1930, 1, 0, 0, 0, 1929, 1927, 1, 0, 0, 0, 1930, 1932, 1, 0, 0, 0, 1931, 1929, 1, 0, 0, 0, 1932, 1933, 5, 42, 0, 0, 1933, 1934, 5, 47, 0, 0, 1934, 1935, 1, 0, 0, 0, 1935, 1936, 6, 242, 8, 0, 1936, 491, 1, 0, 0, 0, 1937, 1938, 5, 45, 0, 0, 1938, 1942, 5, 45, 0, 0, 1939, 1940, 5, 47, 0, 0, 1940, 1942, 5, 47, 0, 0, 1941, 1937, 1, 0, 0, 0, 1941, 1939, 1, 0, 0, 0, 1942, 1946, 1, 0, 0, 0, 1943, 1945, 8, 34, 0, 0, 1944, 1943, 1, 0, 0, 0, 1945, 1948, 1, 0, 0, 0, 1946, 1944, 1, 0, 0, 0, 1946, 1947, 1, 0, 0, 0, 1947, 1950, 1, 0, 0, 0, 1948, 1946, 1, 0, 0, 0, 1949, 1951, 7, 35, 0, 0, 1950, 1949, 1, 0, 0, 0, 1951, 1952, 1, 0, 0, 0, 1952, 1953, 6, 243, 8, 0, 1953, 493, 1, 0, 0, 0, 1954, 1958, 7, 39, 0, 0, 1955, 1957, 7, 40, 0, 0, 1956, 1955, 1, 0, 0, 0, 1957, 1960, 1, 0, 0, 0, 1958, 1956, 1, 0, 0, 0, 1958, 1959, 1, 0, 0, 0, 1959, 1961, 1, 0, 0, 0, 1960, 1958, 1, 0, 0, 0, 1961, 1962, 6, 244, 14, 0, 1962, 495, 1, 0, 0, 0, 1963, 1965, 7, 41, 0, 0, 1964, 1963, 1, 0, 0, 0, 1965, 1966, 1, 0, 0, 0, 1966, 1964, 1, 0, 0, 0, 1966, 1967, 1, 0, 0, 0, 1967, 1968, 1, 0, 0, 0, 1968, 1969, 6, 245, 9, 0, 1969, 497, 1, 0, 0, 0, 1970, 1971, 9, 0, 0, 0, 1971, 1972, 1, 0, 0, 0, 1972, 1973, 6, 246, 18, 0, 1973, 499, 1, 0, 0, 0, 1974, 1976, 8, 42, 0, 0, 1975, 1974, 1, 0, 0, 0, 1976, 1977, 1, 0, 0, 0, 1977, 1975, 1, 0, 0, 0, 1977, 1978, 1, 0, 0, 0, 1978, 501, 1, 0, 0, 0, 1979, 1980, 5, 123, 0, 0, 1980, 1981, 1, 0, 0, 0, 1981, 1982, 6, 248, 17, 0, 1982, 1983, 6, 248, 0, 0, 1983, 503, 1, 0, 0, 0, 1984, 1985, 5, 60, 0, 0, 1985, 1986, 5, 47, 0, 0, 1986, 1987, 1, 0, 0, 0, 1987, 1988, 6, 249, 1, 0, 1988, 1989, 6, 249, 7, 0, 1989, 1990, 6, 249, 2, 0, 1990, 505, 1, 0, 0, 0, 1991, 1992, 5, 60, 0, 0, 1992, 1993, 1, 0, 0, 0, 1993, 1994, 6, 250, 3, 0, 1994, 1995, 6, 250, 4, 0, 1995, 507, 1, 0, 0, 0, 1996, 1998, 7, 41, 0, 0, 1997, 1996, 1, 0, 0, 0, 1998, 1999, 1, 0, 0, 0, 1999, 1997, 1, 0, 0, 0, 1999, 2000, 1, 0, 0, 0, 2000, 2001, 1, 0, 0, 0, 2001, 2002, 6, 251, 9, 0, 2002, 509, 1, 0, 0, 0, 62, 0, 1, 2, 3, 4, 5, 550, 830, 1359, 1393, 1398, 1404, 1406, 1418, 1420, 1434, 1436, 1441, 1448, 1454, 1459, 1465, 1470, 1477, 1483, 1488, 1495, 1500, 1506, 1511, 1513, 1520, 1526, 1531, 1538, 1545, 1552, 1563, 1565, 1711, 1774, 1786, 1791, 1795, 1816, 1818, 1834, 1836, 1860, 1872, 1877, 1881, 1889, 1905, 1929, 1941, 1946, 1950, 1958, 1966, 1977, 1999, 19, 5, 0, 0, 7, 168, 0, 5, 4, 0, 7, 167, 0, 5, 3, 0, 5, 1, 0, 5, 2, 0, 4, 0, 0, 6, 0, 0, 0, 1, 0, 7, 180, 0, 7, 188, 0, 7, 159, 0, 5, 5, 0, 7, 134, 0, 7, 157, 0, 7, 143, 0, 7, 163, 0, 7, 193, 0]
\ No newline at end of file
diff --git a/posthog/hogql/grammar/HogQLLexer.py b/posthog/hogql/grammar/HogQLLexer.py
index 26488134602d..69d46fdc195f 100644
--- a/posthog/hogql/grammar/HogQLLexer.py
+++ b/posthog/hogql/grammar/HogQLLexer.py
@@ -16,7 +16,7 @@ import sys
def serializedATN():
return [
- 4,0,201,1927,6,-1,6,-1,6,-1,6,-1,6,-1,6,-1,2,0,7,0,2,1,7,1,2,2,7,
+ 4,0,205,2003,6,-1,6,-1,6,-1,6,-1,6,-1,6,-1,2,0,7,0,2,1,7,1,2,2,7,
2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,
10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,
17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,
@@ -58,735 +58,766 @@ def serializedATN():
2,228,7,228,2,229,7,229,2,230,7,230,2,231,7,231,2,232,7,232,2,233,
7,233,2,234,7,234,2,235,7,235,2,236,7,236,2,237,7,237,2,238,7,238,
2,239,7,239,2,240,7,240,2,241,7,241,2,242,7,242,2,243,7,243,2,244,
- 7,244,2,245,7,245,1,0,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,2,1,2,1,2,1,
- 2,1,2,1,3,1,3,1,3,1,3,1,4,1,4,1,4,1,4,1,4,1,4,1,5,1,5,1,5,1,6,1,
- 6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,3,6,539,8,6,1,
- 7,1,7,1,7,1,7,1,7,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,9,1,9,1,9,1,
- 9,1,9,1,10,1,10,1,10,1,11,1,11,1,11,1,11,1,11,1,12,1,12,1,12,1,12,
- 1,12,1,13,1,13,1,13,1,13,1,13,1,13,1,14,1,14,1,14,1,14,1,14,1,14,
- 1,14,1,15,1,15,1,15,1,15,1,15,1,15,1,15,1,15,1,16,1,16,1,16,1,16,
- 1,16,1,16,1,16,1,16,1,17,1,17,1,17,1,17,1,17,1,17,1,18,1,18,1,18,
- 1,18,1,18,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,20,1,20,1,20,
- 1,20,1,20,1,21,1,21,1,21,1,21,1,22,1,22,1,22,1,22,1,22,1,23,1,23,
- 1,23,1,23,1,23,1,23,1,23,1,23,1,23,1,23,1,23,1,24,1,24,1,24,1,24,
- 1,24,1,24,1,24,1,24,1,24,1,25,1,25,1,25,1,25,1,25,1,26,1,26,1,26,
- 1,26,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,28,1,28,1,28,1,28,1,28,
- 1,28,1,28,1,28,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,30,1,30,
- 1,30,1,30,1,30,1,30,1,31,1,31,1,31,1,31,1,31,1,32,1,32,1,32,1,32,
- 1,32,1,32,1,32,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,34,1,34,
- 1,34,1,34,1,34,1,34,1,35,1,35,1,35,1,36,1,36,1,36,1,36,1,36,1,36,
- 1,36,1,36,1,36,1,36,1,37,1,37,1,37,1,37,1,38,1,38,1,38,1,38,1,38,
- 1,39,1,39,1,39,1,39,1,39,1,40,1,40,1,40,1,40,1,41,1,41,1,41,1,41,
- 1,41,1,41,1,42,1,42,1,42,1,42,1,42,1,42,1,42,1,42,1,42,1,43,1,43,
- 1,43,1,43,1,43,1,43,1,43,1,44,1,44,1,44,1,44,1,44,1,45,1,45,1,45,
- 1,46,1,46,1,46,1,47,1,47,1,47,1,47,1,47,1,47,1,48,1,48,1,48,1,48,
- 1,48,1,48,1,48,1,49,1,49,1,49,1,49,1,49,1,49,1,49,1,49,1,50,1,50,
- 1,50,1,51,1,51,1,51,1,51,1,51,1,51,1,51,1,51,1,51,1,51,1,51,1,51,
- 1,51,3,51,819,8,51,1,52,1,52,1,52,1,52,1,52,1,52,1,53,1,53,1,53,
- 1,53,1,53,1,53,1,53,1,53,1,53,1,53,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,55,1,55,1,55,1,55,1,55,1,55,1,55,
- 1,55,1,55,1,56,1,56,1,56,1,57,1,57,1,57,1,57,1,57,1,58,1,58,1,58,
- 1,58,1,59,1,59,1,59,1,59,1,59,1,59,1,59,1,60,1,60,1,60,1,60,1,60,
- 1,61,1,61,1,61,1,61,1,61,1,61,1,61,1,61,1,62,1,62,1,62,1,62,1,62,
- 1,63,1,63,1,63,1,63,1,64,1,64,1,64,1,64,1,64,1,65,1,65,1,65,1,65,
- 1,65,1,65,1,66,1,66,1,66,1,66,1,66,1,66,1,66,1,66,1,66,1,66,1,66,
- 1,66,1,66,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,68,1,68,1,68,1,68,
- 1,68,1,68,1,69,1,69,1,69,1,69,1,69,1,70,1,70,1,70,1,70,1,70,1,70,
- 1,70,1,70,1,71,1,71,1,71,1,71,1,72,1,72,1,72,1,72,1,73,1,73,1,73,
- 1,73,1,73,1,74,1,74,1,74,1,74,1,74,1,74,1,75,1,75,1,75,1,75,1,75,
- 1,75,1,75,1,76,1,76,1,76,1,77,1,77,1,77,1,78,1,78,1,78,1,78,1,78,
- 1,78,1,79,1,79,1,79,1,79,1,79,1,79,1,80,1,80,1,80,1,80,1,80,1,81,
- 1,81,1,81,1,81,1,81,1,81,1,81,1,81,1,81,1,81,1,82,1,82,1,82,1,82,
- 1,82,1,82,1,83,1,83,1,83,1,83,1,83,1,83,1,83,1,83,1,83,1,83,1,83,
- 1,84,1,84,1,84,1,84,1,84,1,84,1,84,1,84,1,84,1,84,1,85,1,85,1,85,
- 1,85,1,85,1,85,1,85,1,85,1,85,1,86,1,86,1,86,1,86,1,86,1,86,1,86,
- 1,86,1,87,1,87,1,87,1,87,1,87,1,87,1,87,1,87,1,88,1,88,1,88,1,88,
- 1,88,1,88,1,89,1,89,1,89,1,89,1,89,1,89,1,89,1,89,1,89,1,89,1,90,
- 1,90,1,90,1,90,1,90,1,90,1,90,1,90,1,91,1,91,1,91,1,91,1,91,1,91,
- 1,91,1,92,1,92,1,92,1,92,1,92,1,92,1,93,1,93,1,93,1,93,1,93,1,93,
- 1,93,1,94,1,94,1,94,1,94,1,95,1,95,1,95,1,95,1,95,1,96,1,96,1,96,
- 1,96,1,96,1,96,1,96,1,97,1,97,1,97,1,97,1,97,1,97,1,97,1,98,1,98,
- 1,98,1,98,1,98,1,98,1,98,1,99,1,99,1,99,1,99,1,99,1,100,1,100,1,
- 100,1,100,1,100,1,101,1,101,1,101,1,101,1,101,1,101,1,101,1,101,
- 1,101,1,102,1,102,1,102,1,102,1,102,1,103,1,103,1,103,1,103,1,103,
- 1,103,1,103,1,103,1,103,1,103,1,104,1,104,1,104,1,104,1,104,1,105,
- 1,105,1,105,1,105,1,105,1,105,1,106,1,106,1,106,1,106,1,106,1,107,
- 1,107,1,107,1,107,1,107,1,107,1,107,1,107,1,107,1,107,1,108,1,108,
- 1,108,1,108,1,108,1,109,1,109,1,109,1,109,1,109,1,109,1,110,1,110,
- 1,110,1,110,1,110,1,111,1,111,1,111,1,112,1,112,1,112,1,112,1,113,
- 1,113,1,113,1,113,1,113,1,113,1,113,1,114,1,114,1,114,1,114,1,114,
- 1,114,1,114,1,114,1,114,1,115,1,115,1,115,1,115,1,115,1,116,1,116,
- 1,116,1,116,1,116,1,116,1,116,1,116,1,116,1,117,1,117,1,117,1,117,
- 1,118,1,118,1,118,1,118,1,118,1,118,1,118,1,118,1,118,1,119,1,119,
- 1,119,1,119,1,119,1,119,1,119,1,119,1,119,1,119,1,120,1,120,1,120,
- 1,120,1,120,1,120,1,121,1,121,1,121,1,121,1,121,1,121,1,121,1,121,
- 1,122,1,122,1,122,1,122,1,122,1,122,1,123,1,123,1,123,1,123,1,123,
- 1,123,1,123,1,124,1,124,1,124,1,124,1,124,1,125,1,125,1,125,1,125,
- 1,125,1,126,1,126,1,126,1,126,1,126,1,126,1,127,1,127,1,127,1,127,
- 1,127,1,127,1,128,1,128,1,128,1,128,1,128,1,128,1,128,1,129,1,129,
- 1,129,1,129,1,129,1,130,1,130,1,130,1,130,1,130,1,130,1,130,1,131,
- 1,131,1,131,1,131,1,131,1,131,1,131,1,131,1,131,1,131,3,131,1348,
- 8,131,1,132,1,132,1,132,1,132,1,132,1,132,1,132,1,132,1,132,1,132,
+ 7,244,2,245,7,245,2,246,7,246,2,247,7,247,2,248,7,248,2,249,7,249,
+ 2,250,7,250,2,251,7,251,1,0,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,2,1,2,
+ 1,2,1,2,1,2,1,3,1,3,1,3,1,3,1,4,1,4,1,4,1,4,1,4,1,4,1,5,1,5,1,5,
+ 1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,6,3,6,551,
+ 8,6,1,7,1,7,1,7,1,7,1,7,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,9,1,9,
+ 1,9,1,9,1,9,1,10,1,10,1,10,1,11,1,11,1,11,1,11,1,11,1,12,1,12,1,
+ 12,1,12,1,12,1,13,1,13,1,13,1,13,1,13,1,13,1,14,1,14,1,14,1,14,1,
+ 14,1,14,1,14,1,15,1,15,1,15,1,15,1,15,1,15,1,15,1,15,1,16,1,16,1,
+ 16,1,16,1,16,1,16,1,16,1,16,1,17,1,17,1,17,1,17,1,17,1,17,1,18,1,
+ 18,1,18,1,18,1,18,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,20,1,
+ 20,1,20,1,20,1,20,1,21,1,21,1,21,1,21,1,22,1,22,1,22,1,22,1,22,1,
+ 23,1,23,1,23,1,23,1,23,1,23,1,23,1,23,1,23,1,23,1,23,1,24,1,24,1,
+ 24,1,24,1,24,1,24,1,24,1,24,1,24,1,25,1,25,1,25,1,25,1,25,1,26,1,
+ 26,1,26,1,26,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,28,1,28,1,28,1,
+ 28,1,28,1,28,1,28,1,28,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,
+ 30,1,30,1,30,1,30,1,30,1,30,1,31,1,31,1,31,1,31,1,31,1,32,1,32,1,
+ 32,1,32,1,32,1,32,1,32,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,
+ 34,1,34,1,34,1,34,1,34,1,34,1,35,1,35,1,35,1,36,1,36,1,36,1,36,1,
+ 36,1,36,1,36,1,36,1,36,1,36,1,37,1,37,1,37,1,37,1,38,1,38,1,38,1,
+ 38,1,38,1,39,1,39,1,39,1,39,1,39,1,40,1,40,1,40,1,40,1,41,1,41,1,
+ 41,1,41,1,41,1,41,1,42,1,42,1,42,1,42,1,42,1,42,1,42,1,42,1,42,1,
+ 43,1,43,1,43,1,43,1,43,1,43,1,43,1,44,1,44,1,44,1,44,1,44,1,45,1,
+ 45,1,45,1,46,1,46,1,46,1,47,1,47,1,47,1,47,1,47,1,47,1,48,1,48,1,
+ 48,1,48,1,48,1,48,1,48,1,49,1,49,1,49,1,49,1,49,1,49,1,49,1,49,1,
+ 50,1,50,1,50,1,51,1,51,1,51,1,51,1,51,1,51,1,51,1,51,1,51,1,51,1,
+ 51,1,51,1,51,3,51,831,8,51,1,52,1,52,1,52,1,52,1,52,1,52,1,53,1,
+ 53,1,53,1,53,1,53,1,53,1,53,1,53,1,53,1,53,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,55,1,55,1,55,1,55,1,55,1,
+ 55,1,55,1,55,1,55,1,56,1,56,1,56,1,57,1,57,1,57,1,57,1,57,1,58,1,
+ 58,1,58,1,58,1,59,1,59,1,59,1,59,1,59,1,59,1,59,1,60,1,60,1,60,1,
+ 60,1,60,1,61,1,61,1,61,1,61,1,61,1,61,1,61,1,61,1,62,1,62,1,62,1,
+ 62,1,62,1,63,1,63,1,63,1,63,1,64,1,64,1,64,1,64,1,64,1,65,1,65,1,
+ 65,1,65,1,65,1,65,1,66,1,66,1,66,1,66,1,66,1,66,1,66,1,66,1,66,1,
+ 66,1,66,1,66,1,66,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,68,1,68,1,
+ 68,1,68,1,68,1,68,1,69,1,69,1,69,1,69,1,69,1,70,1,70,1,70,1,70,1,
+ 70,1,70,1,70,1,70,1,71,1,71,1,71,1,71,1,72,1,72,1,72,1,72,1,73,1,
+ 73,1,73,1,73,1,73,1,74,1,74,1,74,1,74,1,74,1,74,1,75,1,75,1,75,1,
+ 75,1,75,1,75,1,75,1,76,1,76,1,76,1,77,1,77,1,77,1,78,1,78,1,78,1,
+ 78,1,78,1,78,1,79,1,79,1,79,1,79,1,79,1,79,1,80,1,80,1,80,1,80,1,
+ 80,1,81,1,81,1,81,1,81,1,81,1,81,1,81,1,81,1,81,1,81,1,82,1,82,1,
+ 82,1,82,1,82,1,82,1,83,1,83,1,83,1,83,1,83,1,83,1,83,1,83,1,83,1,
+ 83,1,83,1,84,1,84,1,84,1,84,1,84,1,84,1,84,1,84,1,84,1,84,1,85,1,
+ 85,1,85,1,85,1,85,1,85,1,85,1,85,1,85,1,86,1,86,1,86,1,86,1,86,1,
+ 86,1,86,1,86,1,87,1,87,1,87,1,87,1,87,1,87,1,87,1,87,1,88,1,88,1,
+ 88,1,88,1,88,1,88,1,89,1,89,1,89,1,89,1,89,1,89,1,89,1,89,1,89,1,
+ 89,1,90,1,90,1,90,1,90,1,90,1,90,1,90,1,90,1,91,1,91,1,91,1,91,1,
+ 91,1,91,1,91,1,92,1,92,1,92,1,92,1,92,1,92,1,93,1,93,1,93,1,93,1,
+ 93,1,93,1,93,1,94,1,94,1,94,1,94,1,95,1,95,1,95,1,95,1,95,1,96,1,
+ 96,1,96,1,96,1,96,1,96,1,96,1,97,1,97,1,97,1,97,1,97,1,97,1,97,1,
+ 98,1,98,1,98,1,98,1,98,1,98,1,98,1,99,1,99,1,99,1,99,1,99,1,100,
+ 1,100,1,100,1,100,1,100,1,101,1,101,1,101,1,101,1,101,1,101,1,101,
+ 1,101,1,101,1,102,1,102,1,102,1,102,1,102,1,103,1,103,1,103,1,103,
+ 1,103,1,103,1,103,1,103,1,103,1,103,1,104,1,104,1,104,1,104,1,104,
+ 1,105,1,105,1,105,1,105,1,105,1,105,1,106,1,106,1,106,1,106,1,106,
+ 1,107,1,107,1,107,1,107,1,107,1,107,1,107,1,107,1,107,1,107,1,108,
+ 1,108,1,108,1,108,1,108,1,109,1,109,1,109,1,109,1,109,1,109,1,110,
+ 1,110,1,110,1,110,1,110,1,111,1,111,1,111,1,112,1,112,1,112,1,112,
+ 1,113,1,113,1,113,1,113,1,113,1,113,1,113,1,114,1,114,1,114,1,114,
+ 1,114,1,114,1,114,1,114,1,114,1,115,1,115,1,115,1,115,1,115,1,116,
+ 1,116,1,116,1,116,1,116,1,116,1,116,1,116,1,116,1,117,1,117,1,117,
+ 1,117,1,118,1,118,1,118,1,118,1,118,1,118,1,118,1,118,1,118,1,119,
+ 1,119,1,119,1,119,1,119,1,119,1,119,1,119,1,119,1,119,1,120,1,120,
+ 1,120,1,120,1,120,1,120,1,121,1,121,1,121,1,121,1,121,1,121,1,121,
+ 1,121,1,122,1,122,1,122,1,122,1,122,1,122,1,123,1,123,1,123,1,123,
+ 1,123,1,123,1,123,1,124,1,124,1,124,1,124,1,124,1,125,1,125,1,125,
+ 1,125,1,125,1,126,1,126,1,126,1,126,1,126,1,126,1,127,1,127,1,127,
+ 1,127,1,127,1,127,1,128,1,128,1,128,1,128,1,128,1,128,1,128,1,129,
+ 1,129,1,129,1,129,1,129,1,130,1,130,1,130,1,130,1,130,1,130,1,130,
+ 1,131,1,131,1,131,1,131,1,131,1,131,1,131,1,131,1,131,1,131,3,131,
+ 1360,8,131,1,132,1,132,1,132,1,132,1,132,1,132,1,132,1,132,1,132,
1,132,1,132,1,132,1,132,1,132,1,132,1,132,1,132,1,132,1,132,1,132,
1,132,1,132,1,132,1,132,1,132,1,132,1,132,1,132,1,132,1,132,1,132,
- 3,132,1382,8,132,1,133,1,133,1,133,3,133,1387,8,133,1,133,1,133,
- 1,133,1,133,5,133,1393,8,133,10,133,12,133,1396,9,133,1,134,1,134,
- 1,134,1,134,1,134,1,134,1,134,1,134,1,134,5,134,1407,8,134,10,134,
- 12,134,1410,9,134,1,134,1,134,1,134,1,134,1,134,1,134,1,134,1,134,
- 1,134,1,134,1,134,5,134,1423,8,134,10,134,12,134,1426,9,134,1,134,
- 1,134,3,134,1430,8,134,1,135,1,135,1,135,5,135,1435,8,135,10,135,
- 12,135,1438,9,135,1,135,1,135,3,135,1442,8,135,1,135,1,135,3,135,
- 1446,8,135,1,135,4,135,1449,8,135,11,135,12,135,1450,1,135,1,135,
- 1,135,3,135,1456,8,135,1,135,1,135,3,135,1460,8,135,1,135,4,135,
- 1463,8,135,11,135,12,135,1464,1,135,1,135,1,135,5,135,1470,8,135,
- 10,135,12,135,1473,9,135,1,135,1,135,1,135,3,135,1478,8,135,1,135,
- 4,135,1481,8,135,11,135,12,135,1482,1,135,1,135,1,135,1,135,1,135,
- 3,135,1490,8,135,1,135,4,135,1493,8,135,11,135,12,135,1494,1,135,
- 1,135,1,135,1,135,3,135,1501,8,135,1,135,4,135,1504,8,135,11,135,
- 12,135,1505,3,135,1508,8,135,1,136,1,136,1,136,4,136,1513,8,136,
- 11,136,12,136,1514,1,137,1,137,4,137,1519,8,137,11,137,12,137,1520,
- 1,138,4,138,1524,8,138,11,138,12,138,1525,1,139,1,139,1,139,4,139,
- 1531,8,139,11,139,12,139,1532,1,140,1,140,1,140,4,140,1538,8,140,
- 11,140,12,140,1539,1,141,1,141,1,141,4,141,1545,8,141,11,141,12,
- 141,1546,1,142,1,142,1,142,1,142,1,142,1,142,1,142,1,142,1,142,5,
- 142,1558,8,142,10,142,12,142,1561,9,142,1,142,1,142,1,143,1,143,
- 1,144,1,144,1,145,1,145,1,146,1,146,1,147,1,147,1,148,1,148,1,149,
- 1,149,1,150,1,150,1,151,1,151,1,152,1,152,1,153,1,153,1,154,1,154,
- 1,155,1,155,1,156,1,156,1,157,1,157,1,158,1,158,1,159,1,159,1,160,
- 1,160,1,161,1,161,1,162,1,162,1,163,1,163,1,164,1,164,1,165,1,165,
- 1,166,1,166,1,167,1,167,1,168,1,168,1,169,1,169,1,170,1,170,1,171,
- 1,171,1,172,1,172,1,173,1,173,1,174,1,174,1,174,1,175,1,175,1,176,
- 1,176,1,177,1,177,1,178,1,178,1,178,1,179,1,179,1,179,1,180,1,180,
- 1,181,1,181,1,182,1,182,1,182,1,183,1,183,1,184,1,184,1,185,1,185,
- 1,186,1,186,1,186,1,187,1,187,1,188,1,188,1,188,1,189,1,189,1,190,
- 1,190,1,191,1,191,1,191,1,192,1,192,1,192,1,192,1,193,1,193,1,193,
- 1,193,1,194,1,194,1,195,1,195,1,196,1,196,1,196,1,197,1,197,1,197,
- 1,197,1,197,1,197,1,198,1,198,1,198,1,198,1,198,1,198,1,199,1,199,
- 1,200,1,200,1,200,1,201,1,201,1,201,1,201,3,201,1706,8,201,1,202,
- 1,202,1,202,1,202,1,203,1,203,1,203,1,204,1,204,1,204,1,205,1,205,
- 1,205,1,206,1,206,1,207,1,207,1,208,1,208,1,209,1,209,1,210,1,210,
- 1,210,1,210,1,210,1,211,1,211,1,211,1,211,1,211,1,212,1,212,1,213,
- 1,213,1,214,1,214,1,214,1,215,1,215,1,215,1,215,1,216,1,216,1,217,
- 1,217,1,218,1,218,1,219,1,219,1,220,1,220,1,220,1,221,1,221,1,222,
- 1,222,1,222,1,222,5,222,1767,8,222,10,222,12,222,1770,9,222,1,222,
- 1,222,1,222,1,222,1,222,1,223,1,223,1,223,1,223,3,223,1781,8,223,
- 1,223,5,223,1784,8,223,10,223,12,223,1787,9,223,1,223,3,223,1790,
- 8,223,1,223,1,223,1,224,1,224,1,224,1,224,1,225,1,225,1,226,1,226,
- 1,226,1,226,1,226,1,226,1,226,1,226,1,226,1,226,1,226,4,226,1811,
- 8,226,11,226,12,226,1812,1,227,1,227,1,227,1,227,1,228,1,228,1,228,
- 1,228,1,228,1,229,1,229,1,229,1,229,1,229,4,229,1829,8,229,11,229,
- 12,229,1830,1,230,1,230,1,230,1,230,1,231,1,231,1,231,1,231,1,231,
- 1,231,1,232,1,232,1,232,1,232,1,232,1,232,1,233,1,233,5,233,1851,
- 8,233,10,233,12,233,1854,9,233,1,233,1,233,1,234,1,234,1,234,1,234,
- 1,235,1,235,1,235,1,235,1,236,4,236,1867,8,236,11,236,12,236,1868,
- 1,236,1,236,1,237,1,237,1,237,1,237,1,237,1,238,1,238,1,238,1,238,
- 1,238,1,239,1,239,5,239,1885,8,239,10,239,12,239,1888,9,239,1,239,
- 1,239,1,240,4,240,1893,8,240,11,240,12,240,1894,1,240,1,240,1,241,
- 4,241,1900,8,241,11,241,12,241,1901,1,242,1,242,1,242,1,242,1,242,
- 1,243,1,243,1,243,1,243,1,243,1,243,1,243,1,244,1,244,1,244,1,244,
- 1,244,1,245,4,245,1922,8,245,11,245,12,245,1923,1,245,1,245,1,1768,
- 0,246,6,1,8,2,10,3,12,4,14,5,16,6,18,7,20,8,22,9,24,10,26,11,28,
- 12,30,13,32,14,34,15,36,16,38,17,40,18,42,19,44,20,46,21,48,22,50,
- 23,52,24,54,25,56,26,58,27,60,28,62,29,64,30,66,31,68,32,70,33,72,
- 34,74,35,76,36,78,37,80,38,82,39,84,40,86,41,88,42,90,43,92,44,94,
- 45,96,46,98,47,100,48,102,49,104,50,106,51,108,52,110,53,112,54,
- 114,55,116,56,118,57,120,58,122,59,124,60,126,61,128,62,130,63,132,
- 64,134,65,136,66,138,67,140,68,142,69,144,70,146,71,148,72,150,73,
- 152,74,154,75,156,76,158,77,160,78,162,79,164,80,166,81,168,82,170,
- 83,172,84,174,85,176,86,178,87,180,88,182,89,184,90,186,91,188,92,
- 190,93,192,94,194,95,196,96,198,97,200,98,202,99,204,100,206,101,
- 208,102,210,103,212,104,214,105,216,106,218,107,220,108,222,109,
- 224,110,226,111,228,112,230,113,232,114,234,115,236,116,238,117,
- 240,118,242,119,244,120,246,121,248,122,250,123,252,124,254,125,
- 256,126,258,127,260,128,262,129,264,130,266,131,268,132,270,133,
- 272,134,274,135,276,136,278,137,280,138,282,139,284,140,286,141,
- 288,142,290,143,292,0,294,0,296,0,298,0,300,0,302,0,304,0,306,0,
- 308,0,310,0,312,0,314,0,316,0,318,0,320,0,322,0,324,0,326,0,328,
- 0,330,0,332,0,334,0,336,0,338,0,340,0,342,0,344,0,346,0,348,0,350,
- 0,352,0,354,144,356,145,358,146,360,147,362,148,364,149,366,150,
- 368,151,370,152,372,153,374,154,376,155,378,156,380,157,382,158,
- 384,159,386,160,388,161,390,162,392,163,394,164,396,165,398,166,
- 400,0,402,0,404,167,406,168,408,169,410,170,412,171,414,172,416,
- 173,418,174,420,175,422,176,424,177,426,178,428,179,430,180,432,
- 181,434,182,436,183,438,184,440,185,442,186,444,187,446,188,448,
- 189,450,190,452,191,454,192,456,193,458,194,460,195,462,0,464,196,
- 466,197,468,0,470,0,472,0,474,0,476,0,478,198,480,0,482,0,484,0,
- 486,199,488,200,490,0,492,0,494,0,496,201,6,0,1,2,3,4,5,43,2,0,92,
- 92,96,96,2,0,34,34,92,92,2,0,79,79,111,111,2,0,66,66,98,98,2,0,39,
- 39,92,92,2,0,65,65,97,97,2,0,67,67,99,99,2,0,68,68,100,100,2,0,69,
- 69,101,101,2,0,70,70,102,102,2,0,71,71,103,103,2,0,72,72,104,104,
- 2,0,73,73,105,105,2,0,74,74,106,106,2,0,75,75,107,107,2,0,76,76,
- 108,108,2,0,77,77,109,109,2,0,78,78,110,110,2,0,80,80,112,112,2,
- 0,81,81,113,113,2,0,82,82,114,114,2,0,83,83,115,115,2,0,84,84,116,
- 116,2,0,85,85,117,117,2,0,86,86,118,118,2,0,87,87,119,119,2,0,88,
- 88,120,120,2,0,89,89,121,121,2,0,90,90,122,122,2,0,65,90,97,122,
- 1,0,48,49,1,0,48,55,1,0,48,57,3,0,48,57,65,70,97,102,2,0,10,10,13,
- 13,2,1,10,10,13,13,11,0,9,13,32,32,133,133,160,160,5760,5760,8192,
- 8202,8232,8233,8239,8239,8287,8287,12288,12288,65279,65279,3,0,39,
- 39,92,92,123,123,1,0,123,123,3,0,65,90,95,95,97,122,5,0,45,45,48,
- 57,65,90,95,95,97,122,3,0,9,10,13,13,32,32,2,0,60,60,123,123,1968,
- 0,6,1,0,0,0,0,8,1,0,0,0,0,10,1,0,0,0,0,12,1,0,0,0,0,14,1,0,0,0,0,
- 16,1,0,0,0,0,18,1,0,0,0,0,20,1,0,0,0,0,22,1,0,0,0,0,24,1,0,0,0,0,
- 26,1,0,0,0,0,28,1,0,0,0,0,30,1,0,0,0,0,32,1,0,0,0,0,34,1,0,0,0,0,
- 36,1,0,0,0,0,38,1,0,0,0,0,40,1,0,0,0,0,42,1,0,0,0,0,44,1,0,0,0,0,
- 46,1,0,0,0,0,48,1,0,0,0,0,50,1,0,0,0,0,52,1,0,0,0,0,54,1,0,0,0,0,
- 56,1,0,0,0,0,58,1,0,0,0,0,60,1,0,0,0,0,62,1,0,0,0,0,64,1,0,0,0,0,
- 66,1,0,0,0,0,68,1,0,0,0,0,70,1,0,0,0,0,72,1,0,0,0,0,74,1,0,0,0,0,
- 76,1,0,0,0,0,78,1,0,0,0,0,80,1,0,0,0,0,82,1,0,0,0,0,84,1,0,0,0,0,
- 86,1,0,0,0,0,88,1,0,0,0,0,90,1,0,0,0,0,92,1,0,0,0,0,94,1,0,0,0,0,
- 96,1,0,0,0,0,98,1,0,0,0,0,100,1,0,0,0,0,102,1,0,0,0,0,104,1,0,0,
- 0,0,106,1,0,0,0,0,108,1,0,0,0,0,110,1,0,0,0,0,112,1,0,0,0,0,114,
- 1,0,0,0,0,116,1,0,0,0,0,118,1,0,0,0,0,120,1,0,0,0,0,122,1,0,0,0,
- 0,124,1,0,0,0,0,126,1,0,0,0,0,128,1,0,0,0,0,130,1,0,0,0,0,132,1,
- 0,0,0,0,134,1,0,0,0,0,136,1,0,0,0,0,138,1,0,0,0,0,140,1,0,0,0,0,
- 142,1,0,0,0,0,144,1,0,0,0,0,146,1,0,0,0,0,148,1,0,0,0,0,150,1,0,
- 0,0,0,152,1,0,0,0,0,154,1,0,0,0,0,156,1,0,0,0,0,158,1,0,0,0,0,160,
- 1,0,0,0,0,162,1,0,0,0,0,164,1,0,0,0,0,166,1,0,0,0,0,168,1,0,0,0,
- 0,170,1,0,0,0,0,172,1,0,0,0,0,174,1,0,0,0,0,176,1,0,0,0,0,178,1,
- 0,0,0,0,180,1,0,0,0,0,182,1,0,0,0,0,184,1,0,0,0,0,186,1,0,0,0,0,
- 188,1,0,0,0,0,190,1,0,0,0,0,192,1,0,0,0,0,194,1,0,0,0,0,196,1,0,
- 0,0,0,198,1,0,0,0,0,200,1,0,0,0,0,202,1,0,0,0,0,204,1,0,0,0,0,206,
- 1,0,0,0,0,208,1,0,0,0,0,210,1,0,0,0,0,212,1,0,0,0,0,214,1,0,0,0,
- 0,216,1,0,0,0,0,218,1,0,0,0,0,220,1,0,0,0,0,222,1,0,0,0,0,224,1,
- 0,0,0,0,226,1,0,0,0,0,228,1,0,0,0,0,230,1,0,0,0,0,232,1,0,0,0,0,
- 234,1,0,0,0,0,236,1,0,0,0,0,238,1,0,0,0,0,240,1,0,0,0,0,242,1,0,
- 0,0,0,244,1,0,0,0,0,246,1,0,0,0,0,248,1,0,0,0,0,250,1,0,0,0,0,252,
- 1,0,0,0,0,254,1,0,0,0,0,256,1,0,0,0,0,258,1,0,0,0,0,260,1,0,0,0,
- 0,262,1,0,0,0,0,264,1,0,0,0,0,266,1,0,0,0,0,268,1,0,0,0,0,270,1,
- 0,0,0,0,272,1,0,0,0,0,274,1,0,0,0,0,276,1,0,0,0,0,278,1,0,0,0,0,
- 280,1,0,0,0,0,282,1,0,0,0,0,284,1,0,0,0,0,286,1,0,0,0,0,288,1,0,
- 0,0,0,290,1,0,0,0,0,354,1,0,0,0,0,356,1,0,0,0,0,358,1,0,0,0,0,360,
- 1,0,0,0,0,362,1,0,0,0,0,364,1,0,0,0,0,366,1,0,0,0,0,368,1,0,0,0,
- 0,370,1,0,0,0,0,372,1,0,0,0,0,374,1,0,0,0,0,376,1,0,0,0,0,378,1,
- 0,0,0,0,380,1,0,0,0,0,382,1,0,0,0,0,384,1,0,0,0,0,386,1,0,0,0,0,
- 388,1,0,0,0,0,390,1,0,0,0,0,392,1,0,0,0,0,394,1,0,0,0,0,396,1,0,
- 0,0,0,398,1,0,0,0,0,400,1,0,0,0,0,402,1,0,0,0,0,404,1,0,0,0,0,406,
- 1,0,0,0,0,408,1,0,0,0,0,410,1,0,0,0,0,412,1,0,0,0,0,414,1,0,0,0,
- 0,416,1,0,0,0,0,418,1,0,0,0,0,420,1,0,0,0,0,422,1,0,0,0,0,424,1,
- 0,0,0,0,426,1,0,0,0,0,428,1,0,0,0,0,430,1,0,0,0,0,432,1,0,0,0,0,
- 434,1,0,0,0,0,436,1,0,0,0,0,438,1,0,0,0,0,440,1,0,0,0,0,442,1,0,
- 0,0,0,444,1,0,0,0,0,446,1,0,0,0,0,448,1,0,0,0,0,450,1,0,0,0,0,452,
- 1,0,0,0,0,454,1,0,0,0,0,456,1,0,0,0,1,458,1,0,0,0,1,460,1,0,0,0,
- 1,462,1,0,0,0,2,464,1,0,0,0,2,466,1,0,0,0,3,468,1,0,0,0,3,470,1,
- 0,0,0,3,472,1,0,0,0,3,474,1,0,0,0,3,476,1,0,0,0,3,478,1,0,0,0,3,
- 480,1,0,0,0,4,482,1,0,0,0,4,484,1,0,0,0,4,486,1,0,0,0,5,488,1,0,
- 0,0,5,490,1,0,0,0,5,492,1,0,0,0,5,494,1,0,0,0,5,496,1,0,0,0,6,498,
- 1,0,0,0,8,502,1,0,0,0,10,506,1,0,0,0,12,511,1,0,0,0,14,515,1,0,0,
- 0,16,521,1,0,0,0,18,538,1,0,0,0,20,540,1,0,0,0,22,545,1,0,0,0,24,
- 553,1,0,0,0,26,558,1,0,0,0,28,561,1,0,0,0,30,566,1,0,0,0,32,571,
- 1,0,0,0,34,577,1,0,0,0,36,584,1,0,0,0,38,592,1,0,0,0,40,600,1,0,
- 0,0,42,606,1,0,0,0,44,611,1,0,0,0,46,619,1,0,0,0,48,624,1,0,0,0,
- 50,628,1,0,0,0,52,633,1,0,0,0,54,644,1,0,0,0,56,653,1,0,0,0,58,658,
- 1,0,0,0,60,662,1,0,0,0,62,669,1,0,0,0,64,677,1,0,0,0,66,685,1,0,
- 0,0,68,691,1,0,0,0,70,696,1,0,0,0,72,703,1,0,0,0,74,711,1,0,0,0,
- 76,717,1,0,0,0,78,720,1,0,0,0,80,730,1,0,0,0,82,734,1,0,0,0,84,739,
- 1,0,0,0,86,744,1,0,0,0,88,748,1,0,0,0,90,754,1,0,0,0,92,763,1,0,
- 0,0,94,770,1,0,0,0,96,775,1,0,0,0,98,778,1,0,0,0,100,781,1,0,0,0,
- 102,787,1,0,0,0,104,794,1,0,0,0,106,802,1,0,0,0,108,818,1,0,0,0,
- 110,820,1,0,0,0,112,826,1,0,0,0,114,836,1,0,0,0,116,848,1,0,0,0,
- 118,857,1,0,0,0,120,860,1,0,0,0,122,865,1,0,0,0,124,869,1,0,0,0,
- 126,876,1,0,0,0,128,881,1,0,0,0,130,889,1,0,0,0,132,894,1,0,0,0,
- 134,898,1,0,0,0,136,903,1,0,0,0,138,909,1,0,0,0,140,922,1,0,0,0,
- 142,929,1,0,0,0,144,935,1,0,0,0,146,940,1,0,0,0,148,948,1,0,0,0,
- 150,952,1,0,0,0,152,956,1,0,0,0,154,961,1,0,0,0,156,967,1,0,0,0,
- 158,974,1,0,0,0,160,977,1,0,0,0,162,980,1,0,0,0,164,986,1,0,0,0,
- 166,992,1,0,0,0,168,997,1,0,0,0,170,1007,1,0,0,0,172,1013,1,0,0,
- 0,174,1024,1,0,0,0,176,1034,1,0,0,0,178,1043,1,0,0,0,180,1051,1,
- 0,0,0,182,1059,1,0,0,0,184,1065,1,0,0,0,186,1075,1,0,0,0,188,1083,
- 1,0,0,0,190,1090,1,0,0,0,192,1096,1,0,0,0,194,1103,1,0,0,0,196,1107,
- 1,0,0,0,198,1112,1,0,0,0,200,1119,1,0,0,0,202,1126,1,0,0,0,204,1133,
- 1,0,0,0,206,1138,1,0,0,0,208,1143,1,0,0,0,210,1152,1,0,0,0,212,1157,
- 1,0,0,0,214,1167,1,0,0,0,216,1172,1,0,0,0,218,1178,1,0,0,0,220,1183,
- 1,0,0,0,222,1193,1,0,0,0,224,1198,1,0,0,0,226,1204,1,0,0,0,228,1209,
- 1,0,0,0,230,1212,1,0,0,0,232,1216,1,0,0,0,234,1223,1,0,0,0,236,1232,
- 1,0,0,0,238,1237,1,0,0,0,240,1246,1,0,0,0,242,1250,1,0,0,0,244,1259,
- 1,0,0,0,246,1269,1,0,0,0,248,1275,1,0,0,0,250,1283,1,0,0,0,252,1289,
- 1,0,0,0,254,1296,1,0,0,0,256,1301,1,0,0,0,258,1306,1,0,0,0,260,1312,
- 1,0,0,0,262,1318,1,0,0,0,264,1325,1,0,0,0,266,1330,1,0,0,0,268,1347,
- 1,0,0,0,270,1381,1,0,0,0,272,1386,1,0,0,0,274,1429,1,0,0,0,276,1507,
- 1,0,0,0,278,1509,1,0,0,0,280,1516,1,0,0,0,282,1523,1,0,0,0,284,1527,
- 1,0,0,0,286,1534,1,0,0,0,288,1541,1,0,0,0,290,1548,1,0,0,0,292,1564,
- 1,0,0,0,294,1566,1,0,0,0,296,1568,1,0,0,0,298,1570,1,0,0,0,300,1572,
- 1,0,0,0,302,1574,1,0,0,0,304,1576,1,0,0,0,306,1578,1,0,0,0,308,1580,
- 1,0,0,0,310,1582,1,0,0,0,312,1584,1,0,0,0,314,1586,1,0,0,0,316,1588,
- 1,0,0,0,318,1590,1,0,0,0,320,1592,1,0,0,0,322,1594,1,0,0,0,324,1596,
- 1,0,0,0,326,1598,1,0,0,0,328,1600,1,0,0,0,330,1602,1,0,0,0,332,1604,
- 1,0,0,0,334,1606,1,0,0,0,336,1608,1,0,0,0,338,1610,1,0,0,0,340,1612,
- 1,0,0,0,342,1614,1,0,0,0,344,1616,1,0,0,0,346,1618,1,0,0,0,348,1620,
- 1,0,0,0,350,1622,1,0,0,0,352,1624,1,0,0,0,354,1626,1,0,0,0,356,1629,
- 1,0,0,0,358,1631,1,0,0,0,360,1633,1,0,0,0,362,1635,1,0,0,0,364,1638,
- 1,0,0,0,366,1641,1,0,0,0,368,1643,1,0,0,0,370,1645,1,0,0,0,372,1648,
- 1,0,0,0,374,1650,1,0,0,0,376,1652,1,0,0,0,378,1654,1,0,0,0,380,1657,
- 1,0,0,0,382,1659,1,0,0,0,384,1662,1,0,0,0,386,1664,1,0,0,0,388,1666,
- 1,0,0,0,390,1669,1,0,0,0,392,1673,1,0,0,0,394,1677,1,0,0,0,396,1679,
- 1,0,0,0,398,1681,1,0,0,0,400,1684,1,0,0,0,402,1690,1,0,0,0,404,1696,
- 1,0,0,0,406,1698,1,0,0,0,408,1705,1,0,0,0,410,1707,1,0,0,0,412,1711,
- 1,0,0,0,414,1714,1,0,0,0,416,1717,1,0,0,0,418,1720,1,0,0,0,420,1722,
- 1,0,0,0,422,1724,1,0,0,0,424,1726,1,0,0,0,426,1728,1,0,0,0,428,1733,
- 1,0,0,0,430,1738,1,0,0,0,432,1740,1,0,0,0,434,1742,1,0,0,0,436,1745,
- 1,0,0,0,438,1749,1,0,0,0,440,1751,1,0,0,0,442,1753,1,0,0,0,444,1755,
- 1,0,0,0,446,1757,1,0,0,0,448,1760,1,0,0,0,450,1762,1,0,0,0,452,1780,
- 1,0,0,0,454,1793,1,0,0,0,456,1797,1,0,0,0,458,1810,1,0,0,0,460,1814,
- 1,0,0,0,462,1818,1,0,0,0,464,1828,1,0,0,0,466,1832,1,0,0,0,468,1836,
- 1,0,0,0,470,1842,1,0,0,0,472,1848,1,0,0,0,474,1857,1,0,0,0,476,1861,
- 1,0,0,0,478,1866,1,0,0,0,480,1872,1,0,0,0,482,1877,1,0,0,0,484,1882,
- 1,0,0,0,486,1892,1,0,0,0,488,1899,1,0,0,0,490,1903,1,0,0,0,492,1908,
- 1,0,0,0,494,1915,1,0,0,0,496,1921,1,0,0,0,498,499,3,292,143,0,499,
- 500,3,314,154,0,500,501,3,314,154,0,501,7,1,0,0,0,502,503,3,292,
- 143,0,503,504,3,318,156,0,504,505,3,298,146,0,505,9,1,0,0,0,506,
- 507,3,292,143,0,507,508,3,318,156,0,508,509,3,330,162,0,509,510,
- 3,308,151,0,510,11,1,0,0,0,511,512,3,292,143,0,512,513,3,318,156,
- 0,513,514,3,340,167,0,514,13,1,0,0,0,515,516,3,292,143,0,516,517,
- 3,326,160,0,517,518,3,326,160,0,518,519,3,292,143,0,519,520,3,340,
- 167,0,520,15,1,0,0,0,521,522,3,292,143,0,522,523,3,328,161,0,523,
- 17,1,0,0,0,524,525,3,292,143,0,525,526,3,328,161,0,526,527,3,296,
- 145,0,527,539,1,0,0,0,528,529,3,292,143,0,529,530,3,328,161,0,530,
- 531,3,296,145,0,531,532,3,300,147,0,532,533,3,318,156,0,533,534,
- 3,298,146,0,534,535,3,308,151,0,535,536,3,318,156,0,536,537,3,304,
- 149,0,537,539,1,0,0,0,538,524,1,0,0,0,538,528,1,0,0,0,539,19,1,0,
- 0,0,540,541,3,292,143,0,541,542,3,328,161,0,542,543,3,320,157,0,
- 543,544,3,302,148,0,544,21,1,0,0,0,545,546,3,294,144,0,546,547,3,
- 300,147,0,547,548,3,330,162,0,548,549,3,336,165,0,549,550,3,300,
- 147,0,550,551,3,300,147,0,551,552,3,318,156,0,552,23,1,0,0,0,553,
- 554,3,294,144,0,554,555,3,320,157,0,555,556,3,330,162,0,556,557,
- 3,306,150,0,557,25,1,0,0,0,558,559,3,294,144,0,559,560,3,340,167,
- 0,560,27,1,0,0,0,561,562,3,296,145,0,562,563,3,292,143,0,563,564,
- 3,328,161,0,564,565,3,300,147,0,565,29,1,0,0,0,566,567,3,296,145,
- 0,567,568,3,292,143,0,568,569,3,328,161,0,569,570,3,330,162,0,570,
- 31,1,0,0,0,571,572,3,296,145,0,572,573,3,292,143,0,573,574,3,330,
- 162,0,574,575,3,296,145,0,575,576,3,306,150,0,576,33,1,0,0,0,577,
- 578,3,296,145,0,578,579,3,320,157,0,579,580,3,306,150,0,580,581,
- 3,320,157,0,581,582,3,326,160,0,582,583,3,330,162,0,583,35,1,0,0,
- 0,584,585,3,296,145,0,585,586,3,320,157,0,586,587,3,314,154,0,587,
- 588,3,314,154,0,588,589,3,292,143,0,589,590,3,330,162,0,590,591,
- 3,300,147,0,591,37,1,0,0,0,592,593,3,296,145,0,593,594,3,320,157,
- 0,594,595,3,314,154,0,595,596,3,332,163,0,596,597,3,316,155,0,597,
- 598,3,318,156,0,598,599,3,328,161,0,599,39,1,0,0,0,600,601,3,296,
- 145,0,601,602,3,326,160,0,602,603,3,320,157,0,603,604,3,328,161,
- 0,604,605,3,328,161,0,605,41,1,0,0,0,606,607,3,296,145,0,607,608,
- 3,332,163,0,608,609,3,294,144,0,609,610,3,300,147,0,610,43,1,0,0,
- 0,611,612,3,296,145,0,612,613,3,332,163,0,613,614,3,326,160,0,614,
- 615,3,326,160,0,615,616,3,300,147,0,616,617,3,318,156,0,617,618,
- 3,330,162,0,618,45,1,0,0,0,619,620,3,298,146,0,620,621,3,292,143,
- 0,621,622,3,330,162,0,622,623,3,300,147,0,623,47,1,0,0,0,624,625,
- 3,298,146,0,625,626,3,292,143,0,626,627,3,340,167,0,627,49,1,0,0,
- 0,628,629,3,298,146,0,629,630,3,300,147,0,630,631,3,328,161,0,631,
- 632,3,296,145,0,632,51,1,0,0,0,633,634,3,298,146,0,634,635,3,300,
- 147,0,635,636,3,328,161,0,636,637,3,296,145,0,637,638,3,300,147,
- 0,638,639,3,318,156,0,639,640,3,298,146,0,640,641,3,308,151,0,641,
- 642,3,318,156,0,642,643,3,304,149,0,643,53,1,0,0,0,644,645,3,298,
- 146,0,645,646,3,308,151,0,646,647,3,328,161,0,647,648,3,330,162,
- 0,648,649,3,308,151,0,649,650,3,318,156,0,650,651,3,296,145,0,651,
- 652,3,330,162,0,652,55,1,0,0,0,653,654,3,300,147,0,654,655,3,314,
- 154,0,655,656,3,328,161,0,656,657,3,300,147,0,657,57,1,0,0,0,658,
- 659,3,300,147,0,659,660,3,318,156,0,660,661,3,298,146,0,661,59,1,
- 0,0,0,662,663,3,300,147,0,663,664,3,338,166,0,664,665,3,296,145,
- 0,665,666,3,300,147,0,666,667,3,322,158,0,667,668,3,330,162,0,668,
- 61,1,0,0,0,669,670,3,300,147,0,670,671,3,338,166,0,671,672,3,296,
- 145,0,672,673,3,314,154,0,673,674,3,332,163,0,674,675,3,298,146,
- 0,675,676,3,300,147,0,676,63,1,0,0,0,677,678,3,300,147,0,678,679,
- 3,338,166,0,679,680,3,330,162,0,680,681,3,326,160,0,681,682,3,292,
- 143,0,682,683,3,296,145,0,683,684,3,330,162,0,684,65,1,0,0,0,685,
- 686,3,302,148,0,686,687,3,308,151,0,687,688,3,318,156,0,688,689,
- 3,292,143,0,689,690,3,314,154,0,690,67,1,0,0,0,691,692,3,302,148,
- 0,692,693,3,308,151,0,693,694,3,314,154,0,694,695,3,314,154,0,695,
- 69,1,0,0,0,696,697,3,302,148,0,697,698,3,308,151,0,698,699,3,314,
- 154,0,699,700,3,330,162,0,700,701,3,300,147,0,701,702,3,326,160,
- 0,702,71,1,0,0,0,703,704,3,302,148,0,704,705,3,308,151,0,705,706,
- 3,318,156,0,706,707,3,292,143,0,707,708,3,314,154,0,708,709,3,314,
- 154,0,709,710,3,340,167,0,710,73,1,0,0,0,711,712,3,302,148,0,712,
- 713,3,308,151,0,713,714,3,326,160,0,714,715,3,328,161,0,715,716,
- 3,330,162,0,716,75,1,0,0,0,717,718,3,302,148,0,718,719,3,318,156,
- 0,719,77,1,0,0,0,720,721,3,302,148,0,721,722,3,320,157,0,722,723,
- 3,314,154,0,723,724,3,314,154,0,724,725,3,320,157,0,725,726,3,336,
- 165,0,726,727,3,308,151,0,727,728,3,318,156,0,728,729,3,304,149,
- 0,729,79,1,0,0,0,730,731,3,302,148,0,731,732,3,320,157,0,732,733,
- 3,326,160,0,733,81,1,0,0,0,734,735,3,302,148,0,735,736,3,326,160,
- 0,736,737,3,320,157,0,737,738,3,316,155,0,738,83,1,0,0,0,739,740,
- 3,302,148,0,740,741,3,332,163,0,741,742,3,314,154,0,742,743,3,314,
- 154,0,743,85,1,0,0,0,744,745,3,302,148,0,745,746,3,332,163,0,746,
- 747,3,318,156,0,747,87,1,0,0,0,748,749,3,304,149,0,749,750,3,326,
- 160,0,750,751,3,320,157,0,751,752,3,332,163,0,752,753,3,322,158,
- 0,753,89,1,0,0,0,754,755,3,304,149,0,755,756,3,326,160,0,756,757,
- 3,320,157,0,757,758,3,332,163,0,758,759,3,322,158,0,759,760,3,308,
- 151,0,760,761,3,318,156,0,761,762,3,304,149,0,762,91,1,0,0,0,763,
- 764,3,306,150,0,764,765,3,292,143,0,765,766,3,334,164,0,766,767,
- 3,308,151,0,767,768,3,318,156,0,768,769,3,304,149,0,769,93,1,0,0,
- 0,770,771,3,306,150,0,771,772,3,320,157,0,772,773,3,332,163,0,773,
- 774,3,326,160,0,774,95,1,0,0,0,775,776,3,308,151,0,776,777,3,298,
- 146,0,777,97,1,0,0,0,778,779,3,308,151,0,779,780,3,302,148,0,780,
- 99,1,0,0,0,781,782,3,308,151,0,782,783,3,314,154,0,783,784,3,308,
- 151,0,784,785,3,312,153,0,785,786,3,300,147,0,786,101,1,0,0,0,787,
- 788,3,308,151,0,788,789,3,304,149,0,789,790,3,318,156,0,790,791,
- 3,320,157,0,791,792,3,326,160,0,792,793,3,300,147,0,793,103,1,0,
- 0,0,794,795,3,308,151,0,795,796,3,318,156,0,796,797,3,296,145,0,
- 797,798,3,314,154,0,798,799,3,332,163,0,799,800,3,298,146,0,800,
- 801,3,300,147,0,801,105,1,0,0,0,802,803,3,308,151,0,803,804,3,318,
- 156,0,804,107,1,0,0,0,805,806,3,308,151,0,806,807,3,318,156,0,807,
- 808,3,302,148,0,808,819,1,0,0,0,809,810,3,308,151,0,810,811,3,318,
- 156,0,811,812,3,302,148,0,812,813,3,308,151,0,813,814,3,318,156,
- 0,814,815,3,308,151,0,815,816,3,330,162,0,816,817,3,340,167,0,817,
- 819,1,0,0,0,818,805,1,0,0,0,818,809,1,0,0,0,819,109,1,0,0,0,820,
- 821,3,308,151,0,821,822,3,318,156,0,822,823,3,318,156,0,823,824,
- 3,300,147,0,824,825,3,326,160,0,825,111,1,0,0,0,826,827,3,308,151,
- 0,827,828,3,318,156,0,828,829,3,330,162,0,829,830,3,300,147,0,830,
- 831,3,326,160,0,831,832,3,328,161,0,832,833,3,300,147,0,833,834,
- 3,296,145,0,834,835,3,330,162,0,835,113,1,0,0,0,836,837,3,308,151,
- 0,837,838,3,318,156,0,838,839,3,330,162,0,839,840,3,300,147,0,840,
- 841,3,326,160,0,841,842,3,322,158,0,842,843,3,320,157,0,843,844,
- 3,314,154,0,844,845,3,292,143,0,845,846,3,330,162,0,846,847,3,300,
- 147,0,847,115,1,0,0,0,848,849,3,308,151,0,849,850,3,318,156,0,850,
- 851,3,330,162,0,851,852,3,300,147,0,852,853,3,326,160,0,853,854,
- 3,334,164,0,854,855,3,292,143,0,855,856,3,314,154,0,856,117,1,0,
- 0,0,857,858,3,308,151,0,858,859,3,328,161,0,859,119,1,0,0,0,860,
- 861,3,310,152,0,861,862,3,320,157,0,862,863,3,308,151,0,863,864,
- 3,318,156,0,864,121,1,0,0,0,865,866,3,312,153,0,866,867,3,300,147,
- 0,867,868,3,340,167,0,868,123,1,0,0,0,869,870,3,314,154,0,870,871,
- 3,292,143,0,871,872,3,316,155,0,872,873,3,294,144,0,873,874,3,298,
- 146,0,874,875,3,292,143,0,875,125,1,0,0,0,876,877,3,314,154,0,877,
- 878,3,292,143,0,878,879,3,328,161,0,879,880,3,330,162,0,880,127,
- 1,0,0,0,881,882,3,314,154,0,882,883,3,300,147,0,883,884,3,292,143,
- 0,884,885,3,298,146,0,885,886,3,308,151,0,886,887,3,318,156,0,887,
- 888,3,304,149,0,888,129,1,0,0,0,889,890,3,314,154,0,890,891,3,300,
- 147,0,891,892,3,302,148,0,892,893,3,330,162,0,893,131,1,0,0,0,894,
- 895,3,314,154,0,895,896,3,300,147,0,896,897,3,330,162,0,897,133,
- 1,0,0,0,898,899,3,314,154,0,899,900,3,308,151,0,900,901,3,312,153,
- 0,901,902,3,300,147,0,902,135,1,0,0,0,903,904,3,314,154,0,904,905,
- 3,308,151,0,905,906,3,316,155,0,906,907,3,308,151,0,907,908,3,330,
- 162,0,908,137,1,0,0,0,909,910,3,316,155,0,910,911,3,292,143,0,911,
- 912,3,330,162,0,912,913,3,300,147,0,913,914,3,326,160,0,914,915,
- 3,308,151,0,915,916,3,292,143,0,916,917,3,314,154,0,917,918,3,308,
- 151,0,918,919,3,342,168,0,919,920,3,300,147,0,920,921,3,298,146,
- 0,921,139,1,0,0,0,922,923,3,316,155,0,923,924,3,308,151,0,924,925,
- 3,318,156,0,925,926,3,332,163,0,926,927,3,330,162,0,927,928,3,300,
- 147,0,928,141,1,0,0,0,929,930,3,316,155,0,930,931,3,320,157,0,931,
- 932,3,318,156,0,932,933,3,330,162,0,933,934,3,306,150,0,934,143,
- 1,0,0,0,935,936,3,318,156,0,936,937,3,292,143,0,937,938,3,316,155,
- 0,938,939,3,300,147,0,939,145,1,0,0,0,940,941,3,318,156,0,941,942,
- 3,292,143,0,942,943,3,330,162,0,943,944,3,332,163,0,944,945,3,326,
- 160,0,945,946,3,292,143,0,946,947,3,314,154,0,947,147,1,0,0,0,948,
- 949,3,318,156,0,949,950,3,292,143,0,950,951,3,318,156,0,951,149,
- 1,0,0,0,952,953,3,318,156,0,953,954,3,320,157,0,954,955,3,330,162,
- 0,955,151,1,0,0,0,956,957,3,318,156,0,957,958,3,332,163,0,958,959,
- 3,314,154,0,959,960,3,314,154,0,960,153,1,0,0,0,961,962,3,318,156,
- 0,962,963,3,332,163,0,963,964,3,314,154,0,964,965,3,314,154,0,965,
- 966,3,328,161,0,966,155,1,0,0,0,967,968,3,320,157,0,968,969,3,302,
- 148,0,969,970,3,302,148,0,970,971,3,328,161,0,971,972,3,300,147,
- 0,972,973,3,330,162,0,973,157,1,0,0,0,974,975,3,320,157,0,975,976,
- 3,318,156,0,976,159,1,0,0,0,977,978,3,320,157,0,978,979,3,326,160,
- 0,979,161,1,0,0,0,980,981,3,320,157,0,981,982,3,326,160,0,982,983,
- 3,298,146,0,983,984,3,300,147,0,984,985,3,326,160,0,985,163,1,0,
- 0,0,986,987,3,320,157,0,987,988,3,332,163,0,988,989,3,330,162,0,
- 989,990,3,300,147,0,990,991,3,326,160,0,991,165,1,0,0,0,992,993,
- 3,320,157,0,993,994,3,334,164,0,994,995,3,300,147,0,995,996,3,326,
- 160,0,996,167,1,0,0,0,997,998,3,322,158,0,998,999,3,292,143,0,999,
- 1000,3,326,160,0,1000,1001,3,330,162,0,1001,1002,3,308,151,0,1002,
- 1003,3,330,162,0,1003,1004,3,308,151,0,1004,1005,3,320,157,0,1005,
- 1006,3,318,156,0,1006,169,1,0,0,0,1007,1008,3,322,158,0,1008,1009,
- 3,308,151,0,1009,1010,3,334,164,0,1010,1011,3,320,157,0,1011,1012,
- 3,330,162,0,1012,171,1,0,0,0,1013,1014,3,322,158,0,1014,1015,3,320,
- 157,0,1015,1016,3,328,161,0,1016,1017,3,308,151,0,1017,1018,3,330,
- 162,0,1018,1019,3,308,151,0,1019,1020,3,320,157,0,1020,1021,3,318,
- 156,0,1021,1022,3,292,143,0,1022,1023,3,314,154,0,1023,173,1,0,0,
- 0,1024,1025,3,322,158,0,1025,1026,3,326,160,0,1026,1027,3,300,147,
- 0,1027,1028,3,296,145,0,1028,1029,3,300,147,0,1029,1030,3,298,146,
- 0,1030,1031,3,308,151,0,1031,1032,3,318,156,0,1032,1033,3,304,149,
- 0,1033,175,1,0,0,0,1034,1035,3,322,158,0,1035,1036,3,326,160,0,1036,
- 1037,3,300,147,0,1037,1038,3,336,165,0,1038,1039,3,306,150,0,1039,
- 1040,3,300,147,0,1040,1041,3,326,160,0,1041,1042,3,300,147,0,1042,
- 177,1,0,0,0,1043,1044,3,324,159,0,1044,1045,3,332,163,0,1045,1046,
- 3,292,143,0,1046,1047,3,314,154,0,1047,1048,3,308,151,0,1048,1049,
- 3,302,148,0,1049,1050,3,340,167,0,1050,179,1,0,0,0,1051,1052,3,324,
- 159,0,1052,1053,3,332,163,0,1053,1054,3,292,143,0,1054,1055,3,326,
- 160,0,1055,1056,3,330,162,0,1056,1057,3,300,147,0,1057,1058,3,326,
- 160,0,1058,181,1,0,0,0,1059,1060,3,326,160,0,1060,1061,3,292,143,
- 0,1061,1062,3,318,156,0,1062,1063,3,304,149,0,1063,1064,3,300,147,
- 0,1064,183,1,0,0,0,1065,1066,3,326,160,0,1066,1067,3,300,147,0,1067,
- 1068,3,296,145,0,1068,1069,3,332,163,0,1069,1070,3,326,160,0,1070,
- 1071,3,328,161,0,1071,1072,3,308,151,0,1072,1073,3,334,164,0,1073,
- 1074,3,300,147,0,1074,185,1,0,0,0,1075,1076,3,326,160,0,1076,1077,
- 3,300,147,0,1077,1078,3,322,158,0,1078,1079,3,314,154,0,1079,1080,
- 3,292,143,0,1080,1081,3,296,145,0,1081,1082,3,300,147,0,1082,187,
- 1,0,0,0,1083,1084,3,326,160,0,1084,1085,3,300,147,0,1085,1086,3,
- 330,162,0,1086,1087,3,332,163,0,1087,1088,3,326,160,0,1088,1089,
- 3,318,156,0,1089,189,1,0,0,0,1090,1091,3,326,160,0,1091,1092,3,308,
- 151,0,1092,1093,3,304,149,0,1093,1094,3,306,150,0,1094,1095,3,330,
- 162,0,1095,191,1,0,0,0,1096,1097,3,326,160,0,1097,1098,3,320,157,
- 0,1098,1099,3,314,154,0,1099,1100,3,314,154,0,1100,1101,3,332,163,
- 0,1101,1102,3,322,158,0,1102,193,1,0,0,0,1103,1104,3,326,160,0,1104,
- 1105,3,320,157,0,1105,1106,3,336,165,0,1106,195,1,0,0,0,1107,1108,
- 3,326,160,0,1108,1109,3,320,157,0,1109,1110,3,336,165,0,1110,1111,
- 3,328,161,0,1111,197,1,0,0,0,1112,1113,3,328,161,0,1113,1114,3,292,
- 143,0,1114,1115,3,316,155,0,1115,1116,3,322,158,0,1116,1117,3,314,
- 154,0,1117,1118,3,300,147,0,1118,199,1,0,0,0,1119,1120,3,328,161,
- 0,1120,1121,3,300,147,0,1121,1122,3,296,145,0,1122,1123,3,320,157,
- 0,1123,1124,3,318,156,0,1124,1125,3,298,146,0,1125,201,1,0,0,0,1126,
- 1127,3,328,161,0,1127,1128,3,300,147,0,1128,1129,3,314,154,0,1129,
- 1130,3,300,147,0,1130,1131,3,296,145,0,1131,1132,3,330,162,0,1132,
- 203,1,0,0,0,1133,1134,3,328,161,0,1134,1135,3,300,147,0,1135,1136,
- 3,316,155,0,1136,1137,3,308,151,0,1137,205,1,0,0,0,1138,1139,3,328,
- 161,0,1139,1140,3,300,147,0,1140,1141,3,330,162,0,1141,1142,3,328,
- 161,0,1142,207,1,0,0,0,1143,1144,3,328,161,0,1144,1145,3,300,147,
- 0,1145,1146,3,330,162,0,1146,1147,3,330,162,0,1147,1148,3,308,151,
- 0,1148,1149,3,318,156,0,1149,1150,3,304,149,0,1150,1151,3,328,161,
- 0,1151,209,1,0,0,0,1152,1153,3,328,161,0,1153,1154,3,330,162,0,1154,
- 1155,3,300,147,0,1155,1156,3,322,158,0,1156,211,1,0,0,0,1157,1158,
- 3,328,161,0,1158,1159,3,332,163,0,1159,1160,3,294,144,0,1160,1161,
- 3,328,161,0,1161,1162,3,330,162,0,1162,1163,3,326,160,0,1163,1164,
- 3,308,151,0,1164,1165,3,318,156,0,1165,1166,3,304,149,0,1166,213,
- 1,0,0,0,1167,1168,3,330,162,0,1168,1169,3,306,150,0,1169,1170,3,
- 300,147,0,1170,1171,3,318,156,0,1171,215,1,0,0,0,1172,1173,3,330,
- 162,0,1173,1174,3,306,150,0,1174,1175,3,326,160,0,1175,1176,3,320,
- 157,0,1176,1177,3,336,165,0,1177,217,1,0,0,0,1178,1179,3,330,162,
- 0,1179,1180,3,308,151,0,1180,1181,3,300,147,0,1181,1182,3,328,161,
- 0,1182,219,1,0,0,0,1183,1184,3,330,162,0,1184,1185,3,308,151,0,1185,
- 1186,3,316,155,0,1186,1187,3,300,147,0,1187,1188,3,328,161,0,1188,
- 1189,3,330,162,0,1189,1190,3,292,143,0,1190,1191,3,316,155,0,1191,
- 1192,3,322,158,0,1192,221,1,0,0,0,1193,1194,3,330,162,0,1194,1195,
- 3,308,151,0,1195,1196,3,316,155,0,1196,1197,3,300,147,0,1197,223,
- 1,0,0,0,1198,1199,3,314,154,0,1199,1200,3,320,157,0,1200,1201,3,
- 296,145,0,1201,1202,3,292,143,0,1202,1203,3,314,154,0,1203,225,1,
- 0,0,0,1204,1205,3,342,168,0,1205,1206,3,320,157,0,1206,1207,3,318,
- 156,0,1207,1208,3,300,147,0,1208,227,1,0,0,0,1209,1210,3,330,162,
- 0,1210,1211,3,320,157,0,1211,229,1,0,0,0,1212,1213,3,330,162,0,1213,
- 1214,3,320,157,0,1214,1215,3,322,158,0,1215,231,1,0,0,0,1216,1217,
- 3,330,162,0,1217,1218,3,320,157,0,1218,1219,3,330,162,0,1219,1220,
- 3,292,143,0,1220,1221,3,314,154,0,1221,1222,3,328,161,0,1222,233,
- 1,0,0,0,1223,1224,3,330,162,0,1224,1225,3,326,160,0,1225,1226,3,
- 292,143,0,1226,1227,3,308,151,0,1227,1228,3,314,154,0,1228,1229,
- 3,308,151,0,1229,1230,3,318,156,0,1230,1231,3,304,149,0,1231,235,
- 1,0,0,0,1232,1233,3,330,162,0,1233,1234,3,326,160,0,1234,1235,3,
- 308,151,0,1235,1236,3,316,155,0,1236,237,1,0,0,0,1237,1238,3,330,
- 162,0,1238,1239,3,326,160,0,1239,1240,3,332,163,0,1240,1241,3,318,
- 156,0,1241,1242,3,296,145,0,1242,1243,3,292,143,0,1243,1244,3,330,
- 162,0,1244,1245,3,300,147,0,1245,239,1,0,0,0,1246,1247,3,330,162,
- 0,1247,1248,3,326,160,0,1248,1249,3,340,167,0,1249,241,1,0,0,0,1250,
- 1251,3,330,162,0,1251,1252,3,326,160,0,1252,1253,3,340,167,0,1253,
- 1254,5,95,0,0,1254,1255,3,296,145,0,1255,1256,3,292,143,0,1256,1257,
- 3,328,161,0,1257,1258,3,330,162,0,1258,243,1,0,0,0,1259,1260,3,332,
- 163,0,1260,1261,3,318,156,0,1261,1262,3,294,144,0,1262,1263,3,320,
- 157,0,1263,1264,3,332,163,0,1264,1265,3,318,156,0,1265,1266,3,298,
- 146,0,1266,1267,3,300,147,0,1267,1268,3,298,146,0,1268,245,1,0,0,
- 0,1269,1270,3,332,163,0,1270,1271,3,318,156,0,1271,1272,3,308,151,
- 0,1272,1273,3,320,157,0,1273,1274,3,318,156,0,1274,247,1,0,0,0,1275,
- 1276,3,332,163,0,1276,1277,3,318,156,0,1277,1278,3,322,158,0,1278,
- 1279,3,308,151,0,1279,1280,3,334,164,0,1280,1281,3,320,157,0,1281,
- 1282,3,330,162,0,1282,249,1,0,0,0,1283,1284,3,332,163,0,1284,1285,
- 3,328,161,0,1285,1286,3,308,151,0,1286,1287,3,318,156,0,1287,1288,
- 3,304,149,0,1288,251,1,0,0,0,1289,1290,3,334,164,0,1290,1291,3,292,
- 143,0,1291,1292,3,314,154,0,1292,1293,3,332,163,0,1293,1294,3,300,
- 147,0,1294,1295,3,328,161,0,1295,253,1,0,0,0,1296,1297,3,336,165,
- 0,1297,1298,3,300,147,0,1298,1299,3,300,147,0,1299,1300,3,312,153,
- 0,1300,255,1,0,0,0,1301,1302,3,336,165,0,1302,1303,3,306,150,0,1303,
- 1304,3,300,147,0,1304,1305,3,318,156,0,1305,257,1,0,0,0,1306,1307,
- 3,336,165,0,1307,1308,3,306,150,0,1308,1309,3,300,147,0,1309,1310,
- 3,326,160,0,1310,1311,3,300,147,0,1311,259,1,0,0,0,1312,1313,3,336,
- 165,0,1313,1314,3,306,150,0,1314,1315,3,308,151,0,1315,1316,3,314,
- 154,0,1316,1317,3,300,147,0,1317,261,1,0,0,0,1318,1319,3,336,165,
- 0,1319,1320,3,308,151,0,1320,1321,3,318,156,0,1321,1322,3,298,146,
- 0,1322,1323,3,320,157,0,1323,1324,3,336,165,0,1324,263,1,0,0,0,1325,
- 1326,3,336,165,0,1326,1327,3,308,151,0,1327,1328,3,330,162,0,1328,
- 1329,3,306,150,0,1329,265,1,0,0,0,1330,1331,3,336,165,0,1331,1332,
- 3,308,151,0,1332,1333,3,330,162,0,1333,1334,3,306,150,0,1334,1335,
- 3,308,151,0,1335,1336,3,318,156,0,1336,267,1,0,0,0,1337,1338,3,340,
- 167,0,1338,1339,3,300,147,0,1339,1340,3,292,143,0,1340,1341,3,326,
- 160,0,1341,1348,1,0,0,0,1342,1343,3,340,167,0,1343,1344,3,340,167,
- 0,1344,1345,3,340,167,0,1345,1346,3,340,167,0,1346,1348,1,0,0,0,
- 1347,1337,1,0,0,0,1347,1342,1,0,0,0,1348,269,1,0,0,0,1349,1350,3,
- 360,177,0,1350,1351,3,294,144,0,1351,1382,1,0,0,0,1352,1353,3,360,
- 177,0,1353,1354,3,302,148,0,1354,1382,1,0,0,0,1355,1356,3,360,177,
- 0,1356,1357,3,326,160,0,1357,1382,1,0,0,0,1358,1359,3,360,177,0,
- 1359,1360,3,318,156,0,1360,1382,1,0,0,0,1361,1362,3,360,177,0,1362,
- 1363,3,330,162,0,1363,1382,1,0,0,0,1364,1365,3,360,177,0,1365,1366,
- 5,48,0,0,1366,1382,1,0,0,0,1367,1368,3,360,177,0,1368,1369,3,292,
- 143,0,1369,1382,1,0,0,0,1370,1371,3,360,177,0,1371,1372,3,334,164,
- 0,1372,1382,1,0,0,0,1373,1374,3,360,177,0,1374,1375,3,360,177,0,
- 1375,1382,1,0,0,0,1376,1377,3,360,177,0,1377,1378,3,338,166,0,1378,
- 1379,3,352,173,0,1379,1380,3,352,173,0,1380,1382,1,0,0,0,1381,1349,
- 1,0,0,0,1381,1352,1,0,0,0,1381,1355,1,0,0,0,1381,1358,1,0,0,0,1381,
- 1361,1,0,0,0,1381,1364,1,0,0,0,1381,1367,1,0,0,0,1381,1370,1,0,0,
- 0,1381,1373,1,0,0,0,1381,1376,1,0,0,0,1382,271,1,0,0,0,1383,1387,
- 3,344,169,0,1384,1387,3,448,221,0,1385,1387,3,374,184,0,1386,1383,
- 1,0,0,0,1386,1384,1,0,0,0,1386,1385,1,0,0,0,1387,1394,1,0,0,0,1388,
- 1393,3,344,169,0,1389,1393,3,448,221,0,1390,1393,3,350,172,0,1391,
- 1393,3,374,184,0,1392,1388,1,0,0,0,1392,1389,1,0,0,0,1392,1390,1,
- 0,0,0,1392,1391,1,0,0,0,1393,1396,1,0,0,0,1394,1392,1,0,0,0,1394,
- 1395,1,0,0,0,1395,273,1,0,0,0,1396,1394,1,0,0,0,1397,1408,3,358,
- 176,0,1398,1407,8,0,0,0,1399,1407,3,270,132,0,1400,1401,3,360,177,
- 0,1401,1402,3,430,212,0,1402,1407,1,0,0,0,1403,1404,3,358,176,0,
- 1404,1405,3,358,176,0,1405,1407,1,0,0,0,1406,1398,1,0,0,0,1406,1399,
- 1,0,0,0,1406,1400,1,0,0,0,1406,1403,1,0,0,0,1407,1410,1,0,0,0,1408,
- 1406,1,0,0,0,1408,1409,1,0,0,0,1409,1411,1,0,0,0,1410,1408,1,0,0,
- 0,1411,1412,3,358,176,0,1412,1430,1,0,0,0,1413,1424,3,424,209,0,
- 1414,1423,8,1,0,0,1415,1423,3,270,132,0,1416,1417,3,360,177,0,1417,
- 1418,3,424,209,0,1418,1423,1,0,0,0,1419,1420,3,424,209,0,1420,1421,
- 3,424,209,0,1421,1423,1,0,0,0,1422,1414,1,0,0,0,1422,1415,1,0,0,
- 0,1422,1416,1,0,0,0,1422,1419,1,0,0,0,1423,1426,1,0,0,0,1424,1422,
- 1,0,0,0,1424,1425,1,0,0,0,1425,1427,1,0,0,0,1426,1424,1,0,0,0,1427,
- 1428,3,424,209,0,1428,1430,1,0,0,0,1429,1397,1,0,0,0,1429,1413,1,
- 0,0,0,1430,275,1,0,0,0,1431,1432,3,284,139,0,1432,1436,3,376,185,
- 0,1433,1435,3,352,173,0,1434,1433,1,0,0,0,1435,1438,1,0,0,0,1436,
- 1434,1,0,0,0,1436,1437,1,0,0,0,1437,1441,1,0,0,0,1438,1436,1,0,0,
- 0,1439,1442,3,322,158,0,1440,1442,3,300,147,0,1441,1439,1,0,0,0,
- 1441,1440,1,0,0,0,1442,1445,1,0,0,0,1443,1446,3,420,207,0,1444,1446,
- 3,372,183,0,1445,1443,1,0,0,0,1445,1444,1,0,0,0,1445,1446,1,0,0,
- 0,1446,1448,1,0,0,0,1447,1449,3,350,172,0,1448,1447,1,0,0,0,1449,
- 1450,1,0,0,0,1450,1448,1,0,0,0,1450,1451,1,0,0,0,1451,1508,1,0,0,
- 0,1452,1455,3,284,139,0,1453,1456,3,322,158,0,1454,1456,3,300,147,
- 0,1455,1453,1,0,0,0,1455,1454,1,0,0,0,1456,1459,1,0,0,0,1457,1460,
- 3,420,207,0,1458,1460,3,372,183,0,1459,1457,1,0,0,0,1459,1458,1,
- 0,0,0,1459,1460,1,0,0,0,1460,1462,1,0,0,0,1461,1463,3,350,172,0,
- 1462,1461,1,0,0,0,1463,1464,1,0,0,0,1464,1462,1,0,0,0,1464,1465,
- 1,0,0,0,1465,1508,1,0,0,0,1466,1467,3,282,138,0,1467,1471,3,376,
- 185,0,1468,1470,3,350,172,0,1469,1468,1,0,0,0,1470,1473,1,0,0,0,
- 1471,1469,1,0,0,0,1471,1472,1,0,0,0,1472,1474,1,0,0,0,1473,1471,
- 1,0,0,0,1474,1477,3,300,147,0,1475,1478,3,420,207,0,1476,1478,3,
- 372,183,0,1477,1475,1,0,0,0,1477,1476,1,0,0,0,1477,1478,1,0,0,0,
- 1478,1480,1,0,0,0,1479,1481,3,350,172,0,1480,1479,1,0,0,0,1481,1482,
- 1,0,0,0,1482,1480,1,0,0,0,1482,1483,1,0,0,0,1483,1508,1,0,0,0,1484,
- 1485,3,376,185,0,1485,1486,3,282,138,0,1486,1489,3,300,147,0,1487,
- 1490,3,420,207,0,1488,1490,3,372,183,0,1489,1487,1,0,0,0,1489,1488,
- 1,0,0,0,1489,1490,1,0,0,0,1490,1492,1,0,0,0,1491,1493,3,350,172,
- 0,1492,1491,1,0,0,0,1493,1494,1,0,0,0,1494,1492,1,0,0,0,1494,1495,
- 1,0,0,0,1495,1508,1,0,0,0,1496,1497,3,282,138,0,1497,1500,3,300,
- 147,0,1498,1501,3,420,207,0,1499,1501,3,372,183,0,1500,1498,1,0,
- 0,0,1500,1499,1,0,0,0,1500,1501,1,0,0,0,1501,1503,1,0,0,0,1502,1504,
- 3,350,172,0,1503,1502,1,0,0,0,1504,1505,1,0,0,0,1505,1503,1,0,0,
- 0,1505,1506,1,0,0,0,1506,1508,1,0,0,0,1507,1431,1,0,0,0,1507,1452,
- 1,0,0,0,1507,1466,1,0,0,0,1507,1484,1,0,0,0,1507,1496,1,0,0,0,1508,
- 277,1,0,0,0,1509,1510,5,48,0,0,1510,1512,3,294,144,0,1511,1513,3,
- 346,170,0,1512,1511,1,0,0,0,1513,1514,1,0,0,0,1514,1512,1,0,0,0,
- 1514,1515,1,0,0,0,1515,279,1,0,0,0,1516,1518,5,48,0,0,1517,1519,
- 3,348,171,0,1518,1517,1,0,0,0,1519,1520,1,0,0,0,1520,1518,1,0,0,
- 0,1520,1521,1,0,0,0,1521,281,1,0,0,0,1522,1524,3,350,172,0,1523,
- 1522,1,0,0,0,1524,1525,1,0,0,0,1525,1523,1,0,0,0,1525,1526,1,0,0,
- 0,1526,283,1,0,0,0,1527,1528,5,48,0,0,1528,1530,3,338,166,0,1529,
- 1531,3,352,173,0,1530,1529,1,0,0,0,1531,1532,1,0,0,0,1532,1530,1,
- 0,0,0,1532,1533,1,0,0,0,1533,285,1,0,0,0,1534,1535,5,48,0,0,1535,
- 1537,7,2,0,0,1536,1538,3,350,172,0,1537,1536,1,0,0,0,1538,1539,1,
- 0,0,0,1539,1537,1,0,0,0,1539,1540,1,0,0,0,1540,287,1,0,0,0,1541,
- 1542,5,48,0,0,1542,1544,7,3,0,0,1543,1545,3,350,172,0,1544,1543,
- 1,0,0,0,1545,1546,1,0,0,0,1546,1544,1,0,0,0,1546,1547,1,0,0,0,1547,
- 289,1,0,0,0,1548,1559,3,430,212,0,1549,1558,8,4,0,0,1550,1558,3,
- 270,132,0,1551,1552,3,360,177,0,1552,1553,3,430,212,0,1553,1558,
- 1,0,0,0,1554,1555,3,430,212,0,1555,1556,3,430,212,0,1556,1558,1,
- 0,0,0,1557,1549,1,0,0,0,1557,1550,1,0,0,0,1557,1551,1,0,0,0,1557,
- 1554,1,0,0,0,1558,1561,1,0,0,0,1559,1557,1,0,0,0,1559,1560,1,0,0,
- 0,1560,1562,1,0,0,0,1561,1559,1,0,0,0,1562,1563,3,430,212,0,1563,
- 291,1,0,0,0,1564,1565,7,5,0,0,1565,293,1,0,0,0,1566,1567,7,3,0,0,
- 1567,295,1,0,0,0,1568,1569,7,6,0,0,1569,297,1,0,0,0,1570,1571,7,
- 7,0,0,1571,299,1,0,0,0,1572,1573,7,8,0,0,1573,301,1,0,0,0,1574,1575,
- 7,9,0,0,1575,303,1,0,0,0,1576,1577,7,10,0,0,1577,305,1,0,0,0,1578,
- 1579,7,11,0,0,1579,307,1,0,0,0,1580,1581,7,12,0,0,1581,309,1,0,0,
- 0,1582,1583,7,13,0,0,1583,311,1,0,0,0,1584,1585,7,14,0,0,1585,313,
- 1,0,0,0,1586,1587,7,15,0,0,1587,315,1,0,0,0,1588,1589,7,16,0,0,1589,
- 317,1,0,0,0,1590,1591,7,17,0,0,1591,319,1,0,0,0,1592,1593,7,2,0,
- 0,1593,321,1,0,0,0,1594,1595,7,18,0,0,1595,323,1,0,0,0,1596,1597,
- 7,19,0,0,1597,325,1,0,0,0,1598,1599,7,20,0,0,1599,327,1,0,0,0,1600,
- 1601,7,21,0,0,1601,329,1,0,0,0,1602,1603,7,22,0,0,1603,331,1,0,0,
- 0,1604,1605,7,23,0,0,1605,333,1,0,0,0,1606,1607,7,24,0,0,1607,335,
- 1,0,0,0,1608,1609,7,25,0,0,1609,337,1,0,0,0,1610,1611,7,26,0,0,1611,
- 339,1,0,0,0,1612,1613,7,27,0,0,1613,341,1,0,0,0,1614,1615,7,28,0,
- 0,1615,343,1,0,0,0,1616,1617,7,29,0,0,1617,345,1,0,0,0,1618,1619,
- 7,30,0,0,1619,347,1,0,0,0,1620,1621,7,31,0,0,1621,349,1,0,0,0,1622,
- 1623,7,32,0,0,1623,351,1,0,0,0,1624,1625,7,33,0,0,1625,353,1,0,0,
- 0,1626,1627,5,45,0,0,1627,1628,5,62,0,0,1628,355,1,0,0,0,1629,1630,
- 5,42,0,0,1630,357,1,0,0,0,1631,1632,5,96,0,0,1632,359,1,0,0,0,1633,
- 1634,5,92,0,0,1634,361,1,0,0,0,1635,1636,5,58,0,0,1636,1637,5,58,
- 0,0,1637,363,1,0,0,0,1638,1639,5,58,0,0,1639,1640,5,61,0,0,1640,
- 365,1,0,0,0,1641,1642,5,58,0,0,1642,367,1,0,0,0,1643,1644,5,44,0,
- 0,1644,369,1,0,0,0,1645,1646,5,124,0,0,1646,1647,5,124,0,0,1647,
- 371,1,0,0,0,1648,1649,5,45,0,0,1649,373,1,0,0,0,1650,1651,5,36,0,
- 0,1651,375,1,0,0,0,1652,1653,5,46,0,0,1653,377,1,0,0,0,1654,1655,
- 5,61,0,0,1655,1656,5,61,0,0,1656,379,1,0,0,0,1657,1658,5,61,0,0,
- 1658,381,1,0,0,0,1659,1660,5,62,0,0,1660,1661,5,61,0,0,1661,383,
- 1,0,0,0,1662,1663,5,62,0,0,1663,385,1,0,0,0,1664,1665,5,35,0,0,1665,
- 387,1,0,0,0,1666,1667,5,126,0,0,1667,1668,5,42,0,0,1668,389,1,0,
- 0,0,1669,1670,5,61,0,0,1670,1671,5,126,0,0,1671,1672,5,42,0,0,1672,
- 391,1,0,0,0,1673,1674,5,123,0,0,1674,1675,1,0,0,0,1675,1676,6,193,
- 0,0,1676,393,1,0,0,0,1677,1678,5,91,0,0,1678,395,1,0,0,0,1679,1680,
- 5,40,0,0,1680,397,1,0,0,0,1681,1682,5,60,0,0,1682,1683,5,61,0,0,
- 1683,399,1,0,0,0,1684,1685,5,60,0,0,1685,1686,5,47,0,0,1686,1687,
- 1,0,0,0,1687,1688,6,197,1,0,1688,1689,6,197,2,0,1689,401,1,0,0,0,
- 1690,1691,5,60,0,0,1691,1692,4,198,0,0,1692,1693,1,0,0,0,1693,1694,
- 6,198,3,0,1694,1695,6,198,4,0,1695,403,1,0,0,0,1696,1697,5,60,0,
- 0,1697,405,1,0,0,0,1698,1699,5,60,0,0,1699,1700,5,47,0,0,1700,407,
- 1,0,0,0,1701,1702,5,33,0,0,1702,1706,5,61,0,0,1703,1704,5,60,0,0,
- 1704,1706,5,62,0,0,1705,1701,1,0,0,0,1705,1703,1,0,0,0,1706,409,
- 1,0,0,0,1707,1708,5,33,0,0,1708,1709,5,126,0,0,1709,1710,5,42,0,
- 0,1710,411,1,0,0,0,1711,1712,5,33,0,0,1712,1713,5,126,0,0,1713,413,
- 1,0,0,0,1714,1715,5,63,0,0,1715,1716,5,46,0,0,1716,415,1,0,0,0,1717,
- 1718,5,63,0,0,1718,1719,5,63,0,0,1719,417,1,0,0,0,1720,1721,5,37,
- 0,0,1721,419,1,0,0,0,1722,1723,5,43,0,0,1723,421,1,0,0,0,1724,1725,
- 5,63,0,0,1725,423,1,0,0,0,1726,1727,5,34,0,0,1727,425,1,0,0,0,1728,
- 1729,5,102,0,0,1729,1730,5,39,0,0,1730,1731,1,0,0,0,1731,1732,6,
- 210,5,0,1732,427,1,0,0,0,1733,1734,5,70,0,0,1734,1735,5,39,0,0,1735,
- 1736,1,0,0,0,1736,1737,6,211,6,0,1737,429,1,0,0,0,1738,1739,5,39,
- 0,0,1739,431,1,0,0,0,1740,1741,5,126,0,0,1741,433,1,0,0,0,1742,1743,
- 5,61,0,0,1743,1744,5,126,0,0,1744,435,1,0,0,0,1745,1746,5,125,0,
- 0,1746,1747,1,0,0,0,1747,1748,6,215,7,0,1748,437,1,0,0,0,1749,1750,
- 5,93,0,0,1750,439,1,0,0,0,1751,1752,5,41,0,0,1752,441,1,0,0,0,1753,
- 1754,5,59,0,0,1754,443,1,0,0,0,1755,1756,5,47,0,0,1756,445,1,0,0,
- 0,1757,1758,5,47,0,0,1758,1759,5,62,0,0,1759,447,1,0,0,0,1760,1761,
- 5,95,0,0,1761,449,1,0,0,0,1762,1763,5,47,0,0,1763,1764,5,42,0,0,
- 1764,1768,1,0,0,0,1765,1767,9,0,0,0,1766,1765,1,0,0,0,1767,1770,
- 1,0,0,0,1768,1769,1,0,0,0,1768,1766,1,0,0,0,1769,1771,1,0,0,0,1770,
- 1768,1,0,0,0,1771,1772,5,42,0,0,1772,1773,5,47,0,0,1773,1774,1,0,
- 0,0,1774,1775,6,222,8,0,1775,451,1,0,0,0,1776,1777,5,45,0,0,1777,
- 1781,5,45,0,0,1778,1779,5,47,0,0,1779,1781,5,47,0,0,1780,1776,1,
- 0,0,0,1780,1778,1,0,0,0,1781,1785,1,0,0,0,1782,1784,8,34,0,0,1783,
- 1782,1,0,0,0,1784,1787,1,0,0,0,1785,1783,1,0,0,0,1785,1786,1,0,0,
- 0,1786,1789,1,0,0,0,1787,1785,1,0,0,0,1788,1790,7,35,0,0,1789,1788,
- 1,0,0,0,1790,1791,1,0,0,0,1791,1792,6,223,8,0,1792,453,1,0,0,0,1793,
- 1794,7,36,0,0,1794,1795,1,0,0,0,1795,1796,6,224,9,0,1796,455,1,0,
- 0,0,1797,1798,9,0,0,0,1798,457,1,0,0,0,1799,1811,8,37,0,0,1800,1811,
- 3,270,132,0,1801,1802,3,360,177,0,1802,1803,3,430,212,0,1803,1811,
- 1,0,0,0,1804,1805,3,360,177,0,1805,1806,3,392,193,0,1806,1811,1,
- 0,0,0,1807,1808,3,430,212,0,1808,1809,3,430,212,0,1809,1811,1,0,
- 0,0,1810,1799,1,0,0,0,1810,1800,1,0,0,0,1810,1801,1,0,0,0,1810,1804,
- 1,0,0,0,1810,1807,1,0,0,0,1811,1812,1,0,0,0,1812,1810,1,0,0,0,1812,
- 1813,1,0,0,0,1813,459,1,0,0,0,1814,1815,3,392,193,0,1815,1816,1,
- 0,0,0,1816,1817,6,227,0,0,1817,461,1,0,0,0,1818,1819,3,430,212,0,
- 1819,1820,1,0,0,0,1820,1821,6,228,10,0,1821,1822,6,228,7,0,1822,
- 463,1,0,0,0,1823,1829,8,38,0,0,1824,1829,3,270,132,0,1825,1826,3,
- 360,177,0,1826,1827,3,392,193,0,1827,1829,1,0,0,0,1828,1823,1,0,
- 0,0,1828,1824,1,0,0,0,1828,1825,1,0,0,0,1829,1830,1,0,0,0,1830,1828,
- 1,0,0,0,1830,1831,1,0,0,0,1831,465,1,0,0,0,1832,1833,3,392,193,0,
- 1833,1834,1,0,0,0,1834,1835,6,230,0,0,1835,467,1,0,0,0,1836,1837,
- 5,47,0,0,1837,1838,5,62,0,0,1838,1839,1,0,0,0,1839,1840,6,231,11,
- 0,1840,1841,6,231,7,0,1841,469,1,0,0,0,1842,1843,5,62,0,0,1843,1844,
- 1,0,0,0,1844,1845,6,232,12,0,1845,1846,6,232,7,0,1846,1847,6,232,
- 13,0,1847,471,1,0,0,0,1848,1852,7,39,0,0,1849,1851,7,40,0,0,1850,
- 1849,1,0,0,0,1851,1854,1,0,0,0,1852,1850,1,0,0,0,1852,1853,1,0,0,
- 0,1853,1855,1,0,0,0,1854,1852,1,0,0,0,1855,1856,6,233,14,0,1856,
- 473,1,0,0,0,1857,1858,5,61,0,0,1858,1859,1,0,0,0,1859,1860,6,234,
- 15,0,1860,475,1,0,0,0,1861,1862,3,290,142,0,1862,1863,1,0,0,0,1863,
- 1864,6,235,16,0,1864,477,1,0,0,0,1865,1867,7,41,0,0,1866,1865,1,
- 0,0,0,1867,1868,1,0,0,0,1868,1866,1,0,0,0,1868,1869,1,0,0,0,1869,
- 1870,1,0,0,0,1870,1871,6,236,9,0,1871,479,1,0,0,0,1872,1873,5,123,
- 0,0,1873,1874,1,0,0,0,1874,1875,6,237,17,0,1875,1876,6,237,0,0,1876,
- 481,1,0,0,0,1877,1878,5,62,0,0,1878,1879,1,0,0,0,1879,1880,6,238,
- 12,0,1880,1881,6,238,7,0,1881,483,1,0,0,0,1882,1886,7,39,0,0,1883,
- 1885,7,40,0,0,1884,1883,1,0,0,0,1885,1888,1,0,0,0,1886,1884,1,0,
- 0,0,1886,1887,1,0,0,0,1887,1889,1,0,0,0,1888,1886,1,0,0,0,1889,1890,
- 6,239,14,0,1890,485,1,0,0,0,1891,1893,7,41,0,0,1892,1891,1,0,0,0,
- 1893,1894,1,0,0,0,1894,1892,1,0,0,0,1894,1895,1,0,0,0,1895,1896,
- 1,0,0,0,1896,1897,6,240,9,0,1897,487,1,0,0,0,1898,1900,8,42,0,0,
- 1899,1898,1,0,0,0,1900,1901,1,0,0,0,1901,1899,1,0,0,0,1901,1902,
- 1,0,0,0,1902,489,1,0,0,0,1903,1904,5,123,0,0,1904,1905,1,0,0,0,1905,
- 1906,6,242,17,0,1906,1907,6,242,0,0,1907,491,1,0,0,0,1908,1909,5,
- 60,0,0,1909,1910,5,47,0,0,1910,1911,1,0,0,0,1911,1912,6,243,1,0,
- 1912,1913,6,243,7,0,1913,1914,6,243,2,0,1914,493,1,0,0,0,1915,1916,
- 5,60,0,0,1916,1917,1,0,0,0,1917,1918,6,244,3,0,1918,1919,6,244,4,
- 0,1919,495,1,0,0,0,1920,1922,7,41,0,0,1921,1920,1,0,0,0,1922,1923,
- 1,0,0,0,1923,1921,1,0,0,0,1923,1924,1,0,0,0,1924,1925,1,0,0,0,1925,
- 1926,6,245,9,0,1926,497,1,0,0,0,56,0,1,2,3,4,5,538,818,1347,1381,
- 1386,1392,1394,1406,1408,1422,1424,1429,1436,1441,1445,1450,1455,
- 1459,1464,1471,1477,1482,1489,1494,1500,1505,1507,1514,1520,1525,
- 1532,1539,1546,1557,1559,1705,1768,1780,1785,1789,1810,1812,1828,
- 1830,1852,1868,1886,1894,1901,1923,18,5,0,0,7,168,0,5,4,0,7,167,
- 0,5,3,0,5,1,0,5,2,0,4,0,0,6,0,0,0,1,0,7,180,0,7,188,0,7,159,0,5,
- 5,0,7,134,0,7,157,0,7,143,0,7,163,0
+ 1,132,3,132,1394,8,132,1,133,1,133,1,133,3,133,1399,8,133,1,133,
+ 1,133,1,133,1,133,5,133,1405,8,133,10,133,12,133,1408,9,133,1,134,
+ 1,134,1,134,1,134,1,134,1,134,1,134,1,134,1,134,5,134,1419,8,134,
+ 10,134,12,134,1422,9,134,1,134,1,134,1,134,1,134,1,134,1,134,1,134,
+ 1,134,1,134,1,134,1,134,5,134,1435,8,134,10,134,12,134,1438,9,134,
+ 1,134,1,134,3,134,1442,8,134,1,135,1,135,1,135,5,135,1447,8,135,
+ 10,135,12,135,1450,9,135,1,135,1,135,1,135,3,135,1455,8,135,1,135,
+ 4,135,1458,8,135,11,135,12,135,1459,1,135,1,135,1,135,1,135,3,135,
+ 1466,8,135,1,135,4,135,1469,8,135,11,135,12,135,1470,1,135,1,135,
+ 1,135,5,135,1476,8,135,10,135,12,135,1479,9,135,1,135,1,135,1,135,
+ 3,135,1484,8,135,1,135,4,135,1487,8,135,11,135,12,135,1488,1,135,
+ 1,135,1,135,1,135,1,135,3,135,1496,8,135,1,135,4,135,1499,8,135,
+ 11,135,12,135,1500,1,135,1,135,1,135,1,135,3,135,1507,8,135,1,135,
+ 4,135,1510,8,135,11,135,12,135,1511,3,135,1514,8,135,1,136,1,136,
+ 1,136,4,136,1519,8,136,11,136,12,136,1520,1,137,1,137,4,137,1525,
+ 8,137,11,137,12,137,1526,1,138,4,138,1530,8,138,11,138,12,138,1531,
+ 1,139,1,139,1,139,4,139,1537,8,139,11,139,12,139,1538,1,140,1,140,
+ 1,140,4,140,1544,8,140,11,140,12,140,1545,1,141,1,141,1,141,4,141,
+ 1551,8,141,11,141,12,141,1552,1,142,1,142,1,142,1,142,1,142,1,142,
+ 1,142,1,142,1,142,5,142,1564,8,142,10,142,12,142,1567,9,142,1,142,
+ 1,142,1,143,1,143,1,144,1,144,1,145,1,145,1,146,1,146,1,147,1,147,
+ 1,148,1,148,1,149,1,149,1,150,1,150,1,151,1,151,1,152,1,152,1,153,
+ 1,153,1,154,1,154,1,155,1,155,1,156,1,156,1,157,1,157,1,158,1,158,
+ 1,159,1,159,1,160,1,160,1,161,1,161,1,162,1,162,1,163,1,163,1,164,
+ 1,164,1,165,1,165,1,166,1,166,1,167,1,167,1,168,1,168,1,169,1,169,
+ 1,170,1,170,1,171,1,171,1,172,1,172,1,173,1,173,1,174,1,174,1,174,
+ 1,175,1,175,1,176,1,176,1,177,1,177,1,178,1,178,1,178,1,179,1,179,
+ 1,179,1,180,1,180,1,181,1,181,1,182,1,182,1,182,1,183,1,183,1,184,
+ 1,184,1,185,1,185,1,186,1,186,1,186,1,187,1,187,1,188,1,188,1,188,
+ 1,189,1,189,1,190,1,190,1,191,1,191,1,191,1,192,1,192,1,192,1,192,
+ 1,193,1,193,1,193,1,193,1,194,1,194,1,195,1,195,1,196,1,196,1,196,
+ 1,197,1,197,1,197,1,197,1,197,1,197,1,198,1,198,1,198,1,198,1,198,
+ 1,198,1,199,1,199,1,200,1,200,1,200,1,201,1,201,1,201,1,201,3,201,
+ 1712,8,201,1,202,1,202,1,202,1,202,1,203,1,203,1,203,1,204,1,204,
+ 1,204,1,205,1,205,1,205,1,206,1,206,1,207,1,207,1,208,1,208,1,209,
+ 1,209,1,210,1,210,1,210,1,210,1,210,1,211,1,211,1,211,1,211,1,211,
+ 1,212,1,212,1,213,1,213,1,214,1,214,1,214,1,215,1,215,1,215,1,215,
+ 1,216,1,216,1,217,1,217,1,218,1,218,1,219,1,219,1,220,1,220,1,220,
+ 1,221,1,221,1,222,1,222,1,222,1,222,5,222,1773,8,222,10,222,12,222,
+ 1776,9,222,1,222,1,222,1,222,1,222,1,222,1,223,1,223,1,223,1,223,
+ 3,223,1787,8,223,1,223,5,223,1790,8,223,10,223,12,223,1793,9,223,
+ 1,223,3,223,1796,8,223,1,223,1,223,1,224,1,224,1,224,1,224,1,225,
+ 1,225,1,226,1,226,1,226,1,226,1,226,1,226,1,226,1,226,1,226,1,226,
+ 1,226,4,226,1817,8,226,11,226,12,226,1818,1,227,1,227,1,227,1,227,
+ 1,228,1,228,1,228,1,228,1,228,1,229,1,229,1,229,1,229,1,229,4,229,
+ 1835,8,229,11,229,12,229,1836,1,230,1,230,1,230,1,230,1,231,1,231,
+ 1,231,1,231,1,231,1,231,1,232,1,232,1,232,1,232,1,232,1,232,1,233,
+ 1,233,1,233,1,233,5,233,1859,8,233,10,233,12,233,1862,9,233,1,233,
+ 1,233,1,233,1,233,1,233,1,234,1,234,1,234,1,234,3,234,1873,8,234,
+ 1,234,5,234,1876,8,234,10,234,12,234,1879,9,234,1,234,3,234,1882,
+ 8,234,1,234,1,234,1,235,1,235,5,235,1888,8,235,10,235,12,235,1891,
+ 9,235,1,235,1,235,1,236,1,236,1,236,1,236,1,237,1,237,1,237,1,237,
+ 1,238,4,238,1904,8,238,11,238,12,238,1905,1,238,1,238,1,239,1,239,
+ 1,239,1,239,1,239,1,240,1,240,1,240,1,240,1,241,1,241,1,241,1,241,
+ 1,241,1,242,1,242,1,242,1,242,5,242,1928,8,242,10,242,12,242,1931,
+ 9,242,1,242,1,242,1,242,1,242,1,242,1,243,1,243,1,243,1,243,3,243,
+ 1942,8,243,1,243,5,243,1945,8,243,10,243,12,243,1948,9,243,1,243,
+ 3,243,1951,8,243,1,243,1,243,1,244,1,244,5,244,1957,8,244,10,244,
+ 12,244,1960,9,244,1,244,1,244,1,245,4,245,1965,8,245,11,245,12,245,
+ 1966,1,245,1,245,1,246,1,246,1,246,1,246,1,247,4,247,1976,8,247,
+ 11,247,12,247,1977,1,248,1,248,1,248,1,248,1,248,1,249,1,249,1,249,
+ 1,249,1,249,1,249,1,249,1,250,1,250,1,250,1,250,1,250,1,251,4,251,
+ 1998,8,251,11,251,12,251,1999,1,251,1,251,3,1774,1860,1929,0,252,
+ 6,1,8,2,10,3,12,4,14,5,16,6,18,7,20,8,22,9,24,10,26,11,28,12,30,
+ 13,32,14,34,15,36,16,38,17,40,18,42,19,44,20,46,21,48,22,50,23,52,
+ 24,54,25,56,26,58,27,60,28,62,29,64,30,66,31,68,32,70,33,72,34,74,
+ 35,76,36,78,37,80,38,82,39,84,40,86,41,88,42,90,43,92,44,94,45,96,
+ 46,98,47,100,48,102,49,104,50,106,51,108,52,110,53,112,54,114,55,
+ 116,56,118,57,120,58,122,59,124,60,126,61,128,62,130,63,132,64,134,
+ 65,136,66,138,67,140,68,142,69,144,70,146,71,148,72,150,73,152,74,
+ 154,75,156,76,158,77,160,78,162,79,164,80,166,81,168,82,170,83,172,
+ 84,174,85,176,86,178,87,180,88,182,89,184,90,186,91,188,92,190,93,
+ 192,94,194,95,196,96,198,97,200,98,202,99,204,100,206,101,208,102,
+ 210,103,212,104,214,105,216,106,218,107,220,108,222,109,224,110,
+ 226,111,228,112,230,113,232,114,234,115,236,116,238,117,240,118,
+ 242,119,244,120,246,121,248,122,250,123,252,124,254,125,256,126,
+ 258,127,260,128,262,129,264,130,266,131,268,132,270,133,272,134,
+ 274,135,276,136,278,137,280,138,282,139,284,140,286,141,288,142,
+ 290,143,292,0,294,0,296,0,298,0,300,0,302,0,304,0,306,0,308,0,310,
+ 0,312,0,314,0,316,0,318,0,320,0,322,0,324,0,326,0,328,0,330,0,332,
+ 0,334,0,336,0,338,0,340,0,342,0,344,0,346,0,348,0,350,0,352,0,354,
+ 144,356,145,358,146,360,147,362,148,364,149,366,150,368,151,370,
+ 152,372,153,374,154,376,155,378,156,380,157,382,158,384,159,386,
+ 160,388,161,390,162,392,163,394,164,396,165,398,166,400,0,402,0,
+ 404,167,406,168,408,169,410,170,412,171,414,172,416,173,418,174,
+ 420,175,422,176,424,177,426,178,428,179,430,180,432,181,434,182,
+ 436,183,438,184,440,185,442,186,444,187,446,188,448,189,450,190,
+ 452,191,454,192,456,193,458,194,460,195,462,0,464,196,466,197,468,
+ 0,470,0,472,198,474,199,476,0,478,0,480,0,482,200,484,0,486,0,488,
+ 0,490,201,492,202,494,0,496,203,498,0,500,204,502,0,504,0,506,0,
+ 508,205,6,0,1,2,3,4,5,43,2,0,92,92,96,96,2,0,34,34,92,92,2,0,79,
+ 79,111,111,2,0,66,66,98,98,2,0,39,39,92,92,2,0,65,65,97,97,2,0,67,
+ 67,99,99,2,0,68,68,100,100,2,0,69,69,101,101,2,0,70,70,102,102,2,
+ 0,71,71,103,103,2,0,72,72,104,104,2,0,73,73,105,105,2,0,74,74,106,
+ 106,2,0,75,75,107,107,2,0,76,76,108,108,2,0,77,77,109,109,2,0,78,
+ 78,110,110,2,0,80,80,112,112,2,0,81,81,113,113,2,0,82,82,114,114,
+ 2,0,83,83,115,115,2,0,84,84,116,116,2,0,85,85,117,117,2,0,86,86,
+ 118,118,2,0,87,87,119,119,2,0,88,88,120,120,2,0,89,89,121,121,2,
+ 0,90,90,122,122,2,0,65,90,97,122,1,0,48,49,1,0,48,55,1,0,48,57,3,
+ 0,48,57,65,70,97,102,2,0,10,10,13,13,2,1,10,10,13,13,11,0,9,13,32,
+ 32,133,133,160,160,5760,5760,8192,8202,8232,8233,8239,8239,8287,
+ 8287,12288,12288,65279,65279,3,0,39,39,92,92,123,123,1,0,123,123,
+ 3,0,65,90,95,95,97,122,5,0,45,45,48,57,65,90,95,95,97,122,3,0,9,
+ 10,13,13,32,32,2,0,60,60,123,123,2048,0,6,1,0,0,0,0,8,1,0,0,0,0,
+ 10,1,0,0,0,0,12,1,0,0,0,0,14,1,0,0,0,0,16,1,0,0,0,0,18,1,0,0,0,0,
+ 20,1,0,0,0,0,22,1,0,0,0,0,24,1,0,0,0,0,26,1,0,0,0,0,28,1,0,0,0,0,
+ 30,1,0,0,0,0,32,1,0,0,0,0,34,1,0,0,0,0,36,1,0,0,0,0,38,1,0,0,0,0,
+ 40,1,0,0,0,0,42,1,0,0,0,0,44,1,0,0,0,0,46,1,0,0,0,0,48,1,0,0,0,0,
+ 50,1,0,0,0,0,52,1,0,0,0,0,54,1,0,0,0,0,56,1,0,0,0,0,58,1,0,0,0,0,
+ 60,1,0,0,0,0,62,1,0,0,0,0,64,1,0,0,0,0,66,1,0,0,0,0,68,1,0,0,0,0,
+ 70,1,0,0,0,0,72,1,0,0,0,0,74,1,0,0,0,0,76,1,0,0,0,0,78,1,0,0,0,0,
+ 80,1,0,0,0,0,82,1,0,0,0,0,84,1,0,0,0,0,86,1,0,0,0,0,88,1,0,0,0,0,
+ 90,1,0,0,0,0,92,1,0,0,0,0,94,1,0,0,0,0,96,1,0,0,0,0,98,1,0,0,0,0,
+ 100,1,0,0,0,0,102,1,0,0,0,0,104,1,0,0,0,0,106,1,0,0,0,0,108,1,0,
+ 0,0,0,110,1,0,0,0,0,112,1,0,0,0,0,114,1,0,0,0,0,116,1,0,0,0,0,118,
+ 1,0,0,0,0,120,1,0,0,0,0,122,1,0,0,0,0,124,1,0,0,0,0,126,1,0,0,0,
+ 0,128,1,0,0,0,0,130,1,0,0,0,0,132,1,0,0,0,0,134,1,0,0,0,0,136,1,
+ 0,0,0,0,138,1,0,0,0,0,140,1,0,0,0,0,142,1,0,0,0,0,144,1,0,0,0,0,
+ 146,1,0,0,0,0,148,1,0,0,0,0,150,1,0,0,0,0,152,1,0,0,0,0,154,1,0,
+ 0,0,0,156,1,0,0,0,0,158,1,0,0,0,0,160,1,0,0,0,0,162,1,0,0,0,0,164,
+ 1,0,0,0,0,166,1,0,0,0,0,168,1,0,0,0,0,170,1,0,0,0,0,172,1,0,0,0,
+ 0,174,1,0,0,0,0,176,1,0,0,0,0,178,1,0,0,0,0,180,1,0,0,0,0,182,1,
+ 0,0,0,0,184,1,0,0,0,0,186,1,0,0,0,0,188,1,0,0,0,0,190,1,0,0,0,0,
+ 192,1,0,0,0,0,194,1,0,0,0,0,196,1,0,0,0,0,198,1,0,0,0,0,200,1,0,
+ 0,0,0,202,1,0,0,0,0,204,1,0,0,0,0,206,1,0,0,0,0,208,1,0,0,0,0,210,
+ 1,0,0,0,0,212,1,0,0,0,0,214,1,0,0,0,0,216,1,0,0,0,0,218,1,0,0,0,
+ 0,220,1,0,0,0,0,222,1,0,0,0,0,224,1,0,0,0,0,226,1,0,0,0,0,228,1,
+ 0,0,0,0,230,1,0,0,0,0,232,1,0,0,0,0,234,1,0,0,0,0,236,1,0,0,0,0,
+ 238,1,0,0,0,0,240,1,0,0,0,0,242,1,0,0,0,0,244,1,0,0,0,0,246,1,0,
+ 0,0,0,248,1,0,0,0,0,250,1,0,0,0,0,252,1,0,0,0,0,254,1,0,0,0,0,256,
+ 1,0,0,0,0,258,1,0,0,0,0,260,1,0,0,0,0,262,1,0,0,0,0,264,1,0,0,0,
+ 0,266,1,0,0,0,0,268,1,0,0,0,0,270,1,0,0,0,0,272,1,0,0,0,0,274,1,
+ 0,0,0,0,276,1,0,0,0,0,278,1,0,0,0,0,280,1,0,0,0,0,282,1,0,0,0,0,
+ 284,1,0,0,0,0,286,1,0,0,0,0,288,1,0,0,0,0,290,1,0,0,0,0,354,1,0,
+ 0,0,0,356,1,0,0,0,0,358,1,0,0,0,0,360,1,0,0,0,0,362,1,0,0,0,0,364,
+ 1,0,0,0,0,366,1,0,0,0,0,368,1,0,0,0,0,370,1,0,0,0,0,372,1,0,0,0,
+ 0,374,1,0,0,0,0,376,1,0,0,0,0,378,1,0,0,0,0,380,1,0,0,0,0,382,1,
+ 0,0,0,0,384,1,0,0,0,0,386,1,0,0,0,0,388,1,0,0,0,0,390,1,0,0,0,0,
+ 392,1,0,0,0,0,394,1,0,0,0,0,396,1,0,0,0,0,398,1,0,0,0,0,400,1,0,
+ 0,0,0,402,1,0,0,0,0,404,1,0,0,0,0,406,1,0,0,0,0,408,1,0,0,0,0,410,
+ 1,0,0,0,0,412,1,0,0,0,0,414,1,0,0,0,0,416,1,0,0,0,0,418,1,0,0,0,
+ 0,420,1,0,0,0,0,422,1,0,0,0,0,424,1,0,0,0,0,426,1,0,0,0,0,428,1,
+ 0,0,0,0,430,1,0,0,0,0,432,1,0,0,0,0,434,1,0,0,0,0,436,1,0,0,0,0,
+ 438,1,0,0,0,0,440,1,0,0,0,0,442,1,0,0,0,0,444,1,0,0,0,0,446,1,0,
+ 0,0,0,448,1,0,0,0,0,450,1,0,0,0,0,452,1,0,0,0,0,454,1,0,0,0,0,456,
+ 1,0,0,0,1,458,1,0,0,0,1,460,1,0,0,0,1,462,1,0,0,0,2,464,1,0,0,0,
+ 2,466,1,0,0,0,3,468,1,0,0,0,3,470,1,0,0,0,3,472,1,0,0,0,3,474,1,
+ 0,0,0,3,476,1,0,0,0,3,478,1,0,0,0,3,480,1,0,0,0,3,482,1,0,0,0,3,
+ 484,1,0,0,0,3,486,1,0,0,0,4,488,1,0,0,0,4,490,1,0,0,0,4,492,1,0,
+ 0,0,4,494,1,0,0,0,4,496,1,0,0,0,4,498,1,0,0,0,5,500,1,0,0,0,5,502,
+ 1,0,0,0,5,504,1,0,0,0,5,506,1,0,0,0,5,508,1,0,0,0,6,510,1,0,0,0,
+ 8,514,1,0,0,0,10,518,1,0,0,0,12,523,1,0,0,0,14,527,1,0,0,0,16,533,
+ 1,0,0,0,18,550,1,0,0,0,20,552,1,0,0,0,22,557,1,0,0,0,24,565,1,0,
+ 0,0,26,570,1,0,0,0,28,573,1,0,0,0,30,578,1,0,0,0,32,583,1,0,0,0,
+ 34,589,1,0,0,0,36,596,1,0,0,0,38,604,1,0,0,0,40,612,1,0,0,0,42,618,
+ 1,0,0,0,44,623,1,0,0,0,46,631,1,0,0,0,48,636,1,0,0,0,50,640,1,0,
+ 0,0,52,645,1,0,0,0,54,656,1,0,0,0,56,665,1,0,0,0,58,670,1,0,0,0,
+ 60,674,1,0,0,0,62,681,1,0,0,0,64,689,1,0,0,0,66,697,1,0,0,0,68,703,
+ 1,0,0,0,70,708,1,0,0,0,72,715,1,0,0,0,74,723,1,0,0,0,76,729,1,0,
+ 0,0,78,732,1,0,0,0,80,742,1,0,0,0,82,746,1,0,0,0,84,751,1,0,0,0,
+ 86,756,1,0,0,0,88,760,1,0,0,0,90,766,1,0,0,0,92,775,1,0,0,0,94,782,
+ 1,0,0,0,96,787,1,0,0,0,98,790,1,0,0,0,100,793,1,0,0,0,102,799,1,
+ 0,0,0,104,806,1,0,0,0,106,814,1,0,0,0,108,830,1,0,0,0,110,832,1,
+ 0,0,0,112,838,1,0,0,0,114,848,1,0,0,0,116,860,1,0,0,0,118,869,1,
+ 0,0,0,120,872,1,0,0,0,122,877,1,0,0,0,124,881,1,0,0,0,126,888,1,
+ 0,0,0,128,893,1,0,0,0,130,901,1,0,0,0,132,906,1,0,0,0,134,910,1,
+ 0,0,0,136,915,1,0,0,0,138,921,1,0,0,0,140,934,1,0,0,0,142,941,1,
+ 0,0,0,144,947,1,0,0,0,146,952,1,0,0,0,148,960,1,0,0,0,150,964,1,
+ 0,0,0,152,968,1,0,0,0,154,973,1,0,0,0,156,979,1,0,0,0,158,986,1,
+ 0,0,0,160,989,1,0,0,0,162,992,1,0,0,0,164,998,1,0,0,0,166,1004,1,
+ 0,0,0,168,1009,1,0,0,0,170,1019,1,0,0,0,172,1025,1,0,0,0,174,1036,
+ 1,0,0,0,176,1046,1,0,0,0,178,1055,1,0,0,0,180,1063,1,0,0,0,182,1071,
+ 1,0,0,0,184,1077,1,0,0,0,186,1087,1,0,0,0,188,1095,1,0,0,0,190,1102,
+ 1,0,0,0,192,1108,1,0,0,0,194,1115,1,0,0,0,196,1119,1,0,0,0,198,1124,
+ 1,0,0,0,200,1131,1,0,0,0,202,1138,1,0,0,0,204,1145,1,0,0,0,206,1150,
+ 1,0,0,0,208,1155,1,0,0,0,210,1164,1,0,0,0,212,1169,1,0,0,0,214,1179,
+ 1,0,0,0,216,1184,1,0,0,0,218,1190,1,0,0,0,220,1195,1,0,0,0,222,1205,
+ 1,0,0,0,224,1210,1,0,0,0,226,1216,1,0,0,0,228,1221,1,0,0,0,230,1224,
+ 1,0,0,0,232,1228,1,0,0,0,234,1235,1,0,0,0,236,1244,1,0,0,0,238,1249,
+ 1,0,0,0,240,1258,1,0,0,0,242,1262,1,0,0,0,244,1271,1,0,0,0,246,1281,
+ 1,0,0,0,248,1287,1,0,0,0,250,1295,1,0,0,0,252,1301,1,0,0,0,254,1308,
+ 1,0,0,0,256,1313,1,0,0,0,258,1318,1,0,0,0,260,1324,1,0,0,0,262,1330,
+ 1,0,0,0,264,1337,1,0,0,0,266,1342,1,0,0,0,268,1359,1,0,0,0,270,1393,
+ 1,0,0,0,272,1398,1,0,0,0,274,1441,1,0,0,0,276,1513,1,0,0,0,278,1515,
+ 1,0,0,0,280,1522,1,0,0,0,282,1529,1,0,0,0,284,1533,1,0,0,0,286,1540,
+ 1,0,0,0,288,1547,1,0,0,0,290,1554,1,0,0,0,292,1570,1,0,0,0,294,1572,
+ 1,0,0,0,296,1574,1,0,0,0,298,1576,1,0,0,0,300,1578,1,0,0,0,302,1580,
+ 1,0,0,0,304,1582,1,0,0,0,306,1584,1,0,0,0,308,1586,1,0,0,0,310,1588,
+ 1,0,0,0,312,1590,1,0,0,0,314,1592,1,0,0,0,316,1594,1,0,0,0,318,1596,
+ 1,0,0,0,320,1598,1,0,0,0,322,1600,1,0,0,0,324,1602,1,0,0,0,326,1604,
+ 1,0,0,0,328,1606,1,0,0,0,330,1608,1,0,0,0,332,1610,1,0,0,0,334,1612,
+ 1,0,0,0,336,1614,1,0,0,0,338,1616,1,0,0,0,340,1618,1,0,0,0,342,1620,
+ 1,0,0,0,344,1622,1,0,0,0,346,1624,1,0,0,0,348,1626,1,0,0,0,350,1628,
+ 1,0,0,0,352,1630,1,0,0,0,354,1632,1,0,0,0,356,1635,1,0,0,0,358,1637,
+ 1,0,0,0,360,1639,1,0,0,0,362,1641,1,0,0,0,364,1644,1,0,0,0,366,1647,
+ 1,0,0,0,368,1649,1,0,0,0,370,1651,1,0,0,0,372,1654,1,0,0,0,374,1656,
+ 1,0,0,0,376,1658,1,0,0,0,378,1660,1,0,0,0,380,1663,1,0,0,0,382,1665,
+ 1,0,0,0,384,1668,1,0,0,0,386,1670,1,0,0,0,388,1672,1,0,0,0,390,1675,
+ 1,0,0,0,392,1679,1,0,0,0,394,1683,1,0,0,0,396,1685,1,0,0,0,398,1687,
+ 1,0,0,0,400,1690,1,0,0,0,402,1696,1,0,0,0,404,1702,1,0,0,0,406,1704,
+ 1,0,0,0,408,1711,1,0,0,0,410,1713,1,0,0,0,412,1717,1,0,0,0,414,1720,
+ 1,0,0,0,416,1723,1,0,0,0,418,1726,1,0,0,0,420,1728,1,0,0,0,422,1730,
+ 1,0,0,0,424,1732,1,0,0,0,426,1734,1,0,0,0,428,1739,1,0,0,0,430,1744,
+ 1,0,0,0,432,1746,1,0,0,0,434,1748,1,0,0,0,436,1751,1,0,0,0,438,1755,
+ 1,0,0,0,440,1757,1,0,0,0,442,1759,1,0,0,0,444,1761,1,0,0,0,446,1763,
+ 1,0,0,0,448,1766,1,0,0,0,450,1768,1,0,0,0,452,1786,1,0,0,0,454,1799,
+ 1,0,0,0,456,1803,1,0,0,0,458,1816,1,0,0,0,460,1820,1,0,0,0,462,1824,
+ 1,0,0,0,464,1834,1,0,0,0,466,1838,1,0,0,0,468,1842,1,0,0,0,470,1848,
+ 1,0,0,0,472,1854,1,0,0,0,474,1872,1,0,0,0,476,1885,1,0,0,0,478,1894,
+ 1,0,0,0,480,1898,1,0,0,0,482,1903,1,0,0,0,484,1909,1,0,0,0,486,1914,
+ 1,0,0,0,488,1918,1,0,0,0,490,1923,1,0,0,0,492,1941,1,0,0,0,494,1954,
+ 1,0,0,0,496,1964,1,0,0,0,498,1970,1,0,0,0,500,1975,1,0,0,0,502,1979,
+ 1,0,0,0,504,1984,1,0,0,0,506,1991,1,0,0,0,508,1997,1,0,0,0,510,511,
+ 3,292,143,0,511,512,3,314,154,0,512,513,3,314,154,0,513,7,1,0,0,
+ 0,514,515,3,292,143,0,515,516,3,318,156,0,516,517,3,298,146,0,517,
+ 9,1,0,0,0,518,519,3,292,143,0,519,520,3,318,156,0,520,521,3,330,
+ 162,0,521,522,3,308,151,0,522,11,1,0,0,0,523,524,3,292,143,0,524,
+ 525,3,318,156,0,525,526,3,340,167,0,526,13,1,0,0,0,527,528,3,292,
+ 143,0,528,529,3,326,160,0,529,530,3,326,160,0,530,531,3,292,143,
+ 0,531,532,3,340,167,0,532,15,1,0,0,0,533,534,3,292,143,0,534,535,
+ 3,328,161,0,535,17,1,0,0,0,536,537,3,292,143,0,537,538,3,328,161,
+ 0,538,539,3,296,145,0,539,551,1,0,0,0,540,541,3,292,143,0,541,542,
+ 3,328,161,0,542,543,3,296,145,0,543,544,3,300,147,0,544,545,3,318,
+ 156,0,545,546,3,298,146,0,546,547,3,308,151,0,547,548,3,318,156,
+ 0,548,549,3,304,149,0,549,551,1,0,0,0,550,536,1,0,0,0,550,540,1,
+ 0,0,0,551,19,1,0,0,0,552,553,3,292,143,0,553,554,3,328,161,0,554,
+ 555,3,320,157,0,555,556,3,302,148,0,556,21,1,0,0,0,557,558,3,294,
+ 144,0,558,559,3,300,147,0,559,560,3,330,162,0,560,561,3,336,165,
+ 0,561,562,3,300,147,0,562,563,3,300,147,0,563,564,3,318,156,0,564,
+ 23,1,0,0,0,565,566,3,294,144,0,566,567,3,320,157,0,567,568,3,330,
+ 162,0,568,569,3,306,150,0,569,25,1,0,0,0,570,571,3,294,144,0,571,
+ 572,3,340,167,0,572,27,1,0,0,0,573,574,3,296,145,0,574,575,3,292,
+ 143,0,575,576,3,328,161,0,576,577,3,300,147,0,577,29,1,0,0,0,578,
+ 579,3,296,145,0,579,580,3,292,143,0,580,581,3,328,161,0,581,582,
+ 3,330,162,0,582,31,1,0,0,0,583,584,3,296,145,0,584,585,3,292,143,
+ 0,585,586,3,330,162,0,586,587,3,296,145,0,587,588,3,306,150,0,588,
+ 33,1,0,0,0,589,590,3,296,145,0,590,591,3,320,157,0,591,592,3,306,
+ 150,0,592,593,3,320,157,0,593,594,3,326,160,0,594,595,3,330,162,
+ 0,595,35,1,0,0,0,596,597,3,296,145,0,597,598,3,320,157,0,598,599,
+ 3,314,154,0,599,600,3,314,154,0,600,601,3,292,143,0,601,602,3,330,
+ 162,0,602,603,3,300,147,0,603,37,1,0,0,0,604,605,3,296,145,0,605,
+ 606,3,320,157,0,606,607,3,314,154,0,607,608,3,332,163,0,608,609,
+ 3,316,155,0,609,610,3,318,156,0,610,611,3,328,161,0,611,39,1,0,0,
+ 0,612,613,3,296,145,0,613,614,3,326,160,0,614,615,3,320,157,0,615,
+ 616,3,328,161,0,616,617,3,328,161,0,617,41,1,0,0,0,618,619,3,296,
+ 145,0,619,620,3,332,163,0,620,621,3,294,144,0,621,622,3,300,147,
+ 0,622,43,1,0,0,0,623,624,3,296,145,0,624,625,3,332,163,0,625,626,
+ 3,326,160,0,626,627,3,326,160,0,627,628,3,300,147,0,628,629,3,318,
+ 156,0,629,630,3,330,162,0,630,45,1,0,0,0,631,632,3,298,146,0,632,
+ 633,3,292,143,0,633,634,3,330,162,0,634,635,3,300,147,0,635,47,1,
+ 0,0,0,636,637,3,298,146,0,637,638,3,292,143,0,638,639,3,340,167,
+ 0,639,49,1,0,0,0,640,641,3,298,146,0,641,642,3,300,147,0,642,643,
+ 3,328,161,0,643,644,3,296,145,0,644,51,1,0,0,0,645,646,3,298,146,
+ 0,646,647,3,300,147,0,647,648,3,328,161,0,648,649,3,296,145,0,649,
+ 650,3,300,147,0,650,651,3,318,156,0,651,652,3,298,146,0,652,653,
+ 3,308,151,0,653,654,3,318,156,0,654,655,3,304,149,0,655,53,1,0,0,
+ 0,656,657,3,298,146,0,657,658,3,308,151,0,658,659,3,328,161,0,659,
+ 660,3,330,162,0,660,661,3,308,151,0,661,662,3,318,156,0,662,663,
+ 3,296,145,0,663,664,3,330,162,0,664,55,1,0,0,0,665,666,3,300,147,
+ 0,666,667,3,314,154,0,667,668,3,328,161,0,668,669,3,300,147,0,669,
+ 57,1,0,0,0,670,671,3,300,147,0,671,672,3,318,156,0,672,673,3,298,
+ 146,0,673,59,1,0,0,0,674,675,3,300,147,0,675,676,3,338,166,0,676,
+ 677,3,296,145,0,677,678,3,300,147,0,678,679,3,322,158,0,679,680,
+ 3,330,162,0,680,61,1,0,0,0,681,682,3,300,147,0,682,683,3,338,166,
+ 0,683,684,3,296,145,0,684,685,3,314,154,0,685,686,3,332,163,0,686,
+ 687,3,298,146,0,687,688,3,300,147,0,688,63,1,0,0,0,689,690,3,300,
+ 147,0,690,691,3,338,166,0,691,692,3,330,162,0,692,693,3,326,160,
+ 0,693,694,3,292,143,0,694,695,3,296,145,0,695,696,3,330,162,0,696,
+ 65,1,0,0,0,697,698,3,302,148,0,698,699,3,308,151,0,699,700,3,318,
+ 156,0,700,701,3,292,143,0,701,702,3,314,154,0,702,67,1,0,0,0,703,
+ 704,3,302,148,0,704,705,3,308,151,0,705,706,3,314,154,0,706,707,
+ 3,314,154,0,707,69,1,0,0,0,708,709,3,302,148,0,709,710,3,308,151,
+ 0,710,711,3,314,154,0,711,712,3,330,162,0,712,713,3,300,147,0,713,
+ 714,3,326,160,0,714,71,1,0,0,0,715,716,3,302,148,0,716,717,3,308,
+ 151,0,717,718,3,318,156,0,718,719,3,292,143,0,719,720,3,314,154,
+ 0,720,721,3,314,154,0,721,722,3,340,167,0,722,73,1,0,0,0,723,724,
+ 3,302,148,0,724,725,3,308,151,0,725,726,3,326,160,0,726,727,3,328,
+ 161,0,727,728,3,330,162,0,728,75,1,0,0,0,729,730,3,302,148,0,730,
+ 731,3,318,156,0,731,77,1,0,0,0,732,733,3,302,148,0,733,734,3,320,
+ 157,0,734,735,3,314,154,0,735,736,3,314,154,0,736,737,3,320,157,
+ 0,737,738,3,336,165,0,738,739,3,308,151,0,739,740,3,318,156,0,740,
+ 741,3,304,149,0,741,79,1,0,0,0,742,743,3,302,148,0,743,744,3,320,
+ 157,0,744,745,3,326,160,0,745,81,1,0,0,0,746,747,3,302,148,0,747,
+ 748,3,326,160,0,748,749,3,320,157,0,749,750,3,316,155,0,750,83,1,
+ 0,0,0,751,752,3,302,148,0,752,753,3,332,163,0,753,754,3,314,154,
+ 0,754,755,3,314,154,0,755,85,1,0,0,0,756,757,3,302,148,0,757,758,
+ 3,332,163,0,758,759,3,318,156,0,759,87,1,0,0,0,760,761,3,304,149,
+ 0,761,762,3,326,160,0,762,763,3,320,157,0,763,764,3,332,163,0,764,
+ 765,3,322,158,0,765,89,1,0,0,0,766,767,3,304,149,0,767,768,3,326,
+ 160,0,768,769,3,320,157,0,769,770,3,332,163,0,770,771,3,322,158,
+ 0,771,772,3,308,151,0,772,773,3,318,156,0,773,774,3,304,149,0,774,
+ 91,1,0,0,0,775,776,3,306,150,0,776,777,3,292,143,0,777,778,3,334,
+ 164,0,778,779,3,308,151,0,779,780,3,318,156,0,780,781,3,304,149,
+ 0,781,93,1,0,0,0,782,783,3,306,150,0,783,784,3,320,157,0,784,785,
+ 3,332,163,0,785,786,3,326,160,0,786,95,1,0,0,0,787,788,3,308,151,
+ 0,788,789,3,298,146,0,789,97,1,0,0,0,790,791,3,308,151,0,791,792,
+ 3,302,148,0,792,99,1,0,0,0,793,794,3,308,151,0,794,795,3,314,154,
+ 0,795,796,3,308,151,0,796,797,3,312,153,0,797,798,3,300,147,0,798,
+ 101,1,0,0,0,799,800,3,308,151,0,800,801,3,304,149,0,801,802,3,318,
+ 156,0,802,803,3,320,157,0,803,804,3,326,160,0,804,805,3,300,147,
+ 0,805,103,1,0,0,0,806,807,3,308,151,0,807,808,3,318,156,0,808,809,
+ 3,296,145,0,809,810,3,314,154,0,810,811,3,332,163,0,811,812,3,298,
+ 146,0,812,813,3,300,147,0,813,105,1,0,0,0,814,815,3,308,151,0,815,
+ 816,3,318,156,0,816,107,1,0,0,0,817,818,3,308,151,0,818,819,3,318,
+ 156,0,819,820,3,302,148,0,820,831,1,0,0,0,821,822,3,308,151,0,822,
+ 823,3,318,156,0,823,824,3,302,148,0,824,825,3,308,151,0,825,826,
+ 3,318,156,0,826,827,3,308,151,0,827,828,3,330,162,0,828,829,3,340,
+ 167,0,829,831,1,0,0,0,830,817,1,0,0,0,830,821,1,0,0,0,831,109,1,
+ 0,0,0,832,833,3,308,151,0,833,834,3,318,156,0,834,835,3,318,156,
+ 0,835,836,3,300,147,0,836,837,3,326,160,0,837,111,1,0,0,0,838,839,
+ 3,308,151,0,839,840,3,318,156,0,840,841,3,330,162,0,841,842,3,300,
+ 147,0,842,843,3,326,160,0,843,844,3,328,161,0,844,845,3,300,147,
+ 0,845,846,3,296,145,0,846,847,3,330,162,0,847,113,1,0,0,0,848,849,
+ 3,308,151,0,849,850,3,318,156,0,850,851,3,330,162,0,851,852,3,300,
+ 147,0,852,853,3,326,160,0,853,854,3,322,158,0,854,855,3,320,157,
+ 0,855,856,3,314,154,0,856,857,3,292,143,0,857,858,3,330,162,0,858,
+ 859,3,300,147,0,859,115,1,0,0,0,860,861,3,308,151,0,861,862,3,318,
+ 156,0,862,863,3,330,162,0,863,864,3,300,147,0,864,865,3,326,160,
+ 0,865,866,3,334,164,0,866,867,3,292,143,0,867,868,3,314,154,0,868,
+ 117,1,0,0,0,869,870,3,308,151,0,870,871,3,328,161,0,871,119,1,0,
+ 0,0,872,873,3,310,152,0,873,874,3,320,157,0,874,875,3,308,151,0,
+ 875,876,3,318,156,0,876,121,1,0,0,0,877,878,3,312,153,0,878,879,
+ 3,300,147,0,879,880,3,340,167,0,880,123,1,0,0,0,881,882,3,314,154,
+ 0,882,883,3,292,143,0,883,884,3,316,155,0,884,885,3,294,144,0,885,
+ 886,3,298,146,0,886,887,3,292,143,0,887,125,1,0,0,0,888,889,3,314,
+ 154,0,889,890,3,292,143,0,890,891,3,328,161,0,891,892,3,330,162,
+ 0,892,127,1,0,0,0,893,894,3,314,154,0,894,895,3,300,147,0,895,896,
+ 3,292,143,0,896,897,3,298,146,0,897,898,3,308,151,0,898,899,3,318,
+ 156,0,899,900,3,304,149,0,900,129,1,0,0,0,901,902,3,314,154,0,902,
+ 903,3,300,147,0,903,904,3,302,148,0,904,905,3,330,162,0,905,131,
+ 1,0,0,0,906,907,3,314,154,0,907,908,3,300,147,0,908,909,3,330,162,
+ 0,909,133,1,0,0,0,910,911,3,314,154,0,911,912,3,308,151,0,912,913,
+ 3,312,153,0,913,914,3,300,147,0,914,135,1,0,0,0,915,916,3,314,154,
+ 0,916,917,3,308,151,0,917,918,3,316,155,0,918,919,3,308,151,0,919,
+ 920,3,330,162,0,920,137,1,0,0,0,921,922,3,316,155,0,922,923,3,292,
+ 143,0,923,924,3,330,162,0,924,925,3,300,147,0,925,926,3,326,160,
+ 0,926,927,3,308,151,0,927,928,3,292,143,0,928,929,3,314,154,0,929,
+ 930,3,308,151,0,930,931,3,342,168,0,931,932,3,300,147,0,932,933,
+ 3,298,146,0,933,139,1,0,0,0,934,935,3,316,155,0,935,936,3,308,151,
+ 0,936,937,3,318,156,0,937,938,3,332,163,0,938,939,3,330,162,0,939,
+ 940,3,300,147,0,940,141,1,0,0,0,941,942,3,316,155,0,942,943,3,320,
+ 157,0,943,944,3,318,156,0,944,945,3,330,162,0,945,946,3,306,150,
+ 0,946,143,1,0,0,0,947,948,3,318,156,0,948,949,3,292,143,0,949,950,
+ 3,316,155,0,950,951,3,300,147,0,951,145,1,0,0,0,952,953,3,318,156,
+ 0,953,954,3,292,143,0,954,955,3,330,162,0,955,956,3,332,163,0,956,
+ 957,3,326,160,0,957,958,3,292,143,0,958,959,3,314,154,0,959,147,
+ 1,0,0,0,960,961,3,318,156,0,961,962,3,292,143,0,962,963,3,318,156,
+ 0,963,149,1,0,0,0,964,965,3,318,156,0,965,966,3,320,157,0,966,967,
+ 3,330,162,0,967,151,1,0,0,0,968,969,3,318,156,0,969,970,3,332,163,
+ 0,970,971,3,314,154,0,971,972,3,314,154,0,972,153,1,0,0,0,973,974,
+ 3,318,156,0,974,975,3,332,163,0,975,976,3,314,154,0,976,977,3,314,
+ 154,0,977,978,3,328,161,0,978,155,1,0,0,0,979,980,3,320,157,0,980,
+ 981,3,302,148,0,981,982,3,302,148,0,982,983,3,328,161,0,983,984,
+ 3,300,147,0,984,985,3,330,162,0,985,157,1,0,0,0,986,987,3,320,157,
+ 0,987,988,3,318,156,0,988,159,1,0,0,0,989,990,3,320,157,0,990,991,
+ 3,326,160,0,991,161,1,0,0,0,992,993,3,320,157,0,993,994,3,326,160,
+ 0,994,995,3,298,146,0,995,996,3,300,147,0,996,997,3,326,160,0,997,
+ 163,1,0,0,0,998,999,3,320,157,0,999,1000,3,332,163,0,1000,1001,3,
+ 330,162,0,1001,1002,3,300,147,0,1002,1003,3,326,160,0,1003,165,1,
+ 0,0,0,1004,1005,3,320,157,0,1005,1006,3,334,164,0,1006,1007,3,300,
+ 147,0,1007,1008,3,326,160,0,1008,167,1,0,0,0,1009,1010,3,322,158,
+ 0,1010,1011,3,292,143,0,1011,1012,3,326,160,0,1012,1013,3,330,162,
+ 0,1013,1014,3,308,151,0,1014,1015,3,330,162,0,1015,1016,3,308,151,
+ 0,1016,1017,3,320,157,0,1017,1018,3,318,156,0,1018,169,1,0,0,0,1019,
+ 1020,3,322,158,0,1020,1021,3,308,151,0,1021,1022,3,334,164,0,1022,
+ 1023,3,320,157,0,1023,1024,3,330,162,0,1024,171,1,0,0,0,1025,1026,
+ 3,322,158,0,1026,1027,3,320,157,0,1027,1028,3,328,161,0,1028,1029,
+ 3,308,151,0,1029,1030,3,330,162,0,1030,1031,3,308,151,0,1031,1032,
+ 3,320,157,0,1032,1033,3,318,156,0,1033,1034,3,292,143,0,1034,1035,
+ 3,314,154,0,1035,173,1,0,0,0,1036,1037,3,322,158,0,1037,1038,3,326,
+ 160,0,1038,1039,3,300,147,0,1039,1040,3,296,145,0,1040,1041,3,300,
+ 147,0,1041,1042,3,298,146,0,1042,1043,3,308,151,0,1043,1044,3,318,
+ 156,0,1044,1045,3,304,149,0,1045,175,1,0,0,0,1046,1047,3,322,158,
+ 0,1047,1048,3,326,160,0,1048,1049,3,300,147,0,1049,1050,3,336,165,
+ 0,1050,1051,3,306,150,0,1051,1052,3,300,147,0,1052,1053,3,326,160,
+ 0,1053,1054,3,300,147,0,1054,177,1,0,0,0,1055,1056,3,324,159,0,1056,
+ 1057,3,332,163,0,1057,1058,3,292,143,0,1058,1059,3,314,154,0,1059,
+ 1060,3,308,151,0,1060,1061,3,302,148,0,1061,1062,3,340,167,0,1062,
+ 179,1,0,0,0,1063,1064,3,324,159,0,1064,1065,3,332,163,0,1065,1066,
+ 3,292,143,0,1066,1067,3,326,160,0,1067,1068,3,330,162,0,1068,1069,
+ 3,300,147,0,1069,1070,3,326,160,0,1070,181,1,0,0,0,1071,1072,3,326,
+ 160,0,1072,1073,3,292,143,0,1073,1074,3,318,156,0,1074,1075,3,304,
+ 149,0,1075,1076,3,300,147,0,1076,183,1,0,0,0,1077,1078,3,326,160,
+ 0,1078,1079,3,300,147,0,1079,1080,3,296,145,0,1080,1081,3,332,163,
+ 0,1081,1082,3,326,160,0,1082,1083,3,328,161,0,1083,1084,3,308,151,
+ 0,1084,1085,3,334,164,0,1085,1086,3,300,147,0,1086,185,1,0,0,0,1087,
+ 1088,3,326,160,0,1088,1089,3,300,147,0,1089,1090,3,322,158,0,1090,
+ 1091,3,314,154,0,1091,1092,3,292,143,0,1092,1093,3,296,145,0,1093,
+ 1094,3,300,147,0,1094,187,1,0,0,0,1095,1096,3,326,160,0,1096,1097,
+ 3,300,147,0,1097,1098,3,330,162,0,1098,1099,3,332,163,0,1099,1100,
+ 3,326,160,0,1100,1101,3,318,156,0,1101,189,1,0,0,0,1102,1103,3,326,
+ 160,0,1103,1104,3,308,151,0,1104,1105,3,304,149,0,1105,1106,3,306,
+ 150,0,1106,1107,3,330,162,0,1107,191,1,0,0,0,1108,1109,3,326,160,
+ 0,1109,1110,3,320,157,0,1110,1111,3,314,154,0,1111,1112,3,314,154,
+ 0,1112,1113,3,332,163,0,1113,1114,3,322,158,0,1114,193,1,0,0,0,1115,
+ 1116,3,326,160,0,1116,1117,3,320,157,0,1117,1118,3,336,165,0,1118,
+ 195,1,0,0,0,1119,1120,3,326,160,0,1120,1121,3,320,157,0,1121,1122,
+ 3,336,165,0,1122,1123,3,328,161,0,1123,197,1,0,0,0,1124,1125,3,328,
+ 161,0,1125,1126,3,292,143,0,1126,1127,3,316,155,0,1127,1128,3,322,
+ 158,0,1128,1129,3,314,154,0,1129,1130,3,300,147,0,1130,199,1,0,0,
+ 0,1131,1132,3,328,161,0,1132,1133,3,300,147,0,1133,1134,3,296,145,
+ 0,1134,1135,3,320,157,0,1135,1136,3,318,156,0,1136,1137,3,298,146,
+ 0,1137,201,1,0,0,0,1138,1139,3,328,161,0,1139,1140,3,300,147,0,1140,
+ 1141,3,314,154,0,1141,1142,3,300,147,0,1142,1143,3,296,145,0,1143,
+ 1144,3,330,162,0,1144,203,1,0,0,0,1145,1146,3,328,161,0,1146,1147,
+ 3,300,147,0,1147,1148,3,316,155,0,1148,1149,3,308,151,0,1149,205,
+ 1,0,0,0,1150,1151,3,328,161,0,1151,1152,3,300,147,0,1152,1153,3,
+ 330,162,0,1153,1154,3,328,161,0,1154,207,1,0,0,0,1155,1156,3,328,
+ 161,0,1156,1157,3,300,147,0,1157,1158,3,330,162,0,1158,1159,3,330,
+ 162,0,1159,1160,3,308,151,0,1160,1161,3,318,156,0,1161,1162,3,304,
+ 149,0,1162,1163,3,328,161,0,1163,209,1,0,0,0,1164,1165,3,328,161,
+ 0,1165,1166,3,330,162,0,1166,1167,3,300,147,0,1167,1168,3,322,158,
+ 0,1168,211,1,0,0,0,1169,1170,3,328,161,0,1170,1171,3,332,163,0,1171,
+ 1172,3,294,144,0,1172,1173,3,328,161,0,1173,1174,3,330,162,0,1174,
+ 1175,3,326,160,0,1175,1176,3,308,151,0,1176,1177,3,318,156,0,1177,
+ 1178,3,304,149,0,1178,213,1,0,0,0,1179,1180,3,330,162,0,1180,1181,
+ 3,306,150,0,1181,1182,3,300,147,0,1182,1183,3,318,156,0,1183,215,
+ 1,0,0,0,1184,1185,3,330,162,0,1185,1186,3,306,150,0,1186,1187,3,
+ 326,160,0,1187,1188,3,320,157,0,1188,1189,3,336,165,0,1189,217,1,
+ 0,0,0,1190,1191,3,330,162,0,1191,1192,3,308,151,0,1192,1193,3,300,
+ 147,0,1193,1194,3,328,161,0,1194,219,1,0,0,0,1195,1196,3,330,162,
+ 0,1196,1197,3,308,151,0,1197,1198,3,316,155,0,1198,1199,3,300,147,
+ 0,1199,1200,3,328,161,0,1200,1201,3,330,162,0,1201,1202,3,292,143,
+ 0,1202,1203,3,316,155,0,1203,1204,3,322,158,0,1204,221,1,0,0,0,1205,
+ 1206,3,330,162,0,1206,1207,3,308,151,0,1207,1208,3,316,155,0,1208,
+ 1209,3,300,147,0,1209,223,1,0,0,0,1210,1211,3,314,154,0,1211,1212,
+ 3,320,157,0,1212,1213,3,296,145,0,1213,1214,3,292,143,0,1214,1215,
+ 3,314,154,0,1215,225,1,0,0,0,1216,1217,3,342,168,0,1217,1218,3,320,
+ 157,0,1218,1219,3,318,156,0,1219,1220,3,300,147,0,1220,227,1,0,0,
+ 0,1221,1222,3,330,162,0,1222,1223,3,320,157,0,1223,229,1,0,0,0,1224,
+ 1225,3,330,162,0,1225,1226,3,320,157,0,1226,1227,3,322,158,0,1227,
+ 231,1,0,0,0,1228,1229,3,330,162,0,1229,1230,3,320,157,0,1230,1231,
+ 3,330,162,0,1231,1232,3,292,143,0,1232,1233,3,314,154,0,1233,1234,
+ 3,328,161,0,1234,233,1,0,0,0,1235,1236,3,330,162,0,1236,1237,3,326,
+ 160,0,1237,1238,3,292,143,0,1238,1239,3,308,151,0,1239,1240,3,314,
+ 154,0,1240,1241,3,308,151,0,1241,1242,3,318,156,0,1242,1243,3,304,
+ 149,0,1243,235,1,0,0,0,1244,1245,3,330,162,0,1245,1246,3,326,160,
+ 0,1246,1247,3,308,151,0,1247,1248,3,316,155,0,1248,237,1,0,0,0,1249,
+ 1250,3,330,162,0,1250,1251,3,326,160,0,1251,1252,3,332,163,0,1252,
+ 1253,3,318,156,0,1253,1254,3,296,145,0,1254,1255,3,292,143,0,1255,
+ 1256,3,330,162,0,1256,1257,3,300,147,0,1257,239,1,0,0,0,1258,1259,
+ 3,330,162,0,1259,1260,3,326,160,0,1260,1261,3,340,167,0,1261,241,
+ 1,0,0,0,1262,1263,3,330,162,0,1263,1264,3,326,160,0,1264,1265,3,
+ 340,167,0,1265,1266,5,95,0,0,1266,1267,3,296,145,0,1267,1268,3,292,
+ 143,0,1268,1269,3,328,161,0,1269,1270,3,330,162,0,1270,243,1,0,0,
+ 0,1271,1272,3,332,163,0,1272,1273,3,318,156,0,1273,1274,3,294,144,
+ 0,1274,1275,3,320,157,0,1275,1276,3,332,163,0,1276,1277,3,318,156,
+ 0,1277,1278,3,298,146,0,1278,1279,3,300,147,0,1279,1280,3,298,146,
+ 0,1280,245,1,0,0,0,1281,1282,3,332,163,0,1282,1283,3,318,156,0,1283,
+ 1284,3,308,151,0,1284,1285,3,320,157,0,1285,1286,3,318,156,0,1286,
+ 247,1,0,0,0,1287,1288,3,332,163,0,1288,1289,3,318,156,0,1289,1290,
+ 3,322,158,0,1290,1291,3,308,151,0,1291,1292,3,334,164,0,1292,1293,
+ 3,320,157,0,1293,1294,3,330,162,0,1294,249,1,0,0,0,1295,1296,3,332,
+ 163,0,1296,1297,3,328,161,0,1297,1298,3,308,151,0,1298,1299,3,318,
+ 156,0,1299,1300,3,304,149,0,1300,251,1,0,0,0,1301,1302,3,334,164,
+ 0,1302,1303,3,292,143,0,1303,1304,3,314,154,0,1304,1305,3,332,163,
+ 0,1305,1306,3,300,147,0,1306,1307,3,328,161,0,1307,253,1,0,0,0,1308,
+ 1309,3,336,165,0,1309,1310,3,300,147,0,1310,1311,3,300,147,0,1311,
+ 1312,3,312,153,0,1312,255,1,0,0,0,1313,1314,3,336,165,0,1314,1315,
+ 3,306,150,0,1315,1316,3,300,147,0,1316,1317,3,318,156,0,1317,257,
+ 1,0,0,0,1318,1319,3,336,165,0,1319,1320,3,306,150,0,1320,1321,3,
+ 300,147,0,1321,1322,3,326,160,0,1322,1323,3,300,147,0,1323,259,1,
+ 0,0,0,1324,1325,3,336,165,0,1325,1326,3,306,150,0,1326,1327,3,308,
+ 151,0,1327,1328,3,314,154,0,1328,1329,3,300,147,0,1329,261,1,0,0,
+ 0,1330,1331,3,336,165,0,1331,1332,3,308,151,0,1332,1333,3,318,156,
+ 0,1333,1334,3,298,146,0,1334,1335,3,320,157,0,1335,1336,3,336,165,
+ 0,1336,263,1,0,0,0,1337,1338,3,336,165,0,1338,1339,3,308,151,0,1339,
+ 1340,3,330,162,0,1340,1341,3,306,150,0,1341,265,1,0,0,0,1342,1343,
+ 3,336,165,0,1343,1344,3,308,151,0,1344,1345,3,330,162,0,1345,1346,
+ 3,306,150,0,1346,1347,3,308,151,0,1347,1348,3,318,156,0,1348,267,
+ 1,0,0,0,1349,1350,3,340,167,0,1350,1351,3,300,147,0,1351,1352,3,
+ 292,143,0,1352,1353,3,326,160,0,1353,1360,1,0,0,0,1354,1355,3,340,
+ 167,0,1355,1356,3,340,167,0,1356,1357,3,340,167,0,1357,1358,3,340,
+ 167,0,1358,1360,1,0,0,0,1359,1349,1,0,0,0,1359,1354,1,0,0,0,1360,
+ 269,1,0,0,0,1361,1362,3,360,177,0,1362,1363,3,294,144,0,1363,1394,
+ 1,0,0,0,1364,1365,3,360,177,0,1365,1366,3,302,148,0,1366,1394,1,
+ 0,0,0,1367,1368,3,360,177,0,1368,1369,3,326,160,0,1369,1394,1,0,
+ 0,0,1370,1371,3,360,177,0,1371,1372,3,318,156,0,1372,1394,1,0,0,
+ 0,1373,1374,3,360,177,0,1374,1375,3,330,162,0,1375,1394,1,0,0,0,
+ 1376,1377,3,360,177,0,1377,1378,5,48,0,0,1378,1394,1,0,0,0,1379,
+ 1380,3,360,177,0,1380,1381,3,292,143,0,1381,1394,1,0,0,0,1382,1383,
+ 3,360,177,0,1383,1384,3,334,164,0,1384,1394,1,0,0,0,1385,1386,3,
+ 360,177,0,1386,1387,3,360,177,0,1387,1394,1,0,0,0,1388,1389,3,360,
+ 177,0,1389,1390,3,338,166,0,1390,1391,3,352,173,0,1391,1392,3,352,
+ 173,0,1392,1394,1,0,0,0,1393,1361,1,0,0,0,1393,1364,1,0,0,0,1393,
+ 1367,1,0,0,0,1393,1370,1,0,0,0,1393,1373,1,0,0,0,1393,1376,1,0,0,
+ 0,1393,1379,1,0,0,0,1393,1382,1,0,0,0,1393,1385,1,0,0,0,1393,1388,
+ 1,0,0,0,1394,271,1,0,0,0,1395,1399,3,344,169,0,1396,1399,3,448,221,
+ 0,1397,1399,3,374,184,0,1398,1395,1,0,0,0,1398,1396,1,0,0,0,1398,
+ 1397,1,0,0,0,1399,1406,1,0,0,0,1400,1405,3,344,169,0,1401,1405,3,
+ 448,221,0,1402,1405,3,350,172,0,1403,1405,3,374,184,0,1404,1400,
+ 1,0,0,0,1404,1401,1,0,0,0,1404,1402,1,0,0,0,1404,1403,1,0,0,0,1405,
+ 1408,1,0,0,0,1406,1404,1,0,0,0,1406,1407,1,0,0,0,1407,273,1,0,0,
+ 0,1408,1406,1,0,0,0,1409,1420,3,358,176,0,1410,1419,8,0,0,0,1411,
+ 1419,3,270,132,0,1412,1413,3,360,177,0,1413,1414,3,430,212,0,1414,
+ 1419,1,0,0,0,1415,1416,3,358,176,0,1416,1417,3,358,176,0,1417,1419,
+ 1,0,0,0,1418,1410,1,0,0,0,1418,1411,1,0,0,0,1418,1412,1,0,0,0,1418,
+ 1415,1,0,0,0,1419,1422,1,0,0,0,1420,1418,1,0,0,0,1420,1421,1,0,0,
+ 0,1421,1423,1,0,0,0,1422,1420,1,0,0,0,1423,1424,3,358,176,0,1424,
+ 1442,1,0,0,0,1425,1436,3,424,209,0,1426,1435,8,1,0,0,1427,1435,3,
+ 270,132,0,1428,1429,3,360,177,0,1429,1430,3,424,209,0,1430,1435,
+ 1,0,0,0,1431,1432,3,424,209,0,1432,1433,3,424,209,0,1433,1435,1,
+ 0,0,0,1434,1426,1,0,0,0,1434,1427,1,0,0,0,1434,1428,1,0,0,0,1434,
+ 1431,1,0,0,0,1435,1438,1,0,0,0,1436,1434,1,0,0,0,1436,1437,1,0,0,
+ 0,1437,1439,1,0,0,0,1438,1436,1,0,0,0,1439,1440,3,424,209,0,1440,
+ 1442,1,0,0,0,1441,1409,1,0,0,0,1441,1425,1,0,0,0,1442,275,1,0,0,
+ 0,1443,1444,3,284,139,0,1444,1448,3,376,185,0,1445,1447,3,352,173,
+ 0,1446,1445,1,0,0,0,1447,1450,1,0,0,0,1448,1446,1,0,0,0,1448,1449,
+ 1,0,0,0,1449,1451,1,0,0,0,1450,1448,1,0,0,0,1451,1454,3,322,158,
+ 0,1452,1455,3,420,207,0,1453,1455,3,372,183,0,1454,1452,1,0,0,0,
+ 1454,1453,1,0,0,0,1454,1455,1,0,0,0,1455,1457,1,0,0,0,1456,1458,
+ 3,350,172,0,1457,1456,1,0,0,0,1458,1459,1,0,0,0,1459,1457,1,0,0,
+ 0,1459,1460,1,0,0,0,1460,1514,1,0,0,0,1461,1462,3,284,139,0,1462,
+ 1465,3,322,158,0,1463,1466,3,420,207,0,1464,1466,3,372,183,0,1465,
+ 1463,1,0,0,0,1465,1464,1,0,0,0,1465,1466,1,0,0,0,1466,1468,1,0,0,
+ 0,1467,1469,3,350,172,0,1468,1467,1,0,0,0,1469,1470,1,0,0,0,1470,
+ 1468,1,0,0,0,1470,1471,1,0,0,0,1471,1514,1,0,0,0,1472,1473,3,282,
+ 138,0,1473,1477,3,376,185,0,1474,1476,3,350,172,0,1475,1474,1,0,
+ 0,0,1476,1479,1,0,0,0,1477,1475,1,0,0,0,1477,1478,1,0,0,0,1478,1480,
+ 1,0,0,0,1479,1477,1,0,0,0,1480,1483,3,300,147,0,1481,1484,3,420,
+ 207,0,1482,1484,3,372,183,0,1483,1481,1,0,0,0,1483,1482,1,0,0,0,
+ 1483,1484,1,0,0,0,1484,1486,1,0,0,0,1485,1487,3,350,172,0,1486,1485,
+ 1,0,0,0,1487,1488,1,0,0,0,1488,1486,1,0,0,0,1488,1489,1,0,0,0,1489,
+ 1514,1,0,0,0,1490,1491,3,376,185,0,1491,1492,3,282,138,0,1492,1495,
+ 3,300,147,0,1493,1496,3,420,207,0,1494,1496,3,372,183,0,1495,1493,
+ 1,0,0,0,1495,1494,1,0,0,0,1495,1496,1,0,0,0,1496,1498,1,0,0,0,1497,
+ 1499,3,350,172,0,1498,1497,1,0,0,0,1499,1500,1,0,0,0,1500,1498,1,
+ 0,0,0,1500,1501,1,0,0,0,1501,1514,1,0,0,0,1502,1503,3,282,138,0,
+ 1503,1506,3,300,147,0,1504,1507,3,420,207,0,1505,1507,3,372,183,
+ 0,1506,1504,1,0,0,0,1506,1505,1,0,0,0,1506,1507,1,0,0,0,1507,1509,
+ 1,0,0,0,1508,1510,3,350,172,0,1509,1508,1,0,0,0,1510,1511,1,0,0,
+ 0,1511,1509,1,0,0,0,1511,1512,1,0,0,0,1512,1514,1,0,0,0,1513,1443,
+ 1,0,0,0,1513,1461,1,0,0,0,1513,1472,1,0,0,0,1513,1490,1,0,0,0,1513,
+ 1502,1,0,0,0,1514,277,1,0,0,0,1515,1516,5,48,0,0,1516,1518,3,294,
+ 144,0,1517,1519,3,346,170,0,1518,1517,1,0,0,0,1519,1520,1,0,0,0,
+ 1520,1518,1,0,0,0,1520,1521,1,0,0,0,1521,279,1,0,0,0,1522,1524,5,
+ 48,0,0,1523,1525,3,348,171,0,1524,1523,1,0,0,0,1525,1526,1,0,0,0,
+ 1526,1524,1,0,0,0,1526,1527,1,0,0,0,1527,281,1,0,0,0,1528,1530,3,
+ 350,172,0,1529,1528,1,0,0,0,1530,1531,1,0,0,0,1531,1529,1,0,0,0,
+ 1531,1532,1,0,0,0,1532,283,1,0,0,0,1533,1534,5,48,0,0,1534,1536,
+ 3,338,166,0,1535,1537,3,352,173,0,1536,1535,1,0,0,0,1537,1538,1,
+ 0,0,0,1538,1536,1,0,0,0,1538,1539,1,0,0,0,1539,285,1,0,0,0,1540,
+ 1541,5,48,0,0,1541,1543,7,2,0,0,1542,1544,3,350,172,0,1543,1542,
+ 1,0,0,0,1544,1545,1,0,0,0,1545,1543,1,0,0,0,1545,1546,1,0,0,0,1546,
+ 287,1,0,0,0,1547,1548,5,48,0,0,1548,1550,7,3,0,0,1549,1551,3,350,
+ 172,0,1550,1549,1,0,0,0,1551,1552,1,0,0,0,1552,1550,1,0,0,0,1552,
+ 1553,1,0,0,0,1553,289,1,0,0,0,1554,1565,3,430,212,0,1555,1564,8,
+ 4,0,0,1556,1564,3,270,132,0,1557,1558,3,360,177,0,1558,1559,3,430,
+ 212,0,1559,1564,1,0,0,0,1560,1561,3,430,212,0,1561,1562,3,430,212,
+ 0,1562,1564,1,0,0,0,1563,1555,1,0,0,0,1563,1556,1,0,0,0,1563,1557,
+ 1,0,0,0,1563,1560,1,0,0,0,1564,1567,1,0,0,0,1565,1563,1,0,0,0,1565,
+ 1566,1,0,0,0,1566,1568,1,0,0,0,1567,1565,1,0,0,0,1568,1569,3,430,
+ 212,0,1569,291,1,0,0,0,1570,1571,7,5,0,0,1571,293,1,0,0,0,1572,1573,
+ 7,3,0,0,1573,295,1,0,0,0,1574,1575,7,6,0,0,1575,297,1,0,0,0,1576,
+ 1577,7,7,0,0,1577,299,1,0,0,0,1578,1579,7,8,0,0,1579,301,1,0,0,0,
+ 1580,1581,7,9,0,0,1581,303,1,0,0,0,1582,1583,7,10,0,0,1583,305,1,
+ 0,0,0,1584,1585,7,11,0,0,1585,307,1,0,0,0,1586,1587,7,12,0,0,1587,
+ 309,1,0,0,0,1588,1589,7,13,0,0,1589,311,1,0,0,0,1590,1591,7,14,0,
+ 0,1591,313,1,0,0,0,1592,1593,7,15,0,0,1593,315,1,0,0,0,1594,1595,
+ 7,16,0,0,1595,317,1,0,0,0,1596,1597,7,17,0,0,1597,319,1,0,0,0,1598,
+ 1599,7,2,0,0,1599,321,1,0,0,0,1600,1601,7,18,0,0,1601,323,1,0,0,
+ 0,1602,1603,7,19,0,0,1603,325,1,0,0,0,1604,1605,7,20,0,0,1605,327,
+ 1,0,0,0,1606,1607,7,21,0,0,1607,329,1,0,0,0,1608,1609,7,22,0,0,1609,
+ 331,1,0,0,0,1610,1611,7,23,0,0,1611,333,1,0,0,0,1612,1613,7,24,0,
+ 0,1613,335,1,0,0,0,1614,1615,7,25,0,0,1615,337,1,0,0,0,1616,1617,
+ 7,26,0,0,1617,339,1,0,0,0,1618,1619,7,27,0,0,1619,341,1,0,0,0,1620,
+ 1621,7,28,0,0,1621,343,1,0,0,0,1622,1623,7,29,0,0,1623,345,1,0,0,
+ 0,1624,1625,7,30,0,0,1625,347,1,0,0,0,1626,1627,7,31,0,0,1627,349,
+ 1,0,0,0,1628,1629,7,32,0,0,1629,351,1,0,0,0,1630,1631,7,33,0,0,1631,
+ 353,1,0,0,0,1632,1633,5,45,0,0,1633,1634,5,62,0,0,1634,355,1,0,0,
+ 0,1635,1636,5,42,0,0,1636,357,1,0,0,0,1637,1638,5,96,0,0,1638,359,
+ 1,0,0,0,1639,1640,5,92,0,0,1640,361,1,0,0,0,1641,1642,5,58,0,0,1642,
+ 1643,5,58,0,0,1643,363,1,0,0,0,1644,1645,5,58,0,0,1645,1646,5,61,
+ 0,0,1646,365,1,0,0,0,1647,1648,5,58,0,0,1648,367,1,0,0,0,1649,1650,
+ 5,44,0,0,1650,369,1,0,0,0,1651,1652,5,124,0,0,1652,1653,5,124,0,
+ 0,1653,371,1,0,0,0,1654,1655,5,45,0,0,1655,373,1,0,0,0,1656,1657,
+ 5,36,0,0,1657,375,1,0,0,0,1658,1659,5,46,0,0,1659,377,1,0,0,0,1660,
+ 1661,5,61,0,0,1661,1662,5,61,0,0,1662,379,1,0,0,0,1663,1664,5,61,
+ 0,0,1664,381,1,0,0,0,1665,1666,5,62,0,0,1666,1667,5,61,0,0,1667,
+ 383,1,0,0,0,1668,1669,5,62,0,0,1669,385,1,0,0,0,1670,1671,5,35,0,
+ 0,1671,387,1,0,0,0,1672,1673,5,126,0,0,1673,1674,5,42,0,0,1674,389,
+ 1,0,0,0,1675,1676,5,61,0,0,1676,1677,5,126,0,0,1677,1678,5,42,0,
+ 0,1678,391,1,0,0,0,1679,1680,5,123,0,0,1680,1681,1,0,0,0,1681,1682,
+ 6,193,0,0,1682,393,1,0,0,0,1683,1684,5,91,0,0,1684,395,1,0,0,0,1685,
+ 1686,5,40,0,0,1686,397,1,0,0,0,1687,1688,5,60,0,0,1688,1689,5,61,
+ 0,0,1689,399,1,0,0,0,1690,1691,5,60,0,0,1691,1692,5,47,0,0,1692,
+ 1693,1,0,0,0,1693,1694,6,197,1,0,1694,1695,6,197,2,0,1695,401,1,
+ 0,0,0,1696,1697,5,60,0,0,1697,1698,4,198,0,0,1698,1699,1,0,0,0,1699,
+ 1700,6,198,3,0,1700,1701,6,198,4,0,1701,403,1,0,0,0,1702,1703,5,
+ 60,0,0,1703,405,1,0,0,0,1704,1705,5,60,0,0,1705,1706,5,47,0,0,1706,
+ 407,1,0,0,0,1707,1708,5,33,0,0,1708,1712,5,61,0,0,1709,1710,5,60,
+ 0,0,1710,1712,5,62,0,0,1711,1707,1,0,0,0,1711,1709,1,0,0,0,1712,
+ 409,1,0,0,0,1713,1714,5,33,0,0,1714,1715,5,126,0,0,1715,1716,5,42,
+ 0,0,1716,411,1,0,0,0,1717,1718,5,33,0,0,1718,1719,5,126,0,0,1719,
+ 413,1,0,0,0,1720,1721,5,63,0,0,1721,1722,5,46,0,0,1722,415,1,0,0,
+ 0,1723,1724,5,63,0,0,1724,1725,5,63,0,0,1725,417,1,0,0,0,1726,1727,
+ 5,37,0,0,1727,419,1,0,0,0,1728,1729,5,43,0,0,1729,421,1,0,0,0,1730,
+ 1731,5,63,0,0,1731,423,1,0,0,0,1732,1733,5,34,0,0,1733,425,1,0,0,
+ 0,1734,1735,5,102,0,0,1735,1736,5,39,0,0,1736,1737,1,0,0,0,1737,
+ 1738,6,210,5,0,1738,427,1,0,0,0,1739,1740,5,70,0,0,1740,1741,5,39,
+ 0,0,1741,1742,1,0,0,0,1742,1743,6,211,6,0,1743,429,1,0,0,0,1744,
+ 1745,5,39,0,0,1745,431,1,0,0,0,1746,1747,5,126,0,0,1747,433,1,0,
+ 0,0,1748,1749,5,61,0,0,1749,1750,5,126,0,0,1750,435,1,0,0,0,1751,
+ 1752,5,125,0,0,1752,1753,1,0,0,0,1753,1754,6,215,7,0,1754,437,1,
+ 0,0,0,1755,1756,5,93,0,0,1756,439,1,0,0,0,1757,1758,5,41,0,0,1758,
+ 441,1,0,0,0,1759,1760,5,59,0,0,1760,443,1,0,0,0,1761,1762,5,47,0,
+ 0,1762,445,1,0,0,0,1763,1764,5,47,0,0,1764,1765,5,62,0,0,1765,447,
+ 1,0,0,0,1766,1767,5,95,0,0,1767,449,1,0,0,0,1768,1769,5,47,0,0,1769,
+ 1770,5,42,0,0,1770,1774,1,0,0,0,1771,1773,9,0,0,0,1772,1771,1,0,
+ 0,0,1773,1776,1,0,0,0,1774,1775,1,0,0,0,1774,1772,1,0,0,0,1775,1777,
+ 1,0,0,0,1776,1774,1,0,0,0,1777,1778,5,42,0,0,1778,1779,5,47,0,0,
+ 1779,1780,1,0,0,0,1780,1781,6,222,8,0,1781,451,1,0,0,0,1782,1783,
+ 5,45,0,0,1783,1787,5,45,0,0,1784,1785,5,47,0,0,1785,1787,5,47,0,
+ 0,1786,1782,1,0,0,0,1786,1784,1,0,0,0,1787,1791,1,0,0,0,1788,1790,
+ 8,34,0,0,1789,1788,1,0,0,0,1790,1793,1,0,0,0,1791,1789,1,0,0,0,1791,
+ 1792,1,0,0,0,1792,1795,1,0,0,0,1793,1791,1,0,0,0,1794,1796,7,35,
+ 0,0,1795,1794,1,0,0,0,1796,1797,1,0,0,0,1797,1798,6,223,8,0,1798,
+ 453,1,0,0,0,1799,1800,7,36,0,0,1800,1801,1,0,0,0,1801,1802,6,224,
+ 9,0,1802,455,1,0,0,0,1803,1804,9,0,0,0,1804,457,1,0,0,0,1805,1817,
+ 8,37,0,0,1806,1817,3,270,132,0,1807,1808,3,360,177,0,1808,1809,3,
+ 430,212,0,1809,1817,1,0,0,0,1810,1811,3,360,177,0,1811,1812,3,392,
+ 193,0,1812,1817,1,0,0,0,1813,1814,3,430,212,0,1814,1815,3,430,212,
+ 0,1815,1817,1,0,0,0,1816,1805,1,0,0,0,1816,1806,1,0,0,0,1816,1807,
+ 1,0,0,0,1816,1810,1,0,0,0,1816,1813,1,0,0,0,1817,1818,1,0,0,0,1818,
+ 1816,1,0,0,0,1818,1819,1,0,0,0,1819,459,1,0,0,0,1820,1821,3,392,
+ 193,0,1821,1822,1,0,0,0,1822,1823,6,227,0,0,1823,461,1,0,0,0,1824,
+ 1825,3,430,212,0,1825,1826,1,0,0,0,1826,1827,6,228,10,0,1827,1828,
+ 6,228,7,0,1828,463,1,0,0,0,1829,1835,8,38,0,0,1830,1835,3,270,132,
+ 0,1831,1832,3,360,177,0,1832,1833,3,392,193,0,1833,1835,1,0,0,0,
+ 1834,1829,1,0,0,0,1834,1830,1,0,0,0,1834,1831,1,0,0,0,1835,1836,
+ 1,0,0,0,1836,1834,1,0,0,0,1836,1837,1,0,0,0,1837,465,1,0,0,0,1838,
+ 1839,3,392,193,0,1839,1840,1,0,0,0,1840,1841,6,230,0,0,1841,467,
+ 1,0,0,0,1842,1843,5,47,0,0,1843,1844,5,62,0,0,1844,1845,1,0,0,0,
+ 1845,1846,6,231,11,0,1846,1847,6,231,7,0,1847,469,1,0,0,0,1848,1849,
+ 5,62,0,0,1849,1850,1,0,0,0,1850,1851,6,232,12,0,1851,1852,6,232,
+ 7,0,1852,1853,6,232,13,0,1853,471,1,0,0,0,1854,1855,5,47,0,0,1855,
+ 1856,5,42,0,0,1856,1860,1,0,0,0,1857,1859,9,0,0,0,1858,1857,1,0,
+ 0,0,1859,1862,1,0,0,0,1860,1861,1,0,0,0,1860,1858,1,0,0,0,1861,1863,
+ 1,0,0,0,1862,1860,1,0,0,0,1863,1864,5,42,0,0,1864,1865,5,47,0,0,
+ 1865,1866,1,0,0,0,1866,1867,6,233,8,0,1867,473,1,0,0,0,1868,1869,
+ 5,45,0,0,1869,1873,5,45,0,0,1870,1871,5,47,0,0,1871,1873,5,47,0,
+ 0,1872,1868,1,0,0,0,1872,1870,1,0,0,0,1873,1877,1,0,0,0,1874,1876,
+ 8,34,0,0,1875,1874,1,0,0,0,1876,1879,1,0,0,0,1877,1875,1,0,0,0,1877,
+ 1878,1,0,0,0,1878,1881,1,0,0,0,1879,1877,1,0,0,0,1880,1882,7,35,
+ 0,0,1881,1880,1,0,0,0,1882,1883,1,0,0,0,1883,1884,6,234,8,0,1884,
+ 475,1,0,0,0,1885,1889,7,39,0,0,1886,1888,7,40,0,0,1887,1886,1,0,
+ 0,0,1888,1891,1,0,0,0,1889,1887,1,0,0,0,1889,1890,1,0,0,0,1890,1892,
+ 1,0,0,0,1891,1889,1,0,0,0,1892,1893,6,235,14,0,1893,477,1,0,0,0,
+ 1894,1895,5,61,0,0,1895,1896,1,0,0,0,1896,1897,6,236,15,0,1897,479,
+ 1,0,0,0,1898,1899,3,290,142,0,1899,1900,1,0,0,0,1900,1901,6,237,
+ 16,0,1901,481,1,0,0,0,1902,1904,7,41,0,0,1903,1902,1,0,0,0,1904,
+ 1905,1,0,0,0,1905,1903,1,0,0,0,1905,1906,1,0,0,0,1906,1907,1,0,0,
+ 0,1907,1908,6,238,9,0,1908,483,1,0,0,0,1909,1910,5,123,0,0,1910,
+ 1911,1,0,0,0,1911,1912,6,239,17,0,1912,1913,6,239,0,0,1913,485,1,
+ 0,0,0,1914,1915,9,0,0,0,1915,1916,1,0,0,0,1916,1917,6,240,18,0,1917,
+ 487,1,0,0,0,1918,1919,5,62,0,0,1919,1920,1,0,0,0,1920,1921,6,241,
+ 12,0,1921,1922,6,241,7,0,1922,489,1,0,0,0,1923,1924,5,47,0,0,1924,
+ 1925,5,42,0,0,1925,1929,1,0,0,0,1926,1928,9,0,0,0,1927,1926,1,0,
+ 0,0,1928,1931,1,0,0,0,1929,1930,1,0,0,0,1929,1927,1,0,0,0,1930,1932,
+ 1,0,0,0,1931,1929,1,0,0,0,1932,1933,5,42,0,0,1933,1934,5,47,0,0,
+ 1934,1935,1,0,0,0,1935,1936,6,242,8,0,1936,491,1,0,0,0,1937,1938,
+ 5,45,0,0,1938,1942,5,45,0,0,1939,1940,5,47,0,0,1940,1942,5,47,0,
+ 0,1941,1937,1,0,0,0,1941,1939,1,0,0,0,1942,1946,1,0,0,0,1943,1945,
+ 8,34,0,0,1944,1943,1,0,0,0,1945,1948,1,0,0,0,1946,1944,1,0,0,0,1946,
+ 1947,1,0,0,0,1947,1950,1,0,0,0,1948,1946,1,0,0,0,1949,1951,7,35,
+ 0,0,1950,1949,1,0,0,0,1951,1952,1,0,0,0,1952,1953,6,243,8,0,1953,
+ 493,1,0,0,0,1954,1958,7,39,0,0,1955,1957,7,40,0,0,1956,1955,1,0,
+ 0,0,1957,1960,1,0,0,0,1958,1956,1,0,0,0,1958,1959,1,0,0,0,1959,1961,
+ 1,0,0,0,1960,1958,1,0,0,0,1961,1962,6,244,14,0,1962,495,1,0,0,0,
+ 1963,1965,7,41,0,0,1964,1963,1,0,0,0,1965,1966,1,0,0,0,1966,1964,
+ 1,0,0,0,1966,1967,1,0,0,0,1967,1968,1,0,0,0,1968,1969,6,245,9,0,
+ 1969,497,1,0,0,0,1970,1971,9,0,0,0,1971,1972,1,0,0,0,1972,1973,6,
+ 246,18,0,1973,499,1,0,0,0,1974,1976,8,42,0,0,1975,1974,1,0,0,0,1976,
+ 1977,1,0,0,0,1977,1975,1,0,0,0,1977,1978,1,0,0,0,1978,501,1,0,0,
+ 0,1979,1980,5,123,0,0,1980,1981,1,0,0,0,1981,1982,6,248,17,0,1982,
+ 1983,6,248,0,0,1983,503,1,0,0,0,1984,1985,5,60,0,0,1985,1986,5,47,
+ 0,0,1986,1987,1,0,0,0,1987,1988,6,249,1,0,1988,1989,6,249,7,0,1989,
+ 1990,6,249,2,0,1990,505,1,0,0,0,1991,1992,5,60,0,0,1992,1993,1,0,
+ 0,0,1993,1994,6,250,3,0,1994,1995,6,250,4,0,1995,507,1,0,0,0,1996,
+ 1998,7,41,0,0,1997,1996,1,0,0,0,1998,1999,1,0,0,0,1999,1997,1,0,
+ 0,0,1999,2000,1,0,0,0,2000,2001,1,0,0,0,2001,2002,6,251,9,0,2002,
+ 509,1,0,0,0,62,0,1,2,3,4,5,550,830,1359,1393,1398,1404,1406,1418,
+ 1420,1434,1436,1441,1448,1454,1459,1465,1470,1477,1483,1488,1495,
+ 1500,1506,1511,1513,1520,1526,1531,1538,1545,1552,1563,1565,1711,
+ 1774,1786,1791,1795,1816,1818,1834,1836,1860,1872,1877,1881,1889,
+ 1905,1929,1941,1946,1950,1958,1966,1977,1999,19,5,0,0,7,168,0,5,
+ 4,0,7,167,0,5,3,0,5,1,0,5,2,0,4,0,0,6,0,0,0,1,0,7,180,0,7,188,0,
+ 7,159,0,5,5,0,7,134,0,7,157,0,7,143,0,7,163,0,7,193,0
]
class HogQLLexer(Lexer):
@@ -998,10 +1029,14 @@ class HogQLLexer(Lexer):
STRING_ESCAPE_TRIGGER = 195
FULL_STRING_TEXT = 196
FULL_STRING_ESCAPE_TRIGGER = 197
- TAG_WS = 198
- TAGC_WS = 199
- HOGQLX_TEXT_TEXT = 200
- HOGQLX_TEXT_WS = 201
+ TAG_MULTI_LINE_COMMENT = 198
+ TAG_SINGLE_LINE_COMMENT = 199
+ TAG_WS = 200
+ TAGC_MULTI_LINE_COMMENT = 201
+ TAGC_SINGLE_LINE_COMMENT = 202
+ TAGC_WS = 203
+ HOGQLX_TEXT_TEXT = 204
+ HOGQLX_TEXT_WS = 205
channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ]
@@ -1050,8 +1085,9 @@ class HogQLLexer(Lexer):
"RPAREN", "SEMICOLON", "SLASH", "SLASH_GT", "UNDERSCORE", "MULTI_LINE_COMMENT",
"SINGLE_LINE_COMMENT", "WHITESPACE", "UNEXPECTED_CHARACTER",
"STRING_TEXT", "STRING_ESCAPE_TRIGGER", "FULL_STRING_TEXT",
- "FULL_STRING_ESCAPE_TRIGGER", "TAG_WS", "TAGC_WS", "HOGQLX_TEXT_TEXT",
- "HOGQLX_TEXT_WS" ]
+ "FULL_STRING_ESCAPE_TRIGGER", "TAG_MULTI_LINE_COMMENT", "TAG_SINGLE_LINE_COMMENT",
+ "TAG_WS", "TAGC_MULTI_LINE_COMMENT", "TAGC_SINGLE_LINE_COMMENT",
+ "TAGC_WS", "HOGQLX_TEXT_TEXT", "HOGQLX_TEXT_WS" ]
ruleNames = [ "ALL", "AND", "ANTI", "ANY", "ARRAY", "AS", "ASCENDING",
"ASOF", "BETWEEN", "BOTH", "BY", "CASE", "CAST", "CATCH",
@@ -1094,9 +1130,11 @@ class HogQLLexer(Lexer):
"UNDERSCORE", "MULTI_LINE_COMMENT", "SINGLE_LINE_COMMENT",
"WHITESPACE", "UNEXPECTED_CHARACTER", "STRING_TEXT", "STRING_ESCAPE_TRIGGER",
"STRING_QUOTE_SINGLE", "FULL_STRING_TEXT", "FULL_STRING_ESCAPE_TRIGGER",
- "TAG_SELF_CLOSE_GT", "TAG_OPEN_GT", "TAG_IDENT", "TAG_EQ",
- "TAG_STRING", "TAG_WS", "TAG_LBRACE", "TAGC_GT", "TAGC_IDENT",
- "TAGC_WS", "HOGQLX_TEXT_TEXT", "HOGQLX_TEXT_LBRACE", "HOGQLX_TEXT_LT_SLASH",
+ "TAG_SELF_CLOSE_GT", "TAG_OPEN_GT", "TAG_MULTI_LINE_COMMENT",
+ "TAG_SINGLE_LINE_COMMENT", "TAG_IDENT", "TAG_EQ", "TAG_STRING",
+ "TAG_WS", "TAG_LBRACE", "TAG_UNEXPECTED", "TAGC_GT", "TAGC_MULTI_LINE_COMMENT",
+ "TAGC_SINGLE_LINE_COMMENT", "TAGC_IDENT", "TAGC_WS", "TAGC_UNEXPECTED",
+ "HOGQLX_TEXT_TEXT", "HOGQLX_TEXT_LBRACE", "HOGQLX_TEXT_LT_SLASH",
"HOGQLX_TEXT_LT", "HOGQLX_TEXT_WS" ]
grammarFileName = "HogQLLexer.g4"
diff --git a/posthog/hogql/grammar/HogQLLexer.tokens b/posthog/hogql/grammar/HogQLLexer.tokens
index 0c367d1ea732..73381877cef8 100644
--- a/posthog/hogql/grammar/HogQLLexer.tokens
+++ b/posthog/hogql/grammar/HogQLLexer.tokens
@@ -195,10 +195,14 @@ STRING_TEXT=194
STRING_ESCAPE_TRIGGER=195
FULL_STRING_TEXT=196
FULL_STRING_ESCAPE_TRIGGER=197
-TAG_WS=198
-TAGC_WS=199
-HOGQLX_TEXT_TEXT=200
-HOGQLX_TEXT_WS=201
+TAG_MULTI_LINE_COMMENT=198
+TAG_SINGLE_LINE_COMMENT=199
+TAG_WS=200
+TAGC_MULTI_LINE_COMMENT=201
+TAGC_SINGLE_LINE_COMMENT=202
+TAGC_WS=203
+HOGQLX_TEXT_TEXT=204
+HOGQLX_TEXT_WS=205
'->'=144
'*'=145
'`'=146
diff --git a/posthog/hogql/grammar/HogQLParser.interp b/posthog/hogql/grammar/HogQLParser.interp
index 776ab695caf4..9fe98608043b 100644
--- a/posthog/hogql/grammar/HogQLParser.interp
+++ b/posthog/hogql/grammar/HogQLParser.interp
@@ -201,6 +201,10 @@ null
null
null
null
+null
+null
+null
+null
token symbolic names:
null
@@ -401,7 +405,11 @@ STRING_TEXT
STRING_ESCAPE_TRIGGER
FULL_STRING_TEXT
FULL_STRING_ESCAPE_TRIGGER
+TAG_MULTI_LINE_COMMENT
+TAG_SINGLE_LINE_COMMENT
TAG_WS
+TAGC_MULTI_LINE_COMMENT
+TAGC_SINGLE_LINE_COMMENT
TAGC_WS
HOGQLX_TEXT_TEXT
HOGQLX_TEXT_WS
@@ -528,4 +536,4 @@ stringContentsFull
atn:
-[4, 1, 201, 2081, 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, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103, 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, 108, 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 2, 111, 7, 111, 2, 112, 7, 112, 2, 113, 7, 113, 2, 114, 7, 114, 2, 115, 7, 115, 2, 116, 7, 116, 2, 117, 7, 117, 1, 0, 5, 0, 238, 8, 0, 10, 0, 12, 0, 241, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 247, 8, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 255, 8, 3, 1, 4, 1, 4, 1, 4, 5, 4, 260, 8, 4, 10, 4, 12, 4, 263, 9, 4, 1, 4, 3, 4, 266, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 279, 8, 5, 1, 6, 1, 6, 3, 6, 283, 8, 6, 1, 6, 3, 6, 286, 8, 6, 1, 7, 1, 7, 1, 7, 3, 7, 291, 8, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 298, 8, 8, 1, 8, 1, 8, 3, 8, 302, 8, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 5, 9, 309, 8, 9, 10, 9, 12, 9, 312, 9, 9, 1, 9, 1, 9, 3, 9, 316, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 325, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 333, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 340, 8, 12, 1, 12, 1, 12, 3, 12, 344, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 350, 8, 12, 1, 12, 1, 12, 1, 12, 3, 12, 355, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 363, 8, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 370, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 376, 8, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 3, 16, 388, 8, 16, 1, 16, 3, 16, 391, 8, 16, 1, 17, 1, 17, 1, 18, 1, 18, 5, 18, 397, 8, 18, 10, 18, 12, 18, 400, 9, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 5, 20, 411, 8, 20, 10, 20, 12, 20, 414, 9, 20, 1, 20, 3, 20, 417, 8, 20, 1, 21, 1, 21, 1, 21, 3, 21, 422, 8, 21, 1, 21, 3, 21, 425, 8, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 440, 8, 22, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 446, 8, 23, 1, 23, 1, 23, 1, 23, 3, 23, 451, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 457, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 463, 8, 23, 1, 23, 1, 23, 1, 23, 3, 23, 468, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 474, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 480, 8, 23, 1, 23, 1, 23, 1, 23, 3, 23, 485, 8, 23, 3, 23, 487, 8, 23, 1, 23, 1, 23, 1, 24, 1, 24, 5, 24, 493, 8, 24, 10, 24, 12, 24, 496, 9, 24, 1, 24, 3, 24, 499, 8, 24, 1, 24, 3, 24, 502, 8, 24, 1, 25, 1, 25, 1, 25, 3, 25, 507, 8, 25, 1, 25, 1, 25, 3, 25, 511, 8, 25, 1, 25, 1, 25, 3, 25, 515, 8, 25, 1, 25, 1, 25, 1, 25, 3, 25, 520, 8, 25, 1, 25, 1, 25, 3, 25, 524, 8, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 3, 25, 531, 8, 25, 1, 26, 3, 26, 534, 8, 26, 1, 26, 1, 26, 3, 26, 538, 8, 26, 1, 26, 3, 26, 541, 8, 26, 1, 26, 1, 26, 3, 26, 545, 8, 26, 1, 26, 3, 26, 548, 8, 26, 1, 26, 3, 26, 551, 8, 26, 1, 26, 3, 26, 554, 8, 26, 1, 26, 3, 26, 557, 8, 26, 1, 26, 3, 26, 560, 8, 26, 1, 26, 3, 26, 563, 8, 26, 1, 26, 1, 26, 3, 26, 567, 8, 26, 1, 26, 1, 26, 3, 26, 571, 8, 26, 1, 26, 3, 26, 574, 8, 26, 1, 26, 3, 26, 577, 8, 26, 1, 26, 1, 26, 3, 26, 581, 8, 26, 1, 26, 3, 26, 584, 8, 26, 1, 26, 3, 26, 587, 8, 26, 1, 26, 3, 26, 590, 8, 26, 1, 26, 1, 26, 3, 26, 594, 8, 26, 1, 26, 3, 26, 597, 8, 26, 1, 27, 1, 27, 3, 27, 601, 8, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 3, 28, 609, 8, 28, 1, 29, 1, 29, 1, 29, 1, 30, 3, 30, 615, 8, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 5, 31, 634, 8, 31, 10, 31, 12, 31, 637, 9, 31, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 3, 34, 660, 8, 34, 1, 35, 1, 35, 1, 35, 5, 35, 665, 8, 35, 10, 35, 12, 35, 668, 9, 35, 1, 36, 1, 36, 3, 36, 672, 8, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 3, 39, 686, 8, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 5, 40, 693, 8, 40, 10, 40, 12, 40, 696, 9, 40, 1, 40, 1, 40, 3, 40, 700, 8, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 3, 43, 714, 8, 43, 1, 43, 1, 43, 3, 43, 718, 8, 43, 1, 43, 1, 43, 3, 43, 722, 8, 43, 1, 43, 1, 43, 1, 43, 3, 43, 727, 8, 43, 1, 43, 1, 43, 3, 43, 731, 8, 43, 1, 43, 1, 43, 1, 43, 3, 43, 736, 8, 43, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, 5, 46, 748, 8, 46, 10, 46, 12, 46, 751, 9, 46, 1, 47, 1, 47, 1, 47, 1, 47, 5, 47, 757, 8, 47, 10, 47, 12, 47, 760, 9, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 3, 48, 767, 8, 48, 1, 48, 3, 48, 770, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 776, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 784, 8, 48, 1, 48, 3, 48, 787, 8, 48, 1, 48, 1, 48, 1, 48, 3, 48, 792, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 799, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 809, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 817, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 5, 48, 823, 8, 48, 10, 48, 12, 48, 826, 9, 48, 1, 49, 3, 49, 829, 8, 49, 1, 49, 1, 49, 1, 49, 3, 49, 834, 8, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 841, 8, 49, 1, 49, 3, 49, 844, 8, 49, 1, 49, 1, 49, 3, 49, 848, 8, 49, 1, 49, 1, 49, 3, 49, 852, 8, 49, 1, 49, 3, 49, 855, 8, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 861, 8, 49, 3, 49, 863, 8, 49, 1, 49, 3, 49, 866, 8, 49, 1, 49, 1, 49, 3, 49, 870, 8, 49, 1, 49, 1, 49, 3, 49, 874, 8, 49, 1, 49, 3, 49, 877, 8, 49, 3, 49, 879, 8, 49, 3, 49, 881, 8, 49, 1, 50, 1, 50, 1, 50, 3, 50, 886, 8, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 3, 51, 897, 8, 51, 1, 52, 1, 52, 1, 52, 3, 52, 902, 8, 52, 1, 52, 1, 52, 3, 52, 906, 8, 52, 1, 52, 1, 52, 1, 52, 1, 52, 3, 52, 912, 8, 52, 1, 53, 1, 53, 1, 53, 3, 53, 917, 8, 53, 1, 54, 1, 54, 1, 54, 5, 54, 922, 8, 54, 10, 54, 12, 54, 925, 9, 54, 1, 55, 1, 55, 3, 55, 929, 8, 55, 1, 55, 1, 55, 3, 55, 933, 8, 55, 1, 55, 1, 55, 3, 55, 937, 8, 55, 1, 55, 3, 55, 940, 8, 55, 1, 56, 1, 56, 1, 56, 1, 56, 3, 56, 946, 8, 56, 1, 56, 1, 56, 3, 56, 950, 8, 56, 1, 56, 1, 56, 3, 56, 954, 8, 56, 1, 57, 1, 57, 1, 57, 3, 57, 959, 8, 57, 1, 58, 1, 58, 1, 58, 1, 58, 3, 58, 965, 8, 58, 3, 58, 967, 8, 58, 1, 59, 1, 59, 1, 59, 5, 59, 972, 8, 59, 10, 59, 12, 59, 975, 9, 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 61, 3, 61, 982, 8, 61, 1, 61, 3, 61, 985, 8, 61, 1, 61, 3, 61, 988, 8, 61, 1, 62, 1, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 65, 1, 65, 1, 65, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 3, 66, 1013, 8, 66, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 3, 67, 1027, 8, 67, 1, 68, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 5, 69, 1041, 8, 69, 10, 69, 12, 69, 1044, 9, 69, 1, 69, 3, 69, 1047, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 5, 69, 1056, 8, 69, 10, 69, 12, 69, 1059, 9, 69, 1, 69, 3, 69, 1062, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 5, 69, 1071, 8, 69, 10, 69, 12, 69, 1074, 9, 69, 1, 69, 3, 69, 1077, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 3, 69, 1084, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 4, 69, 1090, 8, 69, 11, 69, 12, 69, 1091, 1, 69, 3, 69, 1095, 8, 69, 1, 69, 1, 69, 1, 69, 3, 69, 1100, 8, 69, 1, 69, 5, 69, 1103, 8, 69, 10, 69, 12, 69, 1106, 9, 69, 1, 70, 1, 70, 1, 70, 3, 70, 1111, 8, 70, 1, 70, 1, 70, 1, 70, 1, 70, 3, 70, 1117, 8, 70, 1, 71, 1, 71, 1, 71, 1, 71, 3, 71, 1123, 8, 71, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 5, 73, 1130, 8, 73, 10, 73, 12, 73, 1133, 9, 73, 1, 73, 3, 73, 1136, 8, 73, 1, 74, 1, 74, 1, 74, 5, 74, 1141, 8, 74, 10, 74, 12, 74, 1144, 9, 74, 1, 74, 1, 74, 1, 74, 3, 74, 1149, 8, 74, 1, 75, 1, 75, 1, 75, 5, 75, 1154, 8, 75, 10, 75, 12, 75, 1157, 9, 75, 1, 75, 3, 75, 1160, 8, 75, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 3, 76, 1172, 8, 76, 1, 77, 1, 77, 1, 77, 3, 77, 1177, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 4, 77, 1184, 8, 77, 11, 77, 12, 77, 1185, 1, 77, 1, 77, 3, 77, 1190, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1223, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1271, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1299, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1363, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1371, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1377, 8, 77, 1, 77, 3, 77, 1380, 8, 77, 1, 77, 3, 77, 1383, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1391, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1401, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1407, 8, 77, 1, 77, 3, 77, 1410, 8, 77, 1, 77, 3, 77, 1413, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1421, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1429, 8, 77, 1, 77, 3, 77, 1432, 8, 77, 1, 77, 1, 77, 3, 77, 1436, 8, 77, 1, 77, 3, 77, 1439, 8, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1444, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1453, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1465, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1473, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 5, 77, 1479, 8, 77, 10, 77, 12, 77, 1482, 9, 77, 1, 77, 3, 77, 1485, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1503, 8, 77, 1, 77, 1, 77, 3, 77, 1507, 8, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1512, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1523, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1529, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1536, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1548, 8, 77, 1, 77, 1, 77, 3, 77, 1552, 8, 77, 1, 77, 3, 77, 1555, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1564, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1570, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1586, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1607, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1618, 8, 77, 1, 77, 1, 77, 3, 77, 1622, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1652, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1659, 8, 77, 5, 77, 1661, 8, 77, 10, 77, 12, 77, 1664, 9, 77, 1, 78, 1, 78, 1, 78, 1, 78, 5, 78, 1670, 8, 78, 10, 78, 12, 78, 1673, 9, 78, 1, 78, 3, 78, 1676, 8, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 5, 78, 1683, 8, 78, 10, 78, 12, 78, 1686, 9, 78, 1, 78, 3, 78, 1689, 8, 78, 1, 78, 1, 78, 3, 78, 1693, 8, 78, 1, 78, 1, 78, 1, 78, 3, 78, 1698, 8, 78, 1, 78, 1, 78, 1, 78, 1, 78, 5, 78, 1704, 8, 78, 10, 78, 12, 78, 1707, 9, 78, 1, 78, 3, 78, 1710, 8, 78, 1, 78, 1, 78, 1, 78, 3, 78, 1715, 8, 78, 1, 79, 1, 79, 1, 79, 5, 79, 1720, 8, 79, 10, 79, 12, 79, 1723, 9, 79, 1, 80, 1, 80, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 3, 81, 1735, 8, 81, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 5, 83, 1742, 8, 83, 10, 83, 12, 83, 1745, 9, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 5, 83, 1752, 8, 83, 10, 83, 12, 83, 1755, 9, 83, 1, 83, 1, 83, 5, 83, 1759, 8, 83, 10, 83, 12, 83, 1762, 9, 83, 1, 83, 1, 83, 1, 83, 1, 83, 3, 83, 1768, 8, 83, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 3, 84, 1781, 8, 84, 1, 85, 1, 85, 1, 85, 5, 85, 1786, 8, 85, 10, 85, 12, 85, 1789, 9, 85, 1, 85, 3, 85, 1792, 8, 85, 1, 86, 1, 86, 3, 86, 1796, 8, 86, 1, 86, 1, 86, 1, 86, 3, 86, 1801, 8, 86, 1, 86, 1, 86, 3, 86, 1805, 8, 86, 1, 86, 3, 86, 1808, 8, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 3, 86, 1818, 8, 86, 1, 87, 1, 87, 1, 87, 1, 87, 5, 87, 1824, 8, 87, 10, 87, 12, 87, 1827, 9, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, 1, 88, 3, 88, 1835, 8, 88, 1, 88, 3, 88, 1838, 8, 88, 1, 89, 1, 89, 1, 89, 5, 89, 1843, 8, 89, 10, 89, 12, 89, 1846, 9, 89, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1861, 8, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1871, 8, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1879, 8, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1889, 8, 90, 1, 90, 3, 90, 1892, 8, 90, 5, 90, 1894, 8, 90, 10, 90, 12, 90, 1897, 9, 90, 1, 91, 1, 91, 4, 91, 1901, 8, 91, 11, 91, 12, 91, 1902, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 93, 1, 93, 1, 93, 5, 93, 1914, 8, 93, 10, 93, 12, 93, 1917, 9, 93, 1, 93, 3, 93, 1920, 8, 93, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 5, 94, 1935, 8, 94, 10, 94, 12, 94, 1938, 9, 94, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 3, 95, 1945, 8, 95, 1, 96, 1, 96, 1, 96, 1, 96, 5, 96, 1951, 8, 96, 10, 96, 12, 96, 1954, 9, 96, 1, 96, 1, 96, 1, 97, 1, 97, 1, 97, 3, 97, 1961, 8, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 3, 98, 1968, 8, 98, 1, 98, 1, 98, 1, 99, 1, 99, 1, 99, 5, 99, 1975, 8, 99, 10, 99, 12, 99, 1978, 9, 99, 1, 99, 3, 99, 1981, 8, 99, 1, 100, 1, 100, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 3, 101, 1991, 8, 101, 3, 101, 1993, 8, 101, 1, 102, 3, 102, 1996, 8, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 3, 102, 2006, 8, 102, 1, 103, 1, 103, 1, 103, 3, 103, 2011, 8, 103, 1, 104, 1, 104, 1, 105, 1, 105, 1, 106, 1, 106, 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, 3, 108, 2024, 8, 108, 1, 109, 1, 109, 1, 109, 3, 109, 2029, 8, 109, 1, 110, 1, 110, 1, 110, 1, 110, 3, 110, 2035, 8, 110, 1, 111, 1, 111, 1, 111, 1, 111, 1, 112, 1, 112, 1, 112, 1, 112, 1, 113, 1, 113, 3, 113, 2047, 8, 113, 1, 114, 1, 114, 5, 114, 2051, 8, 114, 10, 114, 12, 114, 2054, 9, 114, 1, 114, 1, 114, 1, 115, 1, 115, 1, 115, 1, 115, 1, 115, 3, 115, 2063, 8, 115, 1, 116, 1, 116, 5, 116, 2067, 8, 116, 10, 116, 12, 116, 2070, 9, 116, 1, 116, 1, 116, 1, 117, 1, 117, 1, 117, 1, 117, 1, 117, 3, 117, 2079, 8, 117, 1, 117, 0, 4, 96, 138, 154, 180, 118, 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, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 0, 20, 2, 0, 36, 36, 41, 41, 2, 0, 19, 19, 94, 94, 2, 0, 53, 53, 63, 63, 3, 0, 1, 1, 4, 4, 8, 8, 2, 0, 3, 3, 100, 100, 4, 0, 1, 1, 3, 4, 8, 8, 100, 100, 2, 0, 63, 63, 93, 93, 2, 0, 76, 76, 151, 151, 2, 0, 7, 7, 23, 24, 2, 0, 35, 35, 61, 61, 2, 0, 89, 89, 96, 96, 3, 0, 21, 21, 56, 56, 108, 109, 3, 0, 10, 10, 62, 62, 115, 115, 2, 0, 48, 48, 65, 65, 1, 0, 138, 139, 2, 0, 153, 153, 175, 175, 7, 0, 22, 22, 45, 45, 68, 69, 88, 88, 98, 98, 125, 125, 132, 132, 20, 0, 1, 13, 15, 21, 23, 27, 29, 33, 35, 35, 37, 40, 42, 44, 46, 51, 53, 53, 55, 63, 65, 66, 70, 71, 73, 73, 75, 87, 89, 97, 99, 105, 107, 117, 119, 124, 126, 127, 129, 130, 4, 0, 21, 21, 35, 35, 46, 46, 59, 59, 8, 0, 7, 7, 15, 15, 21, 21, 24, 24, 31, 31, 46, 46, 92, 92, 113, 114, 2362, 0, 239, 1, 0, 0, 0, 2, 246, 1, 0, 0, 0, 4, 248, 1, 0, 0, 0, 6, 250, 1, 0, 0, 0, 8, 256, 1, 0, 0, 0, 10, 278, 1, 0, 0, 0, 12, 280, 1, 0, 0, 0, 14, 287, 1, 0, 0, 0, 16, 292, 1, 0, 0, 0, 18, 305, 1, 0, 0, 0, 20, 317, 1, 0, 0, 0, 22, 326, 1, 0, 0, 0, 24, 334, 1, 0, 0, 0, 26, 356, 1, 0, 0, 0, 28, 371, 1, 0, 0, 0, 30, 380, 1, 0, 0, 0, 32, 384, 1, 0, 0, 0, 34, 392, 1, 0, 0, 0, 36, 394, 1, 0, 0, 0, 38, 403, 1, 0, 0, 0, 40, 407, 1, 0, 0, 0, 42, 421, 1, 0, 0, 0, 44, 439, 1, 0, 0, 0, 46, 486, 1, 0, 0, 0, 48, 490, 1, 0, 0, 0, 50, 530, 1, 0, 0, 0, 52, 533, 1, 0, 0, 0, 54, 598, 1, 0, 0, 0, 56, 604, 1, 0, 0, 0, 58, 610, 1, 0, 0, 0, 60, 614, 1, 0, 0, 0, 62, 620, 1, 0, 0, 0, 64, 638, 1, 0, 0, 0, 66, 641, 1, 0, 0, 0, 68, 644, 1, 0, 0, 0, 70, 661, 1, 0, 0, 0, 72, 669, 1, 0, 0, 0, 74, 675, 1, 0, 0, 0, 76, 678, 1, 0, 0, 0, 78, 681, 1, 0, 0, 0, 80, 687, 1, 0, 0, 0, 82, 701, 1, 0, 0, 0, 84, 705, 1, 0, 0, 0, 86, 735, 1, 0, 0, 0, 88, 737, 1, 0, 0, 0, 90, 740, 1, 0, 0, 0, 92, 743, 1, 0, 0, 0, 94, 752, 1, 0, 0, 0, 96, 775, 1, 0, 0, 0, 98, 880, 1, 0, 0, 0, 100, 885, 1, 0, 0, 0, 102, 896, 1, 0, 0, 0, 104, 898, 1, 0, 0, 0, 106, 913, 1, 0, 0, 0, 108, 918, 1, 0, 0, 0, 110, 926, 1, 0, 0, 0, 112, 941, 1, 0, 0, 0, 114, 955, 1, 0, 0, 0, 116, 966, 1, 0, 0, 0, 118, 968, 1, 0, 0, 0, 120, 976, 1, 0, 0, 0, 122, 981, 1, 0, 0, 0, 124, 989, 1, 0, 0, 0, 126, 993, 1, 0, 0, 0, 128, 997, 1, 0, 0, 0, 130, 1003, 1, 0, 0, 0, 132, 1012, 1, 0, 0, 0, 134, 1026, 1, 0, 0, 0, 136, 1028, 1, 0, 0, 0, 138, 1094, 1, 0, 0, 0, 140, 1116, 1, 0, 0, 0, 142, 1122, 1, 0, 0, 0, 144, 1124, 1, 0, 0, 0, 146, 1126, 1, 0, 0, 0, 148, 1148, 1, 0, 0, 0, 150, 1150, 1, 0, 0, 0, 152, 1171, 1, 0, 0, 0, 154, 1522, 1, 0, 0, 0, 156, 1714, 1, 0, 0, 0, 158, 1716, 1, 0, 0, 0, 160, 1724, 1, 0, 0, 0, 162, 1734, 1, 0, 0, 0, 164, 1736, 1, 0, 0, 0, 166, 1767, 1, 0, 0, 0, 168, 1780, 1, 0, 0, 0, 170, 1782, 1, 0, 0, 0, 172, 1817, 1, 0, 0, 0, 174, 1819, 1, 0, 0, 0, 176, 1837, 1, 0, 0, 0, 178, 1839, 1, 0, 0, 0, 180, 1860, 1, 0, 0, 0, 182, 1898, 1, 0, 0, 0, 184, 1904, 1, 0, 0, 0, 186, 1910, 1, 0, 0, 0, 188, 1921, 1, 0, 0, 0, 190, 1944, 1, 0, 0, 0, 192, 1946, 1, 0, 0, 0, 194, 1957, 1, 0, 0, 0, 196, 1967, 1, 0, 0, 0, 198, 1971, 1, 0, 0, 0, 200, 1982, 1, 0, 0, 0, 202, 1992, 1, 0, 0, 0, 204, 1995, 1, 0, 0, 0, 206, 2010, 1, 0, 0, 0, 208, 2012, 1, 0, 0, 0, 210, 2014, 1, 0, 0, 0, 212, 2016, 1, 0, 0, 0, 214, 2018, 1, 0, 0, 0, 216, 2023, 1, 0, 0, 0, 218, 2028, 1, 0, 0, 0, 220, 2034, 1, 0, 0, 0, 222, 2036, 1, 0, 0, 0, 224, 2040, 1, 0, 0, 0, 226, 2046, 1, 0, 0, 0, 228, 2048, 1, 0, 0, 0, 230, 2062, 1, 0, 0, 0, 232, 2064, 1, 0, 0, 0, 234, 2078, 1, 0, 0, 0, 236, 238, 3, 2, 1, 0, 237, 236, 1, 0, 0, 0, 238, 241, 1, 0, 0, 0, 239, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 242, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 242, 243, 5, 0, 0, 1, 243, 1, 1, 0, 0, 0, 244, 247, 3, 6, 3, 0, 245, 247, 3, 10, 5, 0, 246, 244, 1, 0, 0, 0, 246, 245, 1, 0, 0, 0, 247, 3, 1, 0, 0, 0, 248, 249, 3, 154, 77, 0, 249, 5, 1, 0, 0, 0, 250, 251, 5, 64, 0, 0, 251, 254, 3, 220, 110, 0, 252, 253, 5, 149, 0, 0, 253, 255, 3, 4, 2, 0, 254, 252, 1, 0, 0, 0, 254, 255, 1, 0, 0, 0, 255, 7, 1, 0, 0, 0, 256, 261, 3, 178, 89, 0, 257, 258, 5, 151, 0, 0, 258, 260, 3, 178, 89, 0, 259, 257, 1, 0, 0, 0, 260, 263, 1, 0, 0, 0, 261, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 265, 1, 0, 0, 0, 263, 261, 1, 0, 0, 0, 264, 266, 5, 151, 0, 0, 265, 264, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, 9, 1, 0, 0, 0, 267, 279, 3, 12, 6, 0, 268, 279, 3, 14, 7, 0, 269, 279, 3, 18, 9, 0, 270, 279, 3, 20, 10, 0, 271, 279, 3, 22, 11, 0, 272, 279, 3, 26, 13, 0, 273, 279, 3, 24, 12, 0, 274, 279, 3, 28, 14, 0, 275, 279, 3, 36, 18, 0, 276, 279, 3, 32, 16, 0, 277, 279, 3, 34, 17, 0, 278, 267, 1, 0, 0, 0, 278, 268, 1, 0, 0, 0, 278, 269, 1, 0, 0, 0, 278, 270, 1, 0, 0, 0, 278, 271, 1, 0, 0, 0, 278, 272, 1, 0, 0, 0, 278, 273, 1, 0, 0, 0, 278, 274, 1, 0, 0, 0, 278, 275, 1, 0, 0, 0, 278, 276, 1, 0, 0, 0, 278, 277, 1, 0, 0, 0, 279, 11, 1, 0, 0, 0, 280, 282, 5, 92, 0, 0, 281, 283, 3, 4, 2, 0, 282, 281, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 285, 1, 0, 0, 0, 284, 286, 5, 186, 0, 0, 285, 284, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 13, 1, 0, 0, 0, 287, 288, 5, 106, 0, 0, 288, 290, 3, 4, 2, 0, 289, 291, 5, 186, 0, 0, 290, 289, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 15, 1, 0, 0, 0, 292, 301, 5, 14, 0, 0, 293, 294, 5, 165, 0, 0, 294, 297, 3, 220, 110, 0, 295, 296, 5, 150, 0, 0, 296, 298, 3, 220, 110, 0, 297, 295, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 300, 5, 185, 0, 0, 300, 302, 1, 0, 0, 0, 301, 293, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, 304, 3, 36, 18, 0, 304, 17, 1, 0, 0, 0, 305, 306, 5, 118, 0, 0, 306, 310, 3, 36, 18, 0, 307, 309, 3, 16, 8, 0, 308, 307, 1, 0, 0, 0, 309, 312, 1, 0, 0, 0, 310, 308, 1, 0, 0, 0, 310, 311, 1, 0, 0, 0, 311, 315, 1, 0, 0, 0, 312, 310, 1, 0, 0, 0, 313, 314, 5, 34, 0, 0, 314, 316, 3, 36, 18, 0, 315, 313, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, 19, 1, 0, 0, 0, 317, 318, 5, 47, 0, 0, 318, 319, 5, 165, 0, 0, 319, 320, 3, 4, 2, 0, 320, 321, 5, 185, 0, 0, 321, 324, 3, 10, 5, 0, 322, 323, 5, 26, 0, 0, 323, 325, 3, 10, 5, 0, 324, 322, 1, 0, 0, 0, 324, 325, 1, 0, 0, 0, 325, 21, 1, 0, 0, 0, 326, 327, 5, 128, 0, 0, 327, 328, 5, 165, 0, 0, 328, 329, 3, 4, 2, 0, 329, 330, 5, 185, 0, 0, 330, 332, 3, 10, 5, 0, 331, 333, 5, 186, 0, 0, 332, 331, 1, 0, 0, 0, 332, 333, 1, 0, 0, 0, 333, 23, 1, 0, 0, 0, 334, 335, 5, 38, 0, 0, 335, 339, 5, 165, 0, 0, 336, 340, 3, 6, 3, 0, 337, 340, 3, 30, 15, 0, 338, 340, 3, 4, 2, 0, 339, 336, 1, 0, 0, 0, 339, 337, 1, 0, 0, 0, 339, 338, 1, 0, 0, 0, 339, 340, 1, 0, 0, 0, 340, 341, 1, 0, 0, 0, 341, 343, 5, 186, 0, 0, 342, 344, 3, 4, 2, 0, 343, 342, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 349, 5, 186, 0, 0, 346, 350, 3, 6, 3, 0, 347, 350, 3, 30, 15, 0, 348, 350, 3, 4, 2, 0, 349, 346, 1, 0, 0, 0, 349, 347, 1, 0, 0, 0, 349, 348, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 352, 5, 185, 0, 0, 352, 354, 3, 10, 5, 0, 353, 355, 5, 186, 0, 0, 354, 353, 1, 0, 0, 0, 354, 355, 1, 0, 0, 0, 355, 25, 1, 0, 0, 0, 356, 357, 5, 38, 0, 0, 357, 358, 5, 165, 0, 0, 358, 359, 5, 64, 0, 0, 359, 362, 3, 220, 110, 0, 360, 361, 5, 151, 0, 0, 361, 363, 3, 220, 110, 0, 362, 360, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, 365, 5, 51, 0, 0, 365, 366, 3, 4, 2, 0, 366, 367, 5, 185, 0, 0, 367, 369, 3, 10, 5, 0, 368, 370, 5, 186, 0, 0, 369, 368, 1, 0, 0, 0, 369, 370, 1, 0, 0, 0, 370, 27, 1, 0, 0, 0, 371, 372, 7, 0, 0, 0, 372, 373, 3, 220, 110, 0, 373, 375, 5, 165, 0, 0, 374, 376, 3, 8, 4, 0, 375, 374, 1, 0, 0, 0, 375, 376, 1, 0, 0, 0, 376, 377, 1, 0, 0, 0, 377, 378, 5, 185, 0, 0, 378, 379, 3, 36, 18, 0, 379, 29, 1, 0, 0, 0, 380, 381, 3, 4, 2, 0, 381, 382, 5, 149, 0, 0, 382, 383, 3, 4, 2, 0, 383, 31, 1, 0, 0, 0, 384, 387, 3, 4, 2, 0, 385, 386, 5, 149, 0, 0, 386, 388, 3, 4, 2, 0, 387, 385, 1, 0, 0, 0, 387, 388, 1, 0, 0, 0, 388, 390, 1, 0, 0, 0, 389, 391, 5, 186, 0, 0, 390, 389, 1, 0, 0, 0, 390, 391, 1, 0, 0, 0, 391, 33, 1, 0, 0, 0, 392, 393, 5, 186, 0, 0, 393, 35, 1, 0, 0, 0, 394, 398, 5, 163, 0, 0, 395, 397, 3, 2, 1, 0, 396, 395, 1, 0, 0, 0, 397, 400, 1, 0, 0, 0, 398, 396, 1, 0, 0, 0, 398, 399, 1, 0, 0, 0, 399, 401, 1, 0, 0, 0, 400, 398, 1, 0, 0, 0, 401, 402, 5, 183, 0, 0, 402, 37, 1, 0, 0, 0, 403, 404, 3, 4, 2, 0, 404, 405, 5, 150, 0, 0, 405, 406, 3, 4, 2, 0, 406, 39, 1, 0, 0, 0, 407, 412, 3, 38, 19, 0, 408, 409, 5, 151, 0, 0, 409, 411, 3, 38, 19, 0, 410, 408, 1, 0, 0, 0, 411, 414, 1, 0, 0, 0, 412, 410, 1, 0, 0, 0, 412, 413, 1, 0, 0, 0, 413, 416, 1, 0, 0, 0, 414, 412, 1, 0, 0, 0, 415, 417, 5, 151, 0, 0, 416, 415, 1, 0, 0, 0, 416, 417, 1, 0, 0, 0, 417, 41, 1, 0, 0, 0, 418, 422, 3, 48, 24, 0, 419, 422, 3, 52, 26, 0, 420, 422, 3, 166, 83, 0, 421, 418, 1, 0, 0, 0, 421, 419, 1, 0, 0, 0, 421, 420, 1, 0, 0, 0, 422, 424, 1, 0, 0, 0, 423, 425, 5, 186, 0, 0, 424, 423, 1, 0, 0, 0, 424, 425, 1, 0, 0, 0, 425, 426, 1, 0, 0, 0, 426, 427, 5, 0, 0, 1, 427, 43, 1, 0, 0, 0, 428, 440, 3, 52, 26, 0, 429, 430, 3, 54, 27, 0, 430, 431, 5, 165, 0, 0, 431, 432, 3, 48, 24, 0, 432, 433, 5, 185, 0, 0, 433, 440, 1, 0, 0, 0, 434, 435, 5, 165, 0, 0, 435, 436, 3, 48, 24, 0, 436, 437, 5, 185, 0, 0, 437, 440, 1, 0, 0, 0, 438, 440, 3, 224, 112, 0, 439, 428, 1, 0, 0, 0, 439, 429, 1, 0, 0, 0, 439, 434, 1, 0, 0, 0, 439, 438, 1, 0, 0, 0, 440, 45, 1, 0, 0, 0, 441, 442, 5, 28, 0, 0, 442, 445, 5, 1, 0, 0, 443, 444, 5, 11, 0, 0, 444, 446, 5, 70, 0, 0, 445, 443, 1, 0, 0, 0, 445, 446, 1, 0, 0, 0, 446, 487, 1, 0, 0, 0, 447, 450, 5, 28, 0, 0, 448, 449, 5, 11, 0, 0, 449, 451, 5, 70, 0, 0, 450, 448, 1, 0, 0, 0, 450, 451, 1, 0, 0, 0, 451, 487, 1, 0, 0, 0, 452, 453, 5, 121, 0, 0, 453, 456, 5, 1, 0, 0, 454, 455, 5, 11, 0, 0, 455, 457, 5, 70, 0, 0, 456, 454, 1, 0, 0, 0, 456, 457, 1, 0, 0, 0, 457, 487, 1, 0, 0, 0, 458, 459, 5, 121, 0, 0, 459, 462, 5, 25, 0, 0, 460, 461, 5, 11, 0, 0, 461, 463, 5, 70, 0, 0, 462, 460, 1, 0, 0, 0, 462, 463, 1, 0, 0, 0, 463, 487, 1, 0, 0, 0, 464, 467, 5, 121, 0, 0, 465, 466, 5, 11, 0, 0, 466, 468, 5, 70, 0, 0, 467, 465, 1, 0, 0, 0, 467, 468, 1, 0, 0, 0, 468, 487, 1, 0, 0, 0, 469, 470, 5, 54, 0, 0, 470, 473, 5, 1, 0, 0, 471, 472, 5, 11, 0, 0, 472, 474, 5, 70, 0, 0, 473, 471, 1, 0, 0, 0, 473, 474, 1, 0, 0, 0, 474, 487, 1, 0, 0, 0, 475, 476, 5, 54, 0, 0, 476, 479, 5, 25, 0, 0, 477, 478, 5, 11, 0, 0, 478, 480, 5, 70, 0, 0, 479, 477, 1, 0, 0, 0, 479, 480, 1, 0, 0, 0, 480, 487, 1, 0, 0, 0, 481, 484, 5, 54, 0, 0, 482, 483, 5, 11, 0, 0, 483, 485, 5, 70, 0, 0, 484, 482, 1, 0, 0, 0, 484, 485, 1, 0, 0, 0, 485, 487, 1, 0, 0, 0, 486, 441, 1, 0, 0, 0, 486, 447, 1, 0, 0, 0, 486, 452, 1, 0, 0, 0, 486, 458, 1, 0, 0, 0, 486, 464, 1, 0, 0, 0, 486, 469, 1, 0, 0, 0, 486, 475, 1, 0, 0, 0, 486, 481, 1, 0, 0, 0, 487, 488, 1, 0, 0, 0, 488, 489, 3, 44, 22, 0, 489, 47, 1, 0, 0, 0, 490, 494, 3, 44, 22, 0, 491, 493, 3, 46, 23, 0, 492, 491, 1, 0, 0, 0, 493, 496, 1, 0, 0, 0, 494, 492, 1, 0, 0, 0, 494, 495, 1, 0, 0, 0, 495, 498, 1, 0, 0, 0, 496, 494, 1, 0, 0, 0, 497, 499, 3, 78, 39, 0, 498, 497, 1, 0, 0, 0, 498, 499, 1, 0, 0, 0, 499, 501, 1, 0, 0, 0, 500, 502, 3, 50, 25, 0, 501, 500, 1, 0, 0, 0, 501, 502, 1, 0, 0, 0, 502, 49, 1, 0, 0, 0, 503, 504, 5, 66, 0, 0, 504, 506, 3, 154, 77, 0, 505, 507, 5, 174, 0, 0, 506, 505, 1, 0, 0, 0, 506, 507, 1, 0, 0, 0, 507, 510, 1, 0, 0, 0, 508, 509, 5, 151, 0, 0, 509, 511, 3, 154, 77, 0, 510, 508, 1, 0, 0, 0, 510, 511, 1, 0, 0, 0, 511, 514, 1, 0, 0, 0, 512, 513, 5, 130, 0, 0, 513, 515, 5, 107, 0, 0, 514, 512, 1, 0, 0, 0, 514, 515, 1, 0, 0, 0, 515, 531, 1, 0, 0, 0, 516, 517, 5, 66, 0, 0, 517, 519, 3, 154, 77, 0, 518, 520, 5, 174, 0, 0, 519, 518, 1, 0, 0, 0, 519, 520, 1, 0, 0, 0, 520, 523, 1, 0, 0, 0, 521, 522, 5, 130, 0, 0, 522, 524, 5, 107, 0, 0, 523, 521, 1, 0, 0, 0, 523, 524, 1, 0, 0, 0, 524, 525, 1, 0, 0, 0, 525, 526, 5, 76, 0, 0, 526, 527, 3, 154, 77, 0, 527, 531, 1, 0, 0, 0, 528, 529, 5, 76, 0, 0, 529, 531, 3, 154, 77, 0, 530, 503, 1, 0, 0, 0, 530, 516, 1, 0, 0, 0, 530, 528, 1, 0, 0, 0, 531, 51, 1, 0, 0, 0, 532, 534, 3, 54, 27, 0, 533, 532, 1, 0, 0, 0, 533, 534, 1, 0, 0, 0, 534, 535, 1, 0, 0, 0, 535, 537, 5, 99, 0, 0, 536, 538, 5, 25, 0, 0, 537, 536, 1, 0, 0, 0, 537, 538, 1, 0, 0, 0, 538, 540, 1, 0, 0, 0, 539, 541, 3, 56, 28, 0, 540, 539, 1, 0, 0, 0, 540, 541, 1, 0, 0, 0, 541, 542, 1, 0, 0, 0, 542, 544, 3, 148, 74, 0, 543, 545, 3, 58, 29, 0, 544, 543, 1, 0, 0, 0, 544, 545, 1, 0, 0, 0, 545, 547, 1, 0, 0, 0, 546, 548, 3, 60, 30, 0, 547, 546, 1, 0, 0, 0, 547, 548, 1, 0, 0, 0, 548, 550, 1, 0, 0, 0, 549, 551, 3, 64, 32, 0, 550, 549, 1, 0, 0, 0, 550, 551, 1, 0, 0, 0, 551, 553, 1, 0, 0, 0, 552, 554, 3, 66, 33, 0, 553, 552, 1, 0, 0, 0, 553, 554, 1, 0, 0, 0, 554, 559, 1, 0, 0, 0, 555, 557, 5, 123, 0, 0, 556, 555, 1, 0, 0, 0, 556, 557, 1, 0, 0, 0, 557, 558, 1, 0, 0, 0, 558, 560, 3, 104, 52, 0, 559, 556, 1, 0, 0, 0, 559, 560, 1, 0, 0, 0, 560, 562, 1, 0, 0, 0, 561, 563, 3, 68, 34, 0, 562, 561, 1, 0, 0, 0, 562, 563, 1, 0, 0, 0, 563, 566, 1, 0, 0, 0, 564, 565, 5, 130, 0, 0, 565, 567, 7, 1, 0, 0, 566, 564, 1, 0, 0, 0, 566, 567, 1, 0, 0, 0, 567, 570, 1, 0, 0, 0, 568, 569, 5, 130, 0, 0, 569, 571, 5, 114, 0, 0, 570, 568, 1, 0, 0, 0, 570, 571, 1, 0, 0, 0, 571, 573, 1, 0, 0, 0, 572, 574, 3, 74, 37, 0, 573, 572, 1, 0, 0, 0, 573, 574, 1, 0, 0, 0, 574, 576, 1, 0, 0, 0, 575, 577, 3, 76, 38, 0, 576, 575, 1, 0, 0, 0, 576, 577, 1, 0, 0, 0, 577, 580, 1, 0, 0, 0, 578, 579, 5, 123, 0, 0, 579, 581, 3, 104, 52, 0, 580, 578, 1, 0, 0, 0, 580, 581, 1, 0, 0, 0, 581, 583, 1, 0, 0, 0, 582, 584, 3, 62, 31, 0, 583, 582, 1, 0, 0, 0, 583, 584, 1, 0, 0, 0, 584, 586, 1, 0, 0, 0, 585, 587, 3, 78, 39, 0, 586, 585, 1, 0, 0, 0, 586, 587, 1, 0, 0, 0, 587, 589, 1, 0, 0, 0, 588, 590, 3, 84, 42, 0, 589, 588, 1, 0, 0, 0, 589, 590, 1, 0, 0, 0, 590, 593, 1, 0, 0, 0, 591, 594, 3, 86, 43, 0, 592, 594, 3, 88, 44, 0, 593, 591, 1, 0, 0, 0, 593, 592, 1, 0, 0, 0, 593, 594, 1, 0, 0, 0, 594, 596, 1, 0, 0, 0, 595, 597, 3, 90, 45, 0, 596, 595, 1, 0, 0, 0, 596, 597, 1, 0, 0, 0, 597, 53, 1, 0, 0, 0, 598, 600, 5, 130, 0, 0, 599, 601, 5, 90, 0, 0, 600, 599, 1, 0, 0, 0, 600, 601, 1, 0, 0, 0, 601, 602, 1, 0, 0, 0, 602, 603, 3, 170, 85, 0, 603, 55, 1, 0, 0, 0, 604, 605, 5, 113, 0, 0, 605, 608, 5, 139, 0, 0, 606, 607, 5, 130, 0, 0, 607, 609, 5, 107, 0, 0, 608, 606, 1, 0, 0, 0, 608, 609, 1, 0, 0, 0, 609, 57, 1, 0, 0, 0, 610, 611, 5, 39, 0, 0, 611, 612, 3, 96, 48, 0, 612, 59, 1, 0, 0, 0, 613, 615, 7, 2, 0, 0, 614, 613, 1, 0, 0, 0, 614, 615, 1, 0, 0, 0, 615, 616, 1, 0, 0, 0, 616, 617, 5, 5, 0, 0, 617, 618, 5, 58, 0, 0, 618, 619, 3, 146, 73, 0, 619, 61, 1, 0, 0, 0, 620, 621, 5, 129, 0, 0, 621, 622, 3, 220, 110, 0, 622, 623, 5, 6, 0, 0, 623, 624, 5, 165, 0, 0, 624, 625, 3, 122, 61, 0, 625, 635, 5, 185, 0, 0, 626, 627, 5, 151, 0, 0, 627, 628, 3, 220, 110, 0, 628, 629, 5, 6, 0, 0, 629, 630, 5, 165, 0, 0, 630, 631, 3, 122, 61, 0, 631, 632, 5, 185, 0, 0, 632, 634, 1, 0, 0, 0, 633, 626, 1, 0, 0, 0, 634, 637, 1, 0, 0, 0, 635, 633, 1, 0, 0, 0, 635, 636, 1, 0, 0, 0, 636, 63, 1, 0, 0, 0, 637, 635, 1, 0, 0, 0, 638, 639, 5, 86, 0, 0, 639, 640, 3, 154, 77, 0, 640, 65, 1, 0, 0, 0, 641, 642, 5, 127, 0, 0, 642, 643, 3, 154, 77, 0, 643, 67, 1, 0, 0, 0, 644, 645, 5, 42, 0, 0, 645, 659, 5, 11, 0, 0, 646, 660, 5, 1, 0, 0, 647, 648, 7, 1, 0, 0, 648, 649, 5, 165, 0, 0, 649, 650, 3, 146, 73, 0, 650, 651, 5, 185, 0, 0, 651, 660, 1, 0, 0, 0, 652, 653, 5, 43, 0, 0, 653, 654, 5, 101, 0, 0, 654, 655, 5, 165, 0, 0, 655, 656, 3, 70, 35, 0, 656, 657, 5, 185, 0, 0, 657, 660, 1, 0, 0, 0, 658, 660, 3, 146, 73, 0, 659, 646, 1, 0, 0, 0, 659, 647, 1, 0, 0, 0, 659, 652, 1, 0, 0, 0, 659, 658, 1, 0, 0, 0, 660, 69, 1, 0, 0, 0, 661, 666, 3, 72, 36, 0, 662, 663, 5, 151, 0, 0, 663, 665, 3, 72, 36, 0, 664, 662, 1, 0, 0, 0, 665, 668, 1, 0, 0, 0, 666, 664, 1, 0, 0, 0, 666, 667, 1, 0, 0, 0, 667, 71, 1, 0, 0, 0, 668, 666, 1, 0, 0, 0, 669, 671, 5, 165, 0, 0, 670, 672, 3, 146, 73, 0, 671, 670, 1, 0, 0, 0, 671, 672, 1, 0, 0, 0, 672, 673, 1, 0, 0, 0, 673, 674, 5, 185, 0, 0, 674, 73, 1, 0, 0, 0, 675, 676, 5, 44, 0, 0, 676, 677, 3, 154, 77, 0, 677, 75, 1, 0, 0, 0, 678, 679, 5, 87, 0, 0, 679, 680, 3, 154, 77, 0, 680, 77, 1, 0, 0, 0, 681, 682, 5, 79, 0, 0, 682, 683, 5, 11, 0, 0, 683, 685, 3, 108, 54, 0, 684, 686, 3, 80, 40, 0, 685, 684, 1, 0, 0, 0, 685, 686, 1, 0, 0, 0, 686, 79, 1, 0, 0, 0, 687, 699, 5, 55, 0, 0, 688, 689, 5, 165, 0, 0, 689, 694, 3, 114, 57, 0, 690, 691, 5, 151, 0, 0, 691, 693, 3, 114, 57, 0, 692, 690, 1, 0, 0, 0, 693, 696, 1, 0, 0, 0, 694, 692, 1, 0, 0, 0, 694, 695, 1, 0, 0, 0, 695, 697, 1, 0, 0, 0, 696, 694, 1, 0, 0, 0, 697, 698, 5, 185, 0, 0, 698, 700, 1, 0, 0, 0, 699, 688, 1, 0, 0, 0, 699, 700, 1, 0, 0, 0, 700, 81, 1, 0, 0, 0, 701, 702, 5, 79, 0, 0, 702, 703, 5, 11, 0, 0, 703, 704, 3, 146, 73, 0, 704, 83, 1, 0, 0, 0, 705, 706, 5, 66, 0, 0, 706, 707, 3, 106, 53, 0, 707, 708, 5, 11, 0, 0, 708, 709, 3, 146, 73, 0, 709, 85, 1, 0, 0, 0, 710, 711, 5, 66, 0, 0, 711, 713, 3, 154, 77, 0, 712, 714, 5, 174, 0, 0, 713, 712, 1, 0, 0, 0, 713, 714, 1, 0, 0, 0, 714, 717, 1, 0, 0, 0, 715, 716, 5, 151, 0, 0, 716, 718, 3, 154, 77, 0, 717, 715, 1, 0, 0, 0, 717, 718, 1, 0, 0, 0, 718, 721, 1, 0, 0, 0, 719, 720, 5, 130, 0, 0, 720, 722, 5, 107, 0, 0, 721, 719, 1, 0, 0, 0, 721, 722, 1, 0, 0, 0, 722, 736, 1, 0, 0, 0, 723, 724, 5, 66, 0, 0, 724, 726, 3, 154, 77, 0, 725, 727, 5, 174, 0, 0, 726, 725, 1, 0, 0, 0, 726, 727, 1, 0, 0, 0, 727, 730, 1, 0, 0, 0, 728, 729, 5, 130, 0, 0, 729, 731, 5, 107, 0, 0, 730, 728, 1, 0, 0, 0, 730, 731, 1, 0, 0, 0, 731, 732, 1, 0, 0, 0, 732, 733, 5, 76, 0, 0, 733, 734, 3, 154, 77, 0, 734, 736, 1, 0, 0, 0, 735, 710, 1, 0, 0, 0, 735, 723, 1, 0, 0, 0, 736, 87, 1, 0, 0, 0, 737, 738, 5, 76, 0, 0, 738, 739, 3, 154, 77, 0, 739, 89, 1, 0, 0, 0, 740, 741, 5, 102, 0, 0, 741, 742, 3, 118, 59, 0, 742, 91, 1, 0, 0, 0, 743, 744, 5, 124, 0, 0, 744, 749, 3, 94, 47, 0, 745, 746, 5, 151, 0, 0, 746, 748, 3, 94, 47, 0, 747, 745, 1, 0, 0, 0, 748, 751, 1, 0, 0, 0, 749, 747, 1, 0, 0, 0, 749, 750, 1, 0, 0, 0, 750, 93, 1, 0, 0, 0, 751, 749, 1, 0, 0, 0, 752, 753, 5, 165, 0, 0, 753, 758, 3, 154, 77, 0, 754, 755, 5, 151, 0, 0, 755, 757, 3, 154, 77, 0, 756, 754, 1, 0, 0, 0, 757, 760, 1, 0, 0, 0, 758, 756, 1, 0, 0, 0, 758, 759, 1, 0, 0, 0, 759, 761, 1, 0, 0, 0, 760, 758, 1, 0, 0, 0, 761, 762, 5, 185, 0, 0, 762, 95, 1, 0, 0, 0, 763, 764, 6, 48, -1, 0, 764, 766, 3, 180, 90, 0, 765, 767, 5, 31, 0, 0, 766, 765, 1, 0, 0, 0, 766, 767, 1, 0, 0, 0, 767, 769, 1, 0, 0, 0, 768, 770, 3, 104, 52, 0, 769, 768, 1, 0, 0, 0, 769, 770, 1, 0, 0, 0, 770, 776, 1, 0, 0, 0, 771, 772, 5, 165, 0, 0, 772, 773, 3, 96, 48, 0, 773, 774, 5, 185, 0, 0, 774, 776, 1, 0, 0, 0, 775, 763, 1, 0, 0, 0, 775, 771, 1, 0, 0, 0, 776, 824, 1, 0, 0, 0, 777, 778, 10, 5, 0, 0, 778, 779, 3, 100, 50, 0, 779, 780, 3, 96, 48, 6, 780, 823, 1, 0, 0, 0, 781, 783, 10, 7, 0, 0, 782, 784, 5, 71, 0, 0, 783, 782, 1, 0, 0, 0, 783, 784, 1, 0, 0, 0, 784, 786, 1, 0, 0, 0, 785, 787, 3, 98, 49, 0, 786, 785, 1, 0, 0, 0, 786, 787, 1, 0, 0, 0, 787, 788, 1, 0, 0, 0, 788, 789, 5, 58, 0, 0, 789, 791, 3, 96, 48, 0, 790, 792, 3, 102, 51, 0, 791, 790, 1, 0, 0, 0, 791, 792, 1, 0, 0, 0, 792, 823, 1, 0, 0, 0, 793, 794, 10, 6, 0, 0, 794, 795, 5, 84, 0, 0, 795, 796, 5, 58, 0, 0, 796, 798, 3, 96, 48, 0, 797, 799, 3, 102, 51, 0, 798, 797, 1, 0, 0, 0, 798, 799, 1, 0, 0, 0, 799, 823, 1, 0, 0, 0, 800, 801, 10, 4, 0, 0, 801, 802, 5, 83, 0, 0, 802, 803, 5, 165, 0, 0, 803, 804, 3, 146, 73, 0, 804, 808, 3, 182, 91, 0, 805, 806, 5, 42, 0, 0, 806, 807, 5, 11, 0, 0, 807, 809, 3, 146, 73, 0, 808, 805, 1, 0, 0, 0, 808, 809, 1, 0, 0, 0, 809, 810, 1, 0, 0, 0, 810, 811, 5, 185, 0, 0, 811, 823, 1, 0, 0, 0, 812, 813, 10, 3, 0, 0, 813, 816, 5, 122, 0, 0, 814, 815, 5, 50, 0, 0, 815, 817, 5, 75, 0, 0, 816, 814, 1, 0, 0, 0, 816, 817, 1, 0, 0, 0, 817, 818, 1, 0, 0, 0, 818, 819, 5, 165, 0, 0, 819, 820, 3, 186, 93, 0, 820, 821, 5, 185, 0, 0, 821, 823, 1, 0, 0, 0, 822, 777, 1, 0, 0, 0, 822, 781, 1, 0, 0, 0, 822, 793, 1, 0, 0, 0, 822, 800, 1, 0, 0, 0, 822, 812, 1, 0, 0, 0, 823, 826, 1, 0, 0, 0, 824, 822, 1, 0, 0, 0, 824, 825, 1, 0, 0, 0, 825, 97, 1, 0, 0, 0, 826, 824, 1, 0, 0, 0, 827, 829, 7, 3, 0, 0, 828, 827, 1, 0, 0, 0, 828, 829, 1, 0, 0, 0, 829, 830, 1, 0, 0, 0, 830, 841, 5, 53, 0, 0, 831, 833, 5, 53, 0, 0, 832, 834, 7, 3, 0, 0, 833, 832, 1, 0, 0, 0, 833, 834, 1, 0, 0, 0, 834, 841, 1, 0, 0, 0, 835, 841, 7, 3, 0, 0, 836, 841, 5, 3, 0, 0, 837, 841, 5, 100, 0, 0, 838, 839, 5, 8, 0, 0, 839, 841, 7, 4, 0, 0, 840, 828, 1, 0, 0, 0, 840, 831, 1, 0, 0, 0, 840, 835, 1, 0, 0, 0, 840, 836, 1, 0, 0, 0, 840, 837, 1, 0, 0, 0, 840, 838, 1, 0, 0, 0, 841, 881, 1, 0, 0, 0, 842, 844, 7, 5, 0, 0, 843, 842, 1, 0, 0, 0, 843, 844, 1, 0, 0, 0, 844, 845, 1, 0, 0, 0, 845, 847, 7, 6, 0, 0, 846, 848, 5, 80, 0, 0, 847, 846, 1, 0, 0, 0, 847, 848, 1, 0, 0, 0, 848, 863, 1, 0, 0, 0, 849, 851, 7, 6, 0, 0, 850, 852, 5, 80, 0, 0, 851, 850, 1, 0, 0, 0, 851, 852, 1, 0, 0, 0, 852, 854, 1, 0, 0, 0, 853, 855, 7, 5, 0, 0, 854, 853, 1, 0, 0, 0, 854, 855, 1, 0, 0, 0, 855, 863, 1, 0, 0, 0, 856, 857, 5, 8, 0, 0, 857, 858, 7, 4, 0, 0, 858, 860, 7, 6, 0, 0, 859, 861, 5, 80, 0, 0, 860, 859, 1, 0, 0, 0, 860, 861, 1, 0, 0, 0, 861, 863, 1, 0, 0, 0, 862, 843, 1, 0, 0, 0, 862, 849, 1, 0, 0, 0, 862, 856, 1, 0, 0, 0, 863, 881, 1, 0, 0, 0, 864, 866, 7, 3, 0, 0, 865, 864, 1, 0, 0, 0, 865, 866, 1, 0, 0, 0, 866, 867, 1, 0, 0, 0, 867, 869, 5, 40, 0, 0, 868, 870, 5, 80, 0, 0, 869, 868, 1, 0, 0, 0, 869, 870, 1, 0, 0, 0, 870, 879, 1, 0, 0, 0, 871, 873, 5, 40, 0, 0, 872, 874, 5, 80, 0, 0, 873, 872, 1, 0, 0, 0, 873, 874, 1, 0, 0, 0, 874, 876, 1, 0, 0, 0, 875, 877, 7, 3, 0, 0, 876, 875, 1, 0, 0, 0, 876, 877, 1, 0, 0, 0, 877, 879, 1, 0, 0, 0, 878, 865, 1, 0, 0, 0, 878, 871, 1, 0, 0, 0, 879, 881, 1, 0, 0, 0, 880, 840, 1, 0, 0, 0, 880, 862, 1, 0, 0, 0, 880, 878, 1, 0, 0, 0, 881, 99, 1, 0, 0, 0, 882, 883, 5, 18, 0, 0, 883, 886, 5, 58, 0, 0, 884, 886, 5, 151, 0, 0, 885, 882, 1, 0, 0, 0, 885, 884, 1, 0, 0, 0, 886, 101, 1, 0, 0, 0, 887, 888, 5, 77, 0, 0, 888, 897, 3, 146, 73, 0, 889, 890, 5, 123, 0, 0, 890, 891, 5, 165, 0, 0, 891, 892, 3, 146, 73, 0, 892, 893, 5, 185, 0, 0, 893, 897, 1, 0, 0, 0, 894, 895, 5, 123, 0, 0, 895, 897, 3, 146, 73, 0, 896, 887, 1, 0, 0, 0, 896, 889, 1, 0, 0, 0, 896, 894, 1, 0, 0, 0, 897, 103, 1, 0, 0, 0, 898, 899, 5, 97, 0, 0, 899, 901, 3, 116, 58, 0, 900, 902, 5, 174, 0, 0, 901, 900, 1, 0, 0, 0, 901, 902, 1, 0, 0, 0, 902, 905, 1, 0, 0, 0, 903, 904, 5, 76, 0, 0, 904, 906, 3, 116, 58, 0, 905, 903, 1, 0, 0, 0, 905, 906, 1, 0, 0, 0, 906, 911, 1, 0, 0, 0, 907, 908, 5, 165, 0, 0, 908, 909, 3, 220, 110, 0, 909, 910, 5, 185, 0, 0, 910, 912, 1, 0, 0, 0, 911, 907, 1, 0, 0, 0, 911, 912, 1, 0, 0, 0, 912, 105, 1, 0, 0, 0, 913, 916, 3, 154, 77, 0, 914, 915, 7, 7, 0, 0, 915, 917, 3, 154, 77, 0, 916, 914, 1, 0, 0, 0, 916, 917, 1, 0, 0, 0, 917, 107, 1, 0, 0, 0, 918, 923, 3, 110, 55, 0, 919, 920, 5, 151, 0, 0, 920, 922, 3, 110, 55, 0, 921, 919, 1, 0, 0, 0, 922, 925, 1, 0, 0, 0, 923, 921, 1, 0, 0, 0, 923, 924, 1, 0, 0, 0, 924, 109, 1, 0, 0, 0, 925, 923, 1, 0, 0, 0, 926, 928, 3, 154, 77, 0, 927, 929, 7, 8, 0, 0, 928, 927, 1, 0, 0, 0, 928, 929, 1, 0, 0, 0, 929, 932, 1, 0, 0, 0, 930, 931, 5, 75, 0, 0, 931, 933, 7, 9, 0, 0, 932, 930, 1, 0, 0, 0, 932, 933, 1, 0, 0, 0, 933, 936, 1, 0, 0, 0, 934, 935, 5, 16, 0, 0, 935, 937, 5, 143, 0, 0, 936, 934, 1, 0, 0, 0, 936, 937, 1, 0, 0, 0, 937, 939, 1, 0, 0, 0, 938, 940, 3, 112, 56, 0, 939, 938, 1, 0, 0, 0, 939, 940, 1, 0, 0, 0, 940, 111, 1, 0, 0, 0, 941, 942, 5, 130, 0, 0, 942, 945, 5, 32, 0, 0, 943, 944, 5, 39, 0, 0, 944, 946, 3, 154, 77, 0, 945, 943, 1, 0, 0, 0, 945, 946, 1, 0, 0, 0, 946, 949, 1, 0, 0, 0, 947, 948, 5, 112, 0, 0, 948, 950, 3, 154, 77, 0, 949, 947, 1, 0, 0, 0, 949, 950, 1, 0, 0, 0, 950, 953, 1, 0, 0, 0, 951, 952, 5, 103, 0, 0, 952, 954, 3, 154, 77, 0, 953, 951, 1, 0, 0, 0, 953, 954, 1, 0, 0, 0, 954, 113, 1, 0, 0, 0, 955, 958, 3, 154, 77, 0, 956, 957, 5, 6, 0, 0, 957, 959, 3, 154, 77, 0, 958, 956, 1, 0, 0, 0, 958, 959, 1, 0, 0, 0, 959, 115, 1, 0, 0, 0, 960, 967, 3, 224, 112, 0, 961, 964, 3, 204, 102, 0, 962, 963, 5, 187, 0, 0, 963, 965, 3, 204, 102, 0, 964, 962, 1, 0, 0, 0, 964, 965, 1, 0, 0, 0, 965, 967, 1, 0, 0, 0, 966, 960, 1, 0, 0, 0, 966, 961, 1, 0, 0, 0, 967, 117, 1, 0, 0, 0, 968, 973, 3, 120, 60, 0, 969, 970, 5, 151, 0, 0, 970, 972, 3, 120, 60, 0, 971, 969, 1, 0, 0, 0, 972, 975, 1, 0, 0, 0, 973, 971, 1, 0, 0, 0, 973, 974, 1, 0, 0, 0, 974, 119, 1, 0, 0, 0, 975, 973, 1, 0, 0, 0, 976, 977, 3, 220, 110, 0, 977, 978, 5, 157, 0, 0, 978, 979, 3, 206, 103, 0, 979, 121, 1, 0, 0, 0, 980, 982, 3, 124, 62, 0, 981, 980, 1, 0, 0, 0, 981, 982, 1, 0, 0, 0, 982, 984, 1, 0, 0, 0, 983, 985, 3, 126, 63, 0, 984, 983, 1, 0, 0, 0, 984, 985, 1, 0, 0, 0, 985, 987, 1, 0, 0, 0, 986, 988, 3, 130, 65, 0, 987, 986, 1, 0, 0, 0, 987, 988, 1, 0, 0, 0, 988, 123, 1, 0, 0, 0, 989, 990, 5, 82, 0, 0, 990, 991, 5, 11, 0, 0, 991, 992, 3, 146, 73, 0, 992, 125, 1, 0, 0, 0, 993, 994, 5, 79, 0, 0, 994, 995, 5, 11, 0, 0, 995, 996, 3, 108, 54, 0, 996, 127, 1, 0, 0, 0, 997, 998, 5, 131, 0, 0, 998, 999, 5, 42, 0, 0, 999, 1000, 5, 165, 0, 0, 1000, 1001, 3, 78, 39, 0, 1001, 1002, 5, 185, 0, 0, 1002, 129, 1, 0, 0, 0, 1003, 1004, 7, 10, 0, 0, 1004, 1005, 3, 132, 66, 0, 1005, 131, 1, 0, 0, 0, 1006, 1013, 3, 134, 67, 0, 1007, 1008, 5, 9, 0, 0, 1008, 1009, 3, 134, 67, 0, 1009, 1010, 5, 2, 0, 0, 1010, 1011, 3, 134, 67, 0, 1011, 1013, 1, 0, 0, 0, 1012, 1006, 1, 0, 0, 0, 1012, 1007, 1, 0, 0, 0, 1013, 133, 1, 0, 0, 0, 1014, 1015, 5, 20, 0, 0, 1015, 1027, 5, 95, 0, 0, 1016, 1017, 5, 120, 0, 0, 1017, 1027, 5, 85, 0, 0, 1018, 1019, 5, 120, 0, 0, 1019, 1027, 5, 37, 0, 0, 1020, 1021, 3, 154, 77, 0, 1021, 1022, 5, 85, 0, 0, 1022, 1027, 1, 0, 0, 0, 1023, 1024, 3, 154, 77, 0, 1024, 1025, 5, 37, 0, 0, 1025, 1027, 1, 0, 0, 0, 1026, 1014, 1, 0, 0, 0, 1026, 1016, 1, 0, 0, 0, 1026, 1018, 1, 0, 0, 0, 1026, 1020, 1, 0, 0, 0, 1026, 1023, 1, 0, 0, 0, 1027, 135, 1, 0, 0, 0, 1028, 1029, 3, 154, 77, 0, 1029, 1030, 5, 0, 0, 1, 1030, 137, 1, 0, 0, 0, 1031, 1032, 6, 69, -1, 0, 1032, 1033, 3, 220, 110, 0, 1033, 1034, 5, 165, 0, 0, 1034, 1035, 3, 220, 110, 0, 1035, 1042, 3, 138, 69, 0, 1036, 1037, 5, 151, 0, 0, 1037, 1038, 3, 220, 110, 0, 1038, 1039, 3, 138, 69, 0, 1039, 1041, 1, 0, 0, 0, 1040, 1036, 1, 0, 0, 0, 1041, 1044, 1, 0, 0, 0, 1042, 1040, 1, 0, 0, 0, 1042, 1043, 1, 0, 0, 0, 1043, 1046, 1, 0, 0, 0, 1044, 1042, 1, 0, 0, 0, 1045, 1047, 5, 151, 0, 0, 1046, 1045, 1, 0, 0, 0, 1046, 1047, 1, 0, 0, 0, 1047, 1048, 1, 0, 0, 0, 1048, 1049, 5, 185, 0, 0, 1049, 1095, 1, 0, 0, 0, 1050, 1051, 3, 220, 110, 0, 1051, 1052, 5, 165, 0, 0, 1052, 1057, 3, 222, 111, 0, 1053, 1054, 5, 151, 0, 0, 1054, 1056, 3, 222, 111, 0, 1055, 1053, 1, 0, 0, 0, 1056, 1059, 1, 0, 0, 0, 1057, 1055, 1, 0, 0, 0, 1057, 1058, 1, 0, 0, 0, 1058, 1061, 1, 0, 0, 0, 1059, 1057, 1, 0, 0, 0, 1060, 1062, 5, 151, 0, 0, 1061, 1060, 1, 0, 0, 0, 1061, 1062, 1, 0, 0, 0, 1062, 1063, 1, 0, 0, 0, 1063, 1064, 5, 185, 0, 0, 1064, 1095, 1, 0, 0, 0, 1065, 1066, 3, 220, 110, 0, 1066, 1067, 5, 165, 0, 0, 1067, 1072, 3, 138, 69, 0, 1068, 1069, 5, 151, 0, 0, 1069, 1071, 3, 138, 69, 0, 1070, 1068, 1, 0, 0, 0, 1071, 1074, 1, 0, 0, 0, 1072, 1070, 1, 0, 0, 0, 1072, 1073, 1, 0, 0, 0, 1073, 1076, 1, 0, 0, 0, 1074, 1072, 1, 0, 0, 0, 1075, 1077, 5, 151, 0, 0, 1076, 1075, 1, 0, 0, 0, 1076, 1077, 1, 0, 0, 0, 1077, 1078, 1, 0, 0, 0, 1078, 1079, 5, 185, 0, 0, 1079, 1095, 1, 0, 0, 0, 1080, 1081, 3, 220, 110, 0, 1081, 1083, 5, 165, 0, 0, 1082, 1084, 3, 146, 73, 0, 1083, 1082, 1, 0, 0, 0, 1083, 1084, 1, 0, 0, 0, 1084, 1085, 1, 0, 0, 0, 1085, 1086, 5, 185, 0, 0, 1086, 1095, 1, 0, 0, 0, 1087, 1089, 3, 220, 110, 0, 1088, 1090, 3, 220, 110, 0, 1089, 1088, 1, 0, 0, 0, 1090, 1091, 1, 0, 0, 0, 1091, 1089, 1, 0, 0, 0, 1091, 1092, 1, 0, 0, 0, 1092, 1095, 1, 0, 0, 0, 1093, 1095, 3, 220, 110, 0, 1094, 1031, 1, 0, 0, 0, 1094, 1050, 1, 0, 0, 0, 1094, 1065, 1, 0, 0, 0, 1094, 1080, 1, 0, 0, 0, 1094, 1087, 1, 0, 0, 0, 1094, 1093, 1, 0, 0, 0, 1095, 1104, 1, 0, 0, 0, 1096, 1097, 10, 7, 0, 0, 1097, 1099, 5, 164, 0, 0, 1098, 1100, 5, 139, 0, 0, 1099, 1098, 1, 0, 0, 0, 1099, 1100, 1, 0, 0, 0, 1100, 1101, 1, 0, 0, 0, 1101, 1103, 5, 184, 0, 0, 1102, 1096, 1, 0, 0, 0, 1103, 1106, 1, 0, 0, 0, 1104, 1102, 1, 0, 0, 0, 1104, 1105, 1, 0, 0, 0, 1105, 139, 1, 0, 0, 0, 1106, 1104, 1, 0, 0, 0, 1107, 1108, 3, 142, 71, 0, 1108, 1110, 5, 130, 0, 0, 1109, 1111, 5, 110, 0, 0, 1110, 1109, 1, 0, 0, 0, 1110, 1111, 1, 0, 0, 0, 1111, 1112, 1, 0, 0, 0, 1112, 1113, 5, 109, 0, 0, 1113, 1114, 5, 111, 0, 0, 1114, 1117, 1, 0, 0, 0, 1115, 1117, 3, 142, 71, 0, 1116, 1107, 1, 0, 0, 0, 1116, 1115, 1, 0, 0, 0, 1117, 141, 1, 0, 0, 0, 1118, 1123, 5, 134, 0, 0, 1119, 1123, 5, 135, 0, 0, 1120, 1123, 3, 208, 104, 0, 1121, 1123, 3, 144, 72, 0, 1122, 1118, 1, 0, 0, 0, 1122, 1119, 1, 0, 0, 0, 1122, 1120, 1, 0, 0, 0, 1122, 1121, 1, 0, 0, 0, 1123, 143, 1, 0, 0, 0, 1124, 1125, 7, 11, 0, 0, 1125, 145, 1, 0, 0, 0, 1126, 1131, 3, 154, 77, 0, 1127, 1128, 5, 151, 0, 0, 1128, 1130, 3, 154, 77, 0, 1129, 1127, 1, 0, 0, 0, 1130, 1133, 1, 0, 0, 0, 1131, 1129, 1, 0, 0, 0, 1131, 1132, 1, 0, 0, 0, 1132, 1135, 1, 0, 0, 0, 1133, 1131, 1, 0, 0, 0, 1134, 1136, 5, 151, 0, 0, 1135, 1134, 1, 0, 0, 0, 1135, 1136, 1, 0, 0, 0, 1136, 147, 1, 0, 0, 0, 1137, 1142, 3, 152, 76, 0, 1138, 1139, 5, 151, 0, 0, 1139, 1141, 3, 152, 76, 0, 1140, 1138, 1, 0, 0, 0, 1141, 1144, 1, 0, 0, 0, 1142, 1140, 1, 0, 0, 0, 1142, 1143, 1, 0, 0, 0, 1143, 1145, 1, 0, 0, 0, 1144, 1142, 1, 0, 0, 0, 1145, 1146, 5, 151, 0, 0, 1146, 1149, 1, 0, 0, 0, 1147, 1149, 3, 150, 75, 0, 1148, 1137, 1, 0, 0, 0, 1148, 1147, 1, 0, 0, 0, 1149, 149, 1, 0, 0, 0, 1150, 1155, 3, 152, 76, 0, 1151, 1152, 5, 151, 0, 0, 1152, 1154, 3, 152, 76, 0, 1153, 1151, 1, 0, 0, 0, 1154, 1157, 1, 0, 0, 0, 1155, 1153, 1, 0, 0, 0, 1155, 1156, 1, 0, 0, 0, 1156, 1159, 1, 0, 0, 0, 1157, 1155, 1, 0, 0, 0, 1158, 1160, 5, 151, 0, 0, 1159, 1158, 1, 0, 0, 0, 1159, 1160, 1, 0, 0, 0, 1160, 151, 1, 0, 0, 0, 1161, 1162, 3, 220, 110, 0, 1162, 1163, 5, 150, 0, 0, 1163, 1164, 3, 154, 77, 0, 1164, 1172, 1, 0, 0, 0, 1165, 1166, 5, 39, 0, 0, 1166, 1172, 3, 218, 109, 0, 1167, 1172, 3, 154, 77, 0, 1168, 1169, 3, 154, 77, 0, 1169, 1170, 3, 218, 109, 0, 1170, 1172, 1, 0, 0, 0, 1171, 1161, 1, 0, 0, 0, 1171, 1165, 1, 0, 0, 0, 1171, 1167, 1, 0, 0, 0, 1171, 1168, 1, 0, 0, 0, 1172, 153, 1, 0, 0, 0, 1173, 1174, 6, 77, -1, 0, 1174, 1176, 5, 12, 0, 0, 1175, 1177, 3, 154, 77, 0, 1176, 1175, 1, 0, 0, 0, 1176, 1177, 1, 0, 0, 0, 1177, 1183, 1, 0, 0, 0, 1178, 1179, 5, 126, 0, 0, 1179, 1180, 3, 154, 77, 0, 1180, 1181, 5, 105, 0, 0, 1181, 1182, 3, 154, 77, 0, 1182, 1184, 1, 0, 0, 0, 1183, 1178, 1, 0, 0, 0, 1184, 1185, 1, 0, 0, 0, 1185, 1183, 1, 0, 0, 0, 1185, 1186, 1, 0, 0, 0, 1186, 1189, 1, 0, 0, 0, 1187, 1188, 5, 26, 0, 0, 1188, 1190, 3, 154, 77, 0, 1189, 1187, 1, 0, 0, 0, 1189, 1190, 1, 0, 0, 0, 1190, 1191, 1, 0, 0, 0, 1191, 1192, 5, 27, 0, 0, 1192, 1523, 1, 0, 0, 0, 1193, 1194, 5, 13, 0, 0, 1194, 1195, 5, 165, 0, 0, 1195, 1196, 3, 154, 77, 0, 1196, 1197, 5, 6, 0, 0, 1197, 1198, 3, 138, 69, 0, 1198, 1199, 5, 185, 0, 0, 1199, 1523, 1, 0, 0, 0, 1200, 1201, 5, 119, 0, 0, 1201, 1202, 5, 165, 0, 0, 1202, 1203, 3, 154, 77, 0, 1203, 1204, 5, 6, 0, 0, 1204, 1205, 3, 138, 69, 0, 1205, 1206, 5, 185, 0, 0, 1206, 1523, 1, 0, 0, 0, 1207, 1208, 5, 21, 0, 0, 1208, 1523, 5, 143, 0, 0, 1209, 1210, 5, 56, 0, 0, 1210, 1523, 5, 143, 0, 0, 1211, 1212, 5, 56, 0, 0, 1212, 1213, 3, 154, 77, 0, 1213, 1214, 3, 208, 104, 0, 1214, 1523, 1, 0, 0, 0, 1215, 1216, 5, 104, 0, 0, 1216, 1217, 5, 165, 0, 0, 1217, 1218, 3, 154, 77, 0, 1218, 1219, 5, 39, 0, 0, 1219, 1222, 3, 154, 77, 0, 1220, 1221, 5, 38, 0, 0, 1221, 1223, 3, 154, 77, 0, 1222, 1220, 1, 0, 0, 0, 1222, 1223, 1, 0, 0, 0, 1223, 1224, 1, 0, 0, 0, 1224, 1225, 5, 185, 0, 0, 1225, 1523, 1, 0, 0, 0, 1226, 1227, 5, 108, 0, 0, 1227, 1523, 5, 143, 0, 0, 1228, 1229, 5, 116, 0, 0, 1229, 1230, 5, 165, 0, 0, 1230, 1231, 7, 12, 0, 0, 1231, 1232, 3, 226, 113, 0, 1232, 1233, 5, 39, 0, 0, 1233, 1234, 3, 154, 77, 0, 1234, 1235, 5, 185, 0, 0, 1235, 1523, 1, 0, 0, 0, 1236, 1237, 5, 17, 0, 0, 1237, 1238, 5, 165, 0, 0, 1238, 1239, 5, 143, 0, 0, 1239, 1523, 5, 185, 0, 0, 1240, 1241, 5, 17, 0, 0, 1241, 1242, 5, 165, 0, 0, 1242, 1243, 3, 146, 73, 0, 1243, 1244, 5, 185, 0, 0, 1244, 1523, 1, 0, 0, 0, 1245, 1246, 5, 17, 0, 0, 1246, 1247, 5, 165, 0, 0, 1247, 1248, 5, 145, 0, 0, 1248, 1249, 5, 29, 0, 0, 1249, 1250, 5, 165, 0, 0, 1250, 1251, 3, 8, 4, 0, 1251, 1252, 5, 185, 0, 0, 1252, 1253, 5, 91, 0, 0, 1253, 1254, 5, 165, 0, 0, 1254, 1255, 3, 158, 79, 0, 1255, 1256, 5, 185, 0, 0, 1256, 1257, 5, 185, 0, 0, 1257, 1271, 1, 0, 0, 0, 1258, 1259, 5, 165, 0, 0, 1259, 1260, 5, 145, 0, 0, 1260, 1261, 5, 29, 0, 0, 1261, 1262, 5, 165, 0, 0, 1262, 1263, 3, 8, 4, 0, 1263, 1264, 5, 185, 0, 0, 1264, 1265, 5, 91, 0, 0, 1265, 1266, 5, 165, 0, 0, 1266, 1267, 3, 158, 79, 0, 1267, 1268, 5, 185, 0, 0, 1268, 1269, 5, 185, 0, 0, 1269, 1271, 1, 0, 0, 0, 1270, 1245, 1, 0, 0, 0, 1270, 1258, 1, 0, 0, 0, 1271, 1523, 1, 0, 0, 0, 1272, 1273, 5, 17, 0, 0, 1273, 1274, 5, 165, 0, 0, 1274, 1275, 5, 145, 0, 0, 1275, 1276, 5, 29, 0, 0, 1276, 1277, 5, 165, 0, 0, 1277, 1278, 3, 8, 4, 0, 1278, 1279, 5, 185, 0, 0, 1279, 1280, 5, 185, 0, 0, 1280, 1523, 1, 0, 0, 0, 1281, 1282, 5, 17, 0, 0, 1282, 1283, 5, 165, 0, 0, 1283, 1284, 5, 145, 0, 0, 1284, 1285, 5, 91, 0, 0, 1285, 1286, 5, 165, 0, 0, 1286, 1287, 3, 158, 79, 0, 1287, 1288, 5, 185, 0, 0, 1288, 1289, 5, 185, 0, 0, 1289, 1299, 1, 0, 0, 0, 1290, 1291, 5, 165, 0, 0, 1291, 1292, 5, 145, 0, 0, 1292, 1293, 5, 91, 0, 0, 1293, 1294, 5, 165, 0, 0, 1294, 1295, 3, 158, 79, 0, 1295, 1296, 5, 185, 0, 0, 1296, 1297, 5, 185, 0, 0, 1297, 1299, 1, 0, 0, 0, 1298, 1281, 1, 0, 0, 0, 1298, 1290, 1, 0, 0, 0, 1299, 1523, 1, 0, 0, 0, 1300, 1301, 5, 17, 0, 0, 1301, 1302, 5, 165, 0, 0, 1302, 1303, 5, 145, 0, 0, 1303, 1523, 5, 185, 0, 0, 1304, 1305, 5, 17, 0, 0, 1305, 1306, 5, 165, 0, 0, 1306, 1307, 3, 220, 110, 0, 1307, 1308, 5, 155, 0, 0, 1308, 1309, 5, 145, 0, 0, 1309, 1310, 5, 29, 0, 0, 1310, 1311, 5, 165, 0, 0, 1311, 1312, 3, 8, 4, 0, 1312, 1313, 5, 185, 0, 0, 1313, 1314, 5, 91, 0, 0, 1314, 1315, 5, 165, 0, 0, 1315, 1316, 3, 158, 79, 0, 1316, 1317, 5, 185, 0, 0, 1317, 1318, 5, 185, 0, 0, 1318, 1523, 1, 0, 0, 0, 1319, 1320, 5, 17, 0, 0, 1320, 1321, 5, 165, 0, 0, 1321, 1322, 3, 220, 110, 0, 1322, 1323, 5, 155, 0, 0, 1323, 1324, 5, 145, 0, 0, 1324, 1325, 5, 29, 0, 0, 1325, 1326, 5, 165, 0, 0, 1326, 1327, 3, 8, 4, 0, 1327, 1328, 5, 185, 0, 0, 1328, 1329, 5, 185, 0, 0, 1329, 1523, 1, 0, 0, 0, 1330, 1331, 5, 17, 0, 0, 1331, 1332, 5, 165, 0, 0, 1332, 1333, 3, 220, 110, 0, 1333, 1334, 5, 155, 0, 0, 1334, 1335, 5, 145, 0, 0, 1335, 1336, 5, 91, 0, 0, 1336, 1337, 5, 165, 0, 0, 1337, 1338, 3, 158, 79, 0, 1338, 1339, 5, 185, 0, 0, 1339, 1340, 5, 185, 0, 0, 1340, 1523, 1, 0, 0, 0, 1341, 1342, 5, 17, 0, 0, 1342, 1343, 5, 165, 0, 0, 1343, 1344, 3, 220, 110, 0, 1344, 1345, 5, 155, 0, 0, 1345, 1346, 5, 145, 0, 0, 1346, 1347, 5, 185, 0, 0, 1347, 1523, 1, 0, 0, 0, 1348, 1349, 5, 145, 0, 0, 1349, 1350, 5, 17, 0, 0, 1350, 1351, 5, 165, 0, 0, 1351, 1352, 5, 143, 0, 0, 1352, 1523, 5, 185, 0, 0, 1353, 1354, 5, 145, 0, 0, 1354, 1355, 5, 17, 0, 0, 1355, 1356, 5, 165, 0, 0, 1356, 1357, 3, 146, 73, 0, 1357, 1358, 5, 185, 0, 0, 1358, 1523, 1, 0, 0, 0, 1359, 1360, 3, 220, 110, 0, 1360, 1362, 5, 165, 0, 0, 1361, 1363, 3, 146, 73, 0, 1362, 1361, 1, 0, 0, 0, 1362, 1363, 1, 0, 0, 0, 1363, 1364, 1, 0, 0, 0, 1364, 1365, 5, 185, 0, 0, 1365, 1366, 3, 128, 64, 0, 1366, 1523, 1, 0, 0, 0, 1367, 1368, 3, 220, 110, 0, 1368, 1370, 5, 165, 0, 0, 1369, 1371, 3, 146, 73, 0, 1370, 1369, 1, 0, 0, 0, 1370, 1371, 1, 0, 0, 0, 1371, 1372, 1, 0, 0, 0, 1372, 1373, 5, 185, 0, 0, 1373, 1382, 1, 0, 0, 0, 1374, 1376, 5, 165, 0, 0, 1375, 1377, 5, 25, 0, 0, 1376, 1375, 1, 0, 0, 0, 1376, 1377, 1, 0, 0, 0, 1377, 1379, 1, 0, 0, 0, 1378, 1380, 3, 146, 73, 0, 1379, 1378, 1, 0, 0, 0, 1379, 1380, 1, 0, 0, 0, 1380, 1381, 1, 0, 0, 0, 1381, 1383, 5, 185, 0, 0, 1382, 1374, 1, 0, 0, 0, 1382, 1383, 1, 0, 0, 0, 1383, 1390, 1, 0, 0, 0, 1384, 1385, 5, 33, 0, 0, 1385, 1386, 5, 165, 0, 0, 1386, 1387, 5, 127, 0, 0, 1387, 1388, 3, 154, 77, 0, 1388, 1389, 5, 185, 0, 0, 1389, 1391, 1, 0, 0, 0, 1390, 1384, 1, 0, 0, 0, 1390, 1391, 1, 0, 0, 0, 1391, 1392, 1, 0, 0, 0, 1392, 1393, 5, 81, 0, 0, 1393, 1394, 5, 165, 0, 0, 1394, 1395, 3, 122, 61, 0, 1395, 1396, 5, 185, 0, 0, 1396, 1523, 1, 0, 0, 0, 1397, 1398, 3, 220, 110, 0, 1398, 1400, 5, 165, 0, 0, 1399, 1401, 3, 146, 73, 0, 1400, 1399, 1, 0, 0, 0, 1400, 1401, 1, 0, 0, 0, 1401, 1402, 1, 0, 0, 0, 1402, 1403, 5, 185, 0, 0, 1403, 1412, 1, 0, 0, 0, 1404, 1406, 5, 165, 0, 0, 1405, 1407, 5, 25, 0, 0, 1406, 1405, 1, 0, 0, 0, 1406, 1407, 1, 0, 0, 0, 1407, 1409, 1, 0, 0, 0, 1408, 1410, 3, 146, 73, 0, 1409, 1408, 1, 0, 0, 0, 1409, 1410, 1, 0, 0, 0, 1410, 1411, 1, 0, 0, 0, 1411, 1413, 5, 185, 0, 0, 1412, 1404, 1, 0, 0, 0, 1412, 1413, 1, 0, 0, 0, 1413, 1420, 1, 0, 0, 0, 1414, 1415, 5, 33, 0, 0, 1415, 1416, 5, 165, 0, 0, 1416, 1417, 5, 127, 0, 0, 1417, 1418, 3, 154, 77, 0, 1418, 1419, 5, 185, 0, 0, 1419, 1421, 1, 0, 0, 0, 1420, 1414, 1, 0, 0, 0, 1420, 1421, 1, 0, 0, 0, 1421, 1422, 1, 0, 0, 0, 1422, 1423, 5, 81, 0, 0, 1423, 1424, 3, 220, 110, 0, 1424, 1523, 1, 0, 0, 0, 1425, 1431, 3, 220, 110, 0, 1426, 1428, 5, 165, 0, 0, 1427, 1429, 3, 146, 73, 0, 1428, 1427, 1, 0, 0, 0, 1428, 1429, 1, 0, 0, 0, 1429, 1430, 1, 0, 0, 0, 1430, 1432, 5, 185, 0, 0, 1431, 1426, 1, 0, 0, 0, 1431, 1432, 1, 0, 0, 0, 1432, 1433, 1, 0, 0, 0, 1433, 1435, 5, 165, 0, 0, 1434, 1436, 5, 25, 0, 0, 1435, 1434, 1, 0, 0, 0, 1435, 1436, 1, 0, 0, 0, 1436, 1438, 1, 0, 0, 0, 1437, 1439, 3, 146, 73, 0, 1438, 1437, 1, 0, 0, 0, 1438, 1439, 1, 0, 0, 0, 1439, 1443, 1, 0, 0, 0, 1440, 1441, 5, 79, 0, 0, 1441, 1442, 5, 11, 0, 0, 1442, 1444, 3, 108, 54, 0, 1443, 1440, 1, 0, 0, 0, 1443, 1444, 1, 0, 0, 0, 1444, 1445, 1, 0, 0, 0, 1445, 1452, 5, 185, 0, 0, 1446, 1447, 5, 33, 0, 0, 1447, 1448, 5, 165, 0, 0, 1448, 1449, 5, 127, 0, 0, 1449, 1450, 3, 154, 77, 0, 1450, 1451, 5, 185, 0, 0, 1451, 1453, 1, 0, 0, 0, 1452, 1446, 1, 0, 0, 0, 1452, 1453, 1, 0, 0, 0, 1453, 1523, 1, 0, 0, 0, 1454, 1523, 3, 166, 83, 0, 1455, 1523, 3, 228, 114, 0, 1456, 1523, 3, 206, 103, 0, 1457, 1458, 5, 153, 0, 0, 1458, 1523, 3, 154, 77, 25, 1459, 1460, 5, 73, 0, 0, 1460, 1523, 3, 154, 77, 17, 1461, 1462, 3, 196, 98, 0, 1462, 1463, 5, 155, 0, 0, 1463, 1465, 1, 0, 0, 0, 1464, 1461, 1, 0, 0, 0, 1464, 1465, 1, 0, 0, 0, 1465, 1466, 1, 0, 0, 0, 1466, 1472, 5, 145, 0, 0, 1467, 1468, 5, 29, 0, 0, 1468, 1469, 5, 165, 0, 0, 1469, 1470, 3, 8, 4, 0, 1470, 1471, 5, 185, 0, 0, 1471, 1473, 1, 0, 0, 0, 1472, 1467, 1, 0, 0, 0, 1472, 1473, 1, 0, 0, 0, 1473, 1523, 1, 0, 0, 0, 1474, 1475, 5, 60, 0, 0, 1475, 1480, 3, 220, 110, 0, 1476, 1477, 5, 151, 0, 0, 1477, 1479, 3, 220, 110, 0, 1478, 1476, 1, 0, 0, 0, 1479, 1482, 1, 0, 0, 0, 1480, 1478, 1, 0, 0, 0, 1480, 1481, 1, 0, 0, 0, 1481, 1484, 1, 0, 0, 0, 1482, 1480, 1, 0, 0, 0, 1483, 1485, 5, 151, 0, 0, 1484, 1483, 1, 0, 0, 0, 1484, 1485, 1, 0, 0, 0, 1485, 1486, 1, 0, 0, 0, 1486, 1487, 5, 150, 0, 0, 1487, 1488, 3, 154, 77, 10, 1488, 1523, 1, 0, 0, 0, 1489, 1490, 5, 165, 0, 0, 1490, 1491, 3, 48, 24, 0, 1491, 1492, 5, 185, 0, 0, 1492, 1523, 1, 0, 0, 0, 1493, 1494, 5, 165, 0, 0, 1494, 1495, 3, 154, 77, 0, 1495, 1496, 5, 185, 0, 0, 1496, 1523, 1, 0, 0, 0, 1497, 1498, 5, 165, 0, 0, 1498, 1499, 3, 146, 73, 0, 1499, 1500, 5, 185, 0, 0, 1500, 1523, 1, 0, 0, 0, 1501, 1503, 5, 5, 0, 0, 1502, 1501, 1, 0, 0, 0, 1502, 1503, 1, 0, 0, 0, 1503, 1504, 1, 0, 0, 0, 1504, 1506, 5, 164, 0, 0, 1505, 1507, 3, 146, 73, 0, 1506, 1505, 1, 0, 0, 0, 1506, 1507, 1, 0, 0, 0, 1507, 1508, 1, 0, 0, 0, 1508, 1523, 5, 184, 0, 0, 1509, 1511, 5, 163, 0, 0, 1510, 1512, 3, 40, 20, 0, 1511, 1510, 1, 0, 0, 0, 1511, 1512, 1, 0, 0, 0, 1512, 1513, 1, 0, 0, 0, 1513, 1523, 5, 183, 0, 0, 1514, 1523, 3, 156, 78, 0, 1515, 1516, 3, 220, 110, 0, 1516, 1517, 5, 149, 0, 0, 1517, 1518, 3, 154, 77, 3, 1518, 1523, 1, 0, 0, 0, 1519, 1520, 5, 160, 0, 0, 1520, 1523, 5, 139, 0, 0, 1521, 1523, 3, 176, 88, 0, 1522, 1173, 1, 0, 0, 0, 1522, 1193, 1, 0, 0, 0, 1522, 1200, 1, 0, 0, 0, 1522, 1207, 1, 0, 0, 0, 1522, 1209, 1, 0, 0, 0, 1522, 1211, 1, 0, 0, 0, 1522, 1215, 1, 0, 0, 0, 1522, 1226, 1, 0, 0, 0, 1522, 1228, 1, 0, 0, 0, 1522, 1236, 1, 0, 0, 0, 1522, 1240, 1, 0, 0, 0, 1522, 1270, 1, 0, 0, 0, 1522, 1272, 1, 0, 0, 0, 1522, 1298, 1, 0, 0, 0, 1522, 1300, 1, 0, 0, 0, 1522, 1304, 1, 0, 0, 0, 1522, 1319, 1, 0, 0, 0, 1522, 1330, 1, 0, 0, 0, 1522, 1341, 1, 0, 0, 0, 1522, 1348, 1, 0, 0, 0, 1522, 1353, 1, 0, 0, 0, 1522, 1359, 1, 0, 0, 0, 1522, 1367, 1, 0, 0, 0, 1522, 1397, 1, 0, 0, 0, 1522, 1425, 1, 0, 0, 0, 1522, 1454, 1, 0, 0, 0, 1522, 1455, 1, 0, 0, 0, 1522, 1456, 1, 0, 0, 0, 1522, 1457, 1, 0, 0, 0, 1522, 1459, 1, 0, 0, 0, 1522, 1464, 1, 0, 0, 0, 1522, 1474, 1, 0, 0, 0, 1522, 1489, 1, 0, 0, 0, 1522, 1493, 1, 0, 0, 0, 1522, 1497, 1, 0, 0, 0, 1522, 1502, 1, 0, 0, 0, 1522, 1509, 1, 0, 0, 0, 1522, 1514, 1, 0, 0, 0, 1522, 1515, 1, 0, 0, 0, 1522, 1519, 1, 0, 0, 0, 1522, 1521, 1, 0, 0, 0, 1523, 1662, 1, 0, 0, 0, 1524, 1528, 10, 24, 0, 0, 1525, 1529, 5, 145, 0, 0, 1526, 1529, 5, 187, 0, 0, 1527, 1529, 5, 174, 0, 0, 1528, 1525, 1, 0, 0, 0, 1528, 1526, 1, 0, 0, 0, 1528, 1527, 1, 0, 0, 0, 1529, 1530, 1, 0, 0, 0, 1530, 1661, 3, 154, 77, 25, 1531, 1535, 10, 23, 0, 0, 1532, 1536, 5, 175, 0, 0, 1533, 1536, 5, 153, 0, 0, 1534, 1536, 5, 152, 0, 0, 1535, 1532, 1, 0, 0, 0, 1535, 1533, 1, 0, 0, 0, 1535, 1534, 1, 0, 0, 0, 1536, 1537, 1, 0, 0, 0, 1537, 1661, 3, 154, 77, 24, 1538, 1563, 10, 22, 0, 0, 1539, 1564, 5, 156, 0, 0, 1540, 1564, 5, 157, 0, 0, 1541, 1564, 5, 169, 0, 0, 1542, 1564, 5, 166, 0, 0, 1543, 1564, 5, 167, 0, 0, 1544, 1564, 5, 158, 0, 0, 1545, 1564, 5, 159, 0, 0, 1546, 1548, 5, 73, 0, 0, 1547, 1546, 1, 0, 0, 0, 1547, 1548, 1, 0, 0, 0, 1548, 1549, 1, 0, 0, 0, 1549, 1551, 5, 51, 0, 0, 1550, 1552, 5, 15, 0, 0, 1551, 1550, 1, 0, 0, 0, 1551, 1552, 1, 0, 0, 0, 1552, 1564, 1, 0, 0, 0, 1553, 1555, 5, 73, 0, 0, 1554, 1553, 1, 0, 0, 0, 1554, 1555, 1, 0, 0, 0, 1555, 1556, 1, 0, 0, 0, 1556, 1564, 7, 13, 0, 0, 1557, 1564, 5, 181, 0, 0, 1558, 1564, 5, 182, 0, 0, 1559, 1564, 5, 171, 0, 0, 1560, 1564, 5, 161, 0, 0, 1561, 1564, 5, 162, 0, 0, 1562, 1564, 5, 170, 0, 0, 1563, 1539, 1, 0, 0, 0, 1563, 1540, 1, 0, 0, 0, 1563, 1541, 1, 0, 0, 0, 1563, 1542, 1, 0, 0, 0, 1563, 1543, 1, 0, 0, 0, 1563, 1544, 1, 0, 0, 0, 1563, 1545, 1, 0, 0, 0, 1563, 1547, 1, 0, 0, 0, 1563, 1554, 1, 0, 0, 0, 1563, 1557, 1, 0, 0, 0, 1563, 1558, 1, 0, 0, 0, 1563, 1559, 1, 0, 0, 0, 1563, 1560, 1, 0, 0, 0, 1563, 1561, 1, 0, 0, 0, 1563, 1562, 1, 0, 0, 0, 1564, 1565, 1, 0, 0, 0, 1565, 1661, 3, 154, 77, 23, 1566, 1567, 10, 19, 0, 0, 1567, 1569, 5, 57, 0, 0, 1568, 1570, 5, 73, 0, 0, 1569, 1568, 1, 0, 0, 0, 1569, 1570, 1, 0, 0, 0, 1570, 1571, 1, 0, 0, 0, 1571, 1572, 5, 25, 0, 0, 1572, 1573, 5, 39, 0, 0, 1573, 1661, 3, 154, 77, 20, 1574, 1575, 10, 18, 0, 0, 1575, 1576, 5, 173, 0, 0, 1576, 1661, 3, 154, 77, 19, 1577, 1578, 10, 16, 0, 0, 1578, 1579, 5, 2, 0, 0, 1579, 1661, 3, 154, 77, 17, 1580, 1581, 10, 15, 0, 0, 1581, 1582, 5, 78, 0, 0, 1582, 1661, 3, 154, 77, 16, 1583, 1585, 10, 14, 0, 0, 1584, 1586, 5, 73, 0, 0, 1585, 1584, 1, 0, 0, 0, 1585, 1586, 1, 0, 0, 0, 1586, 1587, 1, 0, 0, 0, 1587, 1588, 5, 9, 0, 0, 1588, 1589, 3, 154, 77, 0, 1589, 1590, 5, 2, 0, 0, 1590, 1591, 3, 154, 77, 15, 1591, 1661, 1, 0, 0, 0, 1592, 1593, 10, 13, 0, 0, 1593, 1594, 5, 176, 0, 0, 1594, 1595, 3, 154, 77, 0, 1595, 1596, 5, 150, 0, 0, 1596, 1597, 3, 154, 77, 13, 1597, 1661, 1, 0, 0, 0, 1598, 1599, 10, 38, 0, 0, 1599, 1600, 5, 165, 0, 0, 1600, 1601, 3, 48, 24, 0, 1601, 1602, 5, 185, 0, 0, 1602, 1661, 1, 0, 0, 0, 1603, 1604, 10, 37, 0, 0, 1604, 1606, 5, 165, 0, 0, 1605, 1607, 3, 146, 73, 0, 1606, 1605, 1, 0, 0, 0, 1606, 1607, 1, 0, 0, 0, 1607, 1608, 1, 0, 0, 0, 1608, 1661, 5, 185, 0, 0, 1609, 1610, 10, 33, 0, 0, 1610, 1611, 5, 164, 0, 0, 1611, 1612, 3, 154, 77, 0, 1612, 1613, 5, 184, 0, 0, 1613, 1661, 1, 0, 0, 0, 1614, 1615, 10, 32, 0, 0, 1615, 1617, 5, 164, 0, 0, 1616, 1618, 3, 154, 77, 0, 1617, 1616, 1, 0, 0, 0, 1617, 1618, 1, 0, 0, 0, 1618, 1619, 1, 0, 0, 0, 1619, 1621, 5, 150, 0, 0, 1620, 1622, 3, 154, 77, 0, 1621, 1620, 1, 0, 0, 0, 1621, 1622, 1, 0, 0, 0, 1622, 1623, 1, 0, 0, 0, 1623, 1661, 5, 184, 0, 0, 1624, 1625, 10, 31, 0, 0, 1625, 1626, 5, 155, 0, 0, 1626, 1661, 5, 139, 0, 0, 1627, 1628, 10, 30, 0, 0, 1628, 1629, 5, 155, 0, 0, 1629, 1661, 3, 220, 110, 0, 1630, 1631, 10, 29, 0, 0, 1631, 1632, 5, 172, 0, 0, 1632, 1633, 5, 164, 0, 0, 1633, 1634, 3, 154, 77, 0, 1634, 1635, 5, 184, 0, 0, 1635, 1661, 1, 0, 0, 0, 1636, 1637, 10, 28, 0, 0, 1637, 1638, 5, 172, 0, 0, 1638, 1661, 5, 139, 0, 0, 1639, 1640, 10, 27, 0, 0, 1640, 1641, 5, 172, 0, 0, 1641, 1661, 3, 220, 110, 0, 1642, 1643, 10, 26, 0, 0, 1643, 1644, 5, 148, 0, 0, 1644, 1661, 3, 140, 70, 0, 1645, 1646, 10, 21, 0, 0, 1646, 1647, 5, 49, 0, 0, 1647, 1661, 5, 75, 0, 0, 1648, 1649, 10, 20, 0, 0, 1649, 1651, 5, 57, 0, 0, 1650, 1652, 5, 73, 0, 0, 1651, 1650, 1, 0, 0, 0, 1651, 1652, 1, 0, 0, 0, 1652, 1653, 1, 0, 0, 0, 1653, 1661, 5, 74, 0, 0, 1654, 1655, 10, 12, 0, 0, 1655, 1658, 5, 6, 0, 0, 1656, 1659, 3, 220, 110, 0, 1657, 1659, 5, 143, 0, 0, 1658, 1656, 1, 0, 0, 0, 1658, 1657, 1, 0, 0, 0, 1659, 1661, 1, 0, 0, 0, 1660, 1524, 1, 0, 0, 0, 1660, 1531, 1, 0, 0, 0, 1660, 1538, 1, 0, 0, 0, 1660, 1566, 1, 0, 0, 0, 1660, 1574, 1, 0, 0, 0, 1660, 1577, 1, 0, 0, 0, 1660, 1580, 1, 0, 0, 0, 1660, 1583, 1, 0, 0, 0, 1660, 1592, 1, 0, 0, 0, 1660, 1598, 1, 0, 0, 0, 1660, 1603, 1, 0, 0, 0, 1660, 1609, 1, 0, 0, 0, 1660, 1614, 1, 0, 0, 0, 1660, 1624, 1, 0, 0, 0, 1660, 1627, 1, 0, 0, 0, 1660, 1630, 1, 0, 0, 0, 1660, 1636, 1, 0, 0, 0, 1660, 1639, 1, 0, 0, 0, 1660, 1642, 1, 0, 0, 0, 1660, 1645, 1, 0, 0, 0, 1660, 1648, 1, 0, 0, 0, 1660, 1654, 1, 0, 0, 0, 1661, 1664, 1, 0, 0, 0, 1662, 1660, 1, 0, 0, 0, 1662, 1663, 1, 0, 0, 0, 1663, 155, 1, 0, 0, 0, 1664, 1662, 1, 0, 0, 0, 1665, 1666, 5, 165, 0, 0, 1666, 1671, 3, 220, 110, 0, 1667, 1668, 5, 151, 0, 0, 1668, 1670, 3, 220, 110, 0, 1669, 1667, 1, 0, 0, 0, 1670, 1673, 1, 0, 0, 0, 1671, 1669, 1, 0, 0, 0, 1671, 1672, 1, 0, 0, 0, 1672, 1675, 1, 0, 0, 0, 1673, 1671, 1, 0, 0, 0, 1674, 1676, 5, 151, 0, 0, 1675, 1674, 1, 0, 0, 0, 1675, 1676, 1, 0, 0, 0, 1676, 1677, 1, 0, 0, 0, 1677, 1678, 5, 185, 0, 0, 1678, 1693, 1, 0, 0, 0, 1679, 1684, 3, 220, 110, 0, 1680, 1681, 5, 151, 0, 0, 1681, 1683, 3, 220, 110, 0, 1682, 1680, 1, 0, 0, 0, 1683, 1686, 1, 0, 0, 0, 1684, 1682, 1, 0, 0, 0, 1684, 1685, 1, 0, 0, 0, 1685, 1688, 1, 0, 0, 0, 1686, 1684, 1, 0, 0, 0, 1687, 1689, 5, 151, 0, 0, 1688, 1687, 1, 0, 0, 0, 1688, 1689, 1, 0, 0, 0, 1689, 1693, 1, 0, 0, 0, 1690, 1691, 5, 165, 0, 0, 1691, 1693, 5, 185, 0, 0, 1692, 1665, 1, 0, 0, 0, 1692, 1679, 1, 0, 0, 0, 1692, 1690, 1, 0, 0, 0, 1693, 1694, 1, 0, 0, 0, 1694, 1697, 5, 144, 0, 0, 1695, 1698, 3, 154, 77, 0, 1696, 1698, 3, 36, 18, 0, 1697, 1695, 1, 0, 0, 0, 1697, 1696, 1, 0, 0, 0, 1698, 1715, 1, 0, 0, 0, 1699, 1700, 5, 60, 0, 0, 1700, 1705, 3, 220, 110, 0, 1701, 1702, 5, 151, 0, 0, 1702, 1704, 3, 220, 110, 0, 1703, 1701, 1, 0, 0, 0, 1704, 1707, 1, 0, 0, 0, 1705, 1703, 1, 0, 0, 0, 1705, 1706, 1, 0, 0, 0, 1706, 1709, 1, 0, 0, 0, 1707, 1705, 1, 0, 0, 0, 1708, 1710, 5, 151, 0, 0, 1709, 1708, 1, 0, 0, 0, 1709, 1710, 1, 0, 0, 0, 1710, 1711, 1, 0, 0, 0, 1711, 1712, 5, 150, 0, 0, 1712, 1713, 3, 154, 77, 0, 1713, 1715, 1, 0, 0, 0, 1714, 1692, 1, 0, 0, 0, 1714, 1699, 1, 0, 0, 0, 1715, 157, 1, 0, 0, 0, 1716, 1721, 3, 160, 80, 0, 1717, 1718, 5, 151, 0, 0, 1718, 1720, 3, 160, 80, 0, 1719, 1717, 1, 0, 0, 0, 1720, 1723, 1, 0, 0, 0, 1721, 1719, 1, 0, 0, 0, 1721, 1722, 1, 0, 0, 0, 1722, 159, 1, 0, 0, 0, 1723, 1721, 1, 0, 0, 0, 1724, 1725, 3, 154, 77, 0, 1725, 1726, 5, 6, 0, 0, 1726, 1727, 3, 220, 110, 0, 1727, 161, 1, 0, 0, 0, 1728, 1735, 3, 166, 83, 0, 1729, 1735, 3, 164, 82, 0, 1730, 1731, 5, 163, 0, 0, 1731, 1732, 3, 154, 77, 0, 1732, 1733, 5, 183, 0, 0, 1733, 1735, 1, 0, 0, 0, 1734, 1728, 1, 0, 0, 0, 1734, 1729, 1, 0, 0, 0, 1734, 1730, 1, 0, 0, 0, 1735, 163, 1, 0, 0, 0, 1736, 1737, 5, 200, 0, 0, 1737, 165, 1, 0, 0, 0, 1738, 1739, 5, 167, 0, 0, 1739, 1743, 3, 220, 110, 0, 1740, 1742, 3, 168, 84, 0, 1741, 1740, 1, 0, 0, 0, 1742, 1745, 1, 0, 0, 0, 1743, 1741, 1, 0, 0, 0, 1743, 1744, 1, 0, 0, 0, 1744, 1746, 1, 0, 0, 0, 1745, 1743, 1, 0, 0, 0, 1746, 1747, 5, 188, 0, 0, 1747, 1768, 1, 0, 0, 0, 1748, 1749, 5, 167, 0, 0, 1749, 1753, 3, 220, 110, 0, 1750, 1752, 3, 168, 84, 0, 1751, 1750, 1, 0, 0, 0, 1752, 1755, 1, 0, 0, 0, 1753, 1751, 1, 0, 0, 0, 1753, 1754, 1, 0, 0, 0, 1754, 1756, 1, 0, 0, 0, 1755, 1753, 1, 0, 0, 0, 1756, 1760, 5, 159, 0, 0, 1757, 1759, 3, 162, 81, 0, 1758, 1757, 1, 0, 0, 0, 1759, 1762, 1, 0, 0, 0, 1760, 1758, 1, 0, 0, 0, 1760, 1761, 1, 0, 0, 0, 1761, 1763, 1, 0, 0, 0, 1762, 1760, 1, 0, 0, 0, 1763, 1764, 5, 168, 0, 0, 1764, 1765, 3, 220, 110, 0, 1765, 1766, 5, 159, 0, 0, 1766, 1768, 1, 0, 0, 0, 1767, 1738, 1, 0, 0, 0, 1767, 1748, 1, 0, 0, 0, 1768, 167, 1, 0, 0, 0, 1769, 1770, 3, 220, 110, 0, 1770, 1771, 5, 157, 0, 0, 1771, 1772, 3, 226, 113, 0, 1772, 1781, 1, 0, 0, 0, 1773, 1774, 3, 220, 110, 0, 1774, 1775, 5, 157, 0, 0, 1775, 1776, 5, 163, 0, 0, 1776, 1777, 3, 154, 77, 0, 1777, 1778, 5, 183, 0, 0, 1778, 1781, 1, 0, 0, 0, 1779, 1781, 3, 220, 110, 0, 1780, 1769, 1, 0, 0, 0, 1780, 1773, 1, 0, 0, 0, 1780, 1779, 1, 0, 0, 0, 1781, 169, 1, 0, 0, 0, 1782, 1787, 3, 172, 86, 0, 1783, 1784, 5, 151, 0, 0, 1784, 1786, 3, 172, 86, 0, 1785, 1783, 1, 0, 0, 0, 1786, 1789, 1, 0, 0, 0, 1787, 1785, 1, 0, 0, 0, 1787, 1788, 1, 0, 0, 0, 1788, 1791, 1, 0, 0, 0, 1789, 1787, 1, 0, 0, 0, 1790, 1792, 5, 151, 0, 0, 1791, 1790, 1, 0, 0, 0, 1791, 1792, 1, 0, 0, 0, 1792, 171, 1, 0, 0, 0, 1793, 1795, 3, 220, 110, 0, 1794, 1796, 3, 174, 87, 0, 1795, 1794, 1, 0, 0, 0, 1795, 1796, 1, 0, 0, 0, 1796, 1800, 1, 0, 0, 0, 1797, 1798, 5, 123, 0, 0, 1798, 1799, 5, 59, 0, 0, 1799, 1801, 3, 174, 87, 0, 1800, 1797, 1, 0, 0, 0, 1800, 1801, 1, 0, 0, 0, 1801, 1802, 1, 0, 0, 0, 1802, 1807, 5, 6, 0, 0, 1803, 1805, 5, 73, 0, 0, 1804, 1803, 1, 0, 0, 0, 1804, 1805, 1, 0, 0, 0, 1805, 1806, 1, 0, 0, 0, 1806, 1808, 5, 67, 0, 0, 1807, 1804, 1, 0, 0, 0, 1807, 1808, 1, 0, 0, 0, 1808, 1809, 1, 0, 0, 0, 1809, 1810, 5, 165, 0, 0, 1810, 1811, 3, 48, 24, 0, 1811, 1812, 5, 185, 0, 0, 1812, 1818, 1, 0, 0, 0, 1813, 1814, 3, 154, 77, 0, 1814, 1815, 5, 6, 0, 0, 1815, 1816, 3, 220, 110, 0, 1816, 1818, 1, 0, 0, 0, 1817, 1793, 1, 0, 0, 0, 1817, 1813, 1, 0, 0, 0, 1818, 173, 1, 0, 0, 0, 1819, 1820, 5, 165, 0, 0, 1820, 1825, 3, 220, 110, 0, 1821, 1822, 5, 151, 0, 0, 1822, 1824, 3, 220, 110, 0, 1823, 1821, 1, 0, 0, 0, 1824, 1827, 1, 0, 0, 0, 1825, 1823, 1, 0, 0, 0, 1825, 1826, 1, 0, 0, 0, 1826, 1828, 1, 0, 0, 0, 1827, 1825, 1, 0, 0, 0, 1828, 1829, 5, 185, 0, 0, 1829, 175, 1, 0, 0, 0, 1830, 1838, 3, 224, 112, 0, 1831, 1832, 3, 196, 98, 0, 1832, 1833, 5, 155, 0, 0, 1833, 1835, 1, 0, 0, 0, 1834, 1831, 1, 0, 0, 0, 1834, 1835, 1, 0, 0, 0, 1835, 1836, 1, 0, 0, 0, 1836, 1838, 3, 178, 89, 0, 1837, 1830, 1, 0, 0, 0, 1837, 1834, 1, 0, 0, 0, 1838, 177, 1, 0, 0, 0, 1839, 1844, 3, 220, 110, 0, 1840, 1841, 5, 155, 0, 0, 1841, 1843, 3, 220, 110, 0, 1842, 1840, 1, 0, 0, 0, 1843, 1846, 1, 0, 0, 0, 1844, 1842, 1, 0, 0, 0, 1844, 1845, 1, 0, 0, 0, 1845, 179, 1, 0, 0, 0, 1846, 1844, 1, 0, 0, 0, 1847, 1848, 6, 90, -1, 0, 1848, 1861, 3, 196, 98, 0, 1849, 1861, 3, 194, 97, 0, 1850, 1851, 5, 165, 0, 0, 1851, 1852, 3, 48, 24, 0, 1852, 1853, 5, 185, 0, 0, 1853, 1861, 1, 0, 0, 0, 1854, 1855, 5, 165, 0, 0, 1855, 1856, 3, 92, 46, 0, 1856, 1857, 5, 185, 0, 0, 1857, 1861, 1, 0, 0, 0, 1858, 1861, 3, 166, 83, 0, 1859, 1861, 3, 224, 112, 0, 1860, 1847, 1, 0, 0, 0, 1860, 1849, 1, 0, 0, 0, 1860, 1850, 1, 0, 0, 0, 1860, 1854, 1, 0, 0, 0, 1860, 1858, 1, 0, 0, 0, 1860, 1859, 1, 0, 0, 0, 1861, 1895, 1, 0, 0, 0, 1862, 1863, 10, 5, 0, 0, 1863, 1864, 5, 83, 0, 0, 1864, 1865, 5, 165, 0, 0, 1865, 1866, 3, 146, 73, 0, 1866, 1870, 3, 182, 91, 0, 1867, 1868, 5, 42, 0, 0, 1868, 1869, 5, 11, 0, 0, 1869, 1871, 3, 146, 73, 0, 1870, 1867, 1, 0, 0, 0, 1870, 1871, 1, 0, 0, 0, 1871, 1872, 1, 0, 0, 0, 1872, 1873, 5, 185, 0, 0, 1873, 1894, 1, 0, 0, 0, 1874, 1875, 10, 4, 0, 0, 1875, 1878, 5, 122, 0, 0, 1876, 1877, 5, 50, 0, 0, 1877, 1879, 5, 75, 0, 0, 1878, 1876, 1, 0, 0, 0, 1878, 1879, 1, 0, 0, 0, 1879, 1880, 1, 0, 0, 0, 1880, 1881, 5, 165, 0, 0, 1881, 1882, 3, 186, 93, 0, 1882, 1883, 5, 185, 0, 0, 1883, 1894, 1, 0, 0, 0, 1884, 1888, 10, 3, 0, 0, 1885, 1889, 3, 216, 108, 0, 1886, 1887, 5, 6, 0, 0, 1887, 1889, 3, 220, 110, 0, 1888, 1885, 1, 0, 0, 0, 1888, 1886, 1, 0, 0, 0, 1889, 1891, 1, 0, 0, 0, 1890, 1892, 3, 192, 96, 0, 1891, 1890, 1, 0, 0, 0, 1891, 1892, 1, 0, 0, 0, 1892, 1894, 1, 0, 0, 0, 1893, 1862, 1, 0, 0, 0, 1893, 1874, 1, 0, 0, 0, 1893, 1884, 1, 0, 0, 0, 1894, 1897, 1, 0, 0, 0, 1895, 1893, 1, 0, 0, 0, 1895, 1896, 1, 0, 0, 0, 1896, 181, 1, 0, 0, 0, 1897, 1895, 1, 0, 0, 0, 1898, 1900, 5, 38, 0, 0, 1899, 1901, 3, 184, 92, 0, 1900, 1899, 1, 0, 0, 0, 1901, 1902, 1, 0, 0, 0, 1902, 1900, 1, 0, 0, 0, 1902, 1903, 1, 0, 0, 0, 1903, 183, 1, 0, 0, 0, 1904, 1905, 3, 190, 95, 0, 1905, 1906, 5, 51, 0, 0, 1906, 1907, 5, 165, 0, 0, 1907, 1908, 3, 146, 73, 0, 1908, 1909, 5, 185, 0, 0, 1909, 185, 1, 0, 0, 0, 1910, 1915, 3, 188, 94, 0, 1911, 1912, 5, 151, 0, 0, 1912, 1914, 3, 188, 94, 0, 1913, 1911, 1, 0, 0, 0, 1914, 1917, 1, 0, 0, 0, 1915, 1913, 1, 0, 0, 0, 1915, 1916, 1, 0, 0, 0, 1916, 1919, 1, 0, 0, 0, 1917, 1915, 1, 0, 0, 0, 1918, 1920, 5, 151, 0, 0, 1919, 1918, 1, 0, 0, 0, 1919, 1920, 1, 0, 0, 0, 1920, 187, 1, 0, 0, 0, 1921, 1922, 3, 190, 95, 0, 1922, 1923, 5, 38, 0, 0, 1923, 1924, 3, 190, 95, 0, 1924, 1925, 5, 51, 0, 0, 1925, 1926, 5, 165, 0, 0, 1926, 1927, 3, 146, 73, 0, 1927, 1936, 5, 185, 0, 0, 1928, 1929, 3, 190, 95, 0, 1929, 1930, 5, 51, 0, 0, 1930, 1931, 5, 165, 0, 0, 1931, 1932, 3, 146, 73, 0, 1932, 1933, 5, 185, 0, 0, 1933, 1935, 1, 0, 0, 0, 1934, 1928, 1, 0, 0, 0, 1935, 1938, 1, 0, 0, 0, 1936, 1934, 1, 0, 0, 0, 1936, 1937, 1, 0, 0, 0, 1937, 189, 1, 0, 0, 0, 1938, 1936, 1, 0, 0, 0, 1939, 1940, 5, 165, 0, 0, 1940, 1941, 3, 146, 73, 0, 1941, 1942, 5, 185, 0, 0, 1942, 1945, 1, 0, 0, 0, 1943, 1945, 3, 154, 77, 0, 1944, 1939, 1, 0, 0, 0, 1944, 1943, 1, 0, 0, 0, 1945, 191, 1, 0, 0, 0, 1946, 1947, 5, 165, 0, 0, 1947, 1952, 3, 220, 110, 0, 1948, 1949, 5, 151, 0, 0, 1949, 1951, 3, 220, 110, 0, 1950, 1948, 1, 0, 0, 0, 1951, 1954, 1, 0, 0, 0, 1952, 1950, 1, 0, 0, 0, 1952, 1953, 1, 0, 0, 0, 1953, 1955, 1, 0, 0, 0, 1954, 1952, 1, 0, 0, 0, 1955, 1956, 5, 185, 0, 0, 1956, 193, 1, 0, 0, 0, 1957, 1958, 3, 220, 110, 0, 1958, 1960, 5, 165, 0, 0, 1959, 1961, 3, 198, 99, 0, 1960, 1959, 1, 0, 0, 0, 1960, 1961, 1, 0, 0, 0, 1961, 1962, 1, 0, 0, 0, 1962, 1963, 5, 185, 0, 0, 1963, 195, 1, 0, 0, 0, 1964, 1965, 3, 200, 100, 0, 1965, 1966, 5, 155, 0, 0, 1966, 1968, 1, 0, 0, 0, 1967, 1964, 1, 0, 0, 0, 1967, 1968, 1, 0, 0, 0, 1968, 1969, 1, 0, 0, 0, 1969, 1970, 3, 178, 89, 0, 1970, 197, 1, 0, 0, 0, 1971, 1976, 3, 154, 77, 0, 1972, 1973, 5, 151, 0, 0, 1973, 1975, 3, 154, 77, 0, 1974, 1972, 1, 0, 0, 0, 1975, 1978, 1, 0, 0, 0, 1976, 1974, 1, 0, 0, 0, 1976, 1977, 1, 0, 0, 0, 1977, 1980, 1, 0, 0, 0, 1978, 1976, 1, 0, 0, 0, 1979, 1981, 5, 151, 0, 0, 1980, 1979, 1, 0, 0, 0, 1980, 1981, 1, 0, 0, 0, 1981, 199, 1, 0, 0, 0, 1982, 1983, 3, 220, 110, 0, 1983, 201, 1, 0, 0, 0, 1984, 1993, 5, 136, 0, 0, 1985, 1986, 5, 155, 0, 0, 1986, 1993, 7, 14, 0, 0, 1987, 1988, 5, 139, 0, 0, 1988, 1990, 5, 155, 0, 0, 1989, 1991, 7, 14, 0, 0, 1990, 1989, 1, 0, 0, 0, 1990, 1991, 1, 0, 0, 0, 1991, 1993, 1, 0, 0, 0, 1992, 1984, 1, 0, 0, 0, 1992, 1985, 1, 0, 0, 0, 1992, 1987, 1, 0, 0, 0, 1993, 203, 1, 0, 0, 0, 1994, 1996, 7, 15, 0, 0, 1995, 1994, 1, 0, 0, 0, 1995, 1996, 1, 0, 0, 0, 1996, 2005, 1, 0, 0, 0, 1997, 2006, 3, 202, 101, 0, 1998, 2006, 5, 137, 0, 0, 1999, 2006, 5, 138, 0, 0, 2000, 2006, 5, 141, 0, 0, 2001, 2006, 5, 139, 0, 0, 2002, 2006, 5, 140, 0, 0, 2003, 2006, 5, 52, 0, 0, 2004, 2006, 5, 72, 0, 0, 2005, 1997, 1, 0, 0, 0, 2005, 1998, 1, 0, 0, 0, 2005, 1999, 1, 0, 0, 0, 2005, 2000, 1, 0, 0, 0, 2005, 2001, 1, 0, 0, 0, 2005, 2002, 1, 0, 0, 0, 2005, 2003, 1, 0, 0, 0, 2005, 2004, 1, 0, 0, 0, 2006, 205, 1, 0, 0, 0, 2007, 2011, 3, 204, 102, 0, 2008, 2011, 5, 143, 0, 0, 2009, 2011, 5, 74, 0, 0, 2010, 2007, 1, 0, 0, 0, 2010, 2008, 1, 0, 0, 0, 2010, 2009, 1, 0, 0, 0, 2011, 207, 1, 0, 0, 0, 2012, 2013, 7, 16, 0, 0, 2013, 209, 1, 0, 0, 0, 2014, 2015, 7, 17, 0, 0, 2015, 211, 1, 0, 0, 0, 2016, 2017, 7, 18, 0, 0, 2017, 213, 1, 0, 0, 0, 2018, 2019, 7, 19, 0, 0, 2019, 215, 1, 0, 0, 0, 2020, 2024, 5, 134, 0, 0, 2021, 2024, 5, 135, 0, 0, 2022, 2024, 3, 212, 106, 0, 2023, 2020, 1, 0, 0, 0, 2023, 2021, 1, 0, 0, 0, 2023, 2022, 1, 0, 0, 0, 2024, 217, 1, 0, 0, 0, 2025, 2029, 5, 134, 0, 0, 2026, 2029, 5, 135, 0, 0, 2027, 2029, 3, 214, 107, 0, 2028, 2025, 1, 0, 0, 0, 2028, 2026, 1, 0, 0, 0, 2028, 2027, 1, 0, 0, 0, 2029, 219, 1, 0, 0, 0, 2030, 2035, 5, 134, 0, 0, 2031, 2035, 5, 135, 0, 0, 2032, 2035, 3, 208, 104, 0, 2033, 2035, 3, 210, 105, 0, 2034, 2030, 1, 0, 0, 0, 2034, 2031, 1, 0, 0, 0, 2034, 2032, 1, 0, 0, 0, 2034, 2033, 1, 0, 0, 0, 2035, 221, 1, 0, 0, 0, 2036, 2037, 3, 226, 113, 0, 2037, 2038, 5, 157, 0, 0, 2038, 2039, 3, 204, 102, 0, 2039, 223, 1, 0, 0, 0, 2040, 2041, 5, 163, 0, 0, 2041, 2042, 3, 154, 77, 0, 2042, 2043, 5, 183, 0, 0, 2043, 225, 1, 0, 0, 0, 2044, 2047, 5, 143, 0, 0, 2045, 2047, 3, 228, 114, 0, 2046, 2044, 1, 0, 0, 0, 2046, 2045, 1, 0, 0, 0, 2047, 227, 1, 0, 0, 0, 2048, 2052, 5, 178, 0, 0, 2049, 2051, 3, 230, 115, 0, 2050, 2049, 1, 0, 0, 0, 2051, 2054, 1, 0, 0, 0, 2052, 2050, 1, 0, 0, 0, 2052, 2053, 1, 0, 0, 0, 2053, 2055, 1, 0, 0, 0, 2054, 2052, 1, 0, 0, 0, 2055, 2056, 5, 180, 0, 0, 2056, 229, 1, 0, 0, 0, 2057, 2058, 5, 195, 0, 0, 2058, 2059, 3, 154, 77, 0, 2059, 2060, 5, 183, 0, 0, 2060, 2063, 1, 0, 0, 0, 2061, 2063, 5, 194, 0, 0, 2062, 2057, 1, 0, 0, 0, 2062, 2061, 1, 0, 0, 0, 2063, 231, 1, 0, 0, 0, 2064, 2068, 5, 179, 0, 0, 2065, 2067, 3, 234, 117, 0, 2066, 2065, 1, 0, 0, 0, 2067, 2070, 1, 0, 0, 0, 2068, 2066, 1, 0, 0, 0, 2068, 2069, 1, 0, 0, 0, 2069, 2071, 1, 0, 0, 0, 2070, 2068, 1, 0, 0, 0, 2071, 2072, 5, 0, 0, 1, 2072, 233, 1, 0, 0, 0, 2073, 2074, 5, 197, 0, 0, 2074, 2075, 3, 154, 77, 0, 2075, 2076, 5, 183, 0, 0, 2076, 2079, 1, 0, 0, 0, 2077, 2079, 5, 196, 0, 0, 2078, 2073, 1, 0, 0, 0, 2078, 2077, 1, 0, 0, 0, 2079, 235, 1, 0, 0, 0, 259, 239, 246, 254, 261, 265, 278, 282, 285, 290, 297, 301, 310, 315, 324, 332, 339, 343, 349, 354, 362, 369, 375, 387, 390, 398, 412, 416, 421, 424, 439, 445, 450, 456, 462, 467, 473, 479, 484, 486, 494, 498, 501, 506, 510, 514, 519, 523, 530, 533, 537, 540, 544, 547, 550, 553, 556, 559, 562, 566, 570, 573, 576, 580, 583, 586, 589, 593, 596, 600, 608, 614, 635, 659, 666, 671, 685, 694, 699, 713, 717, 721, 726, 730, 735, 749, 758, 766, 769, 775, 783, 786, 791, 798, 808, 816, 822, 824, 828, 833, 840, 843, 847, 851, 854, 860, 862, 865, 869, 873, 876, 878, 880, 885, 896, 901, 905, 911, 916, 923, 928, 932, 936, 939, 945, 949, 953, 958, 964, 966, 973, 981, 984, 987, 1012, 1026, 1042, 1046, 1057, 1061, 1072, 1076, 1083, 1091, 1094, 1099, 1104, 1110, 1116, 1122, 1131, 1135, 1142, 1148, 1155, 1159, 1171, 1176, 1185, 1189, 1222, 1270, 1298, 1362, 1370, 1376, 1379, 1382, 1390, 1400, 1406, 1409, 1412, 1420, 1428, 1431, 1435, 1438, 1443, 1452, 1464, 1472, 1480, 1484, 1502, 1506, 1511, 1522, 1528, 1535, 1547, 1551, 1554, 1563, 1569, 1585, 1606, 1617, 1621, 1651, 1658, 1660, 1662, 1671, 1675, 1684, 1688, 1692, 1697, 1705, 1709, 1714, 1721, 1734, 1743, 1753, 1760, 1767, 1780, 1787, 1791, 1795, 1800, 1804, 1807, 1817, 1825, 1834, 1837, 1844, 1860, 1870, 1878, 1888, 1891, 1893, 1895, 1902, 1915, 1919, 1936, 1944, 1952, 1960, 1967, 1976, 1980, 1990, 1992, 1995, 2005, 2010, 2023, 2028, 2034, 2046, 2052, 2062, 2068, 2078]
\ No newline at end of file
+[4, 1, 205, 2081, 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, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103, 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, 108, 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 2, 111, 7, 111, 2, 112, 7, 112, 2, 113, 7, 113, 2, 114, 7, 114, 2, 115, 7, 115, 2, 116, 7, 116, 2, 117, 7, 117, 1, 0, 5, 0, 238, 8, 0, 10, 0, 12, 0, 241, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 247, 8, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 255, 8, 3, 1, 4, 1, 4, 1, 4, 5, 4, 260, 8, 4, 10, 4, 12, 4, 263, 9, 4, 1, 4, 3, 4, 266, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 279, 8, 5, 1, 6, 1, 6, 3, 6, 283, 8, 6, 1, 6, 3, 6, 286, 8, 6, 1, 7, 1, 7, 1, 7, 3, 7, 291, 8, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 298, 8, 8, 1, 8, 1, 8, 3, 8, 302, 8, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 5, 9, 309, 8, 9, 10, 9, 12, 9, 312, 9, 9, 1, 9, 1, 9, 3, 9, 316, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 325, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 333, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 340, 8, 12, 1, 12, 1, 12, 3, 12, 344, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 350, 8, 12, 1, 12, 1, 12, 1, 12, 3, 12, 355, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 363, 8, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 370, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 376, 8, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 3, 16, 388, 8, 16, 1, 16, 3, 16, 391, 8, 16, 1, 17, 1, 17, 1, 18, 1, 18, 5, 18, 397, 8, 18, 10, 18, 12, 18, 400, 9, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 5, 20, 411, 8, 20, 10, 20, 12, 20, 414, 9, 20, 1, 20, 3, 20, 417, 8, 20, 1, 21, 1, 21, 1, 21, 3, 21, 422, 8, 21, 1, 21, 3, 21, 425, 8, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 440, 8, 22, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 446, 8, 23, 1, 23, 1, 23, 1, 23, 3, 23, 451, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 457, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 463, 8, 23, 1, 23, 1, 23, 1, 23, 3, 23, 468, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 474, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 480, 8, 23, 1, 23, 1, 23, 1, 23, 3, 23, 485, 8, 23, 3, 23, 487, 8, 23, 1, 23, 1, 23, 1, 24, 1, 24, 5, 24, 493, 8, 24, 10, 24, 12, 24, 496, 9, 24, 1, 24, 3, 24, 499, 8, 24, 1, 24, 3, 24, 502, 8, 24, 1, 25, 1, 25, 1, 25, 3, 25, 507, 8, 25, 1, 25, 1, 25, 3, 25, 511, 8, 25, 1, 25, 1, 25, 3, 25, 515, 8, 25, 1, 25, 1, 25, 1, 25, 3, 25, 520, 8, 25, 1, 25, 1, 25, 3, 25, 524, 8, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 3, 25, 531, 8, 25, 1, 26, 3, 26, 534, 8, 26, 1, 26, 1, 26, 3, 26, 538, 8, 26, 1, 26, 3, 26, 541, 8, 26, 1, 26, 1, 26, 3, 26, 545, 8, 26, 1, 26, 3, 26, 548, 8, 26, 1, 26, 3, 26, 551, 8, 26, 1, 26, 3, 26, 554, 8, 26, 1, 26, 3, 26, 557, 8, 26, 1, 26, 3, 26, 560, 8, 26, 1, 26, 3, 26, 563, 8, 26, 1, 26, 1, 26, 3, 26, 567, 8, 26, 1, 26, 1, 26, 3, 26, 571, 8, 26, 1, 26, 3, 26, 574, 8, 26, 1, 26, 3, 26, 577, 8, 26, 1, 26, 1, 26, 3, 26, 581, 8, 26, 1, 26, 3, 26, 584, 8, 26, 1, 26, 3, 26, 587, 8, 26, 1, 26, 3, 26, 590, 8, 26, 1, 26, 1, 26, 3, 26, 594, 8, 26, 1, 26, 3, 26, 597, 8, 26, 1, 27, 1, 27, 3, 27, 601, 8, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 3, 28, 609, 8, 28, 1, 29, 1, 29, 1, 29, 1, 30, 3, 30, 615, 8, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 5, 31, 634, 8, 31, 10, 31, 12, 31, 637, 9, 31, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 3, 34, 660, 8, 34, 1, 35, 1, 35, 1, 35, 5, 35, 665, 8, 35, 10, 35, 12, 35, 668, 9, 35, 1, 36, 1, 36, 3, 36, 672, 8, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 3, 39, 686, 8, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 5, 40, 693, 8, 40, 10, 40, 12, 40, 696, 9, 40, 1, 40, 1, 40, 3, 40, 700, 8, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 3, 43, 714, 8, 43, 1, 43, 1, 43, 3, 43, 718, 8, 43, 1, 43, 1, 43, 3, 43, 722, 8, 43, 1, 43, 1, 43, 1, 43, 3, 43, 727, 8, 43, 1, 43, 1, 43, 3, 43, 731, 8, 43, 1, 43, 1, 43, 1, 43, 3, 43, 736, 8, 43, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, 5, 46, 748, 8, 46, 10, 46, 12, 46, 751, 9, 46, 1, 47, 1, 47, 1, 47, 1, 47, 5, 47, 757, 8, 47, 10, 47, 12, 47, 760, 9, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 3, 48, 767, 8, 48, 1, 48, 3, 48, 770, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 776, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 784, 8, 48, 1, 48, 3, 48, 787, 8, 48, 1, 48, 1, 48, 1, 48, 3, 48, 792, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 799, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 809, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 817, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 5, 48, 823, 8, 48, 10, 48, 12, 48, 826, 9, 48, 1, 49, 3, 49, 829, 8, 49, 1, 49, 1, 49, 1, 49, 3, 49, 834, 8, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 841, 8, 49, 1, 49, 3, 49, 844, 8, 49, 1, 49, 1, 49, 3, 49, 848, 8, 49, 1, 49, 1, 49, 3, 49, 852, 8, 49, 1, 49, 3, 49, 855, 8, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 861, 8, 49, 3, 49, 863, 8, 49, 1, 49, 3, 49, 866, 8, 49, 1, 49, 1, 49, 3, 49, 870, 8, 49, 1, 49, 1, 49, 3, 49, 874, 8, 49, 1, 49, 3, 49, 877, 8, 49, 3, 49, 879, 8, 49, 3, 49, 881, 8, 49, 1, 50, 1, 50, 1, 50, 3, 50, 886, 8, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 3, 51, 897, 8, 51, 1, 52, 1, 52, 1, 52, 3, 52, 902, 8, 52, 1, 52, 1, 52, 3, 52, 906, 8, 52, 1, 52, 1, 52, 1, 52, 1, 52, 3, 52, 912, 8, 52, 1, 53, 1, 53, 1, 53, 3, 53, 917, 8, 53, 1, 54, 1, 54, 1, 54, 5, 54, 922, 8, 54, 10, 54, 12, 54, 925, 9, 54, 1, 55, 1, 55, 3, 55, 929, 8, 55, 1, 55, 1, 55, 3, 55, 933, 8, 55, 1, 55, 1, 55, 3, 55, 937, 8, 55, 1, 55, 3, 55, 940, 8, 55, 1, 56, 1, 56, 1, 56, 1, 56, 3, 56, 946, 8, 56, 1, 56, 1, 56, 3, 56, 950, 8, 56, 1, 56, 1, 56, 3, 56, 954, 8, 56, 1, 57, 1, 57, 1, 57, 3, 57, 959, 8, 57, 1, 58, 1, 58, 1, 58, 1, 58, 3, 58, 965, 8, 58, 3, 58, 967, 8, 58, 1, 59, 1, 59, 1, 59, 5, 59, 972, 8, 59, 10, 59, 12, 59, 975, 9, 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 61, 3, 61, 982, 8, 61, 1, 61, 3, 61, 985, 8, 61, 1, 61, 3, 61, 988, 8, 61, 1, 62, 1, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 65, 1, 65, 1, 65, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 3, 66, 1013, 8, 66, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 3, 67, 1027, 8, 67, 1, 68, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 5, 69, 1041, 8, 69, 10, 69, 12, 69, 1044, 9, 69, 1, 69, 3, 69, 1047, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 5, 69, 1056, 8, 69, 10, 69, 12, 69, 1059, 9, 69, 1, 69, 3, 69, 1062, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 5, 69, 1071, 8, 69, 10, 69, 12, 69, 1074, 9, 69, 1, 69, 3, 69, 1077, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 3, 69, 1084, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 4, 69, 1090, 8, 69, 11, 69, 12, 69, 1091, 1, 69, 3, 69, 1095, 8, 69, 1, 69, 1, 69, 1, 69, 3, 69, 1100, 8, 69, 1, 69, 5, 69, 1103, 8, 69, 10, 69, 12, 69, 1106, 9, 69, 1, 70, 1, 70, 1, 70, 3, 70, 1111, 8, 70, 1, 70, 1, 70, 1, 70, 1, 70, 3, 70, 1117, 8, 70, 1, 71, 1, 71, 1, 71, 1, 71, 3, 71, 1123, 8, 71, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 5, 73, 1130, 8, 73, 10, 73, 12, 73, 1133, 9, 73, 1, 73, 3, 73, 1136, 8, 73, 1, 74, 1, 74, 1, 74, 5, 74, 1141, 8, 74, 10, 74, 12, 74, 1144, 9, 74, 1, 74, 1, 74, 1, 74, 3, 74, 1149, 8, 74, 1, 75, 1, 75, 1, 75, 5, 75, 1154, 8, 75, 10, 75, 12, 75, 1157, 9, 75, 1, 75, 3, 75, 1160, 8, 75, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 3, 76, 1172, 8, 76, 1, 77, 1, 77, 1, 77, 3, 77, 1177, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 4, 77, 1184, 8, 77, 11, 77, 12, 77, 1185, 1, 77, 1, 77, 3, 77, 1190, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1223, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1271, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1299, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1363, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1371, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1377, 8, 77, 1, 77, 3, 77, 1380, 8, 77, 1, 77, 3, 77, 1383, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1391, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1401, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1407, 8, 77, 1, 77, 3, 77, 1410, 8, 77, 1, 77, 3, 77, 1413, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1421, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1429, 8, 77, 1, 77, 3, 77, 1432, 8, 77, 1, 77, 1, 77, 3, 77, 1436, 8, 77, 1, 77, 3, 77, 1439, 8, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1444, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1453, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1465, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1473, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 5, 77, 1479, 8, 77, 10, 77, 12, 77, 1482, 9, 77, 1, 77, 3, 77, 1485, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1503, 8, 77, 1, 77, 1, 77, 3, 77, 1507, 8, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1512, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1523, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1529, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1536, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1548, 8, 77, 1, 77, 1, 77, 3, 77, 1552, 8, 77, 1, 77, 3, 77, 1555, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1564, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1570, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1586, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1607, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1618, 8, 77, 1, 77, 1, 77, 3, 77, 1622, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1652, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1659, 8, 77, 5, 77, 1661, 8, 77, 10, 77, 12, 77, 1664, 9, 77, 1, 78, 1, 78, 1, 78, 1, 78, 5, 78, 1670, 8, 78, 10, 78, 12, 78, 1673, 9, 78, 1, 78, 3, 78, 1676, 8, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 5, 78, 1683, 8, 78, 10, 78, 12, 78, 1686, 9, 78, 1, 78, 3, 78, 1689, 8, 78, 1, 78, 1, 78, 3, 78, 1693, 8, 78, 1, 78, 1, 78, 1, 78, 3, 78, 1698, 8, 78, 1, 78, 1, 78, 1, 78, 1, 78, 5, 78, 1704, 8, 78, 10, 78, 12, 78, 1707, 9, 78, 1, 78, 3, 78, 1710, 8, 78, 1, 78, 1, 78, 1, 78, 3, 78, 1715, 8, 78, 1, 79, 1, 79, 1, 79, 5, 79, 1720, 8, 79, 10, 79, 12, 79, 1723, 9, 79, 1, 80, 1, 80, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 3, 81, 1735, 8, 81, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 5, 83, 1742, 8, 83, 10, 83, 12, 83, 1745, 9, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 5, 83, 1752, 8, 83, 10, 83, 12, 83, 1755, 9, 83, 1, 83, 1, 83, 5, 83, 1759, 8, 83, 10, 83, 12, 83, 1762, 9, 83, 1, 83, 1, 83, 1, 83, 1, 83, 3, 83, 1768, 8, 83, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 3, 84, 1781, 8, 84, 1, 85, 1, 85, 1, 85, 5, 85, 1786, 8, 85, 10, 85, 12, 85, 1789, 9, 85, 1, 85, 3, 85, 1792, 8, 85, 1, 86, 1, 86, 3, 86, 1796, 8, 86, 1, 86, 1, 86, 1, 86, 3, 86, 1801, 8, 86, 1, 86, 1, 86, 3, 86, 1805, 8, 86, 1, 86, 3, 86, 1808, 8, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 3, 86, 1818, 8, 86, 1, 87, 1, 87, 1, 87, 1, 87, 5, 87, 1824, 8, 87, 10, 87, 12, 87, 1827, 9, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, 1, 88, 3, 88, 1835, 8, 88, 1, 88, 3, 88, 1838, 8, 88, 1, 89, 1, 89, 1, 89, 5, 89, 1843, 8, 89, 10, 89, 12, 89, 1846, 9, 89, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1861, 8, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1871, 8, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1879, 8, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1889, 8, 90, 1, 90, 3, 90, 1892, 8, 90, 5, 90, 1894, 8, 90, 10, 90, 12, 90, 1897, 9, 90, 1, 91, 1, 91, 4, 91, 1901, 8, 91, 11, 91, 12, 91, 1902, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 93, 1, 93, 1, 93, 5, 93, 1914, 8, 93, 10, 93, 12, 93, 1917, 9, 93, 1, 93, 3, 93, 1920, 8, 93, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 5, 94, 1935, 8, 94, 10, 94, 12, 94, 1938, 9, 94, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 3, 95, 1945, 8, 95, 1, 96, 1, 96, 1, 96, 1, 96, 5, 96, 1951, 8, 96, 10, 96, 12, 96, 1954, 9, 96, 1, 96, 1, 96, 1, 97, 1, 97, 1, 97, 3, 97, 1961, 8, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 3, 98, 1968, 8, 98, 1, 98, 1, 98, 1, 99, 1, 99, 1, 99, 5, 99, 1975, 8, 99, 10, 99, 12, 99, 1978, 9, 99, 1, 99, 3, 99, 1981, 8, 99, 1, 100, 1, 100, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 3, 101, 1991, 8, 101, 3, 101, 1993, 8, 101, 1, 102, 3, 102, 1996, 8, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 3, 102, 2006, 8, 102, 1, 103, 1, 103, 1, 103, 3, 103, 2011, 8, 103, 1, 104, 1, 104, 1, 105, 1, 105, 1, 106, 1, 106, 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, 3, 108, 2024, 8, 108, 1, 109, 1, 109, 1, 109, 3, 109, 2029, 8, 109, 1, 110, 1, 110, 1, 110, 1, 110, 3, 110, 2035, 8, 110, 1, 111, 1, 111, 1, 111, 1, 111, 1, 112, 1, 112, 1, 112, 1, 112, 1, 113, 1, 113, 3, 113, 2047, 8, 113, 1, 114, 1, 114, 5, 114, 2051, 8, 114, 10, 114, 12, 114, 2054, 9, 114, 1, 114, 1, 114, 1, 115, 1, 115, 1, 115, 1, 115, 1, 115, 3, 115, 2063, 8, 115, 1, 116, 1, 116, 5, 116, 2067, 8, 116, 10, 116, 12, 116, 2070, 9, 116, 1, 116, 1, 116, 1, 117, 1, 117, 1, 117, 1, 117, 1, 117, 3, 117, 2079, 8, 117, 1, 117, 0, 4, 96, 138, 154, 180, 118, 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, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 0, 20, 2, 0, 36, 36, 41, 41, 2, 0, 19, 19, 94, 94, 2, 0, 53, 53, 63, 63, 3, 0, 1, 1, 4, 4, 8, 8, 2, 0, 3, 3, 100, 100, 4, 0, 1, 1, 3, 4, 8, 8, 100, 100, 2, 0, 63, 63, 93, 93, 2, 0, 76, 76, 151, 151, 2, 0, 7, 7, 23, 24, 2, 0, 35, 35, 61, 61, 2, 0, 89, 89, 96, 96, 3, 0, 21, 21, 56, 56, 108, 109, 3, 0, 10, 10, 62, 62, 115, 115, 2, 0, 48, 48, 65, 65, 1, 0, 138, 139, 2, 0, 153, 153, 175, 175, 7, 0, 22, 22, 45, 45, 68, 69, 88, 88, 98, 98, 125, 125, 132, 132, 20, 0, 1, 13, 15, 21, 23, 27, 29, 33, 35, 35, 37, 40, 42, 44, 46, 51, 53, 53, 55, 63, 65, 66, 70, 71, 73, 73, 75, 87, 89, 97, 99, 105, 107, 117, 119, 124, 126, 127, 129, 130, 4, 0, 21, 21, 35, 35, 46, 46, 59, 59, 8, 0, 7, 7, 15, 15, 21, 21, 24, 24, 31, 31, 46, 46, 92, 92, 113, 114, 2362, 0, 239, 1, 0, 0, 0, 2, 246, 1, 0, 0, 0, 4, 248, 1, 0, 0, 0, 6, 250, 1, 0, 0, 0, 8, 256, 1, 0, 0, 0, 10, 278, 1, 0, 0, 0, 12, 280, 1, 0, 0, 0, 14, 287, 1, 0, 0, 0, 16, 292, 1, 0, 0, 0, 18, 305, 1, 0, 0, 0, 20, 317, 1, 0, 0, 0, 22, 326, 1, 0, 0, 0, 24, 334, 1, 0, 0, 0, 26, 356, 1, 0, 0, 0, 28, 371, 1, 0, 0, 0, 30, 380, 1, 0, 0, 0, 32, 384, 1, 0, 0, 0, 34, 392, 1, 0, 0, 0, 36, 394, 1, 0, 0, 0, 38, 403, 1, 0, 0, 0, 40, 407, 1, 0, 0, 0, 42, 421, 1, 0, 0, 0, 44, 439, 1, 0, 0, 0, 46, 486, 1, 0, 0, 0, 48, 490, 1, 0, 0, 0, 50, 530, 1, 0, 0, 0, 52, 533, 1, 0, 0, 0, 54, 598, 1, 0, 0, 0, 56, 604, 1, 0, 0, 0, 58, 610, 1, 0, 0, 0, 60, 614, 1, 0, 0, 0, 62, 620, 1, 0, 0, 0, 64, 638, 1, 0, 0, 0, 66, 641, 1, 0, 0, 0, 68, 644, 1, 0, 0, 0, 70, 661, 1, 0, 0, 0, 72, 669, 1, 0, 0, 0, 74, 675, 1, 0, 0, 0, 76, 678, 1, 0, 0, 0, 78, 681, 1, 0, 0, 0, 80, 687, 1, 0, 0, 0, 82, 701, 1, 0, 0, 0, 84, 705, 1, 0, 0, 0, 86, 735, 1, 0, 0, 0, 88, 737, 1, 0, 0, 0, 90, 740, 1, 0, 0, 0, 92, 743, 1, 0, 0, 0, 94, 752, 1, 0, 0, 0, 96, 775, 1, 0, 0, 0, 98, 880, 1, 0, 0, 0, 100, 885, 1, 0, 0, 0, 102, 896, 1, 0, 0, 0, 104, 898, 1, 0, 0, 0, 106, 913, 1, 0, 0, 0, 108, 918, 1, 0, 0, 0, 110, 926, 1, 0, 0, 0, 112, 941, 1, 0, 0, 0, 114, 955, 1, 0, 0, 0, 116, 966, 1, 0, 0, 0, 118, 968, 1, 0, 0, 0, 120, 976, 1, 0, 0, 0, 122, 981, 1, 0, 0, 0, 124, 989, 1, 0, 0, 0, 126, 993, 1, 0, 0, 0, 128, 997, 1, 0, 0, 0, 130, 1003, 1, 0, 0, 0, 132, 1012, 1, 0, 0, 0, 134, 1026, 1, 0, 0, 0, 136, 1028, 1, 0, 0, 0, 138, 1094, 1, 0, 0, 0, 140, 1116, 1, 0, 0, 0, 142, 1122, 1, 0, 0, 0, 144, 1124, 1, 0, 0, 0, 146, 1126, 1, 0, 0, 0, 148, 1148, 1, 0, 0, 0, 150, 1150, 1, 0, 0, 0, 152, 1171, 1, 0, 0, 0, 154, 1522, 1, 0, 0, 0, 156, 1714, 1, 0, 0, 0, 158, 1716, 1, 0, 0, 0, 160, 1724, 1, 0, 0, 0, 162, 1734, 1, 0, 0, 0, 164, 1736, 1, 0, 0, 0, 166, 1767, 1, 0, 0, 0, 168, 1780, 1, 0, 0, 0, 170, 1782, 1, 0, 0, 0, 172, 1817, 1, 0, 0, 0, 174, 1819, 1, 0, 0, 0, 176, 1837, 1, 0, 0, 0, 178, 1839, 1, 0, 0, 0, 180, 1860, 1, 0, 0, 0, 182, 1898, 1, 0, 0, 0, 184, 1904, 1, 0, 0, 0, 186, 1910, 1, 0, 0, 0, 188, 1921, 1, 0, 0, 0, 190, 1944, 1, 0, 0, 0, 192, 1946, 1, 0, 0, 0, 194, 1957, 1, 0, 0, 0, 196, 1967, 1, 0, 0, 0, 198, 1971, 1, 0, 0, 0, 200, 1982, 1, 0, 0, 0, 202, 1992, 1, 0, 0, 0, 204, 1995, 1, 0, 0, 0, 206, 2010, 1, 0, 0, 0, 208, 2012, 1, 0, 0, 0, 210, 2014, 1, 0, 0, 0, 212, 2016, 1, 0, 0, 0, 214, 2018, 1, 0, 0, 0, 216, 2023, 1, 0, 0, 0, 218, 2028, 1, 0, 0, 0, 220, 2034, 1, 0, 0, 0, 222, 2036, 1, 0, 0, 0, 224, 2040, 1, 0, 0, 0, 226, 2046, 1, 0, 0, 0, 228, 2048, 1, 0, 0, 0, 230, 2062, 1, 0, 0, 0, 232, 2064, 1, 0, 0, 0, 234, 2078, 1, 0, 0, 0, 236, 238, 3, 2, 1, 0, 237, 236, 1, 0, 0, 0, 238, 241, 1, 0, 0, 0, 239, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 242, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 242, 243, 5, 0, 0, 1, 243, 1, 1, 0, 0, 0, 244, 247, 3, 6, 3, 0, 245, 247, 3, 10, 5, 0, 246, 244, 1, 0, 0, 0, 246, 245, 1, 0, 0, 0, 247, 3, 1, 0, 0, 0, 248, 249, 3, 154, 77, 0, 249, 5, 1, 0, 0, 0, 250, 251, 5, 64, 0, 0, 251, 254, 3, 220, 110, 0, 252, 253, 5, 149, 0, 0, 253, 255, 3, 4, 2, 0, 254, 252, 1, 0, 0, 0, 254, 255, 1, 0, 0, 0, 255, 7, 1, 0, 0, 0, 256, 261, 3, 178, 89, 0, 257, 258, 5, 151, 0, 0, 258, 260, 3, 178, 89, 0, 259, 257, 1, 0, 0, 0, 260, 263, 1, 0, 0, 0, 261, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 265, 1, 0, 0, 0, 263, 261, 1, 0, 0, 0, 264, 266, 5, 151, 0, 0, 265, 264, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, 9, 1, 0, 0, 0, 267, 279, 3, 12, 6, 0, 268, 279, 3, 14, 7, 0, 269, 279, 3, 18, 9, 0, 270, 279, 3, 20, 10, 0, 271, 279, 3, 22, 11, 0, 272, 279, 3, 26, 13, 0, 273, 279, 3, 24, 12, 0, 274, 279, 3, 28, 14, 0, 275, 279, 3, 36, 18, 0, 276, 279, 3, 32, 16, 0, 277, 279, 3, 34, 17, 0, 278, 267, 1, 0, 0, 0, 278, 268, 1, 0, 0, 0, 278, 269, 1, 0, 0, 0, 278, 270, 1, 0, 0, 0, 278, 271, 1, 0, 0, 0, 278, 272, 1, 0, 0, 0, 278, 273, 1, 0, 0, 0, 278, 274, 1, 0, 0, 0, 278, 275, 1, 0, 0, 0, 278, 276, 1, 0, 0, 0, 278, 277, 1, 0, 0, 0, 279, 11, 1, 0, 0, 0, 280, 282, 5, 92, 0, 0, 281, 283, 3, 4, 2, 0, 282, 281, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 285, 1, 0, 0, 0, 284, 286, 5, 186, 0, 0, 285, 284, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 13, 1, 0, 0, 0, 287, 288, 5, 106, 0, 0, 288, 290, 3, 4, 2, 0, 289, 291, 5, 186, 0, 0, 290, 289, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 15, 1, 0, 0, 0, 292, 301, 5, 14, 0, 0, 293, 294, 5, 165, 0, 0, 294, 297, 3, 220, 110, 0, 295, 296, 5, 150, 0, 0, 296, 298, 3, 220, 110, 0, 297, 295, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 300, 5, 185, 0, 0, 300, 302, 1, 0, 0, 0, 301, 293, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, 304, 3, 36, 18, 0, 304, 17, 1, 0, 0, 0, 305, 306, 5, 118, 0, 0, 306, 310, 3, 36, 18, 0, 307, 309, 3, 16, 8, 0, 308, 307, 1, 0, 0, 0, 309, 312, 1, 0, 0, 0, 310, 308, 1, 0, 0, 0, 310, 311, 1, 0, 0, 0, 311, 315, 1, 0, 0, 0, 312, 310, 1, 0, 0, 0, 313, 314, 5, 34, 0, 0, 314, 316, 3, 36, 18, 0, 315, 313, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, 19, 1, 0, 0, 0, 317, 318, 5, 47, 0, 0, 318, 319, 5, 165, 0, 0, 319, 320, 3, 4, 2, 0, 320, 321, 5, 185, 0, 0, 321, 324, 3, 10, 5, 0, 322, 323, 5, 26, 0, 0, 323, 325, 3, 10, 5, 0, 324, 322, 1, 0, 0, 0, 324, 325, 1, 0, 0, 0, 325, 21, 1, 0, 0, 0, 326, 327, 5, 128, 0, 0, 327, 328, 5, 165, 0, 0, 328, 329, 3, 4, 2, 0, 329, 330, 5, 185, 0, 0, 330, 332, 3, 10, 5, 0, 331, 333, 5, 186, 0, 0, 332, 331, 1, 0, 0, 0, 332, 333, 1, 0, 0, 0, 333, 23, 1, 0, 0, 0, 334, 335, 5, 38, 0, 0, 335, 339, 5, 165, 0, 0, 336, 340, 3, 6, 3, 0, 337, 340, 3, 30, 15, 0, 338, 340, 3, 4, 2, 0, 339, 336, 1, 0, 0, 0, 339, 337, 1, 0, 0, 0, 339, 338, 1, 0, 0, 0, 339, 340, 1, 0, 0, 0, 340, 341, 1, 0, 0, 0, 341, 343, 5, 186, 0, 0, 342, 344, 3, 4, 2, 0, 343, 342, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 349, 5, 186, 0, 0, 346, 350, 3, 6, 3, 0, 347, 350, 3, 30, 15, 0, 348, 350, 3, 4, 2, 0, 349, 346, 1, 0, 0, 0, 349, 347, 1, 0, 0, 0, 349, 348, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 352, 5, 185, 0, 0, 352, 354, 3, 10, 5, 0, 353, 355, 5, 186, 0, 0, 354, 353, 1, 0, 0, 0, 354, 355, 1, 0, 0, 0, 355, 25, 1, 0, 0, 0, 356, 357, 5, 38, 0, 0, 357, 358, 5, 165, 0, 0, 358, 359, 5, 64, 0, 0, 359, 362, 3, 220, 110, 0, 360, 361, 5, 151, 0, 0, 361, 363, 3, 220, 110, 0, 362, 360, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, 365, 5, 51, 0, 0, 365, 366, 3, 4, 2, 0, 366, 367, 5, 185, 0, 0, 367, 369, 3, 10, 5, 0, 368, 370, 5, 186, 0, 0, 369, 368, 1, 0, 0, 0, 369, 370, 1, 0, 0, 0, 370, 27, 1, 0, 0, 0, 371, 372, 7, 0, 0, 0, 372, 373, 3, 220, 110, 0, 373, 375, 5, 165, 0, 0, 374, 376, 3, 8, 4, 0, 375, 374, 1, 0, 0, 0, 375, 376, 1, 0, 0, 0, 376, 377, 1, 0, 0, 0, 377, 378, 5, 185, 0, 0, 378, 379, 3, 36, 18, 0, 379, 29, 1, 0, 0, 0, 380, 381, 3, 4, 2, 0, 381, 382, 5, 149, 0, 0, 382, 383, 3, 4, 2, 0, 383, 31, 1, 0, 0, 0, 384, 387, 3, 4, 2, 0, 385, 386, 5, 149, 0, 0, 386, 388, 3, 4, 2, 0, 387, 385, 1, 0, 0, 0, 387, 388, 1, 0, 0, 0, 388, 390, 1, 0, 0, 0, 389, 391, 5, 186, 0, 0, 390, 389, 1, 0, 0, 0, 390, 391, 1, 0, 0, 0, 391, 33, 1, 0, 0, 0, 392, 393, 5, 186, 0, 0, 393, 35, 1, 0, 0, 0, 394, 398, 5, 163, 0, 0, 395, 397, 3, 2, 1, 0, 396, 395, 1, 0, 0, 0, 397, 400, 1, 0, 0, 0, 398, 396, 1, 0, 0, 0, 398, 399, 1, 0, 0, 0, 399, 401, 1, 0, 0, 0, 400, 398, 1, 0, 0, 0, 401, 402, 5, 183, 0, 0, 402, 37, 1, 0, 0, 0, 403, 404, 3, 4, 2, 0, 404, 405, 5, 150, 0, 0, 405, 406, 3, 4, 2, 0, 406, 39, 1, 0, 0, 0, 407, 412, 3, 38, 19, 0, 408, 409, 5, 151, 0, 0, 409, 411, 3, 38, 19, 0, 410, 408, 1, 0, 0, 0, 411, 414, 1, 0, 0, 0, 412, 410, 1, 0, 0, 0, 412, 413, 1, 0, 0, 0, 413, 416, 1, 0, 0, 0, 414, 412, 1, 0, 0, 0, 415, 417, 5, 151, 0, 0, 416, 415, 1, 0, 0, 0, 416, 417, 1, 0, 0, 0, 417, 41, 1, 0, 0, 0, 418, 422, 3, 48, 24, 0, 419, 422, 3, 52, 26, 0, 420, 422, 3, 166, 83, 0, 421, 418, 1, 0, 0, 0, 421, 419, 1, 0, 0, 0, 421, 420, 1, 0, 0, 0, 422, 424, 1, 0, 0, 0, 423, 425, 5, 186, 0, 0, 424, 423, 1, 0, 0, 0, 424, 425, 1, 0, 0, 0, 425, 426, 1, 0, 0, 0, 426, 427, 5, 0, 0, 1, 427, 43, 1, 0, 0, 0, 428, 440, 3, 52, 26, 0, 429, 430, 3, 54, 27, 0, 430, 431, 5, 165, 0, 0, 431, 432, 3, 48, 24, 0, 432, 433, 5, 185, 0, 0, 433, 440, 1, 0, 0, 0, 434, 435, 5, 165, 0, 0, 435, 436, 3, 48, 24, 0, 436, 437, 5, 185, 0, 0, 437, 440, 1, 0, 0, 0, 438, 440, 3, 224, 112, 0, 439, 428, 1, 0, 0, 0, 439, 429, 1, 0, 0, 0, 439, 434, 1, 0, 0, 0, 439, 438, 1, 0, 0, 0, 440, 45, 1, 0, 0, 0, 441, 442, 5, 28, 0, 0, 442, 445, 5, 1, 0, 0, 443, 444, 5, 11, 0, 0, 444, 446, 5, 70, 0, 0, 445, 443, 1, 0, 0, 0, 445, 446, 1, 0, 0, 0, 446, 487, 1, 0, 0, 0, 447, 450, 5, 28, 0, 0, 448, 449, 5, 11, 0, 0, 449, 451, 5, 70, 0, 0, 450, 448, 1, 0, 0, 0, 450, 451, 1, 0, 0, 0, 451, 487, 1, 0, 0, 0, 452, 453, 5, 121, 0, 0, 453, 456, 5, 1, 0, 0, 454, 455, 5, 11, 0, 0, 455, 457, 5, 70, 0, 0, 456, 454, 1, 0, 0, 0, 456, 457, 1, 0, 0, 0, 457, 487, 1, 0, 0, 0, 458, 459, 5, 121, 0, 0, 459, 462, 5, 25, 0, 0, 460, 461, 5, 11, 0, 0, 461, 463, 5, 70, 0, 0, 462, 460, 1, 0, 0, 0, 462, 463, 1, 0, 0, 0, 463, 487, 1, 0, 0, 0, 464, 467, 5, 121, 0, 0, 465, 466, 5, 11, 0, 0, 466, 468, 5, 70, 0, 0, 467, 465, 1, 0, 0, 0, 467, 468, 1, 0, 0, 0, 468, 487, 1, 0, 0, 0, 469, 470, 5, 54, 0, 0, 470, 473, 5, 1, 0, 0, 471, 472, 5, 11, 0, 0, 472, 474, 5, 70, 0, 0, 473, 471, 1, 0, 0, 0, 473, 474, 1, 0, 0, 0, 474, 487, 1, 0, 0, 0, 475, 476, 5, 54, 0, 0, 476, 479, 5, 25, 0, 0, 477, 478, 5, 11, 0, 0, 478, 480, 5, 70, 0, 0, 479, 477, 1, 0, 0, 0, 479, 480, 1, 0, 0, 0, 480, 487, 1, 0, 0, 0, 481, 484, 5, 54, 0, 0, 482, 483, 5, 11, 0, 0, 483, 485, 5, 70, 0, 0, 484, 482, 1, 0, 0, 0, 484, 485, 1, 0, 0, 0, 485, 487, 1, 0, 0, 0, 486, 441, 1, 0, 0, 0, 486, 447, 1, 0, 0, 0, 486, 452, 1, 0, 0, 0, 486, 458, 1, 0, 0, 0, 486, 464, 1, 0, 0, 0, 486, 469, 1, 0, 0, 0, 486, 475, 1, 0, 0, 0, 486, 481, 1, 0, 0, 0, 487, 488, 1, 0, 0, 0, 488, 489, 3, 44, 22, 0, 489, 47, 1, 0, 0, 0, 490, 494, 3, 44, 22, 0, 491, 493, 3, 46, 23, 0, 492, 491, 1, 0, 0, 0, 493, 496, 1, 0, 0, 0, 494, 492, 1, 0, 0, 0, 494, 495, 1, 0, 0, 0, 495, 498, 1, 0, 0, 0, 496, 494, 1, 0, 0, 0, 497, 499, 3, 78, 39, 0, 498, 497, 1, 0, 0, 0, 498, 499, 1, 0, 0, 0, 499, 501, 1, 0, 0, 0, 500, 502, 3, 50, 25, 0, 501, 500, 1, 0, 0, 0, 501, 502, 1, 0, 0, 0, 502, 49, 1, 0, 0, 0, 503, 504, 5, 66, 0, 0, 504, 506, 3, 154, 77, 0, 505, 507, 5, 174, 0, 0, 506, 505, 1, 0, 0, 0, 506, 507, 1, 0, 0, 0, 507, 510, 1, 0, 0, 0, 508, 509, 5, 151, 0, 0, 509, 511, 3, 154, 77, 0, 510, 508, 1, 0, 0, 0, 510, 511, 1, 0, 0, 0, 511, 514, 1, 0, 0, 0, 512, 513, 5, 130, 0, 0, 513, 515, 5, 107, 0, 0, 514, 512, 1, 0, 0, 0, 514, 515, 1, 0, 0, 0, 515, 531, 1, 0, 0, 0, 516, 517, 5, 66, 0, 0, 517, 519, 3, 154, 77, 0, 518, 520, 5, 174, 0, 0, 519, 518, 1, 0, 0, 0, 519, 520, 1, 0, 0, 0, 520, 523, 1, 0, 0, 0, 521, 522, 5, 130, 0, 0, 522, 524, 5, 107, 0, 0, 523, 521, 1, 0, 0, 0, 523, 524, 1, 0, 0, 0, 524, 525, 1, 0, 0, 0, 525, 526, 5, 76, 0, 0, 526, 527, 3, 154, 77, 0, 527, 531, 1, 0, 0, 0, 528, 529, 5, 76, 0, 0, 529, 531, 3, 154, 77, 0, 530, 503, 1, 0, 0, 0, 530, 516, 1, 0, 0, 0, 530, 528, 1, 0, 0, 0, 531, 51, 1, 0, 0, 0, 532, 534, 3, 54, 27, 0, 533, 532, 1, 0, 0, 0, 533, 534, 1, 0, 0, 0, 534, 535, 1, 0, 0, 0, 535, 537, 5, 99, 0, 0, 536, 538, 5, 25, 0, 0, 537, 536, 1, 0, 0, 0, 537, 538, 1, 0, 0, 0, 538, 540, 1, 0, 0, 0, 539, 541, 3, 56, 28, 0, 540, 539, 1, 0, 0, 0, 540, 541, 1, 0, 0, 0, 541, 542, 1, 0, 0, 0, 542, 544, 3, 148, 74, 0, 543, 545, 3, 58, 29, 0, 544, 543, 1, 0, 0, 0, 544, 545, 1, 0, 0, 0, 545, 547, 1, 0, 0, 0, 546, 548, 3, 60, 30, 0, 547, 546, 1, 0, 0, 0, 547, 548, 1, 0, 0, 0, 548, 550, 1, 0, 0, 0, 549, 551, 3, 64, 32, 0, 550, 549, 1, 0, 0, 0, 550, 551, 1, 0, 0, 0, 551, 553, 1, 0, 0, 0, 552, 554, 3, 66, 33, 0, 553, 552, 1, 0, 0, 0, 553, 554, 1, 0, 0, 0, 554, 559, 1, 0, 0, 0, 555, 557, 5, 123, 0, 0, 556, 555, 1, 0, 0, 0, 556, 557, 1, 0, 0, 0, 557, 558, 1, 0, 0, 0, 558, 560, 3, 104, 52, 0, 559, 556, 1, 0, 0, 0, 559, 560, 1, 0, 0, 0, 560, 562, 1, 0, 0, 0, 561, 563, 3, 68, 34, 0, 562, 561, 1, 0, 0, 0, 562, 563, 1, 0, 0, 0, 563, 566, 1, 0, 0, 0, 564, 565, 5, 130, 0, 0, 565, 567, 7, 1, 0, 0, 566, 564, 1, 0, 0, 0, 566, 567, 1, 0, 0, 0, 567, 570, 1, 0, 0, 0, 568, 569, 5, 130, 0, 0, 569, 571, 5, 114, 0, 0, 570, 568, 1, 0, 0, 0, 570, 571, 1, 0, 0, 0, 571, 573, 1, 0, 0, 0, 572, 574, 3, 74, 37, 0, 573, 572, 1, 0, 0, 0, 573, 574, 1, 0, 0, 0, 574, 576, 1, 0, 0, 0, 575, 577, 3, 76, 38, 0, 576, 575, 1, 0, 0, 0, 576, 577, 1, 0, 0, 0, 577, 580, 1, 0, 0, 0, 578, 579, 5, 123, 0, 0, 579, 581, 3, 104, 52, 0, 580, 578, 1, 0, 0, 0, 580, 581, 1, 0, 0, 0, 581, 583, 1, 0, 0, 0, 582, 584, 3, 62, 31, 0, 583, 582, 1, 0, 0, 0, 583, 584, 1, 0, 0, 0, 584, 586, 1, 0, 0, 0, 585, 587, 3, 78, 39, 0, 586, 585, 1, 0, 0, 0, 586, 587, 1, 0, 0, 0, 587, 589, 1, 0, 0, 0, 588, 590, 3, 84, 42, 0, 589, 588, 1, 0, 0, 0, 589, 590, 1, 0, 0, 0, 590, 593, 1, 0, 0, 0, 591, 594, 3, 86, 43, 0, 592, 594, 3, 88, 44, 0, 593, 591, 1, 0, 0, 0, 593, 592, 1, 0, 0, 0, 593, 594, 1, 0, 0, 0, 594, 596, 1, 0, 0, 0, 595, 597, 3, 90, 45, 0, 596, 595, 1, 0, 0, 0, 596, 597, 1, 0, 0, 0, 597, 53, 1, 0, 0, 0, 598, 600, 5, 130, 0, 0, 599, 601, 5, 90, 0, 0, 600, 599, 1, 0, 0, 0, 600, 601, 1, 0, 0, 0, 601, 602, 1, 0, 0, 0, 602, 603, 3, 170, 85, 0, 603, 55, 1, 0, 0, 0, 604, 605, 5, 113, 0, 0, 605, 608, 5, 139, 0, 0, 606, 607, 5, 130, 0, 0, 607, 609, 5, 107, 0, 0, 608, 606, 1, 0, 0, 0, 608, 609, 1, 0, 0, 0, 609, 57, 1, 0, 0, 0, 610, 611, 5, 39, 0, 0, 611, 612, 3, 96, 48, 0, 612, 59, 1, 0, 0, 0, 613, 615, 7, 2, 0, 0, 614, 613, 1, 0, 0, 0, 614, 615, 1, 0, 0, 0, 615, 616, 1, 0, 0, 0, 616, 617, 5, 5, 0, 0, 617, 618, 5, 58, 0, 0, 618, 619, 3, 146, 73, 0, 619, 61, 1, 0, 0, 0, 620, 621, 5, 129, 0, 0, 621, 622, 3, 220, 110, 0, 622, 623, 5, 6, 0, 0, 623, 624, 5, 165, 0, 0, 624, 625, 3, 122, 61, 0, 625, 635, 5, 185, 0, 0, 626, 627, 5, 151, 0, 0, 627, 628, 3, 220, 110, 0, 628, 629, 5, 6, 0, 0, 629, 630, 5, 165, 0, 0, 630, 631, 3, 122, 61, 0, 631, 632, 5, 185, 0, 0, 632, 634, 1, 0, 0, 0, 633, 626, 1, 0, 0, 0, 634, 637, 1, 0, 0, 0, 635, 633, 1, 0, 0, 0, 635, 636, 1, 0, 0, 0, 636, 63, 1, 0, 0, 0, 637, 635, 1, 0, 0, 0, 638, 639, 5, 86, 0, 0, 639, 640, 3, 154, 77, 0, 640, 65, 1, 0, 0, 0, 641, 642, 5, 127, 0, 0, 642, 643, 3, 154, 77, 0, 643, 67, 1, 0, 0, 0, 644, 645, 5, 42, 0, 0, 645, 659, 5, 11, 0, 0, 646, 660, 5, 1, 0, 0, 647, 648, 7, 1, 0, 0, 648, 649, 5, 165, 0, 0, 649, 650, 3, 146, 73, 0, 650, 651, 5, 185, 0, 0, 651, 660, 1, 0, 0, 0, 652, 653, 5, 43, 0, 0, 653, 654, 5, 101, 0, 0, 654, 655, 5, 165, 0, 0, 655, 656, 3, 70, 35, 0, 656, 657, 5, 185, 0, 0, 657, 660, 1, 0, 0, 0, 658, 660, 3, 146, 73, 0, 659, 646, 1, 0, 0, 0, 659, 647, 1, 0, 0, 0, 659, 652, 1, 0, 0, 0, 659, 658, 1, 0, 0, 0, 660, 69, 1, 0, 0, 0, 661, 666, 3, 72, 36, 0, 662, 663, 5, 151, 0, 0, 663, 665, 3, 72, 36, 0, 664, 662, 1, 0, 0, 0, 665, 668, 1, 0, 0, 0, 666, 664, 1, 0, 0, 0, 666, 667, 1, 0, 0, 0, 667, 71, 1, 0, 0, 0, 668, 666, 1, 0, 0, 0, 669, 671, 5, 165, 0, 0, 670, 672, 3, 146, 73, 0, 671, 670, 1, 0, 0, 0, 671, 672, 1, 0, 0, 0, 672, 673, 1, 0, 0, 0, 673, 674, 5, 185, 0, 0, 674, 73, 1, 0, 0, 0, 675, 676, 5, 44, 0, 0, 676, 677, 3, 154, 77, 0, 677, 75, 1, 0, 0, 0, 678, 679, 5, 87, 0, 0, 679, 680, 3, 154, 77, 0, 680, 77, 1, 0, 0, 0, 681, 682, 5, 79, 0, 0, 682, 683, 5, 11, 0, 0, 683, 685, 3, 108, 54, 0, 684, 686, 3, 80, 40, 0, 685, 684, 1, 0, 0, 0, 685, 686, 1, 0, 0, 0, 686, 79, 1, 0, 0, 0, 687, 699, 5, 55, 0, 0, 688, 689, 5, 165, 0, 0, 689, 694, 3, 114, 57, 0, 690, 691, 5, 151, 0, 0, 691, 693, 3, 114, 57, 0, 692, 690, 1, 0, 0, 0, 693, 696, 1, 0, 0, 0, 694, 692, 1, 0, 0, 0, 694, 695, 1, 0, 0, 0, 695, 697, 1, 0, 0, 0, 696, 694, 1, 0, 0, 0, 697, 698, 5, 185, 0, 0, 698, 700, 1, 0, 0, 0, 699, 688, 1, 0, 0, 0, 699, 700, 1, 0, 0, 0, 700, 81, 1, 0, 0, 0, 701, 702, 5, 79, 0, 0, 702, 703, 5, 11, 0, 0, 703, 704, 3, 146, 73, 0, 704, 83, 1, 0, 0, 0, 705, 706, 5, 66, 0, 0, 706, 707, 3, 106, 53, 0, 707, 708, 5, 11, 0, 0, 708, 709, 3, 146, 73, 0, 709, 85, 1, 0, 0, 0, 710, 711, 5, 66, 0, 0, 711, 713, 3, 154, 77, 0, 712, 714, 5, 174, 0, 0, 713, 712, 1, 0, 0, 0, 713, 714, 1, 0, 0, 0, 714, 717, 1, 0, 0, 0, 715, 716, 5, 151, 0, 0, 716, 718, 3, 154, 77, 0, 717, 715, 1, 0, 0, 0, 717, 718, 1, 0, 0, 0, 718, 721, 1, 0, 0, 0, 719, 720, 5, 130, 0, 0, 720, 722, 5, 107, 0, 0, 721, 719, 1, 0, 0, 0, 721, 722, 1, 0, 0, 0, 722, 736, 1, 0, 0, 0, 723, 724, 5, 66, 0, 0, 724, 726, 3, 154, 77, 0, 725, 727, 5, 174, 0, 0, 726, 725, 1, 0, 0, 0, 726, 727, 1, 0, 0, 0, 727, 730, 1, 0, 0, 0, 728, 729, 5, 130, 0, 0, 729, 731, 5, 107, 0, 0, 730, 728, 1, 0, 0, 0, 730, 731, 1, 0, 0, 0, 731, 732, 1, 0, 0, 0, 732, 733, 5, 76, 0, 0, 733, 734, 3, 154, 77, 0, 734, 736, 1, 0, 0, 0, 735, 710, 1, 0, 0, 0, 735, 723, 1, 0, 0, 0, 736, 87, 1, 0, 0, 0, 737, 738, 5, 76, 0, 0, 738, 739, 3, 154, 77, 0, 739, 89, 1, 0, 0, 0, 740, 741, 5, 102, 0, 0, 741, 742, 3, 118, 59, 0, 742, 91, 1, 0, 0, 0, 743, 744, 5, 124, 0, 0, 744, 749, 3, 94, 47, 0, 745, 746, 5, 151, 0, 0, 746, 748, 3, 94, 47, 0, 747, 745, 1, 0, 0, 0, 748, 751, 1, 0, 0, 0, 749, 747, 1, 0, 0, 0, 749, 750, 1, 0, 0, 0, 750, 93, 1, 0, 0, 0, 751, 749, 1, 0, 0, 0, 752, 753, 5, 165, 0, 0, 753, 758, 3, 154, 77, 0, 754, 755, 5, 151, 0, 0, 755, 757, 3, 154, 77, 0, 756, 754, 1, 0, 0, 0, 757, 760, 1, 0, 0, 0, 758, 756, 1, 0, 0, 0, 758, 759, 1, 0, 0, 0, 759, 761, 1, 0, 0, 0, 760, 758, 1, 0, 0, 0, 761, 762, 5, 185, 0, 0, 762, 95, 1, 0, 0, 0, 763, 764, 6, 48, -1, 0, 764, 766, 3, 180, 90, 0, 765, 767, 5, 31, 0, 0, 766, 765, 1, 0, 0, 0, 766, 767, 1, 0, 0, 0, 767, 769, 1, 0, 0, 0, 768, 770, 3, 104, 52, 0, 769, 768, 1, 0, 0, 0, 769, 770, 1, 0, 0, 0, 770, 776, 1, 0, 0, 0, 771, 772, 5, 165, 0, 0, 772, 773, 3, 96, 48, 0, 773, 774, 5, 185, 0, 0, 774, 776, 1, 0, 0, 0, 775, 763, 1, 0, 0, 0, 775, 771, 1, 0, 0, 0, 776, 824, 1, 0, 0, 0, 777, 778, 10, 5, 0, 0, 778, 779, 3, 100, 50, 0, 779, 780, 3, 96, 48, 6, 780, 823, 1, 0, 0, 0, 781, 783, 10, 7, 0, 0, 782, 784, 5, 71, 0, 0, 783, 782, 1, 0, 0, 0, 783, 784, 1, 0, 0, 0, 784, 786, 1, 0, 0, 0, 785, 787, 3, 98, 49, 0, 786, 785, 1, 0, 0, 0, 786, 787, 1, 0, 0, 0, 787, 788, 1, 0, 0, 0, 788, 789, 5, 58, 0, 0, 789, 791, 3, 96, 48, 0, 790, 792, 3, 102, 51, 0, 791, 790, 1, 0, 0, 0, 791, 792, 1, 0, 0, 0, 792, 823, 1, 0, 0, 0, 793, 794, 10, 6, 0, 0, 794, 795, 5, 84, 0, 0, 795, 796, 5, 58, 0, 0, 796, 798, 3, 96, 48, 0, 797, 799, 3, 102, 51, 0, 798, 797, 1, 0, 0, 0, 798, 799, 1, 0, 0, 0, 799, 823, 1, 0, 0, 0, 800, 801, 10, 4, 0, 0, 801, 802, 5, 83, 0, 0, 802, 803, 5, 165, 0, 0, 803, 804, 3, 146, 73, 0, 804, 808, 3, 182, 91, 0, 805, 806, 5, 42, 0, 0, 806, 807, 5, 11, 0, 0, 807, 809, 3, 146, 73, 0, 808, 805, 1, 0, 0, 0, 808, 809, 1, 0, 0, 0, 809, 810, 1, 0, 0, 0, 810, 811, 5, 185, 0, 0, 811, 823, 1, 0, 0, 0, 812, 813, 10, 3, 0, 0, 813, 816, 5, 122, 0, 0, 814, 815, 5, 50, 0, 0, 815, 817, 5, 75, 0, 0, 816, 814, 1, 0, 0, 0, 816, 817, 1, 0, 0, 0, 817, 818, 1, 0, 0, 0, 818, 819, 5, 165, 0, 0, 819, 820, 3, 186, 93, 0, 820, 821, 5, 185, 0, 0, 821, 823, 1, 0, 0, 0, 822, 777, 1, 0, 0, 0, 822, 781, 1, 0, 0, 0, 822, 793, 1, 0, 0, 0, 822, 800, 1, 0, 0, 0, 822, 812, 1, 0, 0, 0, 823, 826, 1, 0, 0, 0, 824, 822, 1, 0, 0, 0, 824, 825, 1, 0, 0, 0, 825, 97, 1, 0, 0, 0, 826, 824, 1, 0, 0, 0, 827, 829, 7, 3, 0, 0, 828, 827, 1, 0, 0, 0, 828, 829, 1, 0, 0, 0, 829, 830, 1, 0, 0, 0, 830, 841, 5, 53, 0, 0, 831, 833, 5, 53, 0, 0, 832, 834, 7, 3, 0, 0, 833, 832, 1, 0, 0, 0, 833, 834, 1, 0, 0, 0, 834, 841, 1, 0, 0, 0, 835, 841, 7, 3, 0, 0, 836, 841, 5, 3, 0, 0, 837, 841, 5, 100, 0, 0, 838, 839, 5, 8, 0, 0, 839, 841, 7, 4, 0, 0, 840, 828, 1, 0, 0, 0, 840, 831, 1, 0, 0, 0, 840, 835, 1, 0, 0, 0, 840, 836, 1, 0, 0, 0, 840, 837, 1, 0, 0, 0, 840, 838, 1, 0, 0, 0, 841, 881, 1, 0, 0, 0, 842, 844, 7, 5, 0, 0, 843, 842, 1, 0, 0, 0, 843, 844, 1, 0, 0, 0, 844, 845, 1, 0, 0, 0, 845, 847, 7, 6, 0, 0, 846, 848, 5, 80, 0, 0, 847, 846, 1, 0, 0, 0, 847, 848, 1, 0, 0, 0, 848, 863, 1, 0, 0, 0, 849, 851, 7, 6, 0, 0, 850, 852, 5, 80, 0, 0, 851, 850, 1, 0, 0, 0, 851, 852, 1, 0, 0, 0, 852, 854, 1, 0, 0, 0, 853, 855, 7, 5, 0, 0, 854, 853, 1, 0, 0, 0, 854, 855, 1, 0, 0, 0, 855, 863, 1, 0, 0, 0, 856, 857, 5, 8, 0, 0, 857, 858, 7, 4, 0, 0, 858, 860, 7, 6, 0, 0, 859, 861, 5, 80, 0, 0, 860, 859, 1, 0, 0, 0, 860, 861, 1, 0, 0, 0, 861, 863, 1, 0, 0, 0, 862, 843, 1, 0, 0, 0, 862, 849, 1, 0, 0, 0, 862, 856, 1, 0, 0, 0, 863, 881, 1, 0, 0, 0, 864, 866, 7, 3, 0, 0, 865, 864, 1, 0, 0, 0, 865, 866, 1, 0, 0, 0, 866, 867, 1, 0, 0, 0, 867, 869, 5, 40, 0, 0, 868, 870, 5, 80, 0, 0, 869, 868, 1, 0, 0, 0, 869, 870, 1, 0, 0, 0, 870, 879, 1, 0, 0, 0, 871, 873, 5, 40, 0, 0, 872, 874, 5, 80, 0, 0, 873, 872, 1, 0, 0, 0, 873, 874, 1, 0, 0, 0, 874, 876, 1, 0, 0, 0, 875, 877, 7, 3, 0, 0, 876, 875, 1, 0, 0, 0, 876, 877, 1, 0, 0, 0, 877, 879, 1, 0, 0, 0, 878, 865, 1, 0, 0, 0, 878, 871, 1, 0, 0, 0, 879, 881, 1, 0, 0, 0, 880, 840, 1, 0, 0, 0, 880, 862, 1, 0, 0, 0, 880, 878, 1, 0, 0, 0, 881, 99, 1, 0, 0, 0, 882, 883, 5, 18, 0, 0, 883, 886, 5, 58, 0, 0, 884, 886, 5, 151, 0, 0, 885, 882, 1, 0, 0, 0, 885, 884, 1, 0, 0, 0, 886, 101, 1, 0, 0, 0, 887, 888, 5, 77, 0, 0, 888, 897, 3, 146, 73, 0, 889, 890, 5, 123, 0, 0, 890, 891, 5, 165, 0, 0, 891, 892, 3, 146, 73, 0, 892, 893, 5, 185, 0, 0, 893, 897, 1, 0, 0, 0, 894, 895, 5, 123, 0, 0, 895, 897, 3, 146, 73, 0, 896, 887, 1, 0, 0, 0, 896, 889, 1, 0, 0, 0, 896, 894, 1, 0, 0, 0, 897, 103, 1, 0, 0, 0, 898, 899, 5, 97, 0, 0, 899, 901, 3, 116, 58, 0, 900, 902, 5, 174, 0, 0, 901, 900, 1, 0, 0, 0, 901, 902, 1, 0, 0, 0, 902, 905, 1, 0, 0, 0, 903, 904, 5, 76, 0, 0, 904, 906, 3, 116, 58, 0, 905, 903, 1, 0, 0, 0, 905, 906, 1, 0, 0, 0, 906, 911, 1, 0, 0, 0, 907, 908, 5, 165, 0, 0, 908, 909, 3, 220, 110, 0, 909, 910, 5, 185, 0, 0, 910, 912, 1, 0, 0, 0, 911, 907, 1, 0, 0, 0, 911, 912, 1, 0, 0, 0, 912, 105, 1, 0, 0, 0, 913, 916, 3, 154, 77, 0, 914, 915, 7, 7, 0, 0, 915, 917, 3, 154, 77, 0, 916, 914, 1, 0, 0, 0, 916, 917, 1, 0, 0, 0, 917, 107, 1, 0, 0, 0, 918, 923, 3, 110, 55, 0, 919, 920, 5, 151, 0, 0, 920, 922, 3, 110, 55, 0, 921, 919, 1, 0, 0, 0, 922, 925, 1, 0, 0, 0, 923, 921, 1, 0, 0, 0, 923, 924, 1, 0, 0, 0, 924, 109, 1, 0, 0, 0, 925, 923, 1, 0, 0, 0, 926, 928, 3, 154, 77, 0, 927, 929, 7, 8, 0, 0, 928, 927, 1, 0, 0, 0, 928, 929, 1, 0, 0, 0, 929, 932, 1, 0, 0, 0, 930, 931, 5, 75, 0, 0, 931, 933, 7, 9, 0, 0, 932, 930, 1, 0, 0, 0, 932, 933, 1, 0, 0, 0, 933, 936, 1, 0, 0, 0, 934, 935, 5, 16, 0, 0, 935, 937, 5, 143, 0, 0, 936, 934, 1, 0, 0, 0, 936, 937, 1, 0, 0, 0, 937, 939, 1, 0, 0, 0, 938, 940, 3, 112, 56, 0, 939, 938, 1, 0, 0, 0, 939, 940, 1, 0, 0, 0, 940, 111, 1, 0, 0, 0, 941, 942, 5, 130, 0, 0, 942, 945, 5, 32, 0, 0, 943, 944, 5, 39, 0, 0, 944, 946, 3, 154, 77, 0, 945, 943, 1, 0, 0, 0, 945, 946, 1, 0, 0, 0, 946, 949, 1, 0, 0, 0, 947, 948, 5, 112, 0, 0, 948, 950, 3, 154, 77, 0, 949, 947, 1, 0, 0, 0, 949, 950, 1, 0, 0, 0, 950, 953, 1, 0, 0, 0, 951, 952, 5, 103, 0, 0, 952, 954, 3, 154, 77, 0, 953, 951, 1, 0, 0, 0, 953, 954, 1, 0, 0, 0, 954, 113, 1, 0, 0, 0, 955, 958, 3, 154, 77, 0, 956, 957, 5, 6, 0, 0, 957, 959, 3, 154, 77, 0, 958, 956, 1, 0, 0, 0, 958, 959, 1, 0, 0, 0, 959, 115, 1, 0, 0, 0, 960, 967, 3, 224, 112, 0, 961, 964, 3, 204, 102, 0, 962, 963, 5, 187, 0, 0, 963, 965, 3, 204, 102, 0, 964, 962, 1, 0, 0, 0, 964, 965, 1, 0, 0, 0, 965, 967, 1, 0, 0, 0, 966, 960, 1, 0, 0, 0, 966, 961, 1, 0, 0, 0, 967, 117, 1, 0, 0, 0, 968, 973, 3, 120, 60, 0, 969, 970, 5, 151, 0, 0, 970, 972, 3, 120, 60, 0, 971, 969, 1, 0, 0, 0, 972, 975, 1, 0, 0, 0, 973, 971, 1, 0, 0, 0, 973, 974, 1, 0, 0, 0, 974, 119, 1, 0, 0, 0, 975, 973, 1, 0, 0, 0, 976, 977, 3, 220, 110, 0, 977, 978, 5, 157, 0, 0, 978, 979, 3, 206, 103, 0, 979, 121, 1, 0, 0, 0, 980, 982, 3, 124, 62, 0, 981, 980, 1, 0, 0, 0, 981, 982, 1, 0, 0, 0, 982, 984, 1, 0, 0, 0, 983, 985, 3, 126, 63, 0, 984, 983, 1, 0, 0, 0, 984, 985, 1, 0, 0, 0, 985, 987, 1, 0, 0, 0, 986, 988, 3, 130, 65, 0, 987, 986, 1, 0, 0, 0, 987, 988, 1, 0, 0, 0, 988, 123, 1, 0, 0, 0, 989, 990, 5, 82, 0, 0, 990, 991, 5, 11, 0, 0, 991, 992, 3, 146, 73, 0, 992, 125, 1, 0, 0, 0, 993, 994, 5, 79, 0, 0, 994, 995, 5, 11, 0, 0, 995, 996, 3, 108, 54, 0, 996, 127, 1, 0, 0, 0, 997, 998, 5, 131, 0, 0, 998, 999, 5, 42, 0, 0, 999, 1000, 5, 165, 0, 0, 1000, 1001, 3, 78, 39, 0, 1001, 1002, 5, 185, 0, 0, 1002, 129, 1, 0, 0, 0, 1003, 1004, 7, 10, 0, 0, 1004, 1005, 3, 132, 66, 0, 1005, 131, 1, 0, 0, 0, 1006, 1013, 3, 134, 67, 0, 1007, 1008, 5, 9, 0, 0, 1008, 1009, 3, 134, 67, 0, 1009, 1010, 5, 2, 0, 0, 1010, 1011, 3, 134, 67, 0, 1011, 1013, 1, 0, 0, 0, 1012, 1006, 1, 0, 0, 0, 1012, 1007, 1, 0, 0, 0, 1013, 133, 1, 0, 0, 0, 1014, 1015, 5, 20, 0, 0, 1015, 1027, 5, 95, 0, 0, 1016, 1017, 5, 120, 0, 0, 1017, 1027, 5, 85, 0, 0, 1018, 1019, 5, 120, 0, 0, 1019, 1027, 5, 37, 0, 0, 1020, 1021, 3, 154, 77, 0, 1021, 1022, 5, 85, 0, 0, 1022, 1027, 1, 0, 0, 0, 1023, 1024, 3, 154, 77, 0, 1024, 1025, 5, 37, 0, 0, 1025, 1027, 1, 0, 0, 0, 1026, 1014, 1, 0, 0, 0, 1026, 1016, 1, 0, 0, 0, 1026, 1018, 1, 0, 0, 0, 1026, 1020, 1, 0, 0, 0, 1026, 1023, 1, 0, 0, 0, 1027, 135, 1, 0, 0, 0, 1028, 1029, 3, 154, 77, 0, 1029, 1030, 5, 0, 0, 1, 1030, 137, 1, 0, 0, 0, 1031, 1032, 6, 69, -1, 0, 1032, 1033, 3, 220, 110, 0, 1033, 1034, 5, 165, 0, 0, 1034, 1035, 3, 220, 110, 0, 1035, 1042, 3, 138, 69, 0, 1036, 1037, 5, 151, 0, 0, 1037, 1038, 3, 220, 110, 0, 1038, 1039, 3, 138, 69, 0, 1039, 1041, 1, 0, 0, 0, 1040, 1036, 1, 0, 0, 0, 1041, 1044, 1, 0, 0, 0, 1042, 1040, 1, 0, 0, 0, 1042, 1043, 1, 0, 0, 0, 1043, 1046, 1, 0, 0, 0, 1044, 1042, 1, 0, 0, 0, 1045, 1047, 5, 151, 0, 0, 1046, 1045, 1, 0, 0, 0, 1046, 1047, 1, 0, 0, 0, 1047, 1048, 1, 0, 0, 0, 1048, 1049, 5, 185, 0, 0, 1049, 1095, 1, 0, 0, 0, 1050, 1051, 3, 220, 110, 0, 1051, 1052, 5, 165, 0, 0, 1052, 1057, 3, 222, 111, 0, 1053, 1054, 5, 151, 0, 0, 1054, 1056, 3, 222, 111, 0, 1055, 1053, 1, 0, 0, 0, 1056, 1059, 1, 0, 0, 0, 1057, 1055, 1, 0, 0, 0, 1057, 1058, 1, 0, 0, 0, 1058, 1061, 1, 0, 0, 0, 1059, 1057, 1, 0, 0, 0, 1060, 1062, 5, 151, 0, 0, 1061, 1060, 1, 0, 0, 0, 1061, 1062, 1, 0, 0, 0, 1062, 1063, 1, 0, 0, 0, 1063, 1064, 5, 185, 0, 0, 1064, 1095, 1, 0, 0, 0, 1065, 1066, 3, 220, 110, 0, 1066, 1067, 5, 165, 0, 0, 1067, 1072, 3, 138, 69, 0, 1068, 1069, 5, 151, 0, 0, 1069, 1071, 3, 138, 69, 0, 1070, 1068, 1, 0, 0, 0, 1071, 1074, 1, 0, 0, 0, 1072, 1070, 1, 0, 0, 0, 1072, 1073, 1, 0, 0, 0, 1073, 1076, 1, 0, 0, 0, 1074, 1072, 1, 0, 0, 0, 1075, 1077, 5, 151, 0, 0, 1076, 1075, 1, 0, 0, 0, 1076, 1077, 1, 0, 0, 0, 1077, 1078, 1, 0, 0, 0, 1078, 1079, 5, 185, 0, 0, 1079, 1095, 1, 0, 0, 0, 1080, 1081, 3, 220, 110, 0, 1081, 1083, 5, 165, 0, 0, 1082, 1084, 3, 146, 73, 0, 1083, 1082, 1, 0, 0, 0, 1083, 1084, 1, 0, 0, 0, 1084, 1085, 1, 0, 0, 0, 1085, 1086, 5, 185, 0, 0, 1086, 1095, 1, 0, 0, 0, 1087, 1089, 3, 220, 110, 0, 1088, 1090, 3, 220, 110, 0, 1089, 1088, 1, 0, 0, 0, 1090, 1091, 1, 0, 0, 0, 1091, 1089, 1, 0, 0, 0, 1091, 1092, 1, 0, 0, 0, 1092, 1095, 1, 0, 0, 0, 1093, 1095, 3, 220, 110, 0, 1094, 1031, 1, 0, 0, 0, 1094, 1050, 1, 0, 0, 0, 1094, 1065, 1, 0, 0, 0, 1094, 1080, 1, 0, 0, 0, 1094, 1087, 1, 0, 0, 0, 1094, 1093, 1, 0, 0, 0, 1095, 1104, 1, 0, 0, 0, 1096, 1097, 10, 7, 0, 0, 1097, 1099, 5, 164, 0, 0, 1098, 1100, 5, 139, 0, 0, 1099, 1098, 1, 0, 0, 0, 1099, 1100, 1, 0, 0, 0, 1100, 1101, 1, 0, 0, 0, 1101, 1103, 5, 184, 0, 0, 1102, 1096, 1, 0, 0, 0, 1103, 1106, 1, 0, 0, 0, 1104, 1102, 1, 0, 0, 0, 1104, 1105, 1, 0, 0, 0, 1105, 139, 1, 0, 0, 0, 1106, 1104, 1, 0, 0, 0, 1107, 1108, 3, 142, 71, 0, 1108, 1110, 5, 130, 0, 0, 1109, 1111, 5, 110, 0, 0, 1110, 1109, 1, 0, 0, 0, 1110, 1111, 1, 0, 0, 0, 1111, 1112, 1, 0, 0, 0, 1112, 1113, 5, 109, 0, 0, 1113, 1114, 5, 111, 0, 0, 1114, 1117, 1, 0, 0, 0, 1115, 1117, 3, 142, 71, 0, 1116, 1107, 1, 0, 0, 0, 1116, 1115, 1, 0, 0, 0, 1117, 141, 1, 0, 0, 0, 1118, 1123, 5, 134, 0, 0, 1119, 1123, 5, 135, 0, 0, 1120, 1123, 3, 208, 104, 0, 1121, 1123, 3, 144, 72, 0, 1122, 1118, 1, 0, 0, 0, 1122, 1119, 1, 0, 0, 0, 1122, 1120, 1, 0, 0, 0, 1122, 1121, 1, 0, 0, 0, 1123, 143, 1, 0, 0, 0, 1124, 1125, 7, 11, 0, 0, 1125, 145, 1, 0, 0, 0, 1126, 1131, 3, 154, 77, 0, 1127, 1128, 5, 151, 0, 0, 1128, 1130, 3, 154, 77, 0, 1129, 1127, 1, 0, 0, 0, 1130, 1133, 1, 0, 0, 0, 1131, 1129, 1, 0, 0, 0, 1131, 1132, 1, 0, 0, 0, 1132, 1135, 1, 0, 0, 0, 1133, 1131, 1, 0, 0, 0, 1134, 1136, 5, 151, 0, 0, 1135, 1134, 1, 0, 0, 0, 1135, 1136, 1, 0, 0, 0, 1136, 147, 1, 0, 0, 0, 1137, 1142, 3, 152, 76, 0, 1138, 1139, 5, 151, 0, 0, 1139, 1141, 3, 152, 76, 0, 1140, 1138, 1, 0, 0, 0, 1141, 1144, 1, 0, 0, 0, 1142, 1140, 1, 0, 0, 0, 1142, 1143, 1, 0, 0, 0, 1143, 1145, 1, 0, 0, 0, 1144, 1142, 1, 0, 0, 0, 1145, 1146, 5, 151, 0, 0, 1146, 1149, 1, 0, 0, 0, 1147, 1149, 3, 150, 75, 0, 1148, 1137, 1, 0, 0, 0, 1148, 1147, 1, 0, 0, 0, 1149, 149, 1, 0, 0, 0, 1150, 1155, 3, 152, 76, 0, 1151, 1152, 5, 151, 0, 0, 1152, 1154, 3, 152, 76, 0, 1153, 1151, 1, 0, 0, 0, 1154, 1157, 1, 0, 0, 0, 1155, 1153, 1, 0, 0, 0, 1155, 1156, 1, 0, 0, 0, 1156, 1159, 1, 0, 0, 0, 1157, 1155, 1, 0, 0, 0, 1158, 1160, 5, 151, 0, 0, 1159, 1158, 1, 0, 0, 0, 1159, 1160, 1, 0, 0, 0, 1160, 151, 1, 0, 0, 0, 1161, 1162, 3, 220, 110, 0, 1162, 1163, 5, 150, 0, 0, 1163, 1164, 3, 154, 77, 0, 1164, 1172, 1, 0, 0, 0, 1165, 1166, 5, 39, 0, 0, 1166, 1172, 3, 218, 109, 0, 1167, 1172, 3, 154, 77, 0, 1168, 1169, 3, 154, 77, 0, 1169, 1170, 3, 218, 109, 0, 1170, 1172, 1, 0, 0, 0, 1171, 1161, 1, 0, 0, 0, 1171, 1165, 1, 0, 0, 0, 1171, 1167, 1, 0, 0, 0, 1171, 1168, 1, 0, 0, 0, 1172, 153, 1, 0, 0, 0, 1173, 1174, 6, 77, -1, 0, 1174, 1176, 5, 12, 0, 0, 1175, 1177, 3, 154, 77, 0, 1176, 1175, 1, 0, 0, 0, 1176, 1177, 1, 0, 0, 0, 1177, 1183, 1, 0, 0, 0, 1178, 1179, 5, 126, 0, 0, 1179, 1180, 3, 154, 77, 0, 1180, 1181, 5, 105, 0, 0, 1181, 1182, 3, 154, 77, 0, 1182, 1184, 1, 0, 0, 0, 1183, 1178, 1, 0, 0, 0, 1184, 1185, 1, 0, 0, 0, 1185, 1183, 1, 0, 0, 0, 1185, 1186, 1, 0, 0, 0, 1186, 1189, 1, 0, 0, 0, 1187, 1188, 5, 26, 0, 0, 1188, 1190, 3, 154, 77, 0, 1189, 1187, 1, 0, 0, 0, 1189, 1190, 1, 0, 0, 0, 1190, 1191, 1, 0, 0, 0, 1191, 1192, 5, 27, 0, 0, 1192, 1523, 1, 0, 0, 0, 1193, 1194, 5, 13, 0, 0, 1194, 1195, 5, 165, 0, 0, 1195, 1196, 3, 154, 77, 0, 1196, 1197, 5, 6, 0, 0, 1197, 1198, 3, 138, 69, 0, 1198, 1199, 5, 185, 0, 0, 1199, 1523, 1, 0, 0, 0, 1200, 1201, 5, 119, 0, 0, 1201, 1202, 5, 165, 0, 0, 1202, 1203, 3, 154, 77, 0, 1203, 1204, 5, 6, 0, 0, 1204, 1205, 3, 138, 69, 0, 1205, 1206, 5, 185, 0, 0, 1206, 1523, 1, 0, 0, 0, 1207, 1208, 5, 21, 0, 0, 1208, 1523, 5, 143, 0, 0, 1209, 1210, 5, 56, 0, 0, 1210, 1523, 5, 143, 0, 0, 1211, 1212, 5, 56, 0, 0, 1212, 1213, 3, 154, 77, 0, 1213, 1214, 3, 208, 104, 0, 1214, 1523, 1, 0, 0, 0, 1215, 1216, 5, 104, 0, 0, 1216, 1217, 5, 165, 0, 0, 1217, 1218, 3, 154, 77, 0, 1218, 1219, 5, 39, 0, 0, 1219, 1222, 3, 154, 77, 0, 1220, 1221, 5, 38, 0, 0, 1221, 1223, 3, 154, 77, 0, 1222, 1220, 1, 0, 0, 0, 1222, 1223, 1, 0, 0, 0, 1223, 1224, 1, 0, 0, 0, 1224, 1225, 5, 185, 0, 0, 1225, 1523, 1, 0, 0, 0, 1226, 1227, 5, 108, 0, 0, 1227, 1523, 5, 143, 0, 0, 1228, 1229, 5, 116, 0, 0, 1229, 1230, 5, 165, 0, 0, 1230, 1231, 7, 12, 0, 0, 1231, 1232, 3, 226, 113, 0, 1232, 1233, 5, 39, 0, 0, 1233, 1234, 3, 154, 77, 0, 1234, 1235, 5, 185, 0, 0, 1235, 1523, 1, 0, 0, 0, 1236, 1237, 5, 17, 0, 0, 1237, 1238, 5, 165, 0, 0, 1238, 1239, 5, 143, 0, 0, 1239, 1523, 5, 185, 0, 0, 1240, 1241, 5, 17, 0, 0, 1241, 1242, 5, 165, 0, 0, 1242, 1243, 3, 146, 73, 0, 1243, 1244, 5, 185, 0, 0, 1244, 1523, 1, 0, 0, 0, 1245, 1246, 5, 17, 0, 0, 1246, 1247, 5, 165, 0, 0, 1247, 1248, 5, 145, 0, 0, 1248, 1249, 5, 29, 0, 0, 1249, 1250, 5, 165, 0, 0, 1250, 1251, 3, 8, 4, 0, 1251, 1252, 5, 185, 0, 0, 1252, 1253, 5, 91, 0, 0, 1253, 1254, 5, 165, 0, 0, 1254, 1255, 3, 158, 79, 0, 1255, 1256, 5, 185, 0, 0, 1256, 1257, 5, 185, 0, 0, 1257, 1271, 1, 0, 0, 0, 1258, 1259, 5, 165, 0, 0, 1259, 1260, 5, 145, 0, 0, 1260, 1261, 5, 29, 0, 0, 1261, 1262, 5, 165, 0, 0, 1262, 1263, 3, 8, 4, 0, 1263, 1264, 5, 185, 0, 0, 1264, 1265, 5, 91, 0, 0, 1265, 1266, 5, 165, 0, 0, 1266, 1267, 3, 158, 79, 0, 1267, 1268, 5, 185, 0, 0, 1268, 1269, 5, 185, 0, 0, 1269, 1271, 1, 0, 0, 0, 1270, 1245, 1, 0, 0, 0, 1270, 1258, 1, 0, 0, 0, 1271, 1523, 1, 0, 0, 0, 1272, 1273, 5, 17, 0, 0, 1273, 1274, 5, 165, 0, 0, 1274, 1275, 5, 145, 0, 0, 1275, 1276, 5, 29, 0, 0, 1276, 1277, 5, 165, 0, 0, 1277, 1278, 3, 8, 4, 0, 1278, 1279, 5, 185, 0, 0, 1279, 1280, 5, 185, 0, 0, 1280, 1523, 1, 0, 0, 0, 1281, 1282, 5, 17, 0, 0, 1282, 1283, 5, 165, 0, 0, 1283, 1284, 5, 145, 0, 0, 1284, 1285, 5, 91, 0, 0, 1285, 1286, 5, 165, 0, 0, 1286, 1287, 3, 158, 79, 0, 1287, 1288, 5, 185, 0, 0, 1288, 1289, 5, 185, 0, 0, 1289, 1299, 1, 0, 0, 0, 1290, 1291, 5, 165, 0, 0, 1291, 1292, 5, 145, 0, 0, 1292, 1293, 5, 91, 0, 0, 1293, 1294, 5, 165, 0, 0, 1294, 1295, 3, 158, 79, 0, 1295, 1296, 5, 185, 0, 0, 1296, 1297, 5, 185, 0, 0, 1297, 1299, 1, 0, 0, 0, 1298, 1281, 1, 0, 0, 0, 1298, 1290, 1, 0, 0, 0, 1299, 1523, 1, 0, 0, 0, 1300, 1301, 5, 17, 0, 0, 1301, 1302, 5, 165, 0, 0, 1302, 1303, 5, 145, 0, 0, 1303, 1523, 5, 185, 0, 0, 1304, 1305, 5, 17, 0, 0, 1305, 1306, 5, 165, 0, 0, 1306, 1307, 3, 220, 110, 0, 1307, 1308, 5, 155, 0, 0, 1308, 1309, 5, 145, 0, 0, 1309, 1310, 5, 29, 0, 0, 1310, 1311, 5, 165, 0, 0, 1311, 1312, 3, 8, 4, 0, 1312, 1313, 5, 185, 0, 0, 1313, 1314, 5, 91, 0, 0, 1314, 1315, 5, 165, 0, 0, 1315, 1316, 3, 158, 79, 0, 1316, 1317, 5, 185, 0, 0, 1317, 1318, 5, 185, 0, 0, 1318, 1523, 1, 0, 0, 0, 1319, 1320, 5, 17, 0, 0, 1320, 1321, 5, 165, 0, 0, 1321, 1322, 3, 220, 110, 0, 1322, 1323, 5, 155, 0, 0, 1323, 1324, 5, 145, 0, 0, 1324, 1325, 5, 29, 0, 0, 1325, 1326, 5, 165, 0, 0, 1326, 1327, 3, 8, 4, 0, 1327, 1328, 5, 185, 0, 0, 1328, 1329, 5, 185, 0, 0, 1329, 1523, 1, 0, 0, 0, 1330, 1331, 5, 17, 0, 0, 1331, 1332, 5, 165, 0, 0, 1332, 1333, 3, 220, 110, 0, 1333, 1334, 5, 155, 0, 0, 1334, 1335, 5, 145, 0, 0, 1335, 1336, 5, 91, 0, 0, 1336, 1337, 5, 165, 0, 0, 1337, 1338, 3, 158, 79, 0, 1338, 1339, 5, 185, 0, 0, 1339, 1340, 5, 185, 0, 0, 1340, 1523, 1, 0, 0, 0, 1341, 1342, 5, 17, 0, 0, 1342, 1343, 5, 165, 0, 0, 1343, 1344, 3, 220, 110, 0, 1344, 1345, 5, 155, 0, 0, 1345, 1346, 5, 145, 0, 0, 1346, 1347, 5, 185, 0, 0, 1347, 1523, 1, 0, 0, 0, 1348, 1349, 5, 145, 0, 0, 1349, 1350, 5, 17, 0, 0, 1350, 1351, 5, 165, 0, 0, 1351, 1352, 5, 143, 0, 0, 1352, 1523, 5, 185, 0, 0, 1353, 1354, 5, 145, 0, 0, 1354, 1355, 5, 17, 0, 0, 1355, 1356, 5, 165, 0, 0, 1356, 1357, 3, 146, 73, 0, 1357, 1358, 5, 185, 0, 0, 1358, 1523, 1, 0, 0, 0, 1359, 1360, 3, 220, 110, 0, 1360, 1362, 5, 165, 0, 0, 1361, 1363, 3, 146, 73, 0, 1362, 1361, 1, 0, 0, 0, 1362, 1363, 1, 0, 0, 0, 1363, 1364, 1, 0, 0, 0, 1364, 1365, 5, 185, 0, 0, 1365, 1366, 3, 128, 64, 0, 1366, 1523, 1, 0, 0, 0, 1367, 1368, 3, 220, 110, 0, 1368, 1370, 5, 165, 0, 0, 1369, 1371, 3, 146, 73, 0, 1370, 1369, 1, 0, 0, 0, 1370, 1371, 1, 0, 0, 0, 1371, 1372, 1, 0, 0, 0, 1372, 1373, 5, 185, 0, 0, 1373, 1382, 1, 0, 0, 0, 1374, 1376, 5, 165, 0, 0, 1375, 1377, 5, 25, 0, 0, 1376, 1375, 1, 0, 0, 0, 1376, 1377, 1, 0, 0, 0, 1377, 1379, 1, 0, 0, 0, 1378, 1380, 3, 146, 73, 0, 1379, 1378, 1, 0, 0, 0, 1379, 1380, 1, 0, 0, 0, 1380, 1381, 1, 0, 0, 0, 1381, 1383, 5, 185, 0, 0, 1382, 1374, 1, 0, 0, 0, 1382, 1383, 1, 0, 0, 0, 1383, 1390, 1, 0, 0, 0, 1384, 1385, 5, 33, 0, 0, 1385, 1386, 5, 165, 0, 0, 1386, 1387, 5, 127, 0, 0, 1387, 1388, 3, 154, 77, 0, 1388, 1389, 5, 185, 0, 0, 1389, 1391, 1, 0, 0, 0, 1390, 1384, 1, 0, 0, 0, 1390, 1391, 1, 0, 0, 0, 1391, 1392, 1, 0, 0, 0, 1392, 1393, 5, 81, 0, 0, 1393, 1394, 5, 165, 0, 0, 1394, 1395, 3, 122, 61, 0, 1395, 1396, 5, 185, 0, 0, 1396, 1523, 1, 0, 0, 0, 1397, 1398, 3, 220, 110, 0, 1398, 1400, 5, 165, 0, 0, 1399, 1401, 3, 146, 73, 0, 1400, 1399, 1, 0, 0, 0, 1400, 1401, 1, 0, 0, 0, 1401, 1402, 1, 0, 0, 0, 1402, 1403, 5, 185, 0, 0, 1403, 1412, 1, 0, 0, 0, 1404, 1406, 5, 165, 0, 0, 1405, 1407, 5, 25, 0, 0, 1406, 1405, 1, 0, 0, 0, 1406, 1407, 1, 0, 0, 0, 1407, 1409, 1, 0, 0, 0, 1408, 1410, 3, 146, 73, 0, 1409, 1408, 1, 0, 0, 0, 1409, 1410, 1, 0, 0, 0, 1410, 1411, 1, 0, 0, 0, 1411, 1413, 5, 185, 0, 0, 1412, 1404, 1, 0, 0, 0, 1412, 1413, 1, 0, 0, 0, 1413, 1420, 1, 0, 0, 0, 1414, 1415, 5, 33, 0, 0, 1415, 1416, 5, 165, 0, 0, 1416, 1417, 5, 127, 0, 0, 1417, 1418, 3, 154, 77, 0, 1418, 1419, 5, 185, 0, 0, 1419, 1421, 1, 0, 0, 0, 1420, 1414, 1, 0, 0, 0, 1420, 1421, 1, 0, 0, 0, 1421, 1422, 1, 0, 0, 0, 1422, 1423, 5, 81, 0, 0, 1423, 1424, 3, 220, 110, 0, 1424, 1523, 1, 0, 0, 0, 1425, 1431, 3, 220, 110, 0, 1426, 1428, 5, 165, 0, 0, 1427, 1429, 3, 146, 73, 0, 1428, 1427, 1, 0, 0, 0, 1428, 1429, 1, 0, 0, 0, 1429, 1430, 1, 0, 0, 0, 1430, 1432, 5, 185, 0, 0, 1431, 1426, 1, 0, 0, 0, 1431, 1432, 1, 0, 0, 0, 1432, 1433, 1, 0, 0, 0, 1433, 1435, 5, 165, 0, 0, 1434, 1436, 5, 25, 0, 0, 1435, 1434, 1, 0, 0, 0, 1435, 1436, 1, 0, 0, 0, 1436, 1438, 1, 0, 0, 0, 1437, 1439, 3, 146, 73, 0, 1438, 1437, 1, 0, 0, 0, 1438, 1439, 1, 0, 0, 0, 1439, 1443, 1, 0, 0, 0, 1440, 1441, 5, 79, 0, 0, 1441, 1442, 5, 11, 0, 0, 1442, 1444, 3, 108, 54, 0, 1443, 1440, 1, 0, 0, 0, 1443, 1444, 1, 0, 0, 0, 1444, 1445, 1, 0, 0, 0, 1445, 1452, 5, 185, 0, 0, 1446, 1447, 5, 33, 0, 0, 1447, 1448, 5, 165, 0, 0, 1448, 1449, 5, 127, 0, 0, 1449, 1450, 3, 154, 77, 0, 1450, 1451, 5, 185, 0, 0, 1451, 1453, 1, 0, 0, 0, 1452, 1446, 1, 0, 0, 0, 1452, 1453, 1, 0, 0, 0, 1453, 1523, 1, 0, 0, 0, 1454, 1523, 3, 166, 83, 0, 1455, 1523, 3, 228, 114, 0, 1456, 1523, 3, 206, 103, 0, 1457, 1458, 5, 153, 0, 0, 1458, 1523, 3, 154, 77, 25, 1459, 1460, 5, 73, 0, 0, 1460, 1523, 3, 154, 77, 17, 1461, 1462, 3, 196, 98, 0, 1462, 1463, 5, 155, 0, 0, 1463, 1465, 1, 0, 0, 0, 1464, 1461, 1, 0, 0, 0, 1464, 1465, 1, 0, 0, 0, 1465, 1466, 1, 0, 0, 0, 1466, 1472, 5, 145, 0, 0, 1467, 1468, 5, 29, 0, 0, 1468, 1469, 5, 165, 0, 0, 1469, 1470, 3, 8, 4, 0, 1470, 1471, 5, 185, 0, 0, 1471, 1473, 1, 0, 0, 0, 1472, 1467, 1, 0, 0, 0, 1472, 1473, 1, 0, 0, 0, 1473, 1523, 1, 0, 0, 0, 1474, 1475, 5, 60, 0, 0, 1475, 1480, 3, 220, 110, 0, 1476, 1477, 5, 151, 0, 0, 1477, 1479, 3, 220, 110, 0, 1478, 1476, 1, 0, 0, 0, 1479, 1482, 1, 0, 0, 0, 1480, 1478, 1, 0, 0, 0, 1480, 1481, 1, 0, 0, 0, 1481, 1484, 1, 0, 0, 0, 1482, 1480, 1, 0, 0, 0, 1483, 1485, 5, 151, 0, 0, 1484, 1483, 1, 0, 0, 0, 1484, 1485, 1, 0, 0, 0, 1485, 1486, 1, 0, 0, 0, 1486, 1487, 5, 150, 0, 0, 1487, 1488, 3, 154, 77, 10, 1488, 1523, 1, 0, 0, 0, 1489, 1490, 5, 165, 0, 0, 1490, 1491, 3, 48, 24, 0, 1491, 1492, 5, 185, 0, 0, 1492, 1523, 1, 0, 0, 0, 1493, 1494, 5, 165, 0, 0, 1494, 1495, 3, 154, 77, 0, 1495, 1496, 5, 185, 0, 0, 1496, 1523, 1, 0, 0, 0, 1497, 1498, 5, 165, 0, 0, 1498, 1499, 3, 146, 73, 0, 1499, 1500, 5, 185, 0, 0, 1500, 1523, 1, 0, 0, 0, 1501, 1503, 5, 5, 0, 0, 1502, 1501, 1, 0, 0, 0, 1502, 1503, 1, 0, 0, 0, 1503, 1504, 1, 0, 0, 0, 1504, 1506, 5, 164, 0, 0, 1505, 1507, 3, 146, 73, 0, 1506, 1505, 1, 0, 0, 0, 1506, 1507, 1, 0, 0, 0, 1507, 1508, 1, 0, 0, 0, 1508, 1523, 5, 184, 0, 0, 1509, 1511, 5, 163, 0, 0, 1510, 1512, 3, 40, 20, 0, 1511, 1510, 1, 0, 0, 0, 1511, 1512, 1, 0, 0, 0, 1512, 1513, 1, 0, 0, 0, 1513, 1523, 5, 183, 0, 0, 1514, 1523, 3, 156, 78, 0, 1515, 1516, 3, 220, 110, 0, 1516, 1517, 5, 149, 0, 0, 1517, 1518, 3, 154, 77, 3, 1518, 1523, 1, 0, 0, 0, 1519, 1520, 5, 160, 0, 0, 1520, 1523, 5, 139, 0, 0, 1521, 1523, 3, 176, 88, 0, 1522, 1173, 1, 0, 0, 0, 1522, 1193, 1, 0, 0, 0, 1522, 1200, 1, 0, 0, 0, 1522, 1207, 1, 0, 0, 0, 1522, 1209, 1, 0, 0, 0, 1522, 1211, 1, 0, 0, 0, 1522, 1215, 1, 0, 0, 0, 1522, 1226, 1, 0, 0, 0, 1522, 1228, 1, 0, 0, 0, 1522, 1236, 1, 0, 0, 0, 1522, 1240, 1, 0, 0, 0, 1522, 1270, 1, 0, 0, 0, 1522, 1272, 1, 0, 0, 0, 1522, 1298, 1, 0, 0, 0, 1522, 1300, 1, 0, 0, 0, 1522, 1304, 1, 0, 0, 0, 1522, 1319, 1, 0, 0, 0, 1522, 1330, 1, 0, 0, 0, 1522, 1341, 1, 0, 0, 0, 1522, 1348, 1, 0, 0, 0, 1522, 1353, 1, 0, 0, 0, 1522, 1359, 1, 0, 0, 0, 1522, 1367, 1, 0, 0, 0, 1522, 1397, 1, 0, 0, 0, 1522, 1425, 1, 0, 0, 0, 1522, 1454, 1, 0, 0, 0, 1522, 1455, 1, 0, 0, 0, 1522, 1456, 1, 0, 0, 0, 1522, 1457, 1, 0, 0, 0, 1522, 1459, 1, 0, 0, 0, 1522, 1464, 1, 0, 0, 0, 1522, 1474, 1, 0, 0, 0, 1522, 1489, 1, 0, 0, 0, 1522, 1493, 1, 0, 0, 0, 1522, 1497, 1, 0, 0, 0, 1522, 1502, 1, 0, 0, 0, 1522, 1509, 1, 0, 0, 0, 1522, 1514, 1, 0, 0, 0, 1522, 1515, 1, 0, 0, 0, 1522, 1519, 1, 0, 0, 0, 1522, 1521, 1, 0, 0, 0, 1523, 1662, 1, 0, 0, 0, 1524, 1528, 10, 24, 0, 0, 1525, 1529, 5, 145, 0, 0, 1526, 1529, 5, 187, 0, 0, 1527, 1529, 5, 174, 0, 0, 1528, 1525, 1, 0, 0, 0, 1528, 1526, 1, 0, 0, 0, 1528, 1527, 1, 0, 0, 0, 1529, 1530, 1, 0, 0, 0, 1530, 1661, 3, 154, 77, 25, 1531, 1535, 10, 23, 0, 0, 1532, 1536, 5, 175, 0, 0, 1533, 1536, 5, 153, 0, 0, 1534, 1536, 5, 152, 0, 0, 1535, 1532, 1, 0, 0, 0, 1535, 1533, 1, 0, 0, 0, 1535, 1534, 1, 0, 0, 0, 1536, 1537, 1, 0, 0, 0, 1537, 1661, 3, 154, 77, 24, 1538, 1563, 10, 22, 0, 0, 1539, 1564, 5, 156, 0, 0, 1540, 1564, 5, 157, 0, 0, 1541, 1564, 5, 169, 0, 0, 1542, 1564, 5, 166, 0, 0, 1543, 1564, 5, 167, 0, 0, 1544, 1564, 5, 158, 0, 0, 1545, 1564, 5, 159, 0, 0, 1546, 1548, 5, 73, 0, 0, 1547, 1546, 1, 0, 0, 0, 1547, 1548, 1, 0, 0, 0, 1548, 1549, 1, 0, 0, 0, 1549, 1551, 5, 51, 0, 0, 1550, 1552, 5, 15, 0, 0, 1551, 1550, 1, 0, 0, 0, 1551, 1552, 1, 0, 0, 0, 1552, 1564, 1, 0, 0, 0, 1553, 1555, 5, 73, 0, 0, 1554, 1553, 1, 0, 0, 0, 1554, 1555, 1, 0, 0, 0, 1555, 1556, 1, 0, 0, 0, 1556, 1564, 7, 13, 0, 0, 1557, 1564, 5, 181, 0, 0, 1558, 1564, 5, 182, 0, 0, 1559, 1564, 5, 171, 0, 0, 1560, 1564, 5, 161, 0, 0, 1561, 1564, 5, 162, 0, 0, 1562, 1564, 5, 170, 0, 0, 1563, 1539, 1, 0, 0, 0, 1563, 1540, 1, 0, 0, 0, 1563, 1541, 1, 0, 0, 0, 1563, 1542, 1, 0, 0, 0, 1563, 1543, 1, 0, 0, 0, 1563, 1544, 1, 0, 0, 0, 1563, 1545, 1, 0, 0, 0, 1563, 1547, 1, 0, 0, 0, 1563, 1554, 1, 0, 0, 0, 1563, 1557, 1, 0, 0, 0, 1563, 1558, 1, 0, 0, 0, 1563, 1559, 1, 0, 0, 0, 1563, 1560, 1, 0, 0, 0, 1563, 1561, 1, 0, 0, 0, 1563, 1562, 1, 0, 0, 0, 1564, 1565, 1, 0, 0, 0, 1565, 1661, 3, 154, 77, 23, 1566, 1567, 10, 19, 0, 0, 1567, 1569, 5, 57, 0, 0, 1568, 1570, 5, 73, 0, 0, 1569, 1568, 1, 0, 0, 0, 1569, 1570, 1, 0, 0, 0, 1570, 1571, 1, 0, 0, 0, 1571, 1572, 5, 25, 0, 0, 1572, 1573, 5, 39, 0, 0, 1573, 1661, 3, 154, 77, 20, 1574, 1575, 10, 18, 0, 0, 1575, 1576, 5, 173, 0, 0, 1576, 1661, 3, 154, 77, 19, 1577, 1578, 10, 16, 0, 0, 1578, 1579, 5, 2, 0, 0, 1579, 1661, 3, 154, 77, 17, 1580, 1581, 10, 15, 0, 0, 1581, 1582, 5, 78, 0, 0, 1582, 1661, 3, 154, 77, 16, 1583, 1585, 10, 14, 0, 0, 1584, 1586, 5, 73, 0, 0, 1585, 1584, 1, 0, 0, 0, 1585, 1586, 1, 0, 0, 0, 1586, 1587, 1, 0, 0, 0, 1587, 1588, 5, 9, 0, 0, 1588, 1589, 3, 154, 77, 0, 1589, 1590, 5, 2, 0, 0, 1590, 1591, 3, 154, 77, 15, 1591, 1661, 1, 0, 0, 0, 1592, 1593, 10, 13, 0, 0, 1593, 1594, 5, 176, 0, 0, 1594, 1595, 3, 154, 77, 0, 1595, 1596, 5, 150, 0, 0, 1596, 1597, 3, 154, 77, 13, 1597, 1661, 1, 0, 0, 0, 1598, 1599, 10, 38, 0, 0, 1599, 1600, 5, 165, 0, 0, 1600, 1601, 3, 48, 24, 0, 1601, 1602, 5, 185, 0, 0, 1602, 1661, 1, 0, 0, 0, 1603, 1604, 10, 37, 0, 0, 1604, 1606, 5, 165, 0, 0, 1605, 1607, 3, 146, 73, 0, 1606, 1605, 1, 0, 0, 0, 1606, 1607, 1, 0, 0, 0, 1607, 1608, 1, 0, 0, 0, 1608, 1661, 5, 185, 0, 0, 1609, 1610, 10, 33, 0, 0, 1610, 1611, 5, 164, 0, 0, 1611, 1612, 3, 154, 77, 0, 1612, 1613, 5, 184, 0, 0, 1613, 1661, 1, 0, 0, 0, 1614, 1615, 10, 32, 0, 0, 1615, 1617, 5, 164, 0, 0, 1616, 1618, 3, 154, 77, 0, 1617, 1616, 1, 0, 0, 0, 1617, 1618, 1, 0, 0, 0, 1618, 1619, 1, 0, 0, 0, 1619, 1621, 5, 150, 0, 0, 1620, 1622, 3, 154, 77, 0, 1621, 1620, 1, 0, 0, 0, 1621, 1622, 1, 0, 0, 0, 1622, 1623, 1, 0, 0, 0, 1623, 1661, 5, 184, 0, 0, 1624, 1625, 10, 31, 0, 0, 1625, 1626, 5, 155, 0, 0, 1626, 1661, 5, 139, 0, 0, 1627, 1628, 10, 30, 0, 0, 1628, 1629, 5, 155, 0, 0, 1629, 1661, 3, 220, 110, 0, 1630, 1631, 10, 29, 0, 0, 1631, 1632, 5, 172, 0, 0, 1632, 1633, 5, 164, 0, 0, 1633, 1634, 3, 154, 77, 0, 1634, 1635, 5, 184, 0, 0, 1635, 1661, 1, 0, 0, 0, 1636, 1637, 10, 28, 0, 0, 1637, 1638, 5, 172, 0, 0, 1638, 1661, 5, 139, 0, 0, 1639, 1640, 10, 27, 0, 0, 1640, 1641, 5, 172, 0, 0, 1641, 1661, 3, 220, 110, 0, 1642, 1643, 10, 26, 0, 0, 1643, 1644, 5, 148, 0, 0, 1644, 1661, 3, 140, 70, 0, 1645, 1646, 10, 21, 0, 0, 1646, 1647, 5, 49, 0, 0, 1647, 1661, 5, 75, 0, 0, 1648, 1649, 10, 20, 0, 0, 1649, 1651, 5, 57, 0, 0, 1650, 1652, 5, 73, 0, 0, 1651, 1650, 1, 0, 0, 0, 1651, 1652, 1, 0, 0, 0, 1652, 1653, 1, 0, 0, 0, 1653, 1661, 5, 74, 0, 0, 1654, 1655, 10, 12, 0, 0, 1655, 1658, 5, 6, 0, 0, 1656, 1659, 3, 220, 110, 0, 1657, 1659, 5, 143, 0, 0, 1658, 1656, 1, 0, 0, 0, 1658, 1657, 1, 0, 0, 0, 1659, 1661, 1, 0, 0, 0, 1660, 1524, 1, 0, 0, 0, 1660, 1531, 1, 0, 0, 0, 1660, 1538, 1, 0, 0, 0, 1660, 1566, 1, 0, 0, 0, 1660, 1574, 1, 0, 0, 0, 1660, 1577, 1, 0, 0, 0, 1660, 1580, 1, 0, 0, 0, 1660, 1583, 1, 0, 0, 0, 1660, 1592, 1, 0, 0, 0, 1660, 1598, 1, 0, 0, 0, 1660, 1603, 1, 0, 0, 0, 1660, 1609, 1, 0, 0, 0, 1660, 1614, 1, 0, 0, 0, 1660, 1624, 1, 0, 0, 0, 1660, 1627, 1, 0, 0, 0, 1660, 1630, 1, 0, 0, 0, 1660, 1636, 1, 0, 0, 0, 1660, 1639, 1, 0, 0, 0, 1660, 1642, 1, 0, 0, 0, 1660, 1645, 1, 0, 0, 0, 1660, 1648, 1, 0, 0, 0, 1660, 1654, 1, 0, 0, 0, 1661, 1664, 1, 0, 0, 0, 1662, 1660, 1, 0, 0, 0, 1662, 1663, 1, 0, 0, 0, 1663, 155, 1, 0, 0, 0, 1664, 1662, 1, 0, 0, 0, 1665, 1666, 5, 165, 0, 0, 1666, 1671, 3, 220, 110, 0, 1667, 1668, 5, 151, 0, 0, 1668, 1670, 3, 220, 110, 0, 1669, 1667, 1, 0, 0, 0, 1670, 1673, 1, 0, 0, 0, 1671, 1669, 1, 0, 0, 0, 1671, 1672, 1, 0, 0, 0, 1672, 1675, 1, 0, 0, 0, 1673, 1671, 1, 0, 0, 0, 1674, 1676, 5, 151, 0, 0, 1675, 1674, 1, 0, 0, 0, 1675, 1676, 1, 0, 0, 0, 1676, 1677, 1, 0, 0, 0, 1677, 1678, 5, 185, 0, 0, 1678, 1693, 1, 0, 0, 0, 1679, 1684, 3, 220, 110, 0, 1680, 1681, 5, 151, 0, 0, 1681, 1683, 3, 220, 110, 0, 1682, 1680, 1, 0, 0, 0, 1683, 1686, 1, 0, 0, 0, 1684, 1682, 1, 0, 0, 0, 1684, 1685, 1, 0, 0, 0, 1685, 1688, 1, 0, 0, 0, 1686, 1684, 1, 0, 0, 0, 1687, 1689, 5, 151, 0, 0, 1688, 1687, 1, 0, 0, 0, 1688, 1689, 1, 0, 0, 0, 1689, 1693, 1, 0, 0, 0, 1690, 1691, 5, 165, 0, 0, 1691, 1693, 5, 185, 0, 0, 1692, 1665, 1, 0, 0, 0, 1692, 1679, 1, 0, 0, 0, 1692, 1690, 1, 0, 0, 0, 1693, 1694, 1, 0, 0, 0, 1694, 1697, 5, 144, 0, 0, 1695, 1698, 3, 154, 77, 0, 1696, 1698, 3, 36, 18, 0, 1697, 1695, 1, 0, 0, 0, 1697, 1696, 1, 0, 0, 0, 1698, 1715, 1, 0, 0, 0, 1699, 1700, 5, 60, 0, 0, 1700, 1705, 3, 220, 110, 0, 1701, 1702, 5, 151, 0, 0, 1702, 1704, 3, 220, 110, 0, 1703, 1701, 1, 0, 0, 0, 1704, 1707, 1, 0, 0, 0, 1705, 1703, 1, 0, 0, 0, 1705, 1706, 1, 0, 0, 0, 1706, 1709, 1, 0, 0, 0, 1707, 1705, 1, 0, 0, 0, 1708, 1710, 5, 151, 0, 0, 1709, 1708, 1, 0, 0, 0, 1709, 1710, 1, 0, 0, 0, 1710, 1711, 1, 0, 0, 0, 1711, 1712, 5, 150, 0, 0, 1712, 1713, 3, 154, 77, 0, 1713, 1715, 1, 0, 0, 0, 1714, 1692, 1, 0, 0, 0, 1714, 1699, 1, 0, 0, 0, 1715, 157, 1, 0, 0, 0, 1716, 1721, 3, 160, 80, 0, 1717, 1718, 5, 151, 0, 0, 1718, 1720, 3, 160, 80, 0, 1719, 1717, 1, 0, 0, 0, 1720, 1723, 1, 0, 0, 0, 1721, 1719, 1, 0, 0, 0, 1721, 1722, 1, 0, 0, 0, 1722, 159, 1, 0, 0, 0, 1723, 1721, 1, 0, 0, 0, 1724, 1725, 3, 154, 77, 0, 1725, 1726, 5, 6, 0, 0, 1726, 1727, 3, 220, 110, 0, 1727, 161, 1, 0, 0, 0, 1728, 1735, 3, 166, 83, 0, 1729, 1735, 3, 164, 82, 0, 1730, 1731, 5, 163, 0, 0, 1731, 1732, 3, 154, 77, 0, 1732, 1733, 5, 183, 0, 0, 1733, 1735, 1, 0, 0, 0, 1734, 1728, 1, 0, 0, 0, 1734, 1729, 1, 0, 0, 0, 1734, 1730, 1, 0, 0, 0, 1735, 163, 1, 0, 0, 0, 1736, 1737, 5, 204, 0, 0, 1737, 165, 1, 0, 0, 0, 1738, 1739, 5, 167, 0, 0, 1739, 1743, 3, 220, 110, 0, 1740, 1742, 3, 168, 84, 0, 1741, 1740, 1, 0, 0, 0, 1742, 1745, 1, 0, 0, 0, 1743, 1741, 1, 0, 0, 0, 1743, 1744, 1, 0, 0, 0, 1744, 1746, 1, 0, 0, 0, 1745, 1743, 1, 0, 0, 0, 1746, 1747, 5, 188, 0, 0, 1747, 1768, 1, 0, 0, 0, 1748, 1749, 5, 167, 0, 0, 1749, 1753, 3, 220, 110, 0, 1750, 1752, 3, 168, 84, 0, 1751, 1750, 1, 0, 0, 0, 1752, 1755, 1, 0, 0, 0, 1753, 1751, 1, 0, 0, 0, 1753, 1754, 1, 0, 0, 0, 1754, 1756, 1, 0, 0, 0, 1755, 1753, 1, 0, 0, 0, 1756, 1760, 5, 159, 0, 0, 1757, 1759, 3, 162, 81, 0, 1758, 1757, 1, 0, 0, 0, 1759, 1762, 1, 0, 0, 0, 1760, 1758, 1, 0, 0, 0, 1760, 1761, 1, 0, 0, 0, 1761, 1763, 1, 0, 0, 0, 1762, 1760, 1, 0, 0, 0, 1763, 1764, 5, 168, 0, 0, 1764, 1765, 3, 220, 110, 0, 1765, 1766, 5, 159, 0, 0, 1766, 1768, 1, 0, 0, 0, 1767, 1738, 1, 0, 0, 0, 1767, 1748, 1, 0, 0, 0, 1768, 167, 1, 0, 0, 0, 1769, 1770, 3, 220, 110, 0, 1770, 1771, 5, 157, 0, 0, 1771, 1772, 3, 226, 113, 0, 1772, 1781, 1, 0, 0, 0, 1773, 1774, 3, 220, 110, 0, 1774, 1775, 5, 157, 0, 0, 1775, 1776, 5, 163, 0, 0, 1776, 1777, 3, 154, 77, 0, 1777, 1778, 5, 183, 0, 0, 1778, 1781, 1, 0, 0, 0, 1779, 1781, 3, 220, 110, 0, 1780, 1769, 1, 0, 0, 0, 1780, 1773, 1, 0, 0, 0, 1780, 1779, 1, 0, 0, 0, 1781, 169, 1, 0, 0, 0, 1782, 1787, 3, 172, 86, 0, 1783, 1784, 5, 151, 0, 0, 1784, 1786, 3, 172, 86, 0, 1785, 1783, 1, 0, 0, 0, 1786, 1789, 1, 0, 0, 0, 1787, 1785, 1, 0, 0, 0, 1787, 1788, 1, 0, 0, 0, 1788, 1791, 1, 0, 0, 0, 1789, 1787, 1, 0, 0, 0, 1790, 1792, 5, 151, 0, 0, 1791, 1790, 1, 0, 0, 0, 1791, 1792, 1, 0, 0, 0, 1792, 171, 1, 0, 0, 0, 1793, 1795, 3, 220, 110, 0, 1794, 1796, 3, 174, 87, 0, 1795, 1794, 1, 0, 0, 0, 1795, 1796, 1, 0, 0, 0, 1796, 1800, 1, 0, 0, 0, 1797, 1798, 5, 123, 0, 0, 1798, 1799, 5, 59, 0, 0, 1799, 1801, 3, 174, 87, 0, 1800, 1797, 1, 0, 0, 0, 1800, 1801, 1, 0, 0, 0, 1801, 1802, 1, 0, 0, 0, 1802, 1807, 5, 6, 0, 0, 1803, 1805, 5, 73, 0, 0, 1804, 1803, 1, 0, 0, 0, 1804, 1805, 1, 0, 0, 0, 1805, 1806, 1, 0, 0, 0, 1806, 1808, 5, 67, 0, 0, 1807, 1804, 1, 0, 0, 0, 1807, 1808, 1, 0, 0, 0, 1808, 1809, 1, 0, 0, 0, 1809, 1810, 5, 165, 0, 0, 1810, 1811, 3, 48, 24, 0, 1811, 1812, 5, 185, 0, 0, 1812, 1818, 1, 0, 0, 0, 1813, 1814, 3, 154, 77, 0, 1814, 1815, 5, 6, 0, 0, 1815, 1816, 3, 220, 110, 0, 1816, 1818, 1, 0, 0, 0, 1817, 1793, 1, 0, 0, 0, 1817, 1813, 1, 0, 0, 0, 1818, 173, 1, 0, 0, 0, 1819, 1820, 5, 165, 0, 0, 1820, 1825, 3, 220, 110, 0, 1821, 1822, 5, 151, 0, 0, 1822, 1824, 3, 220, 110, 0, 1823, 1821, 1, 0, 0, 0, 1824, 1827, 1, 0, 0, 0, 1825, 1823, 1, 0, 0, 0, 1825, 1826, 1, 0, 0, 0, 1826, 1828, 1, 0, 0, 0, 1827, 1825, 1, 0, 0, 0, 1828, 1829, 5, 185, 0, 0, 1829, 175, 1, 0, 0, 0, 1830, 1838, 3, 224, 112, 0, 1831, 1832, 3, 196, 98, 0, 1832, 1833, 5, 155, 0, 0, 1833, 1835, 1, 0, 0, 0, 1834, 1831, 1, 0, 0, 0, 1834, 1835, 1, 0, 0, 0, 1835, 1836, 1, 0, 0, 0, 1836, 1838, 3, 178, 89, 0, 1837, 1830, 1, 0, 0, 0, 1837, 1834, 1, 0, 0, 0, 1838, 177, 1, 0, 0, 0, 1839, 1844, 3, 220, 110, 0, 1840, 1841, 5, 155, 0, 0, 1841, 1843, 3, 220, 110, 0, 1842, 1840, 1, 0, 0, 0, 1843, 1846, 1, 0, 0, 0, 1844, 1842, 1, 0, 0, 0, 1844, 1845, 1, 0, 0, 0, 1845, 179, 1, 0, 0, 0, 1846, 1844, 1, 0, 0, 0, 1847, 1848, 6, 90, -1, 0, 1848, 1861, 3, 196, 98, 0, 1849, 1861, 3, 194, 97, 0, 1850, 1851, 5, 165, 0, 0, 1851, 1852, 3, 48, 24, 0, 1852, 1853, 5, 185, 0, 0, 1853, 1861, 1, 0, 0, 0, 1854, 1855, 5, 165, 0, 0, 1855, 1856, 3, 92, 46, 0, 1856, 1857, 5, 185, 0, 0, 1857, 1861, 1, 0, 0, 0, 1858, 1861, 3, 166, 83, 0, 1859, 1861, 3, 224, 112, 0, 1860, 1847, 1, 0, 0, 0, 1860, 1849, 1, 0, 0, 0, 1860, 1850, 1, 0, 0, 0, 1860, 1854, 1, 0, 0, 0, 1860, 1858, 1, 0, 0, 0, 1860, 1859, 1, 0, 0, 0, 1861, 1895, 1, 0, 0, 0, 1862, 1863, 10, 5, 0, 0, 1863, 1864, 5, 83, 0, 0, 1864, 1865, 5, 165, 0, 0, 1865, 1866, 3, 146, 73, 0, 1866, 1870, 3, 182, 91, 0, 1867, 1868, 5, 42, 0, 0, 1868, 1869, 5, 11, 0, 0, 1869, 1871, 3, 146, 73, 0, 1870, 1867, 1, 0, 0, 0, 1870, 1871, 1, 0, 0, 0, 1871, 1872, 1, 0, 0, 0, 1872, 1873, 5, 185, 0, 0, 1873, 1894, 1, 0, 0, 0, 1874, 1875, 10, 4, 0, 0, 1875, 1878, 5, 122, 0, 0, 1876, 1877, 5, 50, 0, 0, 1877, 1879, 5, 75, 0, 0, 1878, 1876, 1, 0, 0, 0, 1878, 1879, 1, 0, 0, 0, 1879, 1880, 1, 0, 0, 0, 1880, 1881, 5, 165, 0, 0, 1881, 1882, 3, 186, 93, 0, 1882, 1883, 5, 185, 0, 0, 1883, 1894, 1, 0, 0, 0, 1884, 1888, 10, 3, 0, 0, 1885, 1889, 3, 216, 108, 0, 1886, 1887, 5, 6, 0, 0, 1887, 1889, 3, 220, 110, 0, 1888, 1885, 1, 0, 0, 0, 1888, 1886, 1, 0, 0, 0, 1889, 1891, 1, 0, 0, 0, 1890, 1892, 3, 192, 96, 0, 1891, 1890, 1, 0, 0, 0, 1891, 1892, 1, 0, 0, 0, 1892, 1894, 1, 0, 0, 0, 1893, 1862, 1, 0, 0, 0, 1893, 1874, 1, 0, 0, 0, 1893, 1884, 1, 0, 0, 0, 1894, 1897, 1, 0, 0, 0, 1895, 1893, 1, 0, 0, 0, 1895, 1896, 1, 0, 0, 0, 1896, 181, 1, 0, 0, 0, 1897, 1895, 1, 0, 0, 0, 1898, 1900, 5, 38, 0, 0, 1899, 1901, 3, 184, 92, 0, 1900, 1899, 1, 0, 0, 0, 1901, 1902, 1, 0, 0, 0, 1902, 1900, 1, 0, 0, 0, 1902, 1903, 1, 0, 0, 0, 1903, 183, 1, 0, 0, 0, 1904, 1905, 3, 190, 95, 0, 1905, 1906, 5, 51, 0, 0, 1906, 1907, 5, 165, 0, 0, 1907, 1908, 3, 146, 73, 0, 1908, 1909, 5, 185, 0, 0, 1909, 185, 1, 0, 0, 0, 1910, 1915, 3, 188, 94, 0, 1911, 1912, 5, 151, 0, 0, 1912, 1914, 3, 188, 94, 0, 1913, 1911, 1, 0, 0, 0, 1914, 1917, 1, 0, 0, 0, 1915, 1913, 1, 0, 0, 0, 1915, 1916, 1, 0, 0, 0, 1916, 1919, 1, 0, 0, 0, 1917, 1915, 1, 0, 0, 0, 1918, 1920, 5, 151, 0, 0, 1919, 1918, 1, 0, 0, 0, 1919, 1920, 1, 0, 0, 0, 1920, 187, 1, 0, 0, 0, 1921, 1922, 3, 190, 95, 0, 1922, 1923, 5, 38, 0, 0, 1923, 1924, 3, 190, 95, 0, 1924, 1925, 5, 51, 0, 0, 1925, 1926, 5, 165, 0, 0, 1926, 1927, 3, 146, 73, 0, 1927, 1936, 5, 185, 0, 0, 1928, 1929, 3, 190, 95, 0, 1929, 1930, 5, 51, 0, 0, 1930, 1931, 5, 165, 0, 0, 1931, 1932, 3, 146, 73, 0, 1932, 1933, 5, 185, 0, 0, 1933, 1935, 1, 0, 0, 0, 1934, 1928, 1, 0, 0, 0, 1935, 1938, 1, 0, 0, 0, 1936, 1934, 1, 0, 0, 0, 1936, 1937, 1, 0, 0, 0, 1937, 189, 1, 0, 0, 0, 1938, 1936, 1, 0, 0, 0, 1939, 1940, 5, 165, 0, 0, 1940, 1941, 3, 146, 73, 0, 1941, 1942, 5, 185, 0, 0, 1942, 1945, 1, 0, 0, 0, 1943, 1945, 3, 154, 77, 0, 1944, 1939, 1, 0, 0, 0, 1944, 1943, 1, 0, 0, 0, 1945, 191, 1, 0, 0, 0, 1946, 1947, 5, 165, 0, 0, 1947, 1952, 3, 220, 110, 0, 1948, 1949, 5, 151, 0, 0, 1949, 1951, 3, 220, 110, 0, 1950, 1948, 1, 0, 0, 0, 1951, 1954, 1, 0, 0, 0, 1952, 1950, 1, 0, 0, 0, 1952, 1953, 1, 0, 0, 0, 1953, 1955, 1, 0, 0, 0, 1954, 1952, 1, 0, 0, 0, 1955, 1956, 5, 185, 0, 0, 1956, 193, 1, 0, 0, 0, 1957, 1958, 3, 220, 110, 0, 1958, 1960, 5, 165, 0, 0, 1959, 1961, 3, 198, 99, 0, 1960, 1959, 1, 0, 0, 0, 1960, 1961, 1, 0, 0, 0, 1961, 1962, 1, 0, 0, 0, 1962, 1963, 5, 185, 0, 0, 1963, 195, 1, 0, 0, 0, 1964, 1965, 3, 200, 100, 0, 1965, 1966, 5, 155, 0, 0, 1966, 1968, 1, 0, 0, 0, 1967, 1964, 1, 0, 0, 0, 1967, 1968, 1, 0, 0, 0, 1968, 1969, 1, 0, 0, 0, 1969, 1970, 3, 178, 89, 0, 1970, 197, 1, 0, 0, 0, 1971, 1976, 3, 154, 77, 0, 1972, 1973, 5, 151, 0, 0, 1973, 1975, 3, 154, 77, 0, 1974, 1972, 1, 0, 0, 0, 1975, 1978, 1, 0, 0, 0, 1976, 1974, 1, 0, 0, 0, 1976, 1977, 1, 0, 0, 0, 1977, 1980, 1, 0, 0, 0, 1978, 1976, 1, 0, 0, 0, 1979, 1981, 5, 151, 0, 0, 1980, 1979, 1, 0, 0, 0, 1980, 1981, 1, 0, 0, 0, 1981, 199, 1, 0, 0, 0, 1982, 1983, 3, 220, 110, 0, 1983, 201, 1, 0, 0, 0, 1984, 1993, 5, 136, 0, 0, 1985, 1986, 5, 155, 0, 0, 1986, 1993, 7, 14, 0, 0, 1987, 1988, 5, 139, 0, 0, 1988, 1990, 5, 155, 0, 0, 1989, 1991, 7, 14, 0, 0, 1990, 1989, 1, 0, 0, 0, 1990, 1991, 1, 0, 0, 0, 1991, 1993, 1, 0, 0, 0, 1992, 1984, 1, 0, 0, 0, 1992, 1985, 1, 0, 0, 0, 1992, 1987, 1, 0, 0, 0, 1993, 203, 1, 0, 0, 0, 1994, 1996, 7, 15, 0, 0, 1995, 1994, 1, 0, 0, 0, 1995, 1996, 1, 0, 0, 0, 1996, 2005, 1, 0, 0, 0, 1997, 2006, 3, 202, 101, 0, 1998, 2006, 5, 137, 0, 0, 1999, 2006, 5, 138, 0, 0, 2000, 2006, 5, 141, 0, 0, 2001, 2006, 5, 139, 0, 0, 2002, 2006, 5, 140, 0, 0, 2003, 2006, 5, 52, 0, 0, 2004, 2006, 5, 72, 0, 0, 2005, 1997, 1, 0, 0, 0, 2005, 1998, 1, 0, 0, 0, 2005, 1999, 1, 0, 0, 0, 2005, 2000, 1, 0, 0, 0, 2005, 2001, 1, 0, 0, 0, 2005, 2002, 1, 0, 0, 0, 2005, 2003, 1, 0, 0, 0, 2005, 2004, 1, 0, 0, 0, 2006, 205, 1, 0, 0, 0, 2007, 2011, 3, 204, 102, 0, 2008, 2011, 5, 143, 0, 0, 2009, 2011, 5, 74, 0, 0, 2010, 2007, 1, 0, 0, 0, 2010, 2008, 1, 0, 0, 0, 2010, 2009, 1, 0, 0, 0, 2011, 207, 1, 0, 0, 0, 2012, 2013, 7, 16, 0, 0, 2013, 209, 1, 0, 0, 0, 2014, 2015, 7, 17, 0, 0, 2015, 211, 1, 0, 0, 0, 2016, 2017, 7, 18, 0, 0, 2017, 213, 1, 0, 0, 0, 2018, 2019, 7, 19, 0, 0, 2019, 215, 1, 0, 0, 0, 2020, 2024, 5, 134, 0, 0, 2021, 2024, 5, 135, 0, 0, 2022, 2024, 3, 212, 106, 0, 2023, 2020, 1, 0, 0, 0, 2023, 2021, 1, 0, 0, 0, 2023, 2022, 1, 0, 0, 0, 2024, 217, 1, 0, 0, 0, 2025, 2029, 5, 134, 0, 0, 2026, 2029, 5, 135, 0, 0, 2027, 2029, 3, 214, 107, 0, 2028, 2025, 1, 0, 0, 0, 2028, 2026, 1, 0, 0, 0, 2028, 2027, 1, 0, 0, 0, 2029, 219, 1, 0, 0, 0, 2030, 2035, 5, 134, 0, 0, 2031, 2035, 5, 135, 0, 0, 2032, 2035, 3, 208, 104, 0, 2033, 2035, 3, 210, 105, 0, 2034, 2030, 1, 0, 0, 0, 2034, 2031, 1, 0, 0, 0, 2034, 2032, 1, 0, 0, 0, 2034, 2033, 1, 0, 0, 0, 2035, 221, 1, 0, 0, 0, 2036, 2037, 3, 226, 113, 0, 2037, 2038, 5, 157, 0, 0, 2038, 2039, 3, 204, 102, 0, 2039, 223, 1, 0, 0, 0, 2040, 2041, 5, 163, 0, 0, 2041, 2042, 3, 154, 77, 0, 2042, 2043, 5, 183, 0, 0, 2043, 225, 1, 0, 0, 0, 2044, 2047, 5, 143, 0, 0, 2045, 2047, 3, 228, 114, 0, 2046, 2044, 1, 0, 0, 0, 2046, 2045, 1, 0, 0, 0, 2047, 227, 1, 0, 0, 0, 2048, 2052, 5, 178, 0, 0, 2049, 2051, 3, 230, 115, 0, 2050, 2049, 1, 0, 0, 0, 2051, 2054, 1, 0, 0, 0, 2052, 2050, 1, 0, 0, 0, 2052, 2053, 1, 0, 0, 0, 2053, 2055, 1, 0, 0, 0, 2054, 2052, 1, 0, 0, 0, 2055, 2056, 5, 180, 0, 0, 2056, 229, 1, 0, 0, 0, 2057, 2058, 5, 195, 0, 0, 2058, 2059, 3, 154, 77, 0, 2059, 2060, 5, 183, 0, 0, 2060, 2063, 1, 0, 0, 0, 2061, 2063, 5, 194, 0, 0, 2062, 2057, 1, 0, 0, 0, 2062, 2061, 1, 0, 0, 0, 2063, 231, 1, 0, 0, 0, 2064, 2068, 5, 179, 0, 0, 2065, 2067, 3, 234, 117, 0, 2066, 2065, 1, 0, 0, 0, 2067, 2070, 1, 0, 0, 0, 2068, 2066, 1, 0, 0, 0, 2068, 2069, 1, 0, 0, 0, 2069, 2071, 1, 0, 0, 0, 2070, 2068, 1, 0, 0, 0, 2071, 2072, 5, 0, 0, 1, 2072, 233, 1, 0, 0, 0, 2073, 2074, 5, 197, 0, 0, 2074, 2075, 3, 154, 77, 0, 2075, 2076, 5, 183, 0, 0, 2076, 2079, 1, 0, 0, 0, 2077, 2079, 5, 196, 0, 0, 2078, 2073, 1, 0, 0, 0, 2078, 2077, 1, 0, 0, 0, 2079, 235, 1, 0, 0, 0, 259, 239, 246, 254, 261, 265, 278, 282, 285, 290, 297, 301, 310, 315, 324, 332, 339, 343, 349, 354, 362, 369, 375, 387, 390, 398, 412, 416, 421, 424, 439, 445, 450, 456, 462, 467, 473, 479, 484, 486, 494, 498, 501, 506, 510, 514, 519, 523, 530, 533, 537, 540, 544, 547, 550, 553, 556, 559, 562, 566, 570, 573, 576, 580, 583, 586, 589, 593, 596, 600, 608, 614, 635, 659, 666, 671, 685, 694, 699, 713, 717, 721, 726, 730, 735, 749, 758, 766, 769, 775, 783, 786, 791, 798, 808, 816, 822, 824, 828, 833, 840, 843, 847, 851, 854, 860, 862, 865, 869, 873, 876, 878, 880, 885, 896, 901, 905, 911, 916, 923, 928, 932, 936, 939, 945, 949, 953, 958, 964, 966, 973, 981, 984, 987, 1012, 1026, 1042, 1046, 1057, 1061, 1072, 1076, 1083, 1091, 1094, 1099, 1104, 1110, 1116, 1122, 1131, 1135, 1142, 1148, 1155, 1159, 1171, 1176, 1185, 1189, 1222, 1270, 1298, 1362, 1370, 1376, 1379, 1382, 1390, 1400, 1406, 1409, 1412, 1420, 1428, 1431, 1435, 1438, 1443, 1452, 1464, 1472, 1480, 1484, 1502, 1506, 1511, 1522, 1528, 1535, 1547, 1551, 1554, 1563, 1569, 1585, 1606, 1617, 1621, 1651, 1658, 1660, 1662, 1671, 1675, 1684, 1688, 1692, 1697, 1705, 1709, 1714, 1721, 1734, 1743, 1753, 1760, 1767, 1780, 1787, 1791, 1795, 1800, 1804, 1807, 1817, 1825, 1834, 1837, 1844, 1860, 1870, 1878, 1888, 1891, 1893, 1895, 1902, 1915, 1919, 1936, 1944, 1952, 1960, 1967, 1976, 1980, 1990, 1992, 1995, 2005, 2010, 2023, 2028, 2034, 2046, 2052, 2062, 2068, 2078]
\ No newline at end of file
diff --git a/posthog/hogql/grammar/HogQLParser.py b/posthog/hogql/grammar/HogQLParser.py
index c2ea000ef2dc..872d4f09e6cd 100644
--- a/posthog/hogql/grammar/HogQLParser.py
+++ b/posthog/hogql/grammar/HogQLParser.py
@@ -10,7 +10,7 @@ else:
def serializedATN():
return [
- 4,1,201,2081,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,
+ 4,1,205,2081,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,
@@ -740,7 +740,7 @@ def serializedATN():
0,1728,1735,3,166,83,0,1729,1735,3,164,82,0,1730,1731,5,163,0,0,
1731,1732,3,154,77,0,1732,1733,5,183,0,0,1733,1735,1,0,0,0,1734,
1728,1,0,0,0,1734,1729,1,0,0,0,1734,1730,1,0,0,0,1735,163,1,0,0,
- 0,1736,1737,5,200,0,0,1737,165,1,0,0,0,1738,1739,5,167,0,0,1739,
+ 0,1736,1737,5,204,0,0,1737,165,1,0,0,0,1738,1739,5,167,0,0,1739,
1743,3,220,110,0,1740,1742,3,168,84,0,1741,1740,1,0,0,0,1742,1745,
1,0,0,0,1743,1741,1,0,0,0,1743,1744,1,0,0,0,1744,1746,1,0,0,0,1745,
1743,1,0,0,0,1746,1747,5,188,0,0,1747,1768,1,0,0,0,1748,1749,5,167,
@@ -972,7 +972,9 @@ class HogQLParser ( Parser ):
"UNDERSCORE", "MULTI_LINE_COMMENT", "SINGLE_LINE_COMMENT",
"WHITESPACE", "UNEXPECTED_CHARACTER", "STRING_TEXT",
"STRING_ESCAPE_TRIGGER", "FULL_STRING_TEXT", "FULL_STRING_ESCAPE_TRIGGER",
- "TAG_WS", "TAGC_WS", "HOGQLX_TEXT_TEXT", "HOGQLX_TEXT_WS" ]
+ "TAG_MULTI_LINE_COMMENT", "TAG_SINGLE_LINE_COMMENT",
+ "TAG_WS", "TAGC_MULTI_LINE_COMMENT", "TAGC_SINGLE_LINE_COMMENT",
+ "TAGC_WS", "HOGQLX_TEXT_TEXT", "HOGQLX_TEXT_WS" ]
RULE_program = 0
RULE_declaration = 1
@@ -1325,10 +1327,14 @@ class HogQLParser ( Parser ):
STRING_ESCAPE_TRIGGER=195
FULL_STRING_TEXT=196
FULL_STRING_ESCAPE_TRIGGER=197
- TAG_WS=198
- TAGC_WS=199
- HOGQLX_TEXT_TEXT=200
- HOGQLX_TEXT_WS=201
+ TAG_MULTI_LINE_COMMENT=198
+ TAG_SINGLE_LINE_COMMENT=199
+ TAG_WS=200
+ TAGC_MULTI_LINE_COMMENT=201
+ TAGC_SINGLE_LINE_COMMENT=202
+ TAGC_WS=203
+ HOGQLX_TEXT_TEXT=204
+ HOGQLX_TEXT_WS=205
def __init__(self, input:TokenStream, output:TextIO = sys.stdout):
super().__init__(input, output)
@@ -11873,7 +11879,7 @@ class HogQLParser ( Parser ):
self.state = 1728
self.hogqlxTagElement()
pass
- elif token in [200]:
+ elif token in [204]:
self.enterOuterAlt(localctx, 2)
self.state = 1729
self.hogqlxText()
@@ -12076,7 +12082,7 @@ class HogQLParser ( Parser ):
self.state = 1760
self._errHandler.sync(self)
_la = self._input.LA(1)
- while ((((_la - 163)) & ~0x3f) == 0 and ((1 << (_la - 163)) & 137438953489) != 0):
+ while ((((_la - 163)) & ~0x3f) == 0 and ((1 << (_la - 163)) & 2199023255569) != 0):
self.state = 1757
self.hogqlxChildElement()
self.state = 1762
diff --git a/posthog/hogql/grammar/HogQLParser.tokens b/posthog/hogql/grammar/HogQLParser.tokens
index 0c367d1ea732..73381877cef8 100644
--- a/posthog/hogql/grammar/HogQLParser.tokens
+++ b/posthog/hogql/grammar/HogQLParser.tokens
@@ -195,10 +195,14 @@ STRING_TEXT=194
STRING_ESCAPE_TRIGGER=195
FULL_STRING_TEXT=196
FULL_STRING_ESCAPE_TRIGGER=197
-TAG_WS=198
-TAGC_WS=199
-HOGQLX_TEXT_TEXT=200
-HOGQLX_TEXT_WS=201
+TAG_MULTI_LINE_COMMENT=198
+TAG_SINGLE_LINE_COMMENT=199
+TAG_WS=200
+TAGC_MULTI_LINE_COMMENT=201
+TAGC_SINGLE_LINE_COMMENT=202
+TAGC_WS=203
+HOGQLX_TEXT_TEXT=204
+HOGQLX_TEXT_WS=205
'->'=144
'*'=145
'`'=146
diff --git a/posthog/hogql/json_ast.py b/posthog/hogql/json_ast.py
index f1ecf988d6cd..69623880e66c 100644
--- a/posthog/hogql/json_ast.py
+++ b/posthog/hogql/json_ast.py
@@ -59,6 +59,21 @@ assert ast.CompareOperation in _ENUM_FIELDS, "_build_enum_fields did not registe
_SPECIAL_FLOATS = {"Infinity": float("inf"), "-Infinity": float("-inf"), "NaN": float("nan")}
+def _parse_large_int_literal(value: str) -> int | None:
+ """Parse an integer literal the parser kept lossless as a string — a
+ decimal or `0x`-prefixed hex magnitude with an optional leading `-`.
+ An integer wider than 64 bits can't round-trip as a native JSON
+ number, so the parser emits the exact digits in the same
+ `value_type: "number"` string envelope the non-finite floats use.
+ Returns None when `value` isn't an integer literal."""
+ body = value[1:] if value.startswith("-") else value
+ base = 16 if body[:2] in ("0x", "0X") else 10
+ try:
+ return int(value, base)
+ except ValueError:
+ return None
+
+
def deserialize_ast(json_str: str) -> ast.AST:
"""Deserialize a JSON string into a Python AST object."""
return _deserialize_node(orjson.loads(json_str))
@@ -77,7 +92,11 @@ def _deserialize_node(data: Any) -> Any:
message = data.get("message", "Unknown error")
start = data.get("start") or {}
end = data.get("end") or {}
- if error_type == "SyntaxError" and "reserved keyword" in message:
+ # A parser that tags an error `SyntaxError` means a malformed
+ # query — surface it as `SyntaxError` (a subclass of
+ # `ExposedHogQLError`) so callers can distinguish it, matching
+ # what the C++ parser raises natively.
+ if error_type == "SyntaxError":
raise HogQLSyntaxError(message, start=start.get("offset"), end=end.get("offset"))
raise ExposedHogQLError(message, start=start.get("offset"), end=end.get("offset"))
@@ -104,13 +123,19 @@ def _deserialize_node(data: Any) -> Any:
kwargs[key] = offset
continue
- # Non-finite floats on Constant nodes are emitted as strings.
+ # Numeric Constants emitted as strings: non-finite floats
+ # (Infinity / NaN) and integer literals too wide to round-trip
+ # as a native JSON number.
if is_constant and key == "value" and value_type == "number" and isinstance(value, str):
special = _SPECIAL_FLOATS.get(value)
if special is not None:
kwargs[key] = special
continue
- raise ValueError(f"Unknown special float value: {value}")
+ int_value = _parse_large_int_literal(value)
+ if int_value is not None:
+ kwargs[key] = int_value
+ continue
+ raise ValueError(f"Unknown numeric constant value: {value!r}")
# `ctes` may be a list of nodes carrying a `name` (preserves order)
# — fold it into a dict keyed by the name.
diff --git a/posthog/hogql/parser.py b/posthog/hogql/parser.py
index 256e493a9b74..5b3995a00a09 100644
--- a/posthog/hogql/parser.py
+++ b/posthog/hogql/parser.py
@@ -1,11 +1,14 @@
import sys
import copy
+import random
import threading
from collections.abc import Callable
from enum import StrEnum
from types import FrameType
from typing import Any, Literal, cast
+from django.conf import settings
+
from antlr4 import CommonTokenStream, InputStream, ParserRuleContext, ParseTreeVisitor
from antlr4.error.ErrorListener import ErrorListener
from cachetools import LRUCache
@@ -20,17 +23,63 @@ from opentelemetry import trace
from prometheus_client import Counter, Gauge, Histogram
from structlog import getLogger
+from posthog.schema import ParserMode
+
from posthog.hogql import ast
from posthog.hogql.ast import SelectSetNode
from posthog.hogql.base import AST
from posthog.hogql.constants import RESERVED_KEYWORDS, HogQLParserBackend
-from posthog.hogql.errors import BaseHogQLError, NotImplementedError, SyntaxError
+from posthog.hogql.errors import BaseHogQLError, ExposedHogQLError, NotImplementedError, SyntaxError
from posthog.hogql.grammar.HogQLLexer import HogQLLexer
from posthog.hogql.grammar.HogQLParser import HogQLParser
from posthog.hogql.json_ast import deserialize_ast
from posthog.hogql.parse_string import parse_string_literal_ctx, parse_string_literal_text, parse_string_text_ctx
from posthog.hogql.placeholders import replace_placeholders
from posthog.hogql.timings import HogQLTimings
+from posthog.hogql.visitor import clear_locations
+
+from posthog.exceptions_capture import capture_exception
+
+logger = getLogger(__name__)
+
+# Defensive import of the rust parser wheel. A packaging error (bad ABI,
+# missing symbol, broken maturin build) shouldn't take the whole module
+# down — `hogql_parser` (cpp) is still available as the production
+# default, and the `*_shadow` parser modes can degrade to a no-op shadow
+# leg until the wheel is repaired. Modes that explicitly select rust as
+# the PRIMARY backend (`rust-json` / `RUST_ONLY` / `RUST_WITH_CPP_SHADOW`)
+# will surface the RuntimeError below at parse time.
+_RUST_PARSER_AVAILABLE = True
+try:
+ from hogql_parser_rs import (
+ parse_expr_json as _parse_expr_json_rs,
+ parse_full_template_string_json as _parse_full_template_string_json_rs,
+ parse_order_expr_json as _parse_order_expr_json_rs,
+ parse_program_json as _parse_program_json_rs,
+ parse_select_json as _parse_select_json_rs,
+ )
+except ImportError as _import_err:
+ _RUST_PARSER_AVAILABLE = False
+ # Bind to a module-level name — `except as` bindings are deleted at
+ # the end of the except block, so the closure below would otherwise
+ # see an unbound `NameError` when called.
+ _RUST_IMPORT_ERROR_REPR = repr(_import_err)
+ logger.exception("hogql_parser_rs import failed; rust-json backend disabled")
+ capture_exception(
+ _import_err,
+ additional_properties={"hogql_parser_rs_import_error": _RUST_IMPORT_ERROR_REPR},
+ )
+
+ def _rust_parser_unavailable(*_args: Any, **_kwargs: Any) -> Any:
+ raise RuntimeError(
+ f"hogql_parser_rs is not importable (packaging error); original ImportError: {_RUST_IMPORT_ERROR_REPR}"
+ )
+
+ _parse_expr_json_rs = _rust_parser_unavailable
+ _parse_full_template_string_json_rs = _rust_parser_unavailable
+ _parse_order_expr_json_rs = _rust_parser_unavailable
+ _parse_program_json_rs = _rust_parser_unavailable
+ _parse_select_json_rs = _rust_parser_unavailable
class CacheOrigin(StrEnum):
@@ -49,8 +98,6 @@ class ParseRule(StrEnum):
tracer = trace.get_tracer(__name__)
-logger = getLogger(__name__)
-
def _unquote_identifier(text: str) -> str:
if len(text) >= 2 and (
@@ -75,6 +122,12 @@ def safe_lambda(f):
def wrapped(*args, **kwargs):
try:
return f(*args, **kwargs)
+ except NotImplementedError as e:
+ # Mirror cpp's JSON wrapper: `NotImplementedError` is `InternalHogQLError`
+ # and shouldn't leak past the parser boundary. `posthog/hogql/json_ast.py`
+ # rewrites cpp's JSON-encoded NotImplementedError into `ExposedHogQLError`;
+ # do the same for the python visitor so callers see the same class.
+ raise ExposedHogQLError(str(e), start=e.start, end=e.end) from e
except Exception as e:
if str(e) == "Empty Stack": # Antlr throws `Exception("Empty Stack")` ¯\_(ツ)_/¯
raise SyntaxError("Unmatched curly bracket") from e
@@ -104,6 +157,13 @@ RULE_TO_PARSE_FUNCTION: dict[HogQLParserBackend, dict[ParseRule, Callable]] = {
ParseRule.FULL_TEMPLATE_STRING: lambda string: deserialize_ast(_parse_full_template_string_json_cpp(string)),
ParseRule.PROGRAM: lambda string: deserialize_ast(_parse_program_json_cpp(string)),
},
+ "rust-json": {
+ ParseRule.EXPR: lambda string, start: deserialize_ast(_parse_expr_json_rs(string, is_internal=start is None)),
+ ParseRule.ORDER_EXPR: lambda string: deserialize_ast(_parse_order_expr_json_rs(string)),
+ ParseRule.SELECT: lambda string: deserialize_ast(_parse_select_json_rs(string)),
+ ParseRule.FULL_TEMPLATE_STRING: lambda string: deserialize_ast(_parse_full_template_string_json_rs(string)),
+ ParseRule.PROGRAM: lambda string: deserialize_ast(_parse_program_json_rs(string)),
+ },
}
RULE_TO_HISTOGRAM: dict[ParseRule, Histogram] = {
@@ -118,6 +178,141 @@ RULE_TO_HISTOGRAM: dict[ParseRule, Histogram] = {
DEFAULT_BACKEND: HogQLParserBackend = "cpp-json"
+# `parserMode` (a HogQLQueryModifier) selects the parser backend per query.
+# Each mode maps to a `(primary, shadow)` backend pair: the primary parses
+# the query and its result is always what's returned; a non-None shadow is
+# run on a small sample of parses purely to detect divergence.
+_PARSER_MODE_BACKENDS: dict[ParserMode, tuple[HogQLParserBackend, HogQLParserBackend | None]] = {
+ ParserMode.CPP_ONLY: ("cpp-json", None),
+ ParserMode.RUST_ONLY: ("rust-json", None),
+ ParserMode.CPP_WITH_RUST_SHADOW: ("cpp-json", "rust-json"),
+ ParserMode.RUST_WITH_CPP_SHADOW: ("rust-json", "cpp-json"),
+}
+
+# Fraction of `*_shadow` parses that also run the secondary backend. Kept
+# low in production — the shadow parse is pure overhead on the request's
+# hot path. Tests run every parse through the shadow (see
+# `_shadow_sample_rate`).
+_SHADOW_SAMPLE_RATE = 0.01
+
+
+def _shadow_sample_rate() -> float:
+ """Tests force 100% shadow sampling to catch any divergence; production
+ keeps the 1% sample to bound per-request overhead."""
+ return 1.0 if settings.TEST else _SHADOW_SAMPLE_RATE
+
+
+def _resolve_parser_mode(
+ parser_mode: ParserMode | None, backend: HogQLParserBackend
+) -> tuple[HogQLParserBackend, HogQLParserBackend | None]:
+ """Resolve a `parserMode` modifier to `(primary, shadow)` backends.
+
+ In TEST: an absent modifier defaults to `CPP_WITH_RUST_SHADOW` so the
+ test suite exercises both backends on every parse and raises on AST
+ divergence (see `_run_shadow_comparison`). Honour an explicit
+ `backend=` override (test factories / parity scripts) untouched.
+
+ In prod: an absent modifier is treated as `cpp_only` — resolved here at
+ the call site, never written back onto the modifier, so the query
+ hash is unaffected. The explicitly-passed `backend` is honoured
+ (default `cpp-json`).
+ """
+ if parser_mode is None:
+ if settings.TEST and backend == DEFAULT_BACKEND:
+ return _PARSER_MODE_BACKENDS[ParserMode.CPP_WITH_RUST_SHADOW]
+ return backend, None
+ return _PARSER_MODE_BACKENDS[parser_mode]
+
+
+class HogQLParserShadowMismatch(Exception):
+ """A `*_shadow` parser mode found the primary and shadow backends
+ produced different ASTs. Reported to error tracking and never raised
+ into a request — the primary backend's result is always returned."""
+
+
+_SHADOW_BACKEND_FAILURES = Counter(
+ "hogql_parser_shadow_backend_failures",
+ "Shadow-backend parses that threw an exception (packaging error, panic, etc.). "
+ "Captured but never propagated — primary backend's result is always returned.",
+ labelnames=["rule", "shadow"],
+)
+
+
+def _run_shadow_comparison(
+ rule: ParseRule,
+ statement: str,
+ primary_backend: HogQLParserBackend,
+ shadow_backend: HogQLParserBackend,
+ primary_node: Any,
+ start: int | None,
+) -> None:
+ """Sample-rate-gated cross-backend parity check.
+
+ In prod: a `_SHADOW_SAMPLE_RATE` (1%) sample of parses also runs the
+ shadow backend; a divergence or shadow-backend crash is captured to
+ error tracking and the primary result is returned untouched.
+
+ In TEST: every parse runs through the shadow. Two failure classes
+ are distinguished:
+ - parser-class: shadow rejects (`BaseHogQLError`) input the primary
+ accepted, OR the two backends agree to parse but produce
+ different ASTs. Both raise in TEST so a regression fails loud.
+ - packaging-class: any other exception (`ImportError`,
+ `RuntimeError` from the stub, a PyO3 panic). NEVER propagates;
+ captured + counted only. A broken shadow wheel must not block
+ the primary parser's hot path or fail the test suite.
+ """
+ if random.random() >= _shadow_sample_rate():
+ return
+ test_mode = settings.TEST
+ try:
+ shadow_node = _invoke_parser(shadow_backend, rule, statement, start)
+ except BaseHogQLError as err:
+ # Parser-class failure: shadow rejects input that primary accepted.
+ # In TEST that's a regression we want to see.
+ _SHADOW_BACKEND_FAILURES.labels(rule=str(rule), shadow=shadow_backend).inc()
+ capture_exception(
+ err,
+ additional_properties={
+ "hogql_parser_rule": str(rule),
+ "hogql_parser_shadow": shadow_backend,
+ "hogql_parser_statement": statement,
+ "hogql_parser_shadow_throw": "true",
+ },
+ )
+ if test_mode:
+ raise
+ return
+ except Exception as err:
+ # Packaging-class failure (ImportError, stub RuntimeError, panic).
+ # Capture + count, never propagate, even in TEST.
+ _SHADOW_BACKEND_FAILURES.labels(rule=str(rule), shadow=shadow_backend).inc()
+ capture_exception(
+ err,
+ additional_properties={
+ "hogql_parser_rule": str(rule),
+ "hogql_parser_shadow": shadow_backend,
+ "hogql_parser_statement": statement,
+ "hogql_parser_shadow_throw": "true",
+ },
+ )
+ return
+ if clear_locations(primary_node) == clear_locations(shadow_node):
+ return
+ mismatch = HogQLParserShadowMismatch(f"{rule} parser AST mismatch: {primary_backend} vs {shadow_backend}")
+ if test_mode:
+ raise mismatch
+ capture_exception(
+ mismatch,
+ additional_properties={
+ "hogql_parser_rule": str(rule),
+ "hogql_parser_primary": primary_backend,
+ "hogql_parser_shadow": shadow_backend,
+ "hogql_parser_statement": statement,
+ },
+ )
+
+
# Two caches so a flood of unique user-generated queries can't displace the
# hot in-code-literal entries. Origin is auto-detected via the call-stack
# `co_consts` walk; callers can override via `cache_origin`.
@@ -304,22 +499,26 @@ def parse_string_template(
timings: HogQLTimings | None = None,
*,
backend: HogQLParserBackend = DEFAULT_BACKEND,
+ parser_mode: ParserMode | None = None,
cache_origin: CacheOrigin = CacheOrigin.AUTO,
) -> ast.Call:
"""Parse a full template string without start/end quotes"""
if timings is None:
timings = HogQLTimings()
+ primary, shadow = _resolve_parser_mode(parser_mode, backend)
# The cache is keyed on `"F'" + string` (a runtime concat that never
# matches a frame literal), so pass the raw `string` as the classify
# target — that keeps the frame walk on the cold path here too.
- with timings.measure(f"parse_full_template_string_{backend}"):
+ with timings.measure(f"parse_full_template_string_{primary}"):
node = _parse_cached(
ParseRule.FULL_TEMPLATE_STRING,
"F'" + string,
- backend,
+ primary,
cache_origin,
classify_input=string,
)
+ if shadow is not None:
+ _run_shadow_comparison(ParseRule.FULL_TEMPLATE_STRING, "F'" + string, primary, shadow, node, None)
if placeholders:
with timings.measure("replace_placeholders"):
node = replace_placeholders(node, placeholders)
@@ -333,14 +532,18 @@ def parse_expr(
timings: HogQLTimings | None = None,
*,
backend: HogQLParserBackend = DEFAULT_BACKEND,
+ parser_mode: ParserMode | None = None,
cache_origin: CacheOrigin = CacheOrigin.AUTO,
) -> ast.Expr:
if expr == "":
raise SyntaxError("Empty query")
if timings is None:
timings = HogQLTimings()
- with timings.measure(f"parse_expr_{backend}"):
- node = _parse_cached(ParseRule.EXPR, expr, backend, cache_origin, start=start)
+ primary, shadow = _resolve_parser_mode(parser_mode, backend)
+ with timings.measure(f"parse_expr_{primary}"):
+ node = _parse_cached(ParseRule.EXPR, expr, primary, cache_origin, start=start)
+ if shadow is not None:
+ _run_shadow_comparison(ParseRule.EXPR, expr, primary, shadow, node, start)
if placeholders:
with timings.measure("replace_placeholders"):
node = replace_placeholders(node, placeholders)
@@ -353,12 +556,16 @@ def parse_order_expr(
timings: HogQLTimings | None = None,
*,
backend: HogQLParserBackend = DEFAULT_BACKEND,
+ parser_mode: ParserMode | None = None,
cache_origin: CacheOrigin = CacheOrigin.AUTO,
) -> ast.OrderExpr:
if timings is None:
timings = HogQLTimings()
- with timings.measure(f"parse_order_expr_{backend}"):
- node = _parse_cached(ParseRule.ORDER_EXPR, order_expr, backend, cache_origin)
+ primary, shadow = _resolve_parser_mode(parser_mode, backend)
+ with timings.measure(f"parse_order_expr_{primary}"):
+ node = _parse_cached(ParseRule.ORDER_EXPR, order_expr, primary, cache_origin)
+ if shadow is not None:
+ _run_shadow_comparison(ParseRule.ORDER_EXPR, order_expr, primary, shadow, node, None)
if placeholders:
with timings.measure("replace_placeholders"):
node = replace_placeholders(node, placeholders)
@@ -371,13 +578,17 @@ def parse_select(
timings: HogQLTimings | None = None,
*,
backend: HogQLParserBackend = DEFAULT_BACKEND,
+ parser_mode: ParserMode | None = None,
cache_origin: CacheOrigin = CacheOrigin.AUTO,
) -> ast.SelectQuery | ast.SelectSetQuery:
if timings is None:
timings = HogQLTimings()
- with timings.measure(f"parse_select_{backend}"):
+ primary, shadow = _resolve_parser_mode(parser_mode, backend)
+ with timings.measure(f"parse_select_{primary}"):
with tracer.start_as_current_span("parse_statement_to_node"):
- node = _parse_cached(ParseRule.SELECT, statement, backend, cache_origin)
+ node = _parse_cached(ParseRule.SELECT, statement, primary, cache_origin)
+ if shadow is not None:
+ _run_shadow_comparison(ParseRule.SELECT, statement, primary, shadow, node, None)
if placeholders:
with timings.measure("replace_placeholders"), tracer.start_as_current_span("replace_placeholders"):
node = replace_placeholders(node, placeholders)
@@ -389,12 +600,16 @@ def parse_program(
timings: HogQLTimings | None = None,
*,
backend: HogQLParserBackend = DEFAULT_BACKEND,
+ parser_mode: ParserMode | None = None,
cache_origin: CacheOrigin = CacheOrigin.AUTO,
) -> ast.Program:
if timings is None:
timings = HogQLTimings()
- with timings.measure(f"parse_expr_{backend}"):
- node = _parse_cached(ParseRule.PROGRAM, source, backend, cache_origin)
+ primary, shadow = _resolve_parser_mode(parser_mode, backend)
+ with timings.measure(f"parse_program_{primary}"):
+ node = _parse_cached(ParseRule.PROGRAM, source, primary, cache_origin)
+ if shadow is not None:
+ _run_shadow_comparison(ParseRule.PROGRAM, source, primary, shadow, node, None)
return cast("ast.Program", node)
@@ -1115,16 +1330,17 @@ class HogQLParseTreeConverter(ParseTreeVisitor):
return (self.visit(ctx.winFrameBound(0)), self.visit(ctx.winFrameBound(1)))
def visitWinFrameBound(self, ctx: HogQLParser.WinFrameBoundContext):
- if ctx.PRECEDING():
- frame_value = self.visit(ctx.columnExpr()) if ctx.columnExpr() else None
- if isinstance(frame_value, ast.Constant) and isinstance(frame_value.value, (int, float)):
- frame_value = int(frame_value.value)
- return ast.WindowFrameExpr(frame_type="PRECEDING", frame_value=frame_value)
- if ctx.FOLLOWING():
+ # Mirror cpp's `VISIT(WinFrameBound)`: unwrap a Constant int frame_value to a bare number; floats / strings / other Constants stay wrapped.
+ if ctx.PRECEDING() or ctx.FOLLOWING():
+ frame_type: Literal["PRECEDING", "FOLLOWING"] = "PRECEDING" if ctx.PRECEDING() else "FOLLOWING"
frame_value = self.visit(ctx.columnExpr()) if ctx.columnExpr() else None
- if isinstance(frame_value, ast.Constant) and isinstance(frame_value.value, (int, float)):
- frame_value = int(frame_value.value)
- return ast.WindowFrameExpr(frame_type="FOLLOWING", frame_value=frame_value)
+ if (
+ isinstance(frame_value, ast.Constant)
+ and isinstance(frame_value.value, int)
+ and not isinstance(frame_value.value, bool)
+ ):
+ frame_value = frame_value.value
+ return ast.WindowFrameExpr(frame_type=frame_type, frame_value=frame_value)
return ast.WindowFrameExpr(frame_type="CURRENT ROW")
def visitExpr(self, ctx: HogQLParser.ExprContext):
@@ -1162,9 +1378,14 @@ class HogQLParseTreeConverter(ParseTreeVisitor):
return " ".join(self.visit(ident) for ident in ctx.identifier()).lower()
def visitColumnTypeExprParam(self, ctx: HogQLParser.ColumnTypeExprParamContext):
- name = self.visit(ctx.identifier())
+ # cpp's `ColumnTypeExprParam` visitor lowercases the head identifier
+ # but emits each top-level `columnExpr` via raw `ctx->getText()` —
+ # case-preserved, quotes preserved, spaceless. The outer cast
+ # visitor must NOT lowercase the result again, or `DateTime64(3,
+ # 'UTC')` collapses to `datetime64(3, 'utc')`.
+ name = self.visit(ctx.identifier()).lower()
params = ", ".join(c.getText() for c in ctx.columnExprList().columnExpr()) if ctx.columnExprList() else ""
- return f"{name}({params})".lower()
+ return f"{name}({params})"
def visitColumnExprList(self, ctx: HogQLParser.ColumnExprListContext):
return [self.visit(c) for c in ctx.columnExpr()]
@@ -1246,8 +1467,13 @@ class HogQLParseTreeConverter(ParseTreeVisitor):
raise NotImplementedError(f"Unsupported node: ColumnExprSubstring")
def visitColumnExprCast(self, ctx: HogQLParser.ColumnExprCastContext):
+ # Each `columnTypeExpr` visitor handles its own case rules (Simple/
+ # Complex/Nested/Compound lowercase; Param keeps the inner getText
+ # case-preserved). A blanket `.lower()` here would erase the
+ # Param-mode case preservation, e.g. `DateTime64(3, 'UTC')` →
+ # `datetime64(3, 'utc')`.
type_name = self.visit(ctx.columnTypeExpr())
- return ast.TypeCast(expr=self.visit(ctx.columnExpr()), type_name=type_name.lower())
+ return ast.TypeCast(expr=self.visit(ctx.columnExpr()), type_name=type_name)
def visitColumnExprTryCast(self, ctx: HogQLParser.ColumnExprTryCastContext):
type_name = self.visit(ctx.columnTypeExpr())
@@ -1893,6 +2119,12 @@ class HogQLParseTreeConverter(ParseTreeVisitor):
abs_text = abs_text[1:]
# Hex before the float guard: hex digits include 'e', so "0xfe" would route through float().
if abs_text.startswith("0x"):
+ # Hex-float? FLOATING_LITERAL uses strict C99 `p`/`P` only
+ # as the exponent marker — `e`/`E` is always a hex digit
+ # in this context, so the presence of `p` is the entire
+ # detection. `float.fromhex` accepts the same syntax.
+ if "p" in abs_text:
+ return ast.Constant(value=sign * float.fromhex(abs_text))
return ast.Constant(value=sign * int(abs_text, 16))
# `0b…` (BINARY_LITERAL): ClickHouse caps binary literals at 64 bits — magnitude
# must fit UInt64 (positive) or Int64 (negative); wider literals are rejected.
diff --git a/posthog/hogql/query.py b/posthog/hogql/query.py
index fcec4f23feb6..27b5a81fdc34 100644
--- a/posthog/hogql/query.py
+++ b/posthog/hogql/query.py
@@ -294,7 +294,11 @@ class HogQLQueryExecutor:
self.select_query = self.query
self.query = None
else:
- self.select_query = parse_select(str(self.query), timings=self.timings)
+ self.select_query = parse_select(
+ str(self.query),
+ timings=self.timings,
+ parser_mode=self.query_modifiers.parserMode,
+ )
@tracer.start_as_current_span("HogQLQueryExecutor._process_variables")
def _process_variables(self):
diff --git a/posthog/hogql/scripts/_diagnostic_common.py b/posthog/hogql/scripts/_diagnostic_common.py
index f8afa50a657d..ce1277f7c8d8 100644
--- a/posthog/hogql/scripts/_diagnostic_common.py
+++ b/posthog/hogql/scripts/_diagnostic_common.py
@@ -209,12 +209,22 @@ def _normalize_error(msg: str) -> str:
return _GOT_RE.sub("got <X>", msg)[:120]
+def _strip_locations() -> bool:
+ """Whether to apply `clear_locations()` to parsed ASTs before the
+ oracle-vs-candidate `==` check. Off by default — diagnostics include
+ per-node `start` / `end` positions in the parity check now that the
+ rust backend emits them with cpp-parity spans. Set `CLEAR_LOCATIONS=1`
+ to revert to the structural-only comparison."""
+ return os.environ.get("CLEAR_LOCATIONS", "").lower() in ("1", "true", "yes")
+
+
def _safe_parse(query: str, rule: str, backend: str) -> tuple[str, Any, str | None]:
"""Parse `query` for a diagnostic that must not abort mid-grind.
Returns `(status, ast_or_none, detail)`:
- - `("ok", ast, None)` — parsed; AST is `clear_locations`-normalised
- so callers can `==`-compare oracle vs candidate.
+ - `("ok", ast, None)` — parsed; AST keeps per-node `start` / `end`
+ positions unless `CLEAR_LOCATIONS=1` strips them. Either way,
+ callers can `==`-compare oracle vs candidate.
- `("reject", None, signature)` — `BaseHogQLError`; a legitimate
"not valid HogQL". `signature` is the normalised error message.
- `("crash", None, signature)` — any other exception
@@ -232,7 +242,7 @@ def _safe_parse(query: str, rule: str, backend: str) -> tuple[str, Any, str | No
return "reject", None, _normalize_error(str(e))
except Exception as e:
return "crash", None, _normalize_error(f"{type(e).__name__}: {e}")
- return "ok", clear_locations(node), None
+ return "ok", clear_locations(node) if _strip_locations() else node, None
# ---------------------------------------------------------------------------
@@ -497,13 +507,14 @@ def crash_signature(tb: str) -> str:
def corpus_try_parse(query: str, rule: str, backend: str) -> tuple[str, Any, str | None]:
"""Parse `query` for the corpus grind. Returns `(status, ast, detail)`:
- `ok` (AST `clear_locations`-normalised), `reject` (detail = the raw
- `BaseHogQLError` message), or `crash` (detail = full traceback).
- Ctrl-C still propagates (`BaseException`, not `Exception`)."""
+ `ok` (AST keeps positions by default; `CLEAR_LOCATIONS=1` to strip),
+ `reject` (detail = the raw `BaseHogQLError` message), or `crash`
+ (detail = full traceback). Ctrl-C still propagates (`BaseException`,
+ not `Exception`)."""
parser_fn = _PARSER_FOR_RULE[rule]
try:
node = parser_fn(query, backend=backend)
- return "ok", clear_locations(node), None
+ return "ok", clear_locations(node) if _strip_locations() else node, None
except BaseHogQLError as e:
return "reject", None, str(e)
except Exception:
diff --git a/posthog/hogql/scripts/build_grammar_strategies.py b/posthog/hogql/scripts/build_grammar_strategies.py
index d87c90c048a2..65c8fc9e2b7e 100755
--- a/posthog/hogql/scripts/build_grammar_strategies.py
+++ b/posthog/hogql/scripts/build_grammar_strategies.py
@@ -47,6 +47,7 @@ from __future__ import annotations
import re
import sys
import argparse
+import subprocess
from dataclasses import dataclass, field
from pathlib import Path
from typing import Literal
@@ -889,10 +890,19 @@ def _classify_alts(alts: list[Alternative]) -> tuple[list[int], list[int], list[
return common, soft, leaf
+def _quote(s: str) -> str:
+ # Emit a double-quoted Python string literal so the codegen output matches `ruff format`'s preference;
+ # otherwise lint-staged keeps reverting the regen on commit. Fall back to `repr` for content that needs
+ # escaping (none of the grammar's keyword literals do today, but it costs nothing to be safe).
+ if any(c in s for c in '"\\') or any(ord(c) < 32 or ord(c) > 126 for c in s):
+ return repr(s)
+ return f'"{s}"'
+
+
def _emit_literal_list(literals: list[str]) -> str:
if len(literals) == 1:
- return repr(literals[0])
- return "draw(st.sampled_from([" + ", ".join(repr(s) for s in literals) + "]))"
+ return _quote(literals[0])
+ return "draw(st.sampled_from([" + ", ".join(_quote(s) for s in literals) + "]))"
_EMITTED_FILE_HEADER = f'''\
@@ -1314,6 +1324,20 @@ LEXER_GRAMMAR = REPO_ROOT / "posthog" / "hogql" / "grammar" / "HogQLLexer.common
OUTPUT_PATH = REPO_ROOT / "posthog" / "hogql" / "test" / "_generated_grammar_strategies.py"
+def _ruff_format(source: str) -> str:
+ # Pipe `source` through `ruff format -` so the codegen output exactly matches what `bin/hogli format:python`
+ # produces. Without this, lint-staged keeps reverting the regen on commit (it formats then sees no diff).
+ # Runs ruff via the same venv that's already importing this module, so no PATH gymnastics needed.
+ result = subprocess.run(
+ ["ruff", "format", "-"],
+ input=source,
+ capture_output=True,
+ text=True,
+ check=True,
+ )
+ return result.stdout
+
+
def main() -> int:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
@@ -1323,7 +1347,7 @@ def main() -> int:
)
args = parser.parse_args()
- source = generate(str(PARSER_GRAMMAR), str(LEXER_GRAMMAR))
+ source = _ruff_format(generate(str(PARSER_GRAMMAR), str(LEXER_GRAMMAR)))
if args.check:
if not OUTPUT_PATH.exists():
diff --git a/posthog/hogql/scripts/hog_corpus_diagnostic.py b/posthog/hogql/scripts/hog_corpus_diagnostic.py
index fdb8d23192f5..bc58bc43a746 100644
--- a/posthog/hogql/scripts/hog_corpus_diagnostic.py
+++ b/posthog/hogql/scripts/hog_corpus_diagnostic.py
@@ -28,7 +28,8 @@ shared machinery lives in `_diagnostic_common.py`.
4. **For each unique program**: parse with `--oracle` (default
`cpp-json`); oracle reject → skipped. Otherwise parse with
`--candidate` — reject, crash, AST mismatch, or pass. ASTs are
- compared after `clear_locations()`.
+ compared with per-node `start` / `end` positions by default
+ (`CLEAR_LOCATIONS=1` strips them for structural-only comparison).
Only Hog functions belonging to organisations that have opted into AI
data processing (`posthog_organization.is_ai_data_processing_approved`)
@@ -37,7 +38,7 @@ are sampled — the Postgres equivalent of the HogQL corpus's
## Usage
- # Default — auto-discover, download, run cpp-vs-python parity:
+ # Default — auto-discover, download, run cpp-vs-rust parity:
PYTHONPATH=. python posthog/hogql/scripts/hog_corpus_diagnostic.py
# Iterate on a candidate parser without re-pulling the corpus:
@@ -175,8 +176,8 @@ def main() -> int:
)
p.add_argument(
"--candidate",
- default=os.environ.get("CANDIDATE_BACKEND", "python"),
- help="Backend under test (default: python; override for forks)",
+ default=os.environ.get("CANDIDATE_BACKEND", "rust-json"),
+ help="Backend under test (default: rust-json; override for forks)",
)
p.add_argument(
"--write-failures",
diff --git a/posthog/hogql/scripts/log_corpus_diagnostic.py b/posthog/hogql/scripts/log_corpus_diagnostic.py
index ecb42c86d562..cbb29fb879b1 100644
--- a/posthog/hogql/scripts/log_corpus_diagnostic.py
+++ b/posthog/hogql/scripts/log_corpus_diagnostic.py
@@ -29,11 +29,12 @@ paginated download, parity grind and failure report are shared via
4. **For each unique query**: parse with `--oracle` (default
`cpp-json`); oracle reject → skipped. Otherwise parse with
`--candidate` — reject, crash, AST mismatch, or pass. ASTs are
- compared after `clear_locations()`.
+ compared with per-node `start` / `end` positions by default
+ (`CLEAR_LOCATIONS=1` strips them for structural-only comparison).
## Usage
- # Default — auto-discover, download, run cpp-vs-python parity:
+ # Default — auto-discover, download, run cpp-vs-rust parity:
PYTHONPATH=. python posthog/hogql/scripts/log_corpus_diagnostic.py
# Iterate on a candidate parser without re-pulling the corpus:
@@ -197,8 +198,8 @@ def main() -> int:
)
p.add_argument(
"--candidate",
- default=os.environ.get("CANDIDATE_BACKEND", "python"),
- help="Backend under test (default: python; override for forks)",
+ default=os.environ.get("CANDIDATE_BACKEND", "rust-json"),
+ help="Backend under test (default: rust-json; override for forks)",
)
p.add_argument(
"--write-failures",
diff --git a/posthog/hogql/scripts/pbt_diagnostic.py b/posthog/hogql/scripts/pbt_diagnostic.py
index 50f8e3437d8f..56f0fc3ee5eb 100644
--- a/posthog/hogql/scripts/pbt_diagnostic.py
+++ b/posthog/hogql/scripts/pbt_diagnostic.py
@@ -3,8 +3,8 @@
Reuses the strategies from `test_parser_grammar_pbt.py` (the
auto-generated grammar PBT introduced in PR #58627) but runs as an
ad-hoc CLI rather than a pytest collection. Backend-agnostic:
-defaults to `cpp-json` vs `python` (the two backends shipped in
-master); point `--candidate` at any other backend in a feature
+defaults to `cpp-json` vs `rust-json` (the two compiled backends);
+point `--candidate` at `python` or any other backend in a feature
branch that adds one.
Distinct from the pytest PBT in five ways:
@@ -210,8 +210,8 @@ def main() -> int:
)
parser.add_argument(
"--candidate",
- default=os.environ.get("CANDIDATE_BACKEND", "python"),
- help="Backend under test (default: python; override in feature branches that add a third backend)",
+ default=os.environ.get("CANDIDATE_BACKEND", "rust-json"),
+ help="Backend under test (default: rust-json; override in feature branches that add a fourth backend)",
)
parser.add_argument(
"--max-mismatch-samples",
diff --git a/posthog/hogql/test/_test_parser.py b/posthog/hogql/test/_test_parser.py
index 142832bb931d..882c23ecf55a 100644
--- a/posthog/hogql/test/_test_parser.py
+++ b/posthog/hogql/test/_test_parser.py
@@ -1,7 +1,14 @@
+# Parity-regression tests touch `parse_expr` / `parse_select` results as concrete subclasses
+# (`ast.Constant.value`, `SelectQuery.select`, …) without `assert isinstance(...)` narrowing on
+# every assertion. Each test runs against all 3 backends; a runtime AttributeError surfaces as
+# a test failure anyway. Relax the narrowing checks here only so the rest of the codebase
+# keeps its strictness.
+# mypy: disable-error-code="arg-type, union-attr, attr-defined, assignment"
+
import math
from typing import Optional, cast
-from posthog.test.base import BaseTest, MemoryLeakTestMixin
+from posthog.test.base import BaseTest, MemoryLeakTestMixin, no_memory_leak_check
from parameterized import parameterized
@@ -1178,6 +1185,52 @@ def parser_test_factory(backend: HogQLParserBackend):
),
)
+ def test_clause_keyword_as_column_after_comma(self):
+ # After a comma, the column list continues with another
+ # column for a clause keyword that can also be a Field —
+ # only `FROM` (and two-token `GROUP BY` / `ORDER BY`) makes
+ # the comma trailing. `window` here is the second column.
+ self.assertEqual(
+ self._select("select 1, window from events"),
+ ast.SelectQuery(
+ select=[ast.Constant(value=1), ast.Field(chain=["window"])],
+ select_from=ast.JoinExpr(table=ast.Field(chain=["events"])),
+ ),
+ )
+ # Same in a GROUP BY list — `window` is the second grouping
+ # key, not the start of a WINDOW clause.
+ grouped = self._select("select count() from events group by tool, window")
+ assert isinstance(grouped, ast.SelectQuery)
+ self.assertEqual(
+ grouped.group_by,
+ [ast.Field(chain=["tool"]), ast.Field(chain=["window"])],
+ )
+
+ def test_clause_keywords_reused_as_identifiers_throughout_query(self):
+ # Every word in this query is a HogQL clause/operator keyword
+ # being reused as a Field or table reference. The grammar's
+ # `keyword` rule allow-lists `SELECT` / `FROM` / `WHERE` /
+ # `AND` so they can stand in for an `identifier` in three
+ # positions: column list (`select` as a Field), FROM-table
+ # (`from` as a table), and WHERE expression (`where AND and`
+ # is the And-of-two-Fields predicate). Catches lexer-mode
+ # bugs and parser-rule bugs where a backend takes the
+ # keyword path instead of the identifier path when both
+ # are legal.
+ self.assertEqual(
+ self._select("select select from from where where and and"),
+ ast.SelectQuery(
+ select=[ast.Field(chain=["select"])],
+ select_from=ast.JoinExpr(table=ast.Field(chain=["from"])),
+ where=ast.And(
+ exprs=[
+ ast.Field(chain=["where"]),
+ ast.Field(chain=["and"]),
+ ]
+ ),
+ ),
+ )
+
def test_expr_with_ignored_sql_comment(self):
self.assertEqual(
self._expr("1 -- asd"),
@@ -1430,6 +1483,15 @@ def parser_test_factory(backend: HogQLParserBackend):
select_from=ast.JoinExpr(table=ast.Field(chain=["events"]), alias="e"),
),
)
+ # `TableExprAlias` is left-recursive, so a table can carry a
+ # chain of implicit aliases — the last one wins.
+ self.assertEqual(
+ self._select("select 1 from events e1 e2"),
+ ast.SelectQuery(
+ select=[ast.Constant(value=1)],
+ select_from=ast.JoinExpr(table=ast.Field(chain=["events"]), alias="e2"),
+ ),
+ )
self.assertEqual(
self._select("select 1 from complex.table"),
ast.SelectQuery(
@@ -4514,4 +4576,2107 @@ def parser_test_factory(backend: HogQLParserBackend):
),
)
+ @no_memory_leak_check
+ def test_statement_keywords_rejected_as_expressions(self):
+ # Hog statement keywords (`fn`, `let`, `while`, …) aren't in the `keyword` rule, unlike `if` / `for` / `return`.
+ for kw in ("fn", "fun", "let", "while", "throw", "try", "catch", "finally"):
+ with self.assertRaises(ExposedHogQLError, msg=f"{backend}: {kw!r} should reject"):
+ parse_expr(kw, backend=backend)
+
+ @no_memory_leak_check
+ def test_exponent_float_without_fractional_digits(self):
+ # FLOATING_LITERAL's fractional digits are optional: `1.e5` is one token, not `1` then ArrayAccess on `e5`.
+ cases = {
+ "1.e5": 100000.0,
+ "1.E5": 100000.0,
+ "1.e+5": 100000.0,
+ "1.e-5": 1e-05,
+ "12.e2": 1200.0,
+ }
+ for src, expected in cases.items():
+ node = parse_expr(src, backend=backend)
+ self.assertIsInstance(node, ast.Constant, msg=f"{backend}: {src!r}")
+ self.assertEqual(node.value, expected, msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_clause_keyword_after_comma_in_select_columns(self):
+ # `select a, where b` is one column + WHERE clause; `select a, where` (no body) is two columns.
+ # `where * columns('x')` could also be multiplication, but cpp prefers the clause.
+ for src, attr in (
+ ("select a, where b", "where"),
+ ("select a, having b", "having"),
+ ("select a, prewhere c", "prewhere"),
+ ("select a, qualify d", "qualify"),
+ ("select columns('gk'), where * columns('gk') with totals", "where"),
+ ("select a, prewhere * columns('y')", "prewhere"),
+ ):
+ node = parse_select(src, backend=backend)
+ self.assertEqual(len(node.select), 1, msg=f"{backend}: {src!r}")
+ self.assertIsNotNone(getattr(node, attr), msg=f"{backend}: {src!r}")
+ # bare clause keyword (no body) → stays a column;
+ # `window from events` is `window` the Field then a FROM
+ # clause, not a malformed WINDOW clause.
+ for src in (
+ "select a, where",
+ "select a, having",
+ "select a, window x",
+ "select 1, window from events",
+ ):
+ node = parse_select(src, backend=backend)
+ self.assertEqual(len(node.select), 2, msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_limit_percent_marker_with_compound_body(self):
+ # `%` is overloaded (modulo + LIMIT PERCENT); compound LIMIT bodies must bind it as the PERCENT marker.
+ cases = (
+ "SELECT 1 LIMIT 1+1 % WITH TIES",
+ "SELECT a, b LIMIT c AND d % WITH TIES",
+ "SELECT 1 LIMIT 1+1 % 2 WITH TIES",
+ "SELECT 1 LIMIT a%b % WITH TIES",
+ "SELECT 1 LIMIT 5 % 2 + 3",
+ "SELECT 1 LIMIT 1+1 % OFFSET 3",
+ )
+ for src in cases:
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_assignment_lhs_is_any_expression(self):
+ # `exprStmt: expression (COLONEQUALS expression)?` — `:=` LHS has no place-expression restriction.
+ cases = (
+ "1 := 1",
+ "[] := 1",
+ "{} := 1",
+ "'s' := 1",
+ "return 1 := 1",
+ "for (let m in 488614) 1 := 1",
+ )
+ for src in cases:
+ oracle = parse_program(src, backend="cpp-json")
+ got = parse_program(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_call_as_assignment_target(self):
+ # `f() := 1` is `Call(f) := 1`; a statement's leading expr folds its postfix `(…)` even with `:=` after.
+ cases = (
+ "f() := 1",
+ "f(x) := 1",
+ "f()(g) := h",
+ "if(x) := y",
+ "(a) := (b) (c) := (d)", # the postfix-stop guard's real RHS scenario must still hold
+ )
+ for src in cases:
+ oracle = parse_program(src, backend="cpp-json")
+ got = parse_program(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_assignment_statement_consumes_trailing_semicolon(self):
+ # `exprStmt: expression (COLONEQUALS expression)? SEMICOLON?` — `:=`-form consumes its trailing `;`.
+ # (`varDecl`'s `LET …` form has no `SEMICOLON?` and must not consume it.)
+ cases = (
+ "if (c) a := b ; else d",
+ "if (c) (a) := b ; else d",
+ "if (c) a := b ;; else d",
+ )
+ for src in cases:
+ oracle = parse_program(src, backend="cpp-json")
+ got = parse_program(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_trailing_limit_offset_compound_body(self):
+ # `LIMIT`/`OFFSET` after `LIMIT BY` takes a full `columnExpr` body — lower-precedence tails must bind.
+ cases = (
+ "select x limit a by c limit d ?? e",
+ "select x limit a by c offset d ?? e",
+ "select x limit a by c limit 1 + 1",
+ )
+ for src in cases:
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_zero_arg_lambda_as_clause_body(self):
+ # After `,`, a clause-keyword + `()->` is a lambda clause body; bare `()` makes the keyword a column.
+ cases = (
+ "select 1, limit () -> 2",
+ "select 1, where () -> 2",
+ "select 1, offset () -> 3",
+ "select 1, limit ()", # bare () — keyword is a column
+ )
+ for src in cases:
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_set_level_offset_compound_body(self):
+ # `offsetOnlyClause: OFFSET columnExpr` at selectSetStmt level takes a full columnExpr (lower-precedence tails bind).
+ cases = (
+ "select 1 offset a or b",
+ "select 1 offset a ignore nulls",
+ "(select 1) offset a ?? b",
+ )
+ for src in cases:
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_pivot_tuple_or_single_parenthesised_operand(self):
+ # Per `columnExprTupleOrSingle`, a parenthesised PIVOT/UNPIVOT operand is always a `Tuple`, even for one element.
+ cases = (
+ "select 1 from a unpivot ((x) for (c) in (d))",
+ "select 1 from a pivot (s for (c) in (1))",
+ )
+ for src in cases:
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_pivot_binds_to_last_joined_table(self):
+ # `joinExpr PIVOT` binds to the immediately-preceding `joinExpr`; after a constraint or explicit parens it wraps the whole chain.
+ cases = (
+ "select 1 from a join b pivot (x for y in (z))",
+ "select 1 from a, b pivot (x for y in (z))",
+ "select 1 from a join b on x pivot (s for t in (u))",
+ "select 1 from (a join b) pivot (x for y in (z))",
+ )
+ for src in cases:
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_columns_macro_asterisk_form_as_list_element(self):
+ # `COLUMNS(…)` tries `columnExprList` before `* EXCLUDE` / `id.* …`, so an asterisk-form + postfix call is `ColumnsList(ExprCall(asterisk-form))`.
+ cases = (
+ "columns(q.*())",
+ "columns(* exclude(a) ())",
+ # guard: plain forms keep their shape
+ "columns(*)",
+ "columns(a, b)",
+ "columns(q.*)",
+ "columns(* exclude(a))",
+ "columns('re')",
+ )
+ for src in cases:
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_columns_replace_item_name_is_the_as_keyword(self):
+ # `columnsReplace: columnExpr AS identifier` — the replacement name can itself be the keyword `as`.
+ cases = (
+ "(* replace(a as as))",
+ "columns(* replace(a as as))",
+ "(* replace(a as b as as))",
+ "columns(* replace(x as y, z as as))",
+ "(* replace(a as b))", # guard: ordinary name
+ )
+ for src in cases:
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_clause_keyword_then_postfix_op_is_a_column(self):
+ # Clause body can't start with a postfix op, so `qualify?.q` / `prewhere::q` keep the keyword as a column.
+ for src in (
+ "select q, qualify ?. q",
+ "select q, prewhere ?. q",
+ "select q, prewhere :: q",
+ "select q, having ?. r",
+ ):
+ node = parse_select(src, backend=backend)
+ self.assertEqual(len(node.select), 2, msg=f"{backend}: {src!r}")
+ # guard: a real expression-starter still opens the clause
+ node = parse_select("select q, having y", backend=backend)
+ self.assertEqual(len(node.select), 1, msg=f"{backend}: having y")
+
+ @no_memory_leak_check
+ def test_from_after_comma_needs_a_table_reference(self):
+ # FROM's body is a `joinExpr`, not a `columnExpr` — `from` after a comma stays a Field unless a table-ref starter follows.
+ for src in ("select q, from", "select q, from + 1", "select q, from()"):
+ node = parse_select(src, backend=backend)
+ self.assertEqual(len(node.select), 2, msg=f"{backend}: {src!r}")
+ self.assertIsNone(node.select_from, msg=f"{backend}: {src!r}")
+ # guard: a real table reference still opens the FROM clause
+ node = parse_select("select q, from t", backend=backend)
+ self.assertEqual(len(node.select), 1, msg=f"{backend}: from t")
+ self.assertIsNotNone(node.select_from, msg=f"{backend}: from t")
+
+ @no_memory_leak_check
+ def test_clause_keyword_asterisk_then_postfix_is_a_clause(self):
+ # `<clause-kw> * <postfix-op>` is the clause with `*` spread + postfix; `*` mult RHS can't begin with a postfix op.
+ for src in (
+ "select q, qualify * ?. q",
+ "select q, where * :: r",
+ "select q, having * ?. r",
+ "select q, offset * ?. r",
+ ):
+ node = parse_select(src, backend=backend)
+ self.assertEqual(len(node.select), 1, msg=f"{backend}: {src!r}")
+ # guard: `where * r` is `where` the column times `r`
+ node = parse_select("select q, where * r", backend=backend)
+ self.assertEqual(len(node.select), 2, msg=f"{backend}: where * r")
+
+ @no_memory_leak_check
+ def test_pivot_tuple_or_single_operand_with_postfix(self):
+ # PIVOT operand is `Tuple` only when `)` is followed by `FOR`/`IN`; `(n)()` takes the columnExpr branch (paren-expr + postfix call).
+ cases = (
+ "select 1 from a unpivot (m for (n)() in (p))",
+ "select 1 from a pivot (m for (n)() in (p))",
+ "select 1 from a unpivot (m for (n) in (p))", # guard: bare paren stays a Tuple
+ )
+ for src in cases:
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_window_frame_between_falls_back_to_field(self):
+ # After ROWS/RANGE, `between` is ambiguous: `frameBetween` alt OR `frameStart` whose columnExpr is the `between` Field.
+ cases = (
+ "select 1 from a window w as (range between preceding)",
+ "select 1 from a window w as (range between 1 preceding and 2 following)", # guard: real BETWEEN frame
+ )
+ for src in cases:
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_pivot_operand_containing_in(self):
+ # PIVOT operand is full `columnExpr`, so `for n in p in (r)` → operand `n in p` + structural `IN (r)`.
+ cases = (
+ "select 1 from a unpivot (m for n in p in (r))",
+ "select 1 from a pivot (m for n in p in (r))",
+ "select 1 from a unpivot (m in n for p in (r))",
+ "select 1 from a pivot (m for n in (r))", # guard: simple form
+ )
+ for src in cases:
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_decoration_after_pivot(self):
+ # `tableExpr PIVOT (…)` is itself a `tableExpr` — it can chain into alias, FINAL/SAMPLE, further PIVOT, or JOIN.
+ cases = (
+ "SELECT 1 FROM (t PIVOT (a FOR b IN (c)) FINAL)",
+ "SELECT 1 FROM (t PIVOT (a FOR b IN (c)) SAMPLE 1)",
+ "SELECT 1 FROM (t UNPIVOT (a FOR b IN (c)) FINAL)",
+ "SELECT 1 FROM t PIVOT (a FOR b IN (c)) FINAL",
+ "SELECT 1 FROM t PIVOT (a FOR b IN (c)) AS x",
+ "SELECT 1 FROM t PIVOT (a FOR b IN (c)) x",
+ "SELECT 1 FROM t PIVOT (a FOR b IN (c)) AS x PIVOT (d FOR e IN (f))",
+ "SELECT 1 FROM t PIVOT (a FOR b IN (c)) JOIN u ON x",
+ )
+ for src in cases:
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_clause_keyword_as_last_group_by_key(self):
+ # The last GROUP BY key can be a clause-keyword Field (e.g. `window`); the next clause then opens normally.
+ for kw in ("window", "having", "qualify"):
+ node = parse_select(
+ f"SELECT a FROM events GROUP BY tool, {kw} HAVING call_count >= 5",
+ backend=backend,
+ )
+ self.assertIsInstance(node, ast.SelectQuery, msg=f"{backend}: {kw}")
+ self.assertEqual(len(node.group_by or []), 2, msg=f"{backend}: {kw}")
+ self.assertIsNotNone(node.having, msg=f"{backend}: {kw}")
+
+ @no_memory_leak_check
+ def test_integer_literal_above_i64_max(self):
+ # Above-i64 ints are kept lossless via the `value_type: "number"` string envelope (orjson rejects >64-bit number tokens).
+ cases = {
+ "9223372036854775808": 9223372036854775808, # i64::MAX + 1
+ "18446744073709551615": 18446744073709551615, # u64::MAX
+ "18446744073709551616": 18446744073709551616, # u64::MAX + 1
+ "99999999999999999999999999": 99999999999999999999999999,
+ "-9223372036854775809": -9223372036854775809, # i64::MIN - 1
+ "0x8000000000000000": 0x8000000000000000,
+ "0xFFFFFFFFFFFFFFFFFF": 0xFFFFFFFFFFFFFFFFFF,
+ }
+ for src, expected in cases.items():
+ node = parse_expr(src, backend=backend)
+ self.assertIsInstance(node, ast.Constant, msg=f"{backend}: {src!r}")
+ self.assertEqual(node.value, expected, msg=f"{backend}: {src!r}")
+ self.assertIsInstance(node.value, int, msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_string_escape_nul_bel_vtab(self):
+ # cpp drops `\0` (NUL ignored), decodes `\a`→0x07, `\v`→0x0B; `\0` also affects quoted identifiers.
+ cases = (
+ r"'a\0b'",
+ r"'\a'",
+ r"'\v'",
+ r"`a\0b`",
+ r'"a\0b"',
+ )
+ for src in cases:
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_reserved_keyword_alias_rejected(self):
+ # `assertValidAlias` fires at all four alias sites (AS-infix, alias-before, implicit, table); quoted forms opt out.
+ for src in (
+ "select 1 as team_id from t", # AS-infix (already checked)
+ "select 1 team_id from t", # implicit alias
+ "select team_id : 1 from t", # alias-before
+ "select * from t as team_id", # table alias (AS)
+ "select * from t team_id", # table alias (bare)
+ ):
+ with self.assertRaises(ExposedHogQLError, msg=f"{backend}: {src!r}"):
+ parse_select(src, backend=backend)
+ # Quoted aliases opt out of the reserved-keyword check.
+ for src in (
+ 'select 1 as "team_id" from t',
+ 'select 1 "team_id" from t',
+ 'select * from t as "team_id"',
+ ):
+ parse_select(src, backend=backend)
+
+ @no_memory_leak_check
+ def test_settings_and_top_clause_error_class(self):
+ # SETTINGS/TOP parse but the visitor rejects them — `NotImplementedError` is `InternalHogQLError` and is rewritten to `ExposedHogQLError` at the parser boundary.
+ for src in ("SELECT 1 SETTINGS x = 1", "SELECT TOP 5 x FROM t"):
+ with self.assertRaises(ExposedHogQLError) as cpp_cm:
+ parse_select(src, backend="cpp-json")
+ with self.assertRaises(ExposedHogQLError) as backend_cm:
+ parse_select(src, backend=backend)
+ self.assertIs(type(backend_cm.exception), type(cpp_cm.exception), msg=f"{backend}: {src!r}")
+ self.assertNotIsInstance(backend_cm.exception, SyntaxError, msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_window_frame_non_int_bound_keeps_constant(self):
+ # Unwrap a frame-bound Constant to a bare number only when integer; floats / strings keep the Constant.
+ cases = (
+ "SELECT count() OVER (ROWS 1.5 PRECEDING) FROM t",
+ "SELECT count() OVER (ROWS '5' PRECEDING) FROM t",
+ "SELECT count() OVER (ROWS 2 PRECEDING) FROM t", # guard: int still bare
+ )
+ for src in cases:
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_boolean_keyword_as_call_name(self):
+ # `true`/`false` are identifiers in the grammar (Bool Constants only as a bare columnIdentifier); as a call name they're `Call(name=...)`.
+ # `null` differs — `NULL` is a real lexer keyword, so `null(1)` stays an `ExprCall` on Null Constant.
+ for src in ("true(1)", "false(1)", "null(1)"):
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ # guard: bare true/false/null are still Constants
+ for src, val in (("true", True), ("false", False), ("null", None)):
+ node = parse_expr(src, backend="rust-json")
+ self.assertIsInstance(node, ast.Constant, msg=src)
+ self.assertEqual(node.value, val, msg=src)
+
+ @no_memory_leak_check
+ def test_hex_integer_literal_baseline(self):
+ # Pins plain `0x…` parsing against hex-float-lexer regressions; `e`/`E` are hex digits here, not exponent markers.
+ cases = {
+ "0x0": 0,
+ "0x1": 1,
+ "0xff": 255,
+ "0xFF": 255,
+ "0XFF": 255,
+ "0xe": 14, # `e` alone is a hex digit, not an exp marker
+ "0xE": 14,
+ "0x1e": 30,
+ "0x1E": 30,
+ "0x1e5": 485, # three hex digits, NOT a float
+ "0xabc": 2748,
+ "0xABC": 2748,
+ "0xfe": 254,
+ "0xae": 174,
+ # signed
+ "-0x1": -1,
+ "+0xff": 255,
+ "-0xff": -255,
+ # lossless past i64 (preserved by the recent lossless-int fix)
+ "0xFFFFFFFFFFFFFFFF": 18446744073709551615,
+ "0xFFFFFFFFFFFFFFFFFF": 4722366482869645213695,
+ }
+ for src, expected in cases.items():
+ node = parse_expr(src, backend=backend)
+ self.assertIsInstance(node, ast.Constant, msg=f"{backend}: {src!r}")
+ self.assertEqual(node.value, expected, msg=f"{backend}: {src!r}")
+ self.assertIsInstance(node.value, int, msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_hex_float_literal_c99(self):
+ # Hex-float `FLOATING_LITERAL` is strict C99 — `p`/`P` is the only exponent marker; `e`/`E` always lexes as a hex digit.
+ cases = {
+ # P-marker, no fraction
+ "0x1p4": float.fromhex("0x1p4"), # 16.0
+ "0x1p+4": float.fromhex("0x1p+4"), # 16.0
+ "0x1p-4": float.fromhex("0x1p-4"), # 0.0625
+ "0xAp1": float.fromhex("0xap1"), # 20.0
+ "0xap1": float.fromhex("0xap1"), # 20.0
+ "0x0p0": float.fromhex("0x0p0"), # 0.0
+ "0xffp10": float.fromhex("0xffp10"), # 261120.0
+ # P-marker, with fraction
+ "0x1.8p3": float.fromhex("0x1.8p3"), # 12.0
+ "0x1.0p3": float.fromhex("0x1.0p3"), # 8.0
+ "0xab.cdp4": float.fromhex("0xab.cdp4"),
+ "0xff.fp-4": float.fromhex("0xff.fp-4"),
+ # `e`/`E` is a hex digit even when adjacent to `p`. `0xep1`
+ # is hex mantissa `0xe` (14) + `p1` exponent → 28.0.
+ "0xep1": float.fromhex("0xep1"), # 28.0
+ "0xEp1": float.fromhex("0xep1"),
+ "0xeep1": float.fromhex("0xeep1"), # 476.0
+ # Signed
+ "-0x1p4": -float.fromhex("0x1p4"), # -16.0
+ "+0x1p4": float.fromhex("0x1p4"), # 16.0
+ }
+ for src, expected in cases.items():
+ node = parse_expr(src, backend=backend)
+ self.assertIsInstance(node, ast.Constant, msg=f"{backend}: {src!r}")
+ self.assertIsInstance(node.value, float, msg=f"{backend}: {src!r}")
+ self.assertEqual(node.value, expected, msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_hex_e_is_hex_digit_not_exponent_marker(self):
+ # `0x1e+4` is `0x1e` (=30) + `4`, not a hex-float — only `p`/`P` marks the exponent (strict C99, matches ClickHouse).
+ for src, op, lhs, rhs in (
+ ("0x1e+4", "+", 30, 4),
+ ("0x1e-4", "-", 30, 4),
+ ("0x1E+4", "+", 30, 4),
+ ("0xe+5", "+", 14, 5),
+ ("0xff-1", "-", 255, 1),
+ ):
+ node = parse_expr(src, backend=backend)
+ self.assertIsInstance(node, ast.ArithmeticOperation, msg=f"{backend}: {src!r}")
+ self.assertEqual(node.op, op, msg=f"{backend}: {src!r}")
+ self.assertEqual(node.left.value, lhs, msg=f"{backend}: {src!r}")
+ self.assertEqual(node.right.value, rhs, msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_hex_float_in_expression_context(self):
+ # Pins that the lexer recognises a whole hex-float as one token usable inside arithmetic.
+ for src, op, lhs, rhs in (
+ ("0x1p4 + 1", "+", float.fromhex("0x1p4"), 1),
+ ("1 + 0x1p4", "+", 1, float.fromhex("0x1p4")),
+ ("0x1p4 * 2", "*", float.fromhex("0x1p4"), 2),
+ ):
+ node = parse_expr(src, backend=backend)
+ self.assertIsInstance(node, ast.ArithmeticOperation, msg=f"{backend}: {src!r}")
+ self.assertEqual(node.op, op, msg=f"{backend}: {src!r}")
+ self.assertIsInstance(node.left, ast.Constant, msg=f"{backend}: {src!r}")
+ self.assertIsInstance(node.right, ast.Constant, msg=f"{backend}: {src!r}")
+ self.assertEqual(node.left.value, lhs, msg=f"{backend}: {src!r}")
+ self.assertEqual(node.right.value, rhs, msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_hex_float_no_integer_part_rejected(self):
+ # `0x.8p3` lacks HEX_DIGIT+ before the dot — invalid per both FLOATING_LITERAL and HEXADECIMAL_LITERAL.
+ with self.assertRaises(ExposedHogQLError, msg=f"{backend}: '0x.8p3'"):
+ parse_expr("0x.8p3", backend=backend)
+
+ @no_memory_leak_check
+ def test_cast_type_arg_with_parenthesized_expr(self):
+ # `CAST(x AS name(args))` — the `ColumnTypeExprParam` arglist admits arbitrary columnExprs including ones with their own `(…)`.
+ cases = (
+ "cast(x as a((b)))",
+ "cast(x as a(case when (c) then d end))",
+ "cast(x as a(if((c), d, e)))",
+ )
+ for src in cases:
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_subquery_arg_call_then_second_call(self):
+ # `f(select 1)()` — `(select 1)` is `ColumnExprCallSelect`, the trailing `()` is a separate `ColumnExprCall` postfix nesting on top.
+ cases = (
+ "f(select 1)()",
+ "a(select 1)(2)",
+ "f(select 1)(x)(y)",
+ )
+ for src in cases:
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_between_not_lambda_lower_bound(self):
+ # `BETWEEN <low>`'s AND-reservation must propagate through a `NOT`-wrapped lambda low bound so the lambda doesn't over-consume `…and c`.
+ cases = (
+ "a between not lambda x: b and c",
+ "a between not x -> y and z",
+ )
+ for src in cases:
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_chained_between_inner_end_position(self):
+ # Left-recursive `between`: `a between L1 and H1 between L2 and H2` parses as `BetweenExpr(BetweenExpr(a, L1, H1), L2, H2)`.
+ # The inner BetweenExpr's `.end` must stop at H1 (offset of `2` here), not extend through H2.
+ src = "select a between 1 and 2 between 3 and 4"
+ node = parse_select(src, backend=backend)
+ assert isinstance(node, ast.SelectQuery)
+ outer = node.select[0]
+ assert isinstance(outer, ast.BetweenExpr), f"{backend}: outer is {type(outer).__name__}"
+ inner = outer.expr
+ assert isinstance(inner, ast.BetweenExpr), f"{backend}: inner is {type(inner).__name__}"
+ # H1 is the constant `2`, which ends at offset 24 in the source.
+ self.assertEqual(inner.end, 24, msg=f"{backend}: inner.end={inner.end}, expected 24")
+ self.assertEqual(outer.end, 40, msg=f"{backend}: outer.end={outer.end}, expected 40")
+
+ @no_memory_leak_check
+ def test_bare_asterisk_clause_body_after_comma(self):
+ # `select a, where *` opens the WHERE clause with a bare `*` body; later LIMIT / GROUP BY / etc. is a normal subsequent clause.
+ cases = (
+ "select a, where * limit 1",
+ "select a, where * with totals",
+ "select a, prewhere * with totals",
+ "select a, where * group by x",
+ "select a, where * order by x",
+ "select a, having * limit 1",
+ "select a, qualify * limit 1",
+ )
+ for src in cases:
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_placeholder_statement_then_postfix_call_or_property(self):
+ # `{expr}` at statement start is a placeholder; trailing `(…)` or `.x` is a postfix on it (not a `block` statement).
+ cases = (
+ "{1}()",
+ "{1}.x",
+ "{a}()",
+ "{ {1}() }",
+ )
+ for src in cases:
+ oracle = parse_program(src, backend="cpp-json")
+ got = parse_program(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_placeholder_as_alias_inside_call_args(self):
+ # `f({placeholder} AS alias, …)` — the placeholder is a columnExpr admitting a trailing `AS alias`, just like any other expression.
+ # Caught by the retention query builder emitting `has({start_event_timestamps} as _start_event_timestamps, {min_timestamp})`.
+ cases = (
+ "has({x} as a)",
+ "has({x} as a, y)",
+ "f({x} as a, {y} as b)",
+ "if(has({x} as _x, {y}), _x, [])",
+ )
+ for src in cases:
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_is_only_consumes_known_tails(self):
+ # `IS` is only `IS [NOT] NULL` / `IS [NOT] DISTINCT FROM y` per cpp's grammar; in Hog program mode anything else falls back to per-token ExprStatements (e.g. `this is a string` parses as four bare identifier statements).
+ # Caught by `test_metadata.py::test_string_template` parsing `"this is a {event} string"` as `HogLanguage.HOG`.
+ cases = (
+ "this is a string",
+ "this is a {event} string",
+ "this is a {NONO()} string",
+ "x is null",
+ "x is not null",
+ "x is distinct from y",
+ "x is not distinct from y",
+ )
+ for src in cases:
+ oracle = parse_program(src, backend="cpp-json")
+ got = parse_program(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_window_frame_bound_low_precedence_value(self):
+ # Window frame bound is a full `columnExpr` — admits comparison / AND / OR (BETWEEN still splits on its own AND).
+ cases = (
+ "SELECT count() OVER (ROWS a = b PRECEDING) FROM t",
+ "SELECT count() OVER (ROWS a AND b FOLLOWING) FROM t",
+ "SELECT count() OVER (ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) FROM t", # guard: real BETWEEN
+ )
+ for src in cases:
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_join_op_modifier_arity_validation(self):
+ # Each `joinOp` alt allows at most one ALL/ANY/ASOF; ANTI/SEMI combine only with ASOF as `ASOF (ANTI|SEMI)`.
+ from posthog.hogql.errors import BaseHogQLError
+
+ invalid = (
+ "SELECT 1 FROM a ANTI ASOF JOIN b ON 1",
+ "SELECT 1 FROM a SEMI ASOF JOIN b ON 1",
+ "SELECT 1 FROM a SEMI ANTI JOIN b ON 1",
+ "SELECT 1 FROM a ALL ANTI JOIN b ON 1",
+ "SELECT 1 FROM a ALL ASOF JOIN b ON 1",
+ "SELECT 1 FROM a ALL ANY JOIN b ON 1",
+ )
+ for src in invalid:
+ with self.assertRaises((BaseHogQLError, SyntaxError), msg=f"{backend}: {src!r}"):
+ parse_select(src, backend=backend)
+ # Valid combinations still parse.
+ for src in (
+ "SELECT 1 FROM a ASOF JOIN b ON 1",
+ "SELECT 1 FROM a ASOF ANTI JOIN b ON 1",
+ "SELECT 1 FROM a ASOF SEMI JOIN b ON 1",
+ "SELECT 1 FROM a ASOF LEFT JOIN b ON 1",
+ "SELECT 1 FROM a SEMI LEFT JOIN b ON 1",
+ ):
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_group_by_all_falls_back_to_columns_on_postfix(self):
+ # `ALL` is also in the `keyword` rule — any postfix after `ALL` makes it a `Field('ALL')` columnExpr, not the all-mode marker.
+ for src in (
+ "SELECT a FROM t GROUP BY ALL, b",
+ "SELECT a FROM t GROUP BY ALL.x",
+ "SELECT a FROM t GROUP BY ALL + 1",
+ "SELECT a FROM t GROUP BY ALL[1]",
+ "SELECT a FROM t GROUP BY ALL()",
+ ):
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ # Guard: bare `ALL` (clause terminator follows) still hits the all-mode marker.
+ oracle = parse_select("SELECT a FROM t GROUP BY ALL", backend="cpp-json")
+ got = parse_select("SELECT a FROM t GROUP BY ALL", backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=backend)
+
+ @no_memory_leak_check
+ def test_with_rollup_cube_totals_chain_grammar(self):
+ # `groupByClause … (WITH (CUBE|ROLLUP))? (WITH TOTALS)?` — at most one CUBE/ROLLUP, then optional TOTALS, in order.
+ from posthog.hogql.errors import BaseHogQLError
+
+ invalid = (
+ "SELECT a FROM t GROUP BY a WITH ROLLUP WITH CUBE",
+ "SELECT a FROM t GROUP BY a WITH ROLLUP WITH ROLLUP",
+ "SELECT a FROM t GROUP BY a WITH TOTALS WITH ROLLUP",
+ "SELECT a FROM t GROUP BY a WITH TOTALS WITH TOTALS",
+ )
+ for src in invalid:
+ with self.assertRaises((BaseHogQLError, SyntaxError), msg=f"{backend}: {src!r}"):
+ parse_select(src, backend=backend)
+ # Valid combinations still parse.
+ for src in (
+ "SELECT a FROM t GROUP BY a WITH ROLLUP",
+ "SELECT a FROM t GROUP BY a WITH CUBE",
+ "SELECT a FROM t GROUP BY a WITH TOTALS",
+ "SELECT a FROM t GROUP BY a WITH ROLLUP WITH TOTALS",
+ "SELECT a FROM t GROUP BY a WITH CUBE WITH TOTALS",
+ ):
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_pivot_in_list_must_be_non_empty(self):
+ # `pivotColumn`'s `IN ( columnExprList )` is non-empty.
+ from posthog.hogql.errors import BaseHogQLError
+
+ with self.assertRaises((BaseHogQLError, SyntaxError)):
+ parse_select("SELECT 1 FROM t PIVOT (sum(x) FOR y IN ())", backend="rust-json")
+ with self.assertRaises((BaseHogQLError, SyntaxError)):
+ parse_select("SELECT 1 FROM t PIVOT (sum(x) FOR y IN ())", backend="cpp-json")
+ # Guard: populated list still parses.
+ src = "SELECT 1 FROM t PIVOT (sum(x) FOR y IN (1, 2))"
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=backend)
+
+ @no_memory_leak_check
+ def test_trim_substring_must_be_string_literal(self):
+ # `TRIM (LEADING|TRAILING|BOTH string FROM columnExpr)` — `string` is `STRING_LITERAL | templateString` only.
+ from posthog.hogql.errors import BaseHogQLError
+
+ invalid = (
+ "TRIM(BOTH x FROM y)",
+ "TRIM(BOTH 1 FROM y)",
+ "TRIM(BOTH f() FROM y)",
+ "TRIM(LEADING (a) FROM y)",
+ )
+ for src in invalid:
+ with self.assertRaises((BaseHogQLError, SyntaxError), msg=f"{backend}: {src!r}"):
+ parse_expr(src, backend=backend)
+ # Guards: string literal + template string still parse.
+ for src in ("TRIM(BOTH 'x' FROM y)", "TRIM(LEADING f'x' FROM y)"):
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_cte_list_paren_after_non_paren_cte(self):
+ # `, (` after a CTE continues the list — paren-subquery or paren-expr as next CTE, not a SELECT-start under trailing-comma tolerance.
+ for src in (
+ "WITH 1 AS x, (SELECT 1) AS y SELECT x, y",
+ "WITH (SELECT 1) AS x, (SELECT 2) AS y SELECT x, y",
+ "WITH 1 AS x, (a + b) AS y SELECT y",
+ "WITH 1 AS x, (1) AS y SELECT y",
+ "WITH 1 AS a, (x -> x + 1) AS f SELECT f(a)",
+ "WITH count() AS c, (x -> x + 1) AS f SELECT f(c)",
+ ):
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_group_by_cube_rollup_continues_list(self):
+ # `CUBE(...)` / `ROLLUP(...)` followed by `, <more>` is a regular function call; the specialised mode commits only when no list continuation follows.
+ for src in (
+ "SELECT * FROM t GROUP BY CUBE(a), ROLLUP(b)",
+ "SELECT * FROM t GROUP BY CUBE(a), b",
+ "SELECT * FROM t GROUP BY ROLLUP(a), b",
+ "SELECT * FROM t GROUP BY a, CUBE(b)",
+ ):
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ # Bare `GROUP BY CUBE(...)` (no trailing keys) still uses the mode.
+ for src in (
+ "SELECT * FROM t GROUP BY CUBE(a)",
+ "SELECT * FROM t GROUP BY ROLLUP(a)",
+ ):
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_trailing_comma_after_joined_table_chain(self):
+ # A stray trailing comma after a constrained JOIN chain (`FROM a JOIN b ON 1,`) falls off the joinExpr without requiring a next table atom.
+ for src in (
+ "SELECT * FROM a JOIN b ON 1,",
+ "SELECT * FROM a JOIN b USING (x),",
+ "SELECT * FROM a JOIN b ON 1 JOIN c ON 1,",
+ ):
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_unterminated_block_comment_lexes_as_div_asterisk(self):
+ # `/* … */` only matches with a closing `*/`; unterminated `/*` falls back to `/ *` tokens that the grammar then evaluates normally.
+ for src in ("1 /*", "1 /* "):
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ # Unterminated `/*` + ident lexes as `1 / * ident`; expression parse fails on the extraneous tokens.
+ from posthog.hogql.errors import BaseHogQLError
+
+ for src in ("1 /* unclosed", "a /* unclosed"):
+ with self.assertRaises((BaseHogQLError, SyntaxError), msg=f"{backend}: {src!r}"):
+ parse_expr(src, backend=backend)
+
+ # Guard: closed `/* … */` is still trivia.
+ oracle = parse_expr("1 /* ok */ + 2", backend="cpp-json")
+ got = parse_expr("1 /* ok */ + 2", backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=backend)
+
+ @no_memory_leak_check
+ def test_interpolate_no_trailing_comma(self):
+ # `INTERPOLATE (…)` body is `interpolateExpr (COMMA interpolateExpr)*` — no trailing comma.
+ from posthog.hogql.errors import BaseHogQLError
+
+ with self.assertRaises((BaseHogQLError, SyntaxError), msg=backend):
+ parse_select(
+ "SELECT 1 FROM t ORDER BY x WITH FILL INTERPOLATE (y,)",
+ backend=backend,
+ )
+
+ @no_memory_leak_check
+ def test_boolean_dot_chain_is_field_not_array_access(self):
+ # `true.x` is `Field(['true','x'])` — bools act as identifiers in `columnIdentifier` chain position, not Bool Constant + `.x` postfix.
+ cases = ("true.x", "false.x", "TRUE.x", "true.x.y", "false.foo.bar")
+ for src in cases:
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ # Guards: bare `true`/`false` stay Bool Constants; `true(1)` is an ident-path Call.
+ for src in ("true", "false", "true(1)"):
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_using_empty_parens_rejected(self):
+ # `joinConstraintClause` requires a non-empty `columnExprList` in both `USING (…)` and `USING …` forms.
+ from posthog.hogql.errors import BaseHogQLError
+
+ with self.assertRaises((BaseHogQLError, SyntaxError)):
+ parse_select("SELECT * FROM a JOIN b USING ()", backend="rust-json")
+ with self.assertRaises((BaseHogQLError, SyntaxError)):
+ parse_select("SELECT * FROM a JOIN b USING ()", backend="cpp-json")
+ # Populated USING still parses.
+ src = "SELECT * FROM a JOIN b USING (x)"
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=backend)
+
+ @no_memory_leak_check
+ def test_group_by_cube_rollup_empty_is_function_call(self):
+ # Empty `CUBE()`/`ROLLUP()` are ordinary Calls in the GROUP BY position, not mode markers.
+ for src in ("SELECT 1 GROUP BY CUBE()", "SELECT 1 GROUP BY ROLLUP()"):
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ # Populated CUBE / ROLLUP still uses the mode marker.
+ src = "SELECT 1 GROUP BY CUBE(a, b)"
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_quoted_identifier_backslash_escapes(self):
+ # `QUOTED_IDENTIFIER` admits `\"`, `\\`, and `""` escapes inside `"…"`.
+ cases = (
+ '"\\""',
+ '"a\\"b"',
+ '"\\\\"',
+ '"a"',
+ )
+ for src in cases:
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_reserved_keywords_rejected_as_identifiers(self):
+ # `identifier` excludes NULL_SQL/INF/NAN_SQL/EXCEPT/INTERSECT and Hog-statement keywords (FN/FUN/LET/WHILE/THROW/TRY/CATCH/FINALLY).
+ from posthog.hogql.errors import BaseHogQLError
+
+ expr_invalid = (
+ # Postfix DOT
+ "a.except",
+ "a.intersect",
+ "a.null",
+ "a.inf",
+ "a.nan",
+ "a.fn",
+ "a.fun",
+ "a.let",
+ "a.while",
+ "a.throw",
+ "a.try",
+ "a.catch",
+ "a.finally",
+ "a.b.except",
+ # Postfix `?.`
+ "a?.except",
+ "a?.null",
+ "a?.inf",
+ )
+ for src in expr_invalid:
+ with self.assertRaises((BaseHogQLError, SyntaxError), msg=f"{backend}: {src!r}"):
+ parse_expr(src, backend=backend)
+
+ select_invalid = (
+ # Alias position
+ "SELECT a AS except FROM t",
+ "SELECT a AS intersect FROM t",
+ "SELECT a AS inf FROM t",
+ "SELECT a AS nan FROM t",
+ "SELECT a AS fn FROM t",
+ "SELECT a AS let FROM t",
+ # Table identifier
+ "SELECT * FROM except.x",
+ "SELECT * FROM x.except",
+ "SELECT * FROM null.x",
+ "SELECT * FROM fn.x",
+ # WHERE / columnExpr position
+ "SELECT 1 FROM t WHERE a.except",
+ # CTE column-name list
+ "WITH x (except, intersect) AS (SELECT 1, 2) SELECT * FROM x",
+ "WITH x (a, null) AS (SELECT 1, 2) SELECT * FROM x",
+ # columnAliases on subquery
+ "SELECT a FROM (SELECT 1) AS x (except)",
+ )
+ for src in select_invalid:
+ with self.assertRaises((BaseHogQLError, SyntaxError), msg=f"{backend}: {src!r}"):
+ parse_select(src, backend=backend)
+ # Guard: interval units / plain identifier-keywords (CASE/DAY/…) still parse.
+ for src in (
+ "a.case",
+ "a.day",
+ "day.minute",
+ "select.from",
+ "SELECT a AS case FROM t",
+ "SELECT a AS day FROM t",
+ ):
+ if "SELECT" in src:
+ self.assertIsNotNone(parse_select(src, backend=backend), msg=f"{backend}: {src!r}")
+ else:
+ self.assertIsNotNone(parse_expr(src, backend=backend), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_bare_asterisk_replace_only_inside_parens(self):
+ # `ColumnExprAsterisk` only admits trailing EXCLUDE; `REPLACE` after `*` is valid only inside `(*…)` or `COLUMNS(*…)`.
+ from posthog.hogql.errors import BaseHogQLError
+
+ invalid_select = ("SELECT * REPLACE (b AS a) FROM t",)
+ for src in invalid_select:
+ with self.assertRaises((BaseHogQLError, SyntaxError), msg=f"{backend}: {src!r}"):
+ parse_select(src, backend=backend)
+ with self.assertRaises((BaseHogQLError, SyntaxError)):
+ parse_expr("* REPLACE (a AS b)", backend="rust-json")
+ with self.assertRaises((BaseHogQLError, SyntaxError)):
+ parse_expr("* REPLACE (a AS b)", backend="cpp-json")
+ # Guard: paren-wrapped REPLACE and bare-`*` EXCLUDE still parse.
+ for src in (
+ "(* REPLACE (1 AS event))",
+ "(* EXCLUDE (a) REPLACE (b AS c))",
+ "* EXCLUDE (a)",
+ ):
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_filter_clause_invalid_before_within_group(self):
+ # `ColumnExprFunctionWithinGroup` has no FILTER slot.
+ from posthog.hogql.errors import BaseHogQLError
+
+ for src in (
+ "median(x) FILTER (WHERE z) WITHIN GROUP (ORDER BY y)",
+ "quantile(x) FILTER (WHERE z > 0) WITHIN GROUP (ORDER BY y)",
+ ):
+ with self.assertRaises((BaseHogQLError, SyntaxError), msg=f"{backend}: {src!r}"):
+ parse_expr(src, backend=backend)
+ # WITHIN GROUP alone still parses.
+ oracle = parse_expr("median(x) WITHIN GROUP (ORDER BY y)", backend="cpp-json")
+ got = parse_expr("median(x) WITHIN GROUP (ORDER BY y)", backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=backend)
+
+ @no_memory_leak_check
+ def test_window_function_args_no_distinct_no_inline_order_by(self):
+ # `ColumnExprWinFunction` takes a plain `columnExprList` — no DISTINCT, no in-args ORDER BY.
+ from posthog.hogql.errors import BaseHogQLError
+
+ for src in (
+ "foo(a ORDER BY b) OVER ()",
+ "foo(DISTINCT a) OVER ()",
+ "foo(DISTINCT a ORDER BY b) OVER ()",
+ ):
+ with self.assertRaises((BaseHogQLError, SyntaxError), msg=f"{backend}: {src!r}"):
+ parse_expr(src, backend=backend)
+ # Plain forms still parse.
+ for src in ("foo(a) OVER ()", "foo(DISTINCT a)", "foo(a ORDER BY b)"):
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_unary_plus_only_on_numeric_literal(self):
+ # `numberLiteral`'s `+` is a sign prefix on number/INF/NAN, not a general unary op.
+ from posthog.hogql.errors import BaseHogQLError
+
+ invalid = ("+a", "+(a)", "+(+a)", "+f(x)")
+ for src in invalid:
+ with self.assertRaises((BaseHogQLError, SyntaxError), msg=f"{backend}: {src!r}"):
+ parse_expr(src, backend=backend)
+ # Guards: numeric / INF / NAN parse (NaN can't be equality-compared; pin parse success + node type).
+ for src in ("+1", "+1.5", "+inf", "+nan"):
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertIsNotNone(got, msg=f"{backend}: {src!r}")
+ if src not in ("+nan",):
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_column_cte_requires_identifier_after_as(self):
+ # `withExpr: columnExpr AS identifier` — post-AS must be a real identifier, not a number / string / paren group.
+ from posthog.hogql.errors import BaseHogQLError
+
+ invalid = (
+ "WITH a AS 1 SELECT a",
+ "WITH 1 + 1 AS 1 SELECT 1",
+ "WITH 1 + 1 AS 'foo' SELECT 'foo'",
+ )
+ for src in invalid:
+ with self.assertRaises((BaseHogQLError, SyntaxError), msg=f"{backend}: {src!r}"):
+ parse_select(src, backend=backend)
+ # Identifier names continue to work.
+ oracle = parse_select("WITH a AS b SELECT b", backend="cpp-json")
+ got = parse_select("WITH a AS b SELECT b", backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}")
+
+ @no_memory_leak_check
+ def test_limit_offset_with_ties_must_precede_offset(self):
+ # `limitAndOffsetClause` is either `LIMIT n PERCENT? (COMMA n)? (WITH TIES)?` (compact) or `LIMIT n PERCENT? (WITH TIES)? OFFSET n` (verbose);
+ # `LIMIT n OFFSET m WITH TIES` matches neither — WITH TIES must precede OFFSET in the verbose form.
+ from posthog.hogql.errors import BaseHogQLError
+
+ with self.assertRaises((BaseHogQLError, SyntaxError)):
+ parse_select("SELECT a FROM t LIMIT 1 OFFSET 2 WITH TIES", backend="rust-json")
+ with self.assertRaises((BaseHogQLError, SyntaxError)):
+ parse_select("SELECT a FROM t LIMIT 1 OFFSET 2 WITH TIES", backend="cpp-json")
+ # Both valid forms still parse.
+ for src in (
+ "SELECT a FROM t LIMIT 1 WITH TIES OFFSET 2",
+ "SELECT a FROM t LIMIT 1, 2 WITH TIES",
+ "SELECT a FROM t LIMIT 1 WITH TIES",
+ ):
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_pivot_in_separator_extends_via_postfix_call(self):
+ # `pivotColumn`'s LHS extends past any `IN (…) (` (postfix-call on LHS); only the LAST `IN (…)` not followed by `(` is structural.
+ cases = (
+ "SELECT 1 FROM t PIVOT (s FOR a IN (1) b IN (2))", # splits at first IN — `b` after close fails LHS-extension
+ "SELECT 1 FROM t PIVOT (sum(x) FOR y IN (1) (2) IN (3))", # one column, structural IN at second depth-0
+ "SELECT 1 FROM t PIVOT (sum(x) FOR y IN (1, 2))",
+ "SELECT 1 FROM t PIVOT (sum(x) FOR (y, z) IN ((a, b), (c, d)))",
+ )
+ for src in cases:
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_return_expr_prefix_shortened_when_assignment_follows(self):
+ # `return <expr>? <stmt>` where stmt starts with `:=` — cpp backtracks the expr to the shortest prefix that leaves `:=` parseable as the next stmt.
+ cases = (
+ "fn f() { return * columns('a') := columns('b') }", # expr = `*`, then columns(…) := …
+ "fn f() { return columns('a') := columns('b') }", # expr = `columns`, paren-expr takes `:=`
+ "fn f() { return * x := y }",
+ "fn f() { return *x := y }",
+ # Guards: cases that should NOT shorten.
+ "fn f() { return X := Y }", # NamedArgument inside return
+ "fn f() { return a.b := c }", # no valid prefix; bare return
+ "fn f() { return * }", # bare asterisk
+ "fn f() { return *columns('a') }", # no `:=`; full SpreadExpr
+ )
+ for src in cases:
+ oracle = parse_program(src, backend="cpp-json")
+ got = parse_program(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_interpolate_as_lambda_value(self):
+ # `interpolateExpr: columnExpr (AS columnExpr)?` — AS RHS is a full columnExpr, so a lambda body is valid.
+ cases = (
+ "SELECT 1 ORDER BY x INTERPOLATE (a AS LAMBDA y: y+1)",
+ "SELECT 1 ORDER BY x INTERPOLATE (a AS y -> y+1)",
+ )
+ for src in cases:
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ # Guards: AS with a non-lambda RHS still folds as a normal column alias.
+ for src in (
+ "SELECT a AS my_alias FROM t",
+ 'SELECT a AS "my alias" FROM t',
+ "SELECT 1 ORDER BY x INTERPOLATE (a AS 5)",
+ ):
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_hogqlx_tag_in_from_paren_decorations(self):
+ # `(<Tag/>)` is `LPAREN joinExpr RPAREN`: alias / FINAL / SAMPLE bind to the tag inside the parens (tableExpr) but not outside (JoinExprParens isn't a tableExpr).
+ from posthog.hogql.errors import BaseHogQLError
+
+ accept = (
+ "SELECT 1 FROM (<Tag /> AS y)",
+ "SELECT 1 FROM (<Tag /> JOIN b ON x)",
+ "SELECT 1 FROM (<Tag /> FINAL)",
+ )
+ for src in accept:
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ reject = (
+ "SELECT 1 FROM (<Tag />) AS x",
+ "SELECT 1 FROM (<Tag />) x",
+ "SELECT 1 FROM (<Tag />) FINAL",
+ )
+ for src in reject:
+ with self.assertRaises((BaseHogQLError, SyntaxError), msg=f"{backend}: {src!r}"):
+ parse_select(src, backend=backend)
+
+ @no_memory_leak_check
+ def test_hogqlx_tag_text_accepts_arbitrary_non_brace_non_lt(self):
+ # `HOGQLX_TEXT_TEXT: ~[<{]+` — any byte except `<` and `{` is valid tag-body text.
+ cases = (
+ "<a>foo&bar</a>",
+ "<a>foo!</a>",
+ "<a>foo@bar</a>",
+ "<a>1 + 2</a>",
+ "<a>!@#%^*()</a>",
+ "<outer><inner>foo!bar</inner>baz&qux</outer>",
+ )
+ for src in cases:
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_hogqlx_tag_identifier_allows_hyphens(self):
+ # `HOGQLX_TAG_OPEN`/`_CLOSE` modes admit `[a-zA-Z_][a-zA-Z0-9_-]*` for tag and attribute names — hyphens are part of the ident.
+ cases = (
+ "<a-b />",
+ "<a-b-c />",
+ "<my-tag a-b={1}>x</my-tag>",
+ "<tag a-b={1}/>",
+ "<tag><my-child/></tag>",
+ "<a-b>{1}</a-b>",
+ )
+ for src in cases:
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_join_expr_parens_does_not_take_outer_alias(self):
+ # `JoinExprParens` isn't a `tableExpr`, so alias / FINAL / SAMPLE can't bind to a `(joinExpr)` from outside.
+ from posthog.hogql.errors import BaseHogQLError
+
+ invalid = (
+ "SELECT 1 FROM (t) AS x",
+ "SELECT 1 FROM (t) x",
+ "SELECT 1 FROM ((t)) AS x",
+ "SELECT 1 FROM (t JOIN b ON x) AS y",
+ "SELECT 1 FROM (t) FINAL",
+ )
+ for src in invalid:
+ with self.assertRaises((BaseHogQLError, SyntaxError), msg=f"{backend}: {src!r}"):
+ parse_select(src, backend=backend)
+ # Guards: subquery and non-parenthesised aliases still parse.
+ valid = (
+ "SELECT 1 FROM t",
+ "SELECT 1 FROM t AS x",
+ "SELECT 1 FROM (SELECT 1)",
+ "SELECT 1 FROM (SELECT 1) AS x",
+ )
+ for src in valid:
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_string_literal_unknown_backslash_escapes_rejected(self):
+ # `ESCAPE_CHAR_COMMON` is closed: `\b \f \r \n \t \0 \a \v \\ \xNN` plus `\'`; anything else is a lexer error.
+ from posthog.hogql.errors import BaseHogQLError
+
+ invalid = (
+ r"'\x'", # \x without two hex digits
+ r"'\g'", # unknown escape letter
+ "'\\u00AB'", # \u not in cpp grammar
+ r"'\1'", # \1 not in cpp grammar
+ r"'\999'", # \9 not in cpp grammar
+ )
+ for src in invalid:
+ with self.assertRaises((BaseHogQLError, SyntaxError), msg=f"{backend}: {src!r}"):
+ parse_expr(src, backend=backend)
+ # Guard: every grammar-allowed escape still parses.
+ valid = (
+ r"'\n'",
+ r"'\t'",
+ r"'\\'",
+ r"'\''",
+ r"'\xAB'",
+ r"'\b'",
+ r"'\xFF'",
+ )
+ for src in valid:
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_sample_clause_leading_dot_float_value(self):
+ # Leading-dot floats `.5` lex as `Dot` + `Number`, so SAMPLE's ratio gate must admit `Dot` when followed by a Number.
+ cases = (
+ "SELECT 1 FROM t SAMPLE .5",
+ "SELECT 1 FROM t SAMPLE .04",
+ "SELECT 1 FROM t SAMPLE .5 / 2",
+ "SELECT 1 FROM t SAMPLE 1 / .04",
+ )
+ for src in cases:
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_sample_clause_only_accepts_number_literals(self):
+ # `ratioExpr: placeholder | numberLiteral (SLASH numberLiteral)?` — each side is a `numberLiteral` only, not a general columnExpr.
+ from posthog.hogql.errors import BaseHogQLError
+
+ invalid = (
+ "SELECT * FROM t SAMPLE a",
+ "SELECT * FROM t SAMPLE x.y",
+ "SELECT * FROM t SAMPLE 1/{p}",
+ "SELECT * FROM t SAMPLE 1+1",
+ )
+ for src in invalid:
+ with self.assertRaises((BaseHogQLError, SyntaxError), msg=f"{backend}: {src!r}"):
+ parse_select(src, backend=backend)
+ # Guard: every grammar-allowed SAMPLE form still parses.
+ valid = (
+ "SELECT * FROM t SAMPLE 1",
+ "SELECT * FROM t SAMPLE 1/2",
+ "SELECT * FROM t SAMPLE {p}",
+ "SELECT * FROM t SAMPLE 0.5",
+ "SELECT * FROM t SAMPLE 1 OFFSET 2",
+ )
+ for src in valid:
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_join_op_grammar_alts_validation(self):
+ # `joinOp` has three disjoint alts (`HogQLParser.g4:127-134`):
+ # JoinOpInner, JoinOpLeftRight, JoinOpFull. Each keyword appears
+ # at most once per alt, and the three alts don't share INNER /
+ # LEFT / RIGHT / FULL. Rust's source-order loop set booleans
+ # without de-duplicating or cross-validating, so it accepted
+ # `INNER LEFT`, `LEFT OUTER LEFT`, `FULL INNER`, etc.
+ from posthog.hogql.errors import BaseHogQLError
+
+ invalid = (
+ "SELECT 1 FROM a INNER LEFT JOIN b ON 1",
+ "SELECT 1 FROM a INNER OUTER JOIN b ON 1",
+ "SELECT 1 FROM a INNER INNER JOIN b ON 1",
+ "SELECT 1 FROM a LEFT OUTER LEFT JOIN b ON 1",
+ "SELECT 1 FROM a FULL INNER JOIN b ON 1",
+ )
+ for src in invalid:
+ with self.assertRaises((BaseHogQLError, SyntaxError), msg=f"{backend}: {src!r}"):
+ parse_select(src, backend=backend)
+ # Guard: every grammar-allowed JOIN op still parses.
+ valid = (
+ "SELECT 1 FROM a JOIN b ON 1",
+ "SELECT 1 FROM a INNER JOIN b ON 1",
+ "SELECT 1 FROM a LEFT JOIN b ON 1",
+ "SELECT 1 FROM a RIGHT JOIN b ON 1",
+ "SELECT 1 FROM a LEFT OUTER JOIN b ON 1",
+ "SELECT 1 FROM a FULL JOIN b ON 1",
+ "SELECT 1 FROM a FULL OUTER JOIN b ON 1",
+ "SELECT 1 FROM a INNER ALL JOIN b ON 1",
+ "SELECT 1 FROM a ALL INNER JOIN b ON 1",
+ "SELECT 1 FROM a ASOF JOIN b ON 1",
+ "SELECT 1 FROM a ASOF LEFT JOIN b ON 1",
+ )
+ for src in valid:
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_capital_F_template_string_only_in_full_template_context(self):
+ # `f'…'` is reachable from `templateString` (a `columnExpr`); `F'…'` only from the `fullTemplateString` entry rule.
+ from posthog.hogql.errors import BaseHogQLError
+
+ for src in ("F'hello'", "F''", "F'{1+2}'"):
+ with self.assertRaises((BaseHogQLError, SyntaxError), msg=f"{backend}: {src!r}"):
+ parse_expr(src, backend=backend)
+ # Guard: lowercase form remains a valid column expression.
+ for src in ("f'hello'", "f'{1+2}'"):
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_empty_paren_only_clauses_rejected(self):
+ # `columnAliases`, `interpolateClause`'s paren body, and `columnsReplaceList` each require ≥ 1 element when parens are present.
+ from posthog.hogql.errors import BaseHogQLError
+
+ invalid_select = (
+ "SELECT * FROM t AS x ()",
+ "SELECT 1 ORDER BY x INTERPOLATE ()",
+ )
+ for src in invalid_select:
+ with self.assertRaises((BaseHogQLError, SyntaxError), msg=f"{backend}: {src!r}"):
+ parse_select(src, backend=backend)
+
+ invalid_expr = (
+ "COLUMNS(* REPLACE (b AS c,))",
+ "COLUMNS(* EXCLUDE (a) REPLACE (b AS c,))",
+ )
+ for src in invalid_expr:
+ with self.assertRaises((BaseHogQLError, SyntaxError), msg=f"{backend}: {src!r}"):
+ parse_expr(src, backend=backend)
+
+ # Guards: populated / bare-keyword forms still parse.
+ for src in (
+ "SELECT * FROM t AS x (a)",
+ "SELECT * FROM t AS x (a, b)",
+ "SELECT 1 ORDER BY x INTERPOLATE (a AS b)",
+ "SELECT 1 ORDER BY x INTERPOLATE",
+ ):
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ for src in (
+ "COLUMNS(* REPLACE (a AS b, c AS d))",
+ "COLUMNS(* REPLACE (a AS b))",
+ ):
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_bare_zero_x_prefix_lexes_as_zero_plus_ident(self):
+ # `HEXADECIMAL_LITERAL` requires ≥ 1 hex digit after `0x`; otherwise the lexer falls back to `0` then ident `x`.
+ from posthog.hogql.errors import BaseHogQLError
+
+ cases = (
+ "SELECT 0x AS y",
+ "SELECT 0x + 1",
+ )
+ for src in cases:
+ with self.assertRaises((BaseHogQLError, SyntaxError), msg=src):
+ parse_select(src, backend="cpp-json")
+ with self.assertRaises((BaseHogQLError, SyntaxError), msg=src):
+ parse_select(src, backend="rust-json")
+ with self.assertRaises((BaseHogQLError, SyntaxError), msg=src):
+ parse_select(src, backend="python")
+ # Valid hex literals (≥ 1 hex digit) must keep working.
+ for src in ("SELECT 0x1", "SELECT 0xFF", "SELECT 0xaB"):
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_cast_type_param_group_mode_classification(self):
+ # `IDENT(...)` type expr commits per-group: Param renders via raw text (case-preserved, spaceless), Complex / Nested lowercase + `, `-join.
+ # Any depth-0 expr-shaped sibling forces Param mode for the entire group.
+ cases = (
+ # All items expr-shaped — Param mode end-to-end.
+ "cast(x as DateTime64(3, 'UTC'))",
+ 'cast(x as DateTime64(3, "UTC"))',
+ "cast(x as Foo(#1, ABC))",
+ # Mixed: `#1` forces Param for the whole group; sibling `Bar(a, b)` renders spaceless + case-preserved.
+ "cast(x as Foo(#1, Bar(a, b)))",
+ "cast(x as Foo(Bar(a, b), #1))",
+ "cast(x as Foo(#1, f(g(a, b), h(c, d))))",
+ # Depth-1 `8` inside `FixedString(8)` doesn't escalate outer Foo to Param.
+ "cast(x as Foo(FixedString(8)))",
+ "cast(x as Foo(g(#1)))",
+ # All items type-shaped — Complex mode.
+ "cast(x as Foo(a(b, c), d))",
+ "cast(x as Tuple(a Int, b Int))",
+ # Top-level operator forces Param.
+ "cast(x as Foo(a, b*c))",
+ # `case when … end` has no depth-0 markers but isn't a type — falls to Param.
+ "cast(x as Foo(case when (c) then d end))",
+ )
+ for src in cases:
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_hogqlx_comments_skipped_between_attributes(self):
+ # `HOGQLX_TAG_OPEN`/`_CLOSE` modes skip block + line comments and route unknown bytes to UNEXPECTED_CHARACTER.
+ cases = (
+ "<a /*c*/ b={1}/>",
+ "<a /* c */b={1}/>",
+ "<a -- comment\n b={1}/>",
+ "<a // comment\n b={1}/>",
+ "<a /*c*/ />",
+ )
+ for src in cases:
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ # Guard: unknown bytes (`#`, `@`) inside a tag now reject via UNEXPECTED_CHARACTER.
+ for src in ("<a # comment\n />", "<a @x b={1}/>"):
+ with self.assertRaises(ExposedHogQLError, msg=src):
+ parse_expr(src, backend="cpp-json")
+ with self.assertRaises(ExposedHogQLError, msg=src):
+ parse_expr(src, backend="rust-json")
+
+ @no_memory_leak_check
+ def test_float_subnormal_preserved_not_flattened_to_infinity(self):
+ # Subnormal floats keep their value (cpp's `strtod`+errno distinguishes underflow from overflow); below the smallest subnormal → 0.0; true overflow → ±Infinity.
+ cases_subnormal = (
+ ("1e-310", 1e-310),
+ ("5e-324", 5e-324),
+ ("-1e-310", -1e-310),
+ )
+ for src, expected in cases_subnormal:
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(got.value, expected, msg=f"{backend}: {src!r}")
+ for src in ("1e-325", "-1e-400"):
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(got.value, 0.0, msg=f"{backend}: {src!r}")
+ for src, expected in (("1e+400", float("inf")), ("-1e+400", float("-inf"))):
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(got.value, expected, msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_stmt_rhs_pratt_recovers_on_infix_rhs_failure(self):
+ # cpp splits `let x := {} * ()` into two stmts when the `*` infix RHS rejects — the stranded operator + operand become the next stmt.
+ cases = (
+ "let x := {} * ()",
+ "{ let x := {} * () }",
+ "a := {} * ()",
+ "return {} * ()",
+ "let x := f() * ()",
+ )
+ for src in cases:
+ oracle = parse_program(src, backend="cpp-json")
+ got = parse_program(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ # Guard: a valid full expression still parses greedily — recovery only fires when RHS rejects.
+ for src in (
+ "let x := {} * (1)",
+ "let x := 1 + 2",
+ "let x := 1",
+ ):
+ oracle = parse_program(src, backend="cpp-json")
+ got = parse_program(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_unpivot_emits_include_nulls_false_by_default(self):
+ # `JoinExprUnpivot` always emits `include_nulls` — `false` by default, `true` when `INCLUDE NULLS` is present.
+ cases = (
+ "SELECT * FROM t UNPIVOT (val FOR month IN (a, b))",
+ "SELECT * FROM t UNPIVOT INCLUDE NULLS (val FOR month IN (a, b))",
+ )
+ for src in cases:
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_not_with_keyword_infix_treats_not_as_field(self):
+ # `NOT <kw-infix> <rhs>` is `Field([not]) <kw-infix> <rhs>` when the infix RHS is valid; otherwise `Not(Field(kw))`.
+ cases = (
+ "NOT BETWEEN 1 AND 2",
+ "NOT LIKE 'a'",
+ "NOT IS NULL",
+ "NOT ILIKE 'a'",
+ "NOT IS NOT NULL",
+ )
+ for src in cases:
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ # Guards: unary-NOT shapes work when the rhs is a complete columnExpr (no kw-infix gap).
+ for src in (
+ "NOT x",
+ "not like", # no rhs → unary NOT on Field(like)
+ "not in (1,2)", # IN takes a paren-list, parses as Not(Call(in))
+ "NOT IN (1)",
+ ):
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_multi_join_with_stacked_on_using_clauses(self):
+ # Multi-JOIN with stacked constraints binds right-associatively: in `a JOIN b JOIN c ON1 ON2`, ON1 attaches to `c`, ON2 to `b`.
+ cases = (
+ "SELECT * FROM a JOIN b JOIN c ON 1 ON 2",
+ "SELECT * FROM a JOIN b JOIN c ON a.x=b.x ON b.y=c.y",
+ "SELECT * FROM a INNER JOIN b INNER JOIN c ON 1 ON 1",
+ "SELECT * FROM a JOIN b JOIN c USING (x) USING (y)",
+ "SELECT * FROM a JOIN b JOIN c JOIN d ON 1 ON 2 ON 3",
+ )
+ for src in cases:
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ # Guards: the interleaved / single-constraint shapes still
+ # parse the same way.
+ for src in (
+ "SELECT * FROM a JOIN b ON 1 JOIN c ON 1",
+ "SELECT * FROM a JOIN b ON 1",
+ "SELECT * FROM a JOIN b USING (x)",
+ ):
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_enum_cast_rejected_as_unsupported(self):
+ # `ColumnTypeExprEnum` (`ident(enumValue,…)` where `enumValue: STRING = number`) is explicitly unsupported by the visitor.
+ for src in (
+ "cast(x as Enum('a' = 1))",
+ "cast(x as Enum8('a' = 1, 'b' = 2))",
+ "cast(x as Enum16('a' = 1))",
+ "cast(x as Enum8('a' = 1, 'b' = 2,))", # trailing comma
+ ):
+ with self.assertRaises(ExposedHogQLError, msg=src) as cpp_cm:
+ parse_expr(src, backend="cpp-json")
+ with self.assertRaises(ExposedHogQLError, msg=src) as rust_cm:
+ parse_expr(src, backend="rust-json")
+ self.assertIn("ColumnTypeExprEnum", str(cpp_cm.exception), msg=src)
+ self.assertIn("ColumnTypeExprEnum", str(rust_cm.exception), msg=src)
+
+ @no_memory_leak_check
+ def test_raw_type_param_text_rejects_null_inf_nan_keywords(self):
+ # cpp's `columnTypeExpr` Param alt routes identifier-shaped
+ # tokens through the `identifier` rule, which omits NULL /
+ # INF / NAN. A bare `Int NULL` inside `Tuple(Int NULL)` errors
+ # at the outer paren because the inner type can't extend
+ # through NULL. Rust's raw-text fallback in
+ # `consume_raw_type_param_text` used to concatenate `IntNULL`
+ # verbatim, silently accepting and emitting a malformed
+ # type-name string.
+ for src in (
+ "cast(x as Tuple(Int NULL))",
+ "cast(x as Array(Int NULL))",
+ "cast(x as Map(String NULL, Int))",
+ "cast(x as Nested(a Int NULL, b String))",
+ "cast(x as FixedString(16 NULL))",
+ "cast(x as FixedString(16 INF))",
+ "cast(x as FixedString(16 NAN))",
+ "cast(x as Decimal(10 NULL, 2))",
+ "cast(x as LowCardinality(String NULL))",
+ ):
+ with self.assertRaises(ExposedHogQLError, msg=src):
+ parse_expr(src, backend="cpp-json")
+ with self.assertRaises(ExposedHogQLError, msg=src):
+ parse_expr(src, backend="rust-json")
+ # Guards: legitimate parametric type casts still parse.
+ for src in (
+ "cast(x as Tuple(Int, String))",
+ "cast(x as Array(Int))",
+ "cast(x as Map(String, Int))",
+ "cast(x as Nested(a Int, b String))",
+ "cast(x as FixedString(16))",
+ "cast(x as Decimal(10, 2))",
+ ):
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_stmt_expression_pratt_recovers_at_statement_level(self):
+ # `x *= 2` has no `*=` token: splits into two stmts (`x` and `* = 2` → Compare(Field('*'), '==', 2)).
+ cases = (
+ "x *= 2",
+ "x * = 2", # equivalent lexing
+ "let x := 1; x *= 2;",
+ )
+ for src in cases:
+ oracle = parse_program(src, backend="cpp-json")
+ got = parse_program(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ # Guards: `* = 2` is a Compare; `* 2` is two ExprStatements; `x * y` is a single multiplication.
+ for src in ("* = 2", "* 2", "x * y", "x = 2"):
+ oracle = parse_program(src, backend="cpp-json")
+ got = parse_program(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_let_decl_shortens_rhs_when_trailing_colon_equals(self):
+ # `LET ident := <expr>` has no slot for a trailing `:=`; cpp shortens the expr to its leading primary so the trailing `:=` opens a new stmt.
+ cases = (
+ "let x := 1 * 2 := 3",
+ "let x := y * (z) := 3",
+ "let x := (1) * (2) := 3",
+ )
+ for src in cases:
+ oracle = parse_program(src, backend="cpp-json")
+ got = parse_program(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ # Guards: ident-chain RHS keeps the full expression via the NamedArgument path.
+ for src in (
+ "let x := y",
+ "let x := 1 + 2",
+ "let x := y * z",
+ "let x := y * z := 1",
+ "let x := y * z := 1;",
+ ):
+ oracle = parse_program(src, backend="cpp-json")
+ got = parse_program(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_bare_assignment_lead_chains_through_second_colon_equals(self):
+ # `IDENT := <rhs> := <outer>` — the *second* `:=` is the stmt-level varAssignment; the leading `IDENT := <rhs>` becomes a NamedArgument lvalue.
+ cases = (
+ "a := 1 := 2",
+ "a := 1 * 2 := 3",
+ "a := 1 + 2 := 3",
+ "a := {} := 2",
+ "a := 'str' := 2",
+ )
+ for src in cases:
+ oracle = parse_program(src, backend="cpp-json")
+ got = parse_program(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ # Guards: existing single- and ident-chain forms.
+ for src in (
+ "a := 1",
+ "a := b",
+ "a := b := c",
+ 'a := "str" := 2',
+ "a := b := c := d",
+ "if (c) a := b",
+ "if (c) a := b ; else d",
+ ):
+ oracle = parse_program(src, backend="cpp-json")
+ got = parse_program(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_pivot_column_lhs_extends_past_in_via_infix_operators(self):
+ # `pivotColumn`'s LHS extends through ANY infix operator after an `IN(…)`; the structural IN is the LAST one not followed by an extender.
+ same_ast = (
+ # `IN` after `IN ( … )` is a Compare infix that extends LHS.
+ "SELECT * FROM t PIVOT(1 FOR a IN (b) IN (d))",
+ # Arithmetic infix extends.
+ "SELECT * FROM t PIVOT(1 FOR a IN (b) + c IN (d))",
+ "SELECT * FROM t PIVOT(1 FOR a IN (b) * c IN (d))",
+ # Boolean keyword infix extends.
+ "SELECT * FROM t PIVOT(1 FOR a IN (b) AND c IN (d))",
+ # LIKE keyword infix extends.
+ "SELECT * FROM t PIVOT(1 FOR a IN (b) LIKE c IN (d))",
+ # Postfix call still extends (pre-existing behaviour).
+ "SELECT * FROM t PIVOT(1 FOR a IN (b) (c) IN (d))",
+ # NOT is a prefix operator, not infix — it starts a new
+ # pivotColumn whose LHS is the bare keyword-as-Field `NOT`.
+ "SELECT * FROM t PIVOT(1 FOR a IN (b) NOT IN (d))",
+ # Bare identifier always starts a new pivotColumn.
+ "SELECT * FROM t PIVOT(1 FOR a IN (b) c IN (d))",
+ "SELECT * FROM t PIVOT(1 FOR a IN (b) c IN (d) e IN (f))",
+ # Single column still works.
+ "SELECT * FROM t PIVOT(1 FOR a IN (b))",
+ )
+ for src in same_ast:
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_parse_order_expr_silently_drops_trailing_tokens(self):
+ # `parse_order_expr_json` parses one OrderExpr and silently drops anything trailing (incl. INTERPOLATE, which is one level up).
+ from posthog.hogql.parser import parse_order_expr
+
+ for src in (
+ "a ASC extra",
+ "a DESC NULLS FIRST extra trailing junk",
+ "a WITH FILL INTERPOLATE (b)",
+ "a WITH FILL FROM 1 TO 10 INTERPOLATE (b)",
+ ):
+ oracle = parse_order_expr(src, backend="cpp-json")
+ got = parse_order_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_pivot_group_by_with_empty_list_rejected(self):
+ # `GROUP BY` (PIVOT-level included) requires a non-empty `columnExprList`.
+ for src in (
+ "SELECT * FROM t PIVOT(sum(a) FOR b IN (1) GROUP BY)",
+ "SELECT * FROM t PIVOT(sum(a) FOR b IN (1) GROUP BY ) AS p",
+ ):
+ with self.assertRaises(ExposedHogQLError, msg=src):
+ parse_select(src, backend="cpp-json")
+ with self.assertRaises(ExposedHogQLError, msg=src):
+ parse_select(src, backend="rust-json")
+ # Guard: the non-empty and trailing-comma forms still parse.
+ for src in (
+ "SELECT * FROM t PIVOT(sum(a) FOR b IN (1) GROUP BY a)",
+ "SELECT * FROM t PIVOT(sum(a) FOR b IN (1) GROUP BY a, c)",
+ "SELECT * FROM t PIVOT(sum(a) FOR b IN (1) GROUP BY a,)",
+ "SELECT * FROM t PIVOT(sum(a) FOR b IN (1))",
+ ):
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_return_expr_prefix_shortening_admits_keyword_head(self):
+ # A leading keyword (`return return *(...) := X`) is a valid shortening head: expr = Field(['return']), `* (...) := X` is the next stmt.
+ cases = (
+ "return return * ( 'e' ) := { }",
+ "return return * ( 'e' ) := ( 'e' )",
+ )
+ for src in cases:
+ oracle = parse_program(src, backend="cpp-json")
+ got = parse_program(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ # Guards: existing shortening shapes still work.
+ for src in (
+ "return * columns('a') := 1",
+ "return columns('a') := 1",
+ "return a := 1",
+ "return a.b := 1",
+ "return",
+ "return x",
+ "return 1 + 2",
+ ):
+ oracle = parse_program(src, backend="cpp-json")
+ got = parse_program(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_hogqlx_drops_whitespace_only_children_containing_newline(self):
+ # `HogqlxTagElementNested` drops child text runs that are all-whitespace AND contain a newline (so pretty-printed HOGQLX has no spurious Constant children).
+ for src in (
+ "<a>\n</a>",
+ "<a>\r\n</a>",
+ "<a>{x}\n</a>",
+ "<a>\n <b/>\n</a>",
+ ):
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ # Guards: pure-space/tab (no newline) and mixed-content runs are kept.
+ for src in (
+ "<a> </a>",
+ "<a>\t</a>",
+ "<a>hello world</a>",
+ "<a>\n hello \n</a>",
+ "<a></a>",
+ "<a/>",
+ ):
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_interval_combined_string_validates_count_and_unit(self):
+ # `INTERVAL '<count> <unit>'` requires an ASCII-digit count and a literal-lowercase unit; each invalid input must surface the same error string in both parsers.
+ cases = (
+ ("INTERVAL 'twenty days'", "Unsupported interval count: twenty"),
+ ("INTERVAL '-1 day'", "Unsupported interval count: -1"),
+ ("INTERVAL '1.5 days'", "Unsupported interval count: 1.5"),
+ # `stoi`'s `out_of_range::what()` differs by stdlib (libc++ adds `: out of range`, libstdc++ doesn't); match the platform-independent prefix only.
+ ("INTERVAL '99999999999999999999 day'", "Unknown error: stoi"),
+ ("INTERVAL '1 SECOND'", "Unsupported interval unit: SECOND"),
+ )
+ for src, expected_msg in cases:
+ with self.assertRaises(ExposedHogQLError, msg=src) as cpp_cm:
+ parse_expr(src, backend="cpp-json")
+ with self.assertRaises(ExposedHogQLError, msg=src) as rust_cm:
+ parse_expr(src, backend="rust-json")
+ self.assertIn(expected_msg, str(cpp_cm.exception), msg=src)
+ self.assertIn(expected_msg, str(rust_cm.exception), msg=src)
+ # Guard: valid combined-string and expr+unit forms still parse.
+ for src in ("INTERVAL '1 day'", "INTERVAL '5 days'", "INTERVAL 1 day", "INTERVAL 1 DAY"):
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_in_cohort_falls_back_to_identifier_when_rhs_missing(self):
+ # `IN COHORT` only commits when a columnExpr follows; otherwise `cohort` is the IN rhs identifier (`a IN cohort` → Compare(a, "in", Field('cohort'))).
+ for src in ("a IN COHORT", "a NOT IN COHORT", "a IN cohort"):
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ for src in (
+ "SELECT a IN COHORT, b FROM t",
+ "SELECT * FROM t WHERE x IN cohort",
+ "SELECT * FROM t WHERE x IN cohort GROUP BY y",
+ "SELECT * FROM t WHERE x IN cohort ORDER BY y",
+ "SELECT a IN cohort LIMIT 1",
+ ):
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ # Guard: when an expression-starter follows, COHORT remains the marker.
+ for src in ("a IN COHORT 1", "a IN COHORT t.id", "a NOT IN COHORT 1", "a IN cohort + 1"):
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_tuple_access_rejects_leading_zero_index(self):
+ # Postfix `.<index>` requires `DECIMAL_LITERAL`; leading-zero numbers lex as `OCTAL_PREFIX_LITERAL` and are rejected.
+ for src in (
+ "a.0123",
+ "a.01",
+ "a.000123",
+ "a?.0123",
+ "a?.01",
+ ):
+ with self.assertRaises(ExposedHogQLError, msg=src):
+ parse_expr(src, backend="cpp-json")
+ with self.assertRaises(ExposedHogQLError, msg=src):
+ parse_expr(src, backend="rust-json")
+ # Guards: single-zero, multi-digit, and float-style chains.
+ for src in ("a.0", "a.1", "a.999", "a.1.5", "a.0.5", "a?.0", "a?.1"):
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_with_cte_admits_primary_form_keywords_as_name(self):
+ # CTE names can be any keyword in `identifier` — including primary-form heads (CASE / CAST / SELECT / NOT).
+ for kw in ("select", "case", "cast", "not"):
+ src = f"WITH {kw} AS (SELECT 1) SELECT * FROM {kw}"
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ # Guard: NULL / INF / NAN / INTERSECT stay rejected — omitted from `keyword`.
+ for kw in ("null", "inf", "nan", "intersect"):
+ src = f"WITH {kw} AS (SELECT 1) SELECT * FROM {kw}"
+ with self.assertRaises(ExposedHogQLError, msg=src):
+ parse_select(src, backend="cpp-json")
+ with self.assertRaises(ExposedHogQLError, msg=src):
+ parse_select(src, backend="rust-json")
+
+ @no_memory_leak_check
+ def test_join_on_with_comma_separated_exprs_rejected(self):
+ # ON takes a comma-separated `columnExprList` per the grammar; the visitor then rejects multi-expr ON as unsupported.
+ for src in (
+ "SELECT * FROM a JOIN b ON x, y",
+ "SELECT * FROM a JOIN b ON x = y, z",
+ ):
+ with self.assertRaises(ExposedHogQLError, msg=src):
+ parse_select(src, backend="cpp-json")
+ with self.assertRaises(ExposedHogQLError, msg=src):
+ parse_select(src, backend="rust-json")
+ # Guards: single-expr ON, USING, CROSS JOIN, and comma-cross-join.
+ for src in (
+ "SELECT * FROM a JOIN b ON x",
+ "SELECT * FROM a JOIN b ON x = y",
+ "SELECT * FROM a JOIN b USING (x, y)",
+ "SELECT * FROM a CROSS JOIN b",
+ "SELECT * FROM a, b",
+ ):
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_cast_type_compound_loop_stops_at_non_identifier_keyword(self):
+ # `columnTypeExpr`'s compound alt is `identifier identifier+`; NULL / INF / NAN aren't in `identifier`, so `cast(x as Int NULL)` rejects.
+ # `Array(Int NULL)` is intentionally omitted — that routes through ColumnTypeExprParam's raw-text fallback (separate problem).
+ for src in (
+ "cast(x as Int NULL)",
+ "cast(x as Int NOT NULL)",
+ "cast(x as Int32 NULL)",
+ "cast(x as UInt64 NOT NULL)",
+ "try_cast(x as Int NULL)",
+ ):
+ with self.assertRaises(ExposedHogQLError, msg=src):
+ parse_expr(src, backend="cpp-json")
+ with self.assertRaises(ExposedHogQLError, msg=src):
+ parse_expr(src, backend="rust-json")
+ # Guards: valid compound and nested forms.
+ for src in (
+ "cast(x as Int)",
+ "cast(x as Decimal(10, 2))",
+ "cast(x as Array(Int))",
+ "cast(x as Time With Time Zone)",
+ "cast(x as Foo Bar Baz)",
+ "cast(x as Foo Not Bar)",
+ ):
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_call_arg_select_releases_when_followed_by_keyword_infix(self):
+ # `f((SELECT 1) IN [1,2])` — the first call arg is the full Compare; keyword-led infixes (IN/LIKE/IS/BETWEEN + NOT-variants) must release the SELECT-as-arg arm.
+ cases = (
+ "f((SELECT 1) IN [1, 2])",
+ "f((SELECT 1) NOT IN [1, 2])",
+ "f((SELECT 1) LIKE 'x')",
+ "f((SELECT 1) NOT LIKE 'x')",
+ "f((SELECT 1) ILIKE 'x')",
+ "f((SELECT 1) NOT ILIKE 'x')",
+ "f((SELECT 1) IS NULL)",
+ "f((SELECT 1) IS NOT NULL)",
+ "f((SELECT 1) BETWEEN 1 AND 2)",
+ "f((SELECT 1) NOT BETWEEN 1 AND 2)",
+ )
+ for src in cases:
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ # Guard: bare-SELECT call argument.
+ for src in ("f((SELECT 1))", "f(SELECT 1)"):
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_named_argument_admits_identifier_shaped_keywords(self):
+ # `ColumnExprNamedArg: identifier COLONEQUALS columnExpr` — `true`/`false` are plain IDENTIFIERs in the lexer; soft keywords pass via `keyword`.
+ cases = (
+ "f(true := 1)",
+ "f(false := 1)",
+ "f(select := 1)",
+ "f(return := 1)",
+ # quoted-ident path stays the same
+ 'f("x" := 1)',
+ "f(x := 1)",
+ )
+ for src in cases:
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ # Guard: NULL / INF / NAN aren't in `identifier`, so they stay rejected.
+ for src in ("f(null := 1)", "f(inf := 1)", "f(nan := 1)"):
+ with self.assertRaises(ExposedHogQLError, msg=src):
+ parse_expr(src, backend="cpp-json")
+ with self.assertRaises(ExposedHogQLError, msg=src):
+ parse_expr(src, backend="rust-json")
+
+ @no_memory_leak_check
+ def test_null_inf_nan_rejected_in_hog_identifier_slots(self):
+ # `varDecl`, `funcStmt`, `catchBlock`, `forInStmt`, and lambda heads all route through `identifier`, which omits NULL / INF / NAN / Hog-stmt keywords.
+ program_cases = (
+ "let null := 1",
+ "let inf := 1",
+ "let nan := 1",
+ "for (let null in xs) {}",
+ "for (let a, null in xs) {}",
+ "fn null() {}",
+ "fn f(null) {}",
+ "fn f(inf) {}",
+ "fn f(nan) {}",
+ "fun null() {}",
+ "fun f(null) {}",
+ "try {} catch (null) {}",
+ "try {} catch (e: null) {}",
+ "try {} catch (null: T) {}",
+ "try {} catch (inf) {}",
+ "(null) -> 1",
+ "(a, null) -> 1",
+ "null -> 1",
+ "lambda null: 1",
+ "lambda a, null: 1",
+ )
+ for src in program_cases:
+ with self.assertRaises(ExposedHogQLError, msg=src):
+ parse_program(src, backend="cpp-json")
+ with self.assertRaises(ExposedHogQLError, msg=src):
+ parse_program(src, backend="rust-json")
+ # Guards: identifier-shaped slots still parse.
+ valid_cases = (
+ ("let true := 1", "program"),
+ ("let select := 1", "program"),
+ ("for (let k, v in xs) {}", "program"),
+ ("fn f(x, y) {}", "program"),
+ ("try {} catch (e) {}", "program"),
+ ("try {} catch (e: T) {}", "program"),
+ ("(x, y) -> x + y", "expr"),
+ ("x -> x", "expr"),
+ ("lambda x: x", "expr"),
+ )
+ for src, kind in valid_cases:
+ parse_fn = parse_program if kind == "program" else parse_expr
+ oracle = parse_fn(src, backend="cpp-json")
+ got = parse_fn(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_true_false_admitted_as_identifier_in_chain_and_table_positions(self):
+ # `true`/`false` are plain IDENTIFIERs in the lexer; they lift to Bool Constants only in the bare-Field branch.
+ expr_cases = ("x.true", "x.false", "x.true.false")
+ for src in expr_cases:
+ oracle = parse_expr(src, backend="cpp-json")
+ got = parse_expr(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ select_cases = (
+ "SELECT * FROM x.true",
+ "SELECT * FROM x.false",
+ "WITH x(true, false) AS (SELECT 1, 2) SELECT * FROM x",
+ )
+ for src in select_cases:
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_join_constraint_rejected_on_lead_table_and_cross_join(self):
+ # `joinConstraintClause` attaches to `JoinExprOp` / `JoinExprPositional` only — not to the lead `JoinExprTable` or `JoinExprCrossOp`.
+ for src in (
+ "SELECT * FROM t USING (a)",
+ "SELECT * FROM t USING (a, b)",
+ "SELECT * FROM t ON 1",
+ "SELECT * FROM t AS x FINAL USING (a)",
+ "SELECT * FROM (SELECT 1) USING (a)",
+ "SELECT * FROM numbers(10) USING (a)",
+ "SELECT * FROM t SAMPLE 0.5 ON 1",
+ "SELECT * FROM t FINAL ON 1",
+ "SELECT 1 FROM a CROSS JOIN b ON 1",
+ "SELECT 1 FROM a CROSS JOIN b USING (x)",
+ # Parens-wrapped JoinExpr: constraints can't penetrate / attach to lead.
+ "SELECT * FROM (a JOIN b) ON 1",
+ "SELECT * FROM (a JOIN b) USING (x)",
+ "SELECT * FROM (a JOIN b) JOIN c ON 1 ON 2",
+ # Stacked overflow: more ONs than fillable JOINs.
+ "SELECT * FROM a JOIN b ON 1 ON 2",
+ "SELECT * FROM a JOIN b JOIN c JOIN d ON 1 ON 2 ON 3 ON 4",
+ # Mixed CROSS in chain: constraint can't fall through.
+ "SELECT * FROM a JOIN b ON 1 CROSS JOIN c ON 2",
+ ):
+ with self.assertRaises(ExposedHogQLError, msg=src):
+ parse_select(src, backend="cpp-json")
+ with self.assertRaises(ExposedHogQLError, msg=src):
+ parse_select(src, backend="rust-json")
+ # Guards: regular JOIN+constraint, stacked ON chains, bare CROSS JOIN, and statement-level `USING SAMPLE` (peel loop must not intercept).
+ for src in (
+ "SELECT * FROM a JOIN b ON 1",
+ "SELECT * FROM a JOIN b USING (x)",
+ "SELECT * FROM a LEFT JOIN b ON 1",
+ "SELECT * FROM a CROSS JOIN b",
+ "SELECT * FROM a JOIN b JOIN c ON 1 ON 2",
+ "SELECT * FROM a JOIN b JOIN c JOIN d ON 1 ON 2 ON 3",
+ "SELECT * FROM t USING SAMPLE 0.5",
+ "SELECT * FROM t USING SAMPLE 0.5 OFFSET 0.1",
+ # Outer JOIN around a parens-wrapped inner JoinExpr still attaches one constraint at the outer level.
+ "SELECT * FROM (a JOIN b) JOIN c ON 1",
+ "SELECT * FROM a JOIN (b JOIN c ON 1) ON 2",
+ # `sample` as an ident inside USING(…) — the `(` follow-token defers to the constraint parser, not the USING-SAMPLE guard.
+ "SELECT * FROM a JOIN b USING (sample)",
+ ):
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
+ @no_memory_leak_check
+ def test_columns_exclude_replace_reject_reserved_keywords(self):
+ # `columnsExcludeItem` and `columnsReplaceItem` use the strict `identifier` rule (excludes NULL/INF/NAN/EXCEPT/INTERSECT + Hog-stmt keywords).
+ for src in (
+ "SELECT * EXCLUDE (null) FROM t",
+ "SELECT * EXCLUDE (inf) FROM t",
+ "SELECT * EXCLUDE (nan) FROM t",
+ "SELECT COLUMNS(* EXCLUDE (null)) FROM t",
+ "SELECT COLUMNS(* REPLACE (a AS null)) FROM t",
+ "SELECT COLUMNS(* REPLACE (a AS inf)) FROM t",
+ "SELECT COLUMNS(* REPLACE (a AS nan)) FROM t",
+ ):
+ with self.assertRaises(ExposedHogQLError, msg=src):
+ parse_select(src, backend="cpp-json")
+ with self.assertRaises(ExposedHogQLError, msg=src):
+ parse_select(src, backend="rust-json")
+ # Guards: identifier-shaped EXCLUDE / REPLACE with admissible alias.
+ for src in (
+ "SELECT * EXCLUDE (a) FROM t",
+ "SELECT * EXCLUDE (a.b) FROM t",
+ "SELECT COLUMNS(* REPLACE (a AS b)) FROM t",
+ ):
+ oracle = parse_select(src, backend="cpp-json")
+ got = parse_select(src, backend=backend)
+ self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+
return TestParser
diff --git a/posthog/hogql/test/test_parser_cpp_bug_xfails.py b/posthog/hogql/test/test_parser_cpp_bug_xfails.py
new file mode 100644
index 000000000000..bd37139e262d
--- /dev/null
+++ b/posthog/hogql/test/test_parser_cpp_bug_xfails.py
@@ -0,0 +1,50 @@
+"""Documented divergences where the C++ ANTLR parser misbehaves and the Rust hand-roll is correct.
+
+Each test asserts the *eventual* desired behaviour — typically that both backends produce the same AST.
+Today the C++ side diverges, so the assertion fails and the test is decorated `@unittest.expectedFailure`.
+When the C++ parser is fixed and the assertion passes, pytest reports XPASS — which becomes a failure
+under `unittest`'s `expectedFailure` semantics — and that's the signal to delete the xfail test and
+verify cpp matches rust.
+
+Keep one test per cpp bug. Each test's docstring explains:
+
+ 1. What the source string is.
+ 2. What C++ currently does (the bug).
+ 3. What Rust does (the correct behaviour).
+ 4. Why C++ is wrong (grammar / visitor reference).
+
+For Rust-correctness regression tests (where Rust used to be wrong and we fixed it), see the
+parity-regression tests in `_test_parser.py`. This file is the inverse: regressions for *C++* whose
+AST the Rust port deliberately does not bug-match.
+"""
+
+import unittest
+from posthog.test.base import BaseTest
+
+from posthog.hogql.parser import parse_select
+from posthog.hogql.visitor import clear_locations
+
+
+class TestParserCppBugXfails(BaseTest):
+ maxDiff = None
+
+ @unittest.expectedFailure
+ def test_sample_after_unpivot_on_join_expr_parens(self):
+ # `select 1 from (a positional join b) unpivot (m for n in (o)) sample 0.5`
+ # cpp: silently drops the trailing `SAMPLE 0.5`. ANTLR parses cleanly — the grammar admits
+ # `sampleClause` in three positions: at joinExpr level via `JoinExprTable: tableExpr FINAL?
+ # sampleClause?` (alt 124) and at selectStmt level via `(USING? sampleClause)?` (HogQLParser.g4
+ # lines 75 and 79). For this input, `(a positional join b)` is a JoinExprParens (alt 125), then
+ # `JoinExprUnpivot` (alt 123) wraps it — that's a joinExpr, not a tableExpr, so the SAMPLE
+ # lands at the selectStmt slot instead. The bug is in the visitor: `VISIT(SelectStmt)` in
+ # `parser_json.cpp` never calls `ctx->sampleClause()`, so the parsed SAMPLE subtree is
+ # silently dropped from the emitted JSON. The only `ctx->sampleClause()` call in the whole
+ # visitor is inside `VISIT(JoinExprTable)` (joinExpr-level only).
+ # rust: attaches the SAMPLE to the outer JoinExpr's `.sample` field, preserving the user's
+ # SAMPLE intent. When cpp's `VISIT(SelectStmt)` is taught to visit `ctx->sampleClause()`
+ # (follow-up), both backends will agree on a shape (either rust's or a third-place
+ # attachment) and this test starts XPASSing — that's the signal to delete it.
+ q = "select 1 from (a positional join b) unpivot (m for n in (o)) sample 0.5"
+ cpp_ast = clear_locations(parse_select(q, backend="cpp-json"))
+ rust_ast = clear_locations(parse_select(q, backend="rust-json"))
+ self.assertEqual(cpp_ast, rust_ast)
diff --git a/posthog/hogql/test/test_parser_mode.py b/posthog/hogql/test/test_parser_mode.py
new file mode 100644
index 000000000000..8916cd4f739e
--- /dev/null
+++ b/posthog/hogql/test/test_parser_mode.py
@@ -0,0 +1,141 @@
+from posthog.test.base import BaseTest
+from unittest.mock import patch
+
+from parameterized import parameterized
+
+from posthog.schema import ParserMode
+
+from posthog.hogql import ast
+from posthog.hogql.parser import HogQLParserShadowMismatch, _resolve_parser_mode, parse_select
+
+
+class TestParserMode(BaseTest):
+ @parameterized.expand(
+ [
+ # An absent modifier in TEST defaults to CPP_WITH_RUST_SHADOW so
+ # every test-suite parse exercises both backends and raises on
+ # divergence (see `_run_shadow_comparison`).
+ (None, ("cpp-json", "rust-json")),
+ (ParserMode.CPP_ONLY, ("cpp-json", None)),
+ (ParserMode.RUST_ONLY, ("rust-json", None)),
+ (ParserMode.CPP_WITH_RUST_SHADOW, ("cpp-json", "rust-json")),
+ (ParserMode.RUST_WITH_CPP_SHADOW, ("rust-json", "cpp-json")),
+ ]
+ )
+ def test_resolve_parser_mode(self, mode, expected):
+ self.assertEqual(_resolve_parser_mode(mode, "cpp-json"), expected)
+
+ def test_resolve_parser_mode_honours_explicit_backend_when_absent(self):
+ # With no modifier the `backend=` override still wins — this is the
+ # path the test/diagnostic harness relies on. Even in TEST, an
+ # explicit non-default backend disables the auto-shadow.
+ self.assertEqual(_resolve_parser_mode(None, "rust-json"), ("rust-json", None))
+
+ def test_resolve_parser_mode_prod_absent_modifier_no_shadow(self):
+ # The TEST-only auto-shadow is gated on `settings.TEST`; with that
+ # flag off (i.e. production) an absent modifier means "no shadow".
+ with patch("posthog.hogql.parser.settings") as mock_settings:
+ mock_settings.TEST = False
+ self.assertEqual(_resolve_parser_mode(None, "cpp-json"), ("cpp-json", None))
+
+ def test_shadow_silent_when_backends_agree(self):
+ # A `*_shadow` mode parses with the shadow backend on every sampled
+ # query; when the ASTs match, nothing is reported.
+ with patch("posthog.hogql.parser._SHADOW_SAMPLE_RATE", 1.0):
+ with patch("posthog.hogql.parser.capture_exception") as captured:
+ node = parse_select("select 1 from events", parser_mode=ParserMode.CPP_WITH_RUST_SHADOW)
+ self.assertIsInstance(node, ast.SelectQuery)
+ captured.assert_not_called()
+
+ def test_shadow_raises_mismatch_in_test_mode(self):
+ # In TEST the shadow comparison raises on divergence, so a test
+ # whose parser produces a mismatched AST fails loudly. Only the
+ # shadow backend is forced to diverge; the primary still parses
+ # for real.
+ from posthog.hogql import parser as parser_module
+
+ decoy = ast.SelectQuery(select=[ast.Constant(value=999)])
+ real_invoke = parser_module._invoke_parser
+
+ def only_shadow_diverges(backend, rule, statement, start):
+ if backend == "rust-json":
+ return decoy
+ return real_invoke(backend, rule, statement, start)
+
+ with patch("posthog.hogql.parser._invoke_parser", side_effect=only_shadow_diverges):
+ with self.assertRaises(HogQLParserShadowMismatch):
+ parse_select(
+ "select shadow_mismatch_probe from events",
+ parser_mode=ParserMode.CPP_WITH_RUST_SHADOW,
+ )
+
+ def test_shadow_reports_mismatch_without_failing_in_prod(self):
+ # In production (`settings.TEST = False`) the shadow comparison
+ # captures the mismatch to error tracking and returns the primary
+ # result — never raises into a request.
+ from posthog.hogql import parser as parser_module
+
+ decoy = ast.SelectQuery(select=[ast.Constant(value=999)])
+ real_invoke = parser_module._invoke_parser
+
+ def only_shadow_diverges(backend, rule, statement, start):
+ if backend == "rust-json":
+ return decoy
+ return real_invoke(backend, rule, statement, start)
+
+ with patch("posthog.hogql.parser._SHADOW_SAMPLE_RATE", 1.0):
+ with patch("posthog.hogql.parser.settings") as mock_settings:
+ mock_settings.TEST = False
+ with patch("posthog.hogql.parser._invoke_parser", side_effect=only_shadow_diverges):
+ with patch("posthog.hogql.parser.capture_exception") as captured:
+ node = parse_select(
+ "select shadow_mismatch_probe from events",
+ parser_mode=ParserMode.CPP_WITH_RUST_SHADOW,
+ )
+ self.assertIsInstance(node, ast.SelectQuery)
+ captured.assert_called_once()
+ self.assertIsInstance(captured.call_args.args[0], HogQLParserShadowMismatch)
+
+ def test_rust_only_parses_through_the_rust_backend(self):
+ # `rust_only` routes the parse entirely through the Rust backend.
+ node = parse_select("select a, b from events where a > 1", parser_mode=ParserMode.RUST_ONLY)
+ self.assertIsInstance(node, ast.SelectQuery)
+
+ def test_shadow_raises_parser_class_throw_in_test_mode(self):
+ # A `BaseHogQLError` from the shadow backend means it rejected what
+ # the primary accepted — a real parser regression. Propagate in TEST
+ # so a unit-suite parse hitting the regression fails loudly.
+ from posthog.hogql import parser as parser_module
+ from posthog.hogql.errors import SyntaxError as HogQLSyntaxError
+
+ real_invoke = parser_module._invoke_parser
+
+ def shadow_throws_parser_class(backend, rule, statement, start):
+ if backend == "rust-json":
+ raise HogQLSyntaxError("simulated rust-json regression")
+ return real_invoke(backend, rule, statement, start)
+
+ with patch("posthog.hogql.parser._invoke_parser", side_effect=shadow_throws_parser_class):
+ with patch("posthog.hogql.parser.capture_exception"):
+ with self.assertRaises(HogQLSyntaxError):
+ parse_select("select 1 from events", parser_mode=ParserMode.CPP_WITH_RUST_SHADOW)
+
+ def test_shadow_swallows_packaging_class_throw_in_test_mode(self):
+ # A non-BaseHogQLError exception (ImportError, RuntimeError from a
+ # broken wheel, PyO3 panic) is treated as a packaging issue — never
+ # propagates, even in TEST. Captures + counts.
+ from posthog.hogql import parser as parser_module
+
+ real_invoke = parser_module._invoke_parser
+
+ def shadow_throws_packaging(backend, rule, statement, start):
+ if backend == "rust-json":
+ raise ImportError("simulated wheel failure")
+ return real_invoke(backend, rule, statement, start)
+
+ with patch("posthog.hogql.parser._invoke_parser", side_effect=shadow_throws_packaging):
+ with patch("posthog.hogql.parser.capture_exception") as captured:
+ node = parse_select("select 1 from events", parser_mode=ParserMode.CPP_WITH_RUST_SHADOW)
+ self.assertIsInstance(node, ast.SelectQuery)
+ captured.assert_called_once()
+ self.assertIsInstance(captured.call_args.args[0], ImportError)
diff --git a/posthog/hogql/test/test_parser_rust_json.py b/posthog/hogql/test/test_parser_rust_json.py
new file mode 100644
index 000000000000..4f6aab4924c2
--- /dev/null
+++ b/posthog/hogql/test/test_parser_rust_json.py
@@ -0,0 +1,32 @@
+"""Tests for the hand-rolled Rust HogQL parser (`rust-json` backend).
+
+The full parser-behaviour suite lives in `_test_parser.py` and runs
+against every backend via `parser_test_factory`. This file only wires
+the `rust-json` backend into that suite and lists the cases the Rust
+parser does not yet match the C++ reference on.
+"""
+
+from ._test_parser import parser_test_factory
+
+# Cases the Rust parser does not yet match C++ on, tracked for follow-up:
+# - promoted_assignment_target_carries_position: the Rust parser does
+# not yet emit per-node source positions (`start` / `end`) at all —
+# every node comes back position-less. The shared suite tolerates
+# this via `clear_locations`, but this test inspects raw positions.
+# Closing it means threading byte offsets through the whole emit
+# layer — a feature in its own right, not a local fix.
+_DEFERRED_EXACT: set[str] = {
+ "test_promoted_assignment_target_carries_position",
+}
+
+
+class TestParserRustJson(parser_test_factory("rust-json")): # type: ignore
+ def setUp(self) -> None:
+ super().setUp()
+ if self._testMethodName in _DEFERRED_EXACT:
+ self.skipTest("not yet matched by rust-json")
+
+ def test_empty(self):
+ # this test only exists to make pycharm recognise this class as a test class
+ # the actual tests are in the parent class
+ pass
diff --git a/posthog/schema.py b/posthog/schema.py
index 7858f3b7e6f6..b179a1e0097e 100644
--- a/posthog/schema.py
+++ b/posthog/schema.py
@@ -2586,6 +2586,13 @@ class MaterializedColumnsOptimizationMode(StrEnum):
OPTIMIZED = "optimized"
+class ParserMode(StrEnum):
+ CPP_ONLY = "cpp_only"
+ CPP_WITH_RUST_SHADOW = "cpp_with_rust_shadow"
+ RUST_WITH_CPP_SHADOW = "rust_with_cpp_shadow"
+ RUST_ONLY = "rust_only"
+
+
class PersonsArgMaxVersion(StrEnum):
AUTO = "auto"
V1 = "v1"
@@ -7300,6 +7307,14 @@ class HogQLQueryModifiers(BaseModel):
materializedColumnsOptimizationMode: MaterializedColumnsOptimizationMode | None = None
optimizeJoinedFilters: bool | None = None
optimizeProjections: bool | None = None
+ parserMode: ParserMode | None = Field(
+ default=None,
+ description=(
+ "HogQL parser backend; absent → `cpp_only`. `*_shadow` modes return the"
+ " primary result and sample-compare against the other parser, reporting"
+ " divergences without failing the request."
+ ),
+ )
personsArgMaxVersion: PersonsArgMaxVersion | None = None
personsJoinMode: PersonsJoinMode | None = None
personsOnEventsMode: PersonsOnEventsMode | None = None
diff --git a/posthog/test/base.py b/posthog/test/base.py
index 3eecdf862d76..ed307448531f 100644
--- a/posthog/test/base.py
+++ b/posthog/test/base.py
@@ -784,6 +784,20 @@ class PostHogTestCase(SimpleTestCase):
func(*args, **kwargs)
+def no_memory_leak_check(method):
+ """Skip the `MemoryLeakTestMixin` re-run-and-measure loop for this test.
+
+ Use on tests whose body is intrinsically noisy from the mixin's
+ point of view — typically tests that assert a parser raises with a
+ verbose error string (the cpp backend's ANTLR error messages
+ accumulate per-call and trip the per-parse byte limit even though
+ nothing leaks). The decorated test method still runs, just once,
+ and skips the priming / measurement loop entirely.
+ """
+ method._no_memory_leak_check = True
+ return method
+
+
class MemoryLeakTestMixin:
MEMORY_INCREASE_PER_PARSE_LIMIT_B: int
"""Parsing more than once can never increase memory by this much (on average)"""
@@ -795,6 +809,10 @@ class MemoryLeakTestMixin:
"""How many times to run every test method to check for memory leaks"""
def _callTestMethod(self, method):
+ # Tests marked `@no_memory_leak_check` run once, no priming/measure loop.
+ if getattr(method, "_no_memory_leak_check", False):
+ method()
+ return
test_case = cast(unittest.TestCase, self)
mem_original_b = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
for _ in range(self.MEMORY_PRIMING_RUNS_N): # Priming runs
diff --git a/products/product_analytics/frontend/generated/api.schemas.ts b/products/product_analytics/frontend/generated/api.schemas.ts
index 2493a2ab14ec..c78a24d7ff43 100644
--- a/products/product_analytics/frontend/generated/api.schemas.ts
+++ b/products/product_analytics/frontend/generated/api.schemas.ts
@@ -351,6 +351,15 @@ export const MaterializedColumnsOptimizationModeApi = {
Optimized: 'optimized',
} as const
+export type ParserModeApi = (typeof ParserModeApi)[keyof typeof ParserModeApi]
+
+export const ParserModeApi = {
+ CppOnly: 'cpp_only',
+ CppWithRustShadow: 'cpp_with_rust_shadow',
+ RustWithCppShadow: 'rust_with_cpp_shadow',
+ RustOnly: 'rust_only',
+} as const
+
export type PersonsArgMaxVersionApi = (typeof PersonsArgMaxVersionApi)[keyof typeof PersonsArgMaxVersionApi]
export const PersonsArgMaxVersionApi = {
@@ -415,6 +424,8 @@ export interface HogQLQueryModifiersApi {
materializedColumnsOptimizationMode?: MaterializedColumnsOptimizationModeApi | null
optimizeJoinedFilters?: boolean | null
optimizeProjections?: boolean | null
+ /** HogQL parser backend; absent → `cpp_only`. `*_shadow` modes return the primary result and sample-compare against the other parser, reporting divergences without failing the request. */
+ parserMode?: ParserModeApi | null
personsArgMaxVersion?: PersonsArgMaxVersionApi | null
personsJoinMode?: PersonsJoinModeApi | null
personsOnEventsMode?: PersonsOnEventsModeApi | null
diff --git a/pyproject.toml b/pyproject.toml
index 7b10f7fc59df..394ad4e0de33 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -67,7 +67,8 @@ dependencies = [
"grimp~=3.14",
"grpcio~=1.71.0",
"gspread==6.2.1",
- "hogql-parser==1.3.53",
+ "hogql-parser==1.3.65",
+ "hogql-parser-rs==1.3.69", # built from rust/hogql/parser via the build-hogql-parser-rs workflow + published to PyPI; rebuild locally with `uv pip install -e rust/hogql/parser` when iterating
"humanize~=4.12.3",
"infi-clickhouse-orm",
"jsonref==1.1.0",
@@ -279,7 +280,7 @@ sentiment = [
required-version = "~=0.10.2"
add-bounds = "major"
exclude-newer = "7 days"
-exclude-newer-package = { hogql-parser = false, posthoganalytics = false, pixelhog = false, django = false }
+exclude-newer-package = { hogql-parser = false, hogql-parser-rs = false, posthoganalytics = false, pixelhog = false, django = false }
constraint-dependencies = [
"langgraph-checkpoint<3",
]
diff --git a/rust/Cargo.lock b/rust/Cargo.lock
index d38c09c6d723..912a4eae387e 100644
--- a/rust/Cargo.lock
+++ b/rust/Cargo.lock
@@ -4140,6 +4140,14 @@ dependencies = [
"digest",
]
+[[package]]
+name = "hogql_parser_rs"
+version = "1.3.69"
+dependencies = [
+ "pyo3",
+ "serde_json",
+]
+
[[package]]
name = "hogvm"
version = "0.1.0"
@@ -4696,6 +4704,15 @@ dependencies = [
"serde_core",
]
+[[package]]
+name = "indoc"
+version = "2.0.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706"
+dependencies = [
+ "rustversion",
+]
+
[[package]]
name = "inferno"
version = "0.11.21"
@@ -7612,6 +7629,69 @@ dependencies = [
"pulldown-cmark",
]
+[[package]]
+name = "pyo3"
+version = "0.22.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f402062616ab18202ae8319da13fa4279883a2b8a9d9f83f20dbade813ce1884"
+dependencies = [
+ "cfg-if",
+ "indoc",
+ "libc",
+ "memoffset",
+ "once_cell",
+ "portable-atomic",
+ "pyo3-build-config",
+ "pyo3-ffi",
+ "pyo3-macros",
+ "unindent",
+]
+
+[[package]]
+name = "pyo3-build-config"
+version = "0.22.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b14b5775b5ff446dd1056212d778012cbe8a0fbffd368029fd9e25b514479c38"
+dependencies = [
+ "once_cell",
+ "target-lexicon",
+]
+
+[[package]]
+name = "pyo3-ffi"
+version = "0.22.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9ab5bcf04a2cdcbb50c7d6105de943f543f9ed92af55818fd17b660390fc8636"
+dependencies = [
+ "libc",
+ "pyo3-build-config",
+]
+
+[[package]]
+name = "pyo3-macros"
+version = "0.22.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0fd24d897903a9e6d80b968368a34e1525aeb719d568dba8b3d4bfa5dc67d453"
+dependencies = [
+ "proc-macro2",
+ "pyo3-macros-backend",
+ "quote",
+ "syn 2.0.117",
+]
+
+[[package]]
+name = "pyo3-macros-backend"
+version = "0.22.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "36c011a03ba1e50152b4b394b479826cad97e7a21eb52df179cd91ac411cbfbe"
+dependencies = [
+ "heck",
+ "proc-macro2",
+ "pyo3-build-config",
+ "quote",
+ "syn 2.0.117",
+]
+
[[package]]
name = "pyroscope"
version = "0.5.8"
@@ -9879,6 +9959,12 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
+[[package]]
+name = "target-lexicon"
+version = "0.12.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
+
[[package]]
name = "tempfile"
version = "3.26.0"
@@ -10738,6 +10824,12 @@ version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
+[[package]]
+name = "unindent"
+version = "0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
+
[[package]]
name = "unsafe-libyaml"
version = "0.2.11"
diff --git a/rust/Cargo.toml b/rust/Cargo.toml
index 579a54052f8f..395b07caeafd 100644
--- a/rust/Cargo.toml
+++ b/rust/Cargo.toml
@@ -38,6 +38,7 @@ members = [
"embedding-worker",
"common/geoip",
"common/hogvm",
+ "hogql/parser",
"kafka-assigner",
"kafka-assigner-proto",
"ingestion-consumer",
diff --git a/rust/hogql/parser/Cargo.toml b/rust/hogql/parser/Cargo.toml
new file mode 100644
index 000000000000..9cd88412cb5c
--- /dev/null
+++ b/rust/hogql/parser/Cargo.toml
@@ -0,0 +1,24 @@
+[package]
+name = "hogql_parser_rs"
+# Track the cpp parser in `common/hogql_parser/setup.py` — both ship as
+# wheels named after the same HogQL grammar revision, so versions move in
+# lockstep.
+version = "1.3.69"
+edition = "2021"
+publish = false
+
+[lib]
+name = "hogql_parser_rs"
+# `cdylib` for the Python wheel that maturin builds; `rlib` so other Rust
+# crates in the workspace can depend on the parser as a library if useful
+# later. `cdylib` alone would break that.
+crate-type = ["cdylib", "rlib"]
+
+[lints]
+workspace = true
+
+[dependencies]
+serde_json.workspace = true
+# `abi3-py312` lets one wheel work on every Python 3.12+ via the stable
+# CPython ABI — avoids shipping a separate wheel per minor Python.
+pyo3 = { version = "0.22", features = ["extension-module", "abi3-py312"] }
diff --git a/rust/hogql/parser/README.md b/rust/hogql/parser/README.md
new file mode 100644
index 000000000000..bf24a925ee11
--- /dev/null
+++ b/rust/hogql/parser/README.md
@@ -0,0 +1,371 @@
+# hogql_parser_rs
+
+Hand-rolled Rust HogQL parser. Pratt + recursive descent. Same JSON AST
+shape as the [C++ ANTLR parser](../../../common/hogql_parser/) so the
+two can be cross-validated query-by-query. Ships as a Python extension
+via `maturin` and is selected as the `rust-json` backend in
+[`posthog/hogql/parser.py`](../../../posthog/hogql/parser.py).
+
+About **15× faster than the C++ parser on `parse_expr`** and **50–55×
+on `parse_select`**, against the same input, on the same machine. The
+numbers come from `posthog/hogql/scripts/parser_bench.py`; re-run
+locally before and after any non-trivial change.
+
+## The C++ parser is the source of truth
+
+When grammar, AST shape, or any visible behaviour disagrees between
+the two, the C++ ANTLR parser is right and this one is wrong. The C++
+parser is generated from
+[`posthog/hogql/grammar/HogQLLexer.*.g4`](../../../posthog/hogql/grammar/HogQLParser.g4)
+
++ `HogQLParser.g4` via ANTLR4. The Rust parser does not consume those
+grammar files; it hand-implements the same recognition behaviour.
+
+This means any grammar change is a **two-step** change:
+
+1. **Update the ANTLR grammar and rebuild the C++ parser.** Get the
+ new shape working end-to-end on `cpp-json`. Pin the new behaviour
+ with regression tests (see "Tools" below).
+
+2. **Bring the Rust parser to parity.** Run the diagnostics, find the
+ new divergences, fix them. This is the part an LLM agent can drive
+ in a long-running loop.
+
+Skipping step 1 produces a Rust parser that "works" but on a shape
+the C++ parser rejects, which means Cloud's printer / planner will
+reject too, because they're built on top of `cpp-json`'s output. Get
+the oracle right first, then the candidate.
+
+## What's in this crate
+
+| Path | What it does |
+| ----------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| [`src/lib.rs`](src/lib.rs) | PyO3 entry points (`parse_expr_json`, `parse_select_json`, `parse_program_json`, `parse_order_expr_json`, `parse_full_template_string_json`). Each returns a JSON string; on error the JSON is an `{"error": true, ...}` envelope `posthog/hogql/json_ast.py` decodes into `HogQLSyntaxError` / `ExposedHogQLError`. |
+| [`src/lex.rs`](src/lex.rs) | Lexer. Hand-rolled state machine matching the ANTLR-generated C++ lexer's tokens + mode stack (default / template-string / HogQLX-tag / HogQLX-text). When you add a new keyword to the grammar, add it here too. |
+| [`src/parse.rs`](src/parse.rs) | Parser core: `Parser` struct, public entry points, the Pratt expression parser (`parse_expr_bp`), positions (`pos_obj`, `wrap_pos`, `wrap_pos_to`), char-offset / line-col tables, `checkpoint` / `restore` for speculative branches. |
+| `src/parse/{expr,select,program,join,cte,hogqlx,template}.rs` | Per-rule parsing. Most grammar changes land in one of these. |
+| [`src/parse/bp.rs`](src/parse/bp.rs) | Binding-power table + `build_infix` / `merge_and_or` / `merge_concat`. The precedence ladder lives here; new operators usually need an entry in `infix_bp` and a `build_infix` arm. |
+| [`src/emit.rs`](src/emit.rs) | AST-node builders + position helpers (`with_pos` is idempotent, `replace_pos` overrides, `no_pos` reserves null keys to opt out of the wrap). When you add a new AST node, add a helper here so callers don't hand-build the JSON object. |
+| [`src/error.rs`](src/error.rs) | `ParseError` + the JSON error envelope. |
+
+## Building locally
+
+```bash
+# One-time: install the rust toolchain via flox / rustup (the workspace
+# Cargo.toml is at `rust/Cargo.toml`).
+
+# Build + install the wheel into the venv (editable). Re-run after each
+# rust source change.
+uv pip install -e rust/hogql/parser
+
+# Or via maturin directly (faster incremental):
+maturin develop --release --manifest-path rust/hogql/parser/Cargo.toml
+
+# Sanity check
+python -c "import hogql_parser_rs; print(hogql_parser_rs.parse_expr_json('1 + 2'))"
+```
+
+`maturin` builds a single `cp312-abi3` wheel that works on Python
+3.12+. CI builds wheels for Linux x86_64/aarch64 (manylinux 2_28 +
+musllinux 1_2) and macOS arm64/x86_64; see
+[`.github/workflows/build-hogql-parser-rs.yml`](../../../.github/workflows/build-hogql-parser-rs.yml).
+
+## Publishing
+
+The crate is pinned via the `hogql-parser-rs==X.Y.Z` line in the
+repo-root [`pyproject.toml`](../../../pyproject.toml). Bump the
+version in **both**:
+
++ [`Cargo.toml`](Cargo.toml)
++ [`pyproject.toml`](pyproject.toml)
+
+(They must match. The PR check at
+[`.github/workflows/build-hogql-parser-rs.yml`](../../../.github/workflows/build-hogql-parser-rs.yml)
+enforces this.)
+
+Version is intentionally locked in step with
+[`common/hogql_parser`](../../../common/hogql_parser) (the C++ parser
+PyPI package) so a bump signals "both parsers move together." The
+publish workflow builds wheels, pushes to PyPI via trusted publishing,
+then opens a follow-up PR that updates the repo-root pin.
+
+## Adding a new grammar feature
+
+Steps 1–4 are the one-time grammar-update process — done once,
+human-driven. Step 5 (running the parity loop below) is the
+long-running, agent-friendly part.
+
+1. **Update [`HogQLLexer.*.g4`](../../../posthog/hogql/grammar/) and
+ [`HogQLParser.g4`](../../../posthog/hogql/grammar/HogQLParser.g4).**
+ Run `pnpm grammar:build` to regenerate the Python and C++ ANTLR
+ artefacts:
+
+ ```bash
+ pnpm grammar:build
+ ```
+
+ That step requires the `antlr` 4.13.2 binary on `PATH`;
+ instructions in
+ [`posthog/hogql/grammar/README.md`](../../../posthog/hogql/grammar/README.md).
+ The script rewrites `common/hogql_parser/HogQL{Lexer,Parser}.{cpp,h,interp,tokens}`
+ and the matching Python files. Both backends now recognise the
+ new shape.
+
+2. **Pick the AST emission.** Decide what JSON the cpp visitor should
+ return for the new shape. Either reuse an existing AST node or add
+ a new one in `posthog/hogql/ast.py`. The Python AST is shared
+ between backends, so any new node has to land there first, otherwise
+ `posthog/hogql/json_ast.py::deserialize_ast` will crash on it.
+
+3. **Update the cpp visitor.** Add the `VISIT(YourNewRule)` arm in
+ [`common/hogql_parser/parser_json.cpp`](../../../common/hogql_parser/parser_json.cpp).
+ Mirror cpp's conventions: call `addPositionInfo(json, ctx)` per
+ rule unless you specifically want a position-less node (see
+ "Position parity" below). Rebuild the cpp wheel
+ (`pip install ./common/hogql_parser`).
+
+4. **Pin the new behaviour with a regression test.** Add a test (and a
+ rust-rejects-it negative test if the grammar tightens) into the
+ `parser_test_factory` suite in
+ [`posthog/hogql/test/_test_parser.py`](../../../posthog/hogql/test/_test_parser.py).
+ The factory runs every test against `cpp-json`, `rust-json`, and
+ `python`; on a fresh grammar change the test passes on cpp and
+ fails on rust. That fail is the starting state for the parity
+ loop.
+
+5. **Run the parity loop.** See the next section.
+
+## The parity loop
+
+The agent loop that brings rust to behavioural parity with cpp. Long-running;
+the diagnostics produce concrete diffs the agent attacks one at a time.
+
+**Before each iteration, rebuild both parser wheels from local source.**
+`uv pip install` / `pip install` will happily resolve to the published
+PyPI wheel and ignore the working tree, so a fresh `maturin develop`
+and a fresh `pip install ./common/hogql_parser` are non-negotiable —
+the diagnostics test what's installed, not what's on disk.
+
+```bash
+maturin develop --release --manifest-path rust/hogql/parser/Cargo.toml
+pip install --force-reinstall --no-deps ./common/hogql_parser
+```
+
+`maturin develop` writes the wheel into the active venv as editable;
+`--force-reinstall --no-deps` for the cpp wheel sidesteps pip's
+"already-satisfied" short-circuit when the in-tree version matches
+the PyPI pin. Skip these and the loop will silently chase divergences
+that have already been fixed in the working tree.
+
+1. **Generate a new divergence.** In priority order:
+ + existing failing regression tests (highest signal);
+ + real production queries via `log_corpus_diagnostic.py` /
+ `hog_corpus_diagnostic.py` (the hog corpus has been at 100% for
+ a while — usually skip);
+ + PBT (`pbt_diagnostic.py --rule expr|select|program`);
+ + thinking hard about edge cases the grammar surface invites.
+
+ For everything other than regression tests, start with a small
+ budget (lower `--n`, less thinking time) and increase until at
+ least one divergence surfaces.
+2. **Reduce + pin.** Shrink each divergence to its minimal form and
+ add it as a regression test in `_test_parser.py`'s factory so
+ it runs on all three backends.
+3. **Read before fixing.** Read the grammar AND the cpp visitor for
+ the rule. 100% identical behaviour means knowing exactly what cpp
+ does — guessing leads to fixes that resurface on a deeper PBT
+ run.
+4. **Fix the rust parser.** Prefer general fixes that won't break on
+ deeper nesting; a depth-0-only special case is a smell. Print a
+ one-paragraph report for the human operator so progress is
+ visible while the loop runs autonomously.
+5. **Re-run the regression suite.** Anything below the previous
+ baseline goes back to step 1.
+
+Generating divergences is the slow step. Run discovery in parallel
+in the background:
+
++ `pbt_diagnostic.py --rule select`
++ `pbt_diagnostic.py --rule expr`
++ `pbt_diagnostic.py --rule program`
++ `log_corpus_diagnostic.py` (real query corpus)
++ a research subagent grepping for cpp-vs-rust visitor differences
++ a research subagent brainstorming adversarial edge cases
+
+Most of these can stream divergences as they're found. Once at least
+one known divergence is in hand, start fixing it while the parallel
+runs keep mining the long tail.
+
+## Tools for parity work
+
+Every script below has the same `--oracle` / `--candidate` flag pair
+and defaults to `cpp-json` vs `rust-json`. The diagnostics include
+per-node `start` / `end` positions in the comparison by default; set
+`CLEAR_LOCATIONS=1` to strip positions when you want a structural-only
+read.
+
+### Regression tests in `posthog/hogql/test/`
+
+```bash
+hogli test posthog/hogql/test/test_parser_cpp_json.py
+hogli test posthog/hogql/test/test_parser_python.py
+hogli test posthog/hogql/test/test_parser_rust_json.py
+```
+
+The behaviour suite + regression pins live in
+[`_test_parser.py`](../../../posthog/hogql/test/_test_parser.py)'s
+`parser_test_factory`. The three files above are thin subclasses that
+spawn one runnable test entry per (backend, case) combination. When
+you find a new divergence, add a reduced regression to the factory —
+it picks up all three backends automatically.
+
+### Property-based testing via `posthog/hogql/scripts/pbt_diagnostic.py`
+
+```bash
+PYTHONPATH=. python posthog/hogql/scripts/pbt_diagnostic.py \
+ --n 5000 --rule program
+
+# Per rule:
+--rule expr # standalone column expressions
+--rule select # SELECT / SELECT-set statements
+--rule program # full Hog programs (declarations + statements + exprs)
+```
+
+Generates ~5 000 random grammar surface examples per rule, parses with
+oracle and candidate, buckets divergences by AST shape, and prints
+shrunk reproducers. Use `--shrink-failures` to auto-reduce each
+divergence to a minimal example.
+
+### Real-query corpora via `log_corpus_diagnostic.py` / `hog_corpus_diagnostic.py`
+
+```bash
+# SELECT queries from the last 7 days of production traffic
+# (redacted, AI-data-processing-approved teams only):
+PYTHONPATH=. python posthog/hogql/scripts/log_corpus_diagnostic.py
+
+# Hog programs from production (transformations, destinations, …):
+PYTHONPATH=. python posthog/hogql/scripts/hog_corpus_diagnostic.py
+```
+
+Both auto-download via `hogli metabase:query` and cache locally under
+`posthog/hogql/scripts/.local/`. Pass `--skip-download` to reuse the
+existing dump while iterating. Failures are written one block per
+divergence to a `.sql` / `.hog` file the agent can chew through.
+
+### Perf bench via `posthog/hogql/scripts/parser_bench.py`
+
+```bash
+CANDIDATE_BACKEND=rust-json PYTHONPATH=. \
+ python posthog/hogql/scripts/parser_bench.py
+```
+
+Runs both parsers against a fixed corpus of representative queries
+(small / medium / nested / pathological) and prints an
+`oracle / candidate` ratio per row. **Re-run before and after any
+non-trivial change.** If `parse_select` mean drops noticeably (the
+parse_select speedup is the headline number), find out why before
+landing.
+
+### Shadow compare in TEST via `cpp-with-rust-shadow`
+
+In `TEST` mode the default backend is `cpp-with-rust-shadow`: both
+backends parse, ASTs are compared, mismatches **raise** so the failing
+test points right at the offending query. In production this same
+mode runs at a 1% sample and only logs. Useful when a regression
+slips past the PBT but shows up in the suite.
+
+```python
+from posthog.hogql.constants import HogQLParserBackend
+parse_expr(src, backend=HogQLParserBackend.CPP_WITH_RUST_SHADOW)
+```
+
+## Rules of thumb for the parity loop
+
+These aren't always obvious from the diagnostics alone:
+
++ **Prefer the generalising fix.** When two implementations both pass
+ the failing cases, pick the one that doesn't depend on the input
+ shape. A `wrap_pos` call at a single emit site beats a depth-aware
+ conditional. A change to the binding-power table beats an
+ ad-hoc check in the consumer.
+
++ **Position bugs hide behind structural bugs.** Always run the PBT
+ with positions on (the default); `CLEAR_LOCATIONS=1` is for
+ diagnosing structural regressions only. A 99% structural match can
+ mask a 50% position-aware match.
+
++ **Look at the cpp visitor before guessing.** Every per-node
+ position decision in this parser has a cpp counterpart in
+ [`common/hogql_parser/parser_json.cpp`](../../../common/hogql_parser/parser_json.cpp).
+ If the cpp visitor calls `addPositionInfo(json, ctx)` you need a
+ wrap on the rust side; if it doesn't, you need `emit::no_pos` (or
+ the helper for that node already does it).
+
++ **Watch the perf bench.** Position emission isn't free. Cache O(N)
+ computations on `Parser` rather than recomputing per emit; the
+ `is_ascii_src` field is the canonical example.
+
++ **Don't fix one rule at a time at the expense of others.** A
+ one-line wrap in `parse/expr.rs` can move three PBT rules at once.
+ Run all three PBTs after each change, not just the one you started
+ with.
+
+## Position parity (the non-obvious part)
+
+The C++ visitor decides per-node whether to emit positions via
+`addPositionInfo(json, ctx)`. Some nodes are deliberately
+position-less (`NamedArgument`, `ColumnsExpr` in qualified-asterisk
+column slots, etc.) so the rust parser has to match that exactly.
+
+Three position helpers in `emit.rs` cover the three cases:
+
+| Helper | When to use |
+| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| `with_pos` | Default. Adds `start` / `end` if not already set. Used by `Parser::wrap_pos` and `wrap_pos_to`. Idempotent so the outer pratt-loop wrap doesn't trample inner spans. |
+| `replace_pos` | Override existing `start` / `end`. Used by the bare-paren grammar alts (`(* REPLACE(...))`) where the inner wrap captured only the inner content but cpp's grammar ctx includes the outer parens. |
+| `no_pos` | Pre-insert `start: null`, `end: null` so the outer wrap leaves the node bare. Used for nodes cpp explicitly doesn't position (`NamedArgument`, `ColumnExprNamedArg`). |
+
+Two more things to keep in mind:
+
++ **Offsets are character indices, not byte indices.** cpp's
+ `getStartIndex()` is char-based; rust's source slices are byte-based.
+ `Parser::pos_obj` converts via `byte_to_char_index` for non-ASCII
+ sources, short-circuits for ASCII. If you bypass `pos_obj` (e.g.
+ hand-building a position object for a node-builder you control),
+ you have to do the conversion yourself.
+
++ **Column is character-position-in-line, not byte-position.** Same
+ reason. The ASCII fast path in `pos_obj` handles this for free; the
+ slow path counts chars between line-start and offset.
+
+## Known long-tail divergences
+
+The PBT for `expr` and `select` exposes adversarial grammar surface
+that the production corpora never see: deep nested
+`BETWEEN low AND high` chains with embedded aliases and ternaries,
+extreme `WITHIN GROUP (ORDER BY …)` shapes, multi-token-`AND`-merged
+operands. These take focused per-shape investigation; the
+[PR description](https://github.com/PostHog/posthog/pull/58949) has
+the current numbers.
+
+The production corpora (`log_corpus_diagnostic`,
+`hog_corpus_diagnostic`) stay above 90%, so anything the PBT surfaces
+that doesn't appear there is technically grammar-parity work but not
+user-visible.
+
+## Selecting from Python
+
+```python
+from posthog.hogql.parser import parse_expr, parse_select, parse_program
+
+ast = parse_expr("1 + event.properties.$browser", backend="rust-json")
+```
+
+Backends live in `posthog/hogql/constants.HogQLParserBackend`:
+
+| Backend | Use case |
+| ------------------------- | ------------------------------------------------------------------------------ |
+| `cpp-json` | Production default. ANTLR-based, oracle for everything below. |
+| `rust-json` | This crate. ~15× / ~50× faster, behaviour identical (modulo the long tail). |
+| `python` | Pure-Python ANTLR fallback. Slower; useful for debugging visitor changes. |
+| `cpp-with-rust-shadow` | Production-default in TEST. Parses with cpp, shadow-parses with rust, raises on mismatch (TEST) / logs at 1% sample (prod). |
diff --git a/rust/hogql/parser/build.rs b/rust/hogql/parser/build.rs
new file mode 100644
index 000000000000..5be820827e24
--- /dev/null
+++ b/rust/hogql/parser/build.rs
@@ -0,0 +1,12 @@
+// Tell macOS's linker to defer libpython symbols to load time. PyO3's
+// `extension-module` feature suppresses the libpython link, but on macOS the
+// linker still needs `-undefined dynamic_lookup` to accept the unresolved
+// symbols when producing a `cdylib`. `maturin` adds this implicitly when it
+// builds the wheel, but a plain `cargo build -p hogql_parser_rs` on
+// macOS doesn't go through maturin, so we add it here too.
+fn main() {
+ if std::env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("macos") {
+ println!("cargo:rustc-link-arg=-undefined");
+ println!("cargo:rustc-link-arg=dynamic_lookup");
+ }
+}
diff --git a/rust/hogql/parser/pyproject.toml b/rust/hogql/parser/pyproject.toml
new file mode 100644
index 000000000000..42a23dcac5f6
--- /dev/null
+++ b/rust/hogql/parser/pyproject.toml
@@ -0,0 +1,36 @@
+[build-system]
+# `maturin` is fetched into an isolated PEP-517 build environment, so no
+# system install (or `cargo install maturin`) is required to build the wheel
+# in CI or on a contributor's machine. The only host requirements are a
+# Python interpreter, `uv` / `pip`, and a Rust toolchain.
+requires = ["maturin>=1.7,<2.0"]
+build-backend = "maturin"
+
+[project]
+name = "hogql_parser_rs"
+# Mirrors `rust/hogql/parser/Cargo.toml` and `common/hogql_parser/setup.py`.
+# All three move in lockstep on every HogQL grammar change.
+version = "1.3.69"
+description = "Hand-rolled Rust HogQL parser with C++-parity AST output"
+readme = "README.md"
+requires-python = ">=3.12"
+authors = [{ name = "PostHog" }]
+license = "MIT"
+classifiers = [
+ "Development Status :: 4 - Beta",
+ "Operating System :: OS Independent",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.12",
+ "Programming Language :: Python :: 3.13",
+ "Programming Language :: Rust",
+]
+
+[project.urls]
+Repository = "https://github.com/PostHog/posthog"
+Issues = "https://github.com/PostHog/posthog/issues"
+
+[tool.maturin]
+module-name = "hogql_parser_rs"
+# Build using the workspace at `rust/Cargo.toml`. Maturin walks up from the
+# crate's `Cargo.toml` to find it automatically.
+features = ["pyo3/extension-module"]
diff --git a/rust/hogql/parser/src/emit.rs b/rust/hogql/parser/src/emit.rs
new file mode 100644
index 000000000000..2bf3a4c99209
--- /dev/null
+++ b/rust/hogql/parser/src/emit.rs
@@ -0,0 +1,313 @@
+//! JSON node builders matching the AST dataclasses at
+//! [`posthog/hogql/ast.py`].
+//!
+//! The Python deserialiser at [`posthog/hogql/json_ast.py`] builds the
+//! dataclass from each JSON object's fields and falls back to dataclass
+//! defaults for anything missing. So we can emit a minimal shape (just the
+//! fields we have a value for) and still produce equivalent objects to the
+//! C++ visitor's more verbose output. Tests compare via
+//! `assertEqual(parse(...), ast.Foo(...))` which invokes the dataclass
+//! `__eq__`; default-equal fields pass either way.
+
+use serde_json::{json, Value};
+
+pub fn constant(value: Value) -> Value {
+ json!({"node": "Constant", "value": value})
+}
+
+/// `inf`, `-inf`, `nan` go through as a string with `value_type: "number"`
+/// envelope. Mirrors the C++ visitor which uses `nlohmann::json` strings for
+/// non-finite floats since standard JSON doesn't represent them.
+pub fn constant_special_number(name: &'static str) -> Value {
+ json!({"node": "Constant", "value": name, "value_type": "number"})
+}
+
+/// An integer-literal Constant whose magnitude exceeds `i64`. The exact
+/// digit text (decimal, or `0x…` hex, with an optional leading `-`) is
+/// carried in the same `value_type: "number"` string envelope; the
+/// deserialiser rebuilds an arbitrary-precision Python `int` from it.
+/// `serde_json::Value` can't hold an integer wider than `u64`, so the
+/// literal can't round-trip as a native JSON number.
+pub fn constant_number_string(text: String) -> Value {
+ json!({"node": "Constant", "value": text, "value_type": "number"})
+}
+
+pub fn field(chain: Vec<Value>) -> Value {
+ json!({"node": "Field", "chain": chain})
+}
+
+pub fn arith(left: Value, op: &str, right: Value) -> Value {
+ json!({"node": "ArithmeticOperation", "left": left, "right": right, "op": op})
+}
+
+pub fn compare(left: Value, op: &str, right: Value) -> Value {
+ json!({"node": "CompareOperation", "left": left, "right": right, "op": op})
+}
+
+pub fn compare_is_null(left: Value, negated: bool) -> Value {
+ json!({
+ "node": "CompareOperation",
+ "left": left,
+ "right": Value::Null.tagged_constant(),
+ "op": if negated { "!=" } else { "==" },
+ "is_null_comparison_style": true,
+ })
+}
+
+pub fn is_distinct_from(left: Value, right: Value, negated: bool) -> Value {
+ json!({"node": "IsDistinctFrom", "left": left, "right": right, "negated": negated})
+}
+
+pub fn between(expr: Value, low: Value, high: Value, negated: bool) -> Value {
+ json!({"node": "BetweenExpr", "expr": expr, "low": low, "high": high, "negated": negated})
+}
+
+pub fn not_(expr: Value) -> Value {
+ json!({"node": "Not", "expr": expr})
+}
+
+pub fn and_(exprs: Vec<Value>) -> Value {
+ json!({"node": "And", "exprs": exprs})
+}
+
+pub fn or_(exprs: Vec<Value>) -> Value {
+ json!({"node": "Or", "exprs": exprs})
+}
+
+pub fn tuple_(exprs: Vec<Value>) -> Value {
+ json!({"node": "Tuple", "exprs": exprs})
+}
+
+pub fn array_(exprs: Vec<Value>) -> Value {
+ json!({"node": "Array", "exprs": exprs})
+}
+
+pub fn array_access(array: Value, property: Value, nullish: bool) -> Value {
+ if nullish {
+ json!({"node": "ArrayAccess", "array": array, "property": property, "nullish": true})
+ } else {
+ json!({"node": "ArrayAccess", "array": array, "property": property})
+ }
+}
+
+pub fn tuple_access(tuple_: Value, index: i64, nullish: bool) -> Value {
+ if nullish {
+ json!({"node": "TupleAccess", "tuple": tuple_, "index": index, "nullish": true})
+ } else {
+ json!({"node": "TupleAccess", "tuple": tuple_, "index": index})
+ }
+}
+
+pub fn alias(expr: Value, name: &str) -> Value {
+ json!({"node": "Alias", "expr": expr, "alias": name})
+}
+
+/// Synthetic `Call` — ternary `?:` (→ `if`), `||` (→ `concat`), `??` (→
+/// `ifNull`), and other rewrites. The C++ visitor emits these without the
+/// four extra fields (`distinct`, `filter_expr`, `order_by`, `params`),
+/// which dataclass defaults absorb on the Python side.
+pub fn call(name: &str, args: Vec<Value>) -> Value {
+ json!({"node": "Call", "name": name, "args": args})
+}
+
+/// Function call carrying every optional shape the grammar's
+/// `ColumnExprFunction` can produce: parametric `name(params)(args)`,
+/// `DISTINCT`, in-arg `ORDER BY`, and trailing `FILTER (WHERE …)`.
+/// Each None / empty field is omitted; the Python dataclass picks up its
+/// default (None / False / empty) on deserialise.
+#[allow(clippy::too_many_arguments)]
+pub fn call_full(
+ name: &str,
+ params: Option<Vec<Value>>,
+ args: Vec<Value>,
+ distinct: bool,
+ order_by: Option<Vec<Value>>,
+ filter_expr: Option<Value>,
+ within_group: Option<Vec<Value>>,
+) -> Value {
+ let mut obj = serde_json::Map::new();
+ obj.insert("node".into(), Value::String("Call".into()));
+ obj.insert("name".into(), Value::String(name.into()));
+ obj.insert("args".into(), Value::Array(args));
+ if let Some(p) = params {
+ obj.insert("params".into(), Value::Array(p));
+ }
+ if distinct {
+ obj.insert("distinct".into(), Value::Bool(true));
+ }
+ if let Some(ob) = order_by {
+ obj.insert("order_by".into(), Value::Array(ob));
+ }
+ if let Some(fe) = filter_expr {
+ obj.insert("filter_expr".into(), fe);
+ }
+ if let Some(wg) = within_group {
+ obj.insert("within_group".into(), Value::Array(wg));
+ }
+ Value::Object(obj)
+}
+
+pub fn lambda(args: Vec<String>, expr: Value) -> Value {
+ let args_json: Vec<Value> = args.into_iter().map(Value::String).collect();
+ json!({"node": "Lambda", "args": args_json, "expr": expr})
+}
+
+pub fn type_cast(expr: Value, type_name: &str) -> Value {
+ json!({"node": "TypeCast", "expr": expr, "type_name": type_name})
+}
+
+pub fn try_cast(expr: Value, type_name: &str) -> Value {
+ json!({"node": "TryCast", "expr": expr, "type_name": type_name})
+}
+
+pub fn array_slice(array: Value, start: Option<Value>, end: Option<Value>) -> Value {
+ let mut obj = serde_json::Map::new();
+ obj.insert("node".into(), Value::String("ArraySlice".into()));
+ obj.insert("array".into(), array);
+ if let Some(s) = start {
+ obj.insert("start_expr".into(), s);
+ }
+ if let Some(e) = end {
+ obj.insert("end_expr".into(), e);
+ }
+ Value::Object(obj)
+}
+
+pub fn dict_(items: Vec<(Value, Value)>) -> Value {
+ let items_json: Vec<Value> = items
+ .into_iter()
+ .map(|(k, v)| Value::Array(vec![k, v]))
+ .collect();
+ json!({"node": "Dict", "items": items_json})
+}
+
+pub fn placeholder(expr: Value) -> Value {
+ json!({"node": "Placeholder", "expr": expr})
+}
+
+pub fn named_argument(name: &str, value: Value) -> Value {
+ // cpp's `ColumnExprNamedArg` visitor omits `addPositionInfo`, so
+ // NamedArgument is always position-less. `no_pos` reserves the
+ // `start`/`end` keys so the outer pratt-loop wrap leaves it bare.
+ no_pos(json!({"node": "NamedArgument", "name": name, "value": value}))
+}
+
+pub fn ignore_nulls(expr: Value) -> Value {
+ // `e IGNORE NULLS` is dropped by the C++ visitor — the expression
+ // returns as-is. Kept as a named helper to make the call site readable
+ // and to leave room for richer behaviour later.
+ expr
+}
+
+pub fn order_expr(expr: Value, order: &str, with_fill: Option<Value>) -> Value {
+ let mut obj = serde_json::Map::new();
+ obj.insert("node".into(), Value::String("OrderExpr".into()));
+ obj.insert("expr".into(), expr);
+ obj.insert("order".into(), Value::String(order.into()));
+ if let Some(wf) = with_fill {
+ obj.insert("with_fill".into(), wf);
+ }
+ Value::Object(obj)
+}
+
+/// `ColumnsExpr` covering the COLUMNS('regex') / COLUMNS(expr,...) /
+/// (*|TABLE.*) EXCLUDE (...) REPLACE (...) family. Every field is optional;
+/// the Python dataclass defaults None/False fill in.
+pub fn columns_expr(
+ regex: Option<String>,
+ columns: Option<Vec<Value>>,
+ all_columns: bool,
+ exclude: Option<Vec<String>>,
+ replace: Option<Vec<(String, Value)>>,
+) -> Value {
+ let mut obj = serde_json::Map::new();
+ obj.insert("node".into(), Value::String("ColumnsExpr".into()));
+ if let Some(r) = regex {
+ obj.insert("regex".into(), Value::String(r));
+ }
+ if let Some(c) = columns {
+ obj.insert("columns".into(), Value::Array(c));
+ }
+ if all_columns {
+ obj.insert("all_columns".into(), Value::Bool(true));
+ }
+ if let Some(e) = exclude {
+ obj.insert(
+ "exclude".into(),
+ Value::Array(e.into_iter().map(Value::String).collect()),
+ );
+ }
+ if let Some(r) = replace {
+ // C++ emits `replace` as an object keyed by name -> Expr.
+ let mut m = serde_json::Map::new();
+ for (k, v) in r {
+ m.insert(k, v);
+ }
+ obj.insert("replace".into(), Value::Object(m));
+ }
+ Value::Object(obj)
+}
+
+pub fn spread_expr(expr: Value) -> Value {
+ json!({"node": "SpreadExpr", "expr": expr})
+}
+
+/// `{line, column, offset}` per cpp's visitor — line is 1-based, column is
+/// 0-based, offset is the byte position in the source. `LineColMap` builds
+/// the line-start index once per parse for O(log N) offset → (line, col).
+pub fn position(line: u32, column: u32, offset: usize) -> Value {
+ json!({"line": line, "column": column, "offset": offset})
+}
+
+/// Inject `start` / `end` position objects on an emitted AST node. Mirrors
+/// the cpp visitor's per-node span emission. Idempotent: if `start` is
+/// already present, leave both keys untouched — this is how cpp's paren
+/// wrap (`(expr)`) keeps the inner expression's positions instead of
+/// overwriting with the outer parens span.
+pub fn with_pos(mut value: Value, start: Value, end: Value) -> Value {
+ if let Some(obj) = value.as_object_mut() {
+ if !obj.contains_key("start") {
+ obj.insert("start".into(), start);
+ obj.insert("end".into(), end);
+ }
+ }
+ value
+}
+
+/// Mark a node as position-less so that downstream `with_pos` calls leave
+/// it bare. Pre-inserts explicit `null` `start` / `end` keys, which `with_pos`
+/// treats the same as "already positioned" via its `contains_key` check.
+/// Mirrors cpp visitors that emit a node without `addPositionInfo(json, ctx)` —
+/// the cpp `Json` then never gets `start` / `end` and the Python AST shows
+/// the dataclass defaults (`None`). Examples: `ColumnExprNamedArg` (NamedArgument).
+pub fn no_pos(mut value: Value) -> Value {
+ if let Some(obj) = value.as_object_mut() {
+ obj.insert("start".into(), Value::Null);
+ obj.insert("end".into(), Value::Null);
+ }
+ value
+}
+
+/// Override existing `start` / `end` keys with new positions, unlike the
+/// idempotent `with_pos`. Used by call sites that know the outer span
+/// must include tokens the inner expression's wrap did not see — e.g.
+/// the `LPAREN ASTERISK REPLACE(...) RPAREN` ColumnsExpr alt where the
+/// inner ColumnsExpr was wrapped at the `*` position but cpp's
+/// grammar-rule ctx includes the outer parens too.
+pub fn replace_pos(mut value: Value, start: Value, end: Value) -> Value {
+ if let Some(obj) = value.as_object_mut() {
+ obj.insert("start".into(), start);
+ obj.insert("end".into(), end);
+ }
+ value
+}
+
+trait ConstantExt {
+ fn tagged_constant(self) -> Value;
+}
+
+impl ConstantExt for Value {
+ fn tagged_constant(self) -> Value {
+ json!({"node": "Constant", "value": self})
+ }
+}
diff --git a/rust/hogql/parser/src/error.rs b/rust/hogql/parser/src/error.rs
new file mode 100644
index 000000000000..3c7497c26eeb
--- /dev/null
+++ b/rust/hogql/parser/src/error.rs
@@ -0,0 +1,96 @@
+//! Error type + JSON envelope serialisation matching the existing C++
+//! parser's error shape in [`common/hogql_parser/parser_json.cpp`]. The
+//! Python side ([`posthog/hogql/json_ast.py`]) special-cases this envelope
+//! and raises `ExposedHogQLError` / `SyntaxError` from it.
+
+use serde_json::json;
+
+#[derive(Debug, Clone)]
+pub struct ParseError {
+ pub message: String,
+ pub start: usize,
+ pub end: usize,
+ /// Maps to the JSON `type` field. The Python deserialiser branches on it:
+ /// `"SyntaxError"` with `"reserved keyword"` in the message becomes
+ /// `HogQLSyntaxError`; everything else becomes `ExposedHogQLError`.
+ pub kind: ErrorKind,
+ /// `true` when this error must not be rolled back by `try_alt` — the
+ /// alternative parsed past its commit point and the failure is
+ /// final. cpp's ANTLR doesn't have rollback in this scenario; the
+ /// alt that would have fallen back instead emits a visitor-level
+ /// `NotImplementedError`. Used by INTERVAL combined-string
+ /// validation, where the string content was definitively assigned
+ /// to the INTERVAL form and the count / unit must validate.
+ pub fatal: bool,
+}
+
+#[derive(Debug, Clone, Copy)]
+#[allow(dead_code)] // `NotImplemented` is reserved for future
+ // deferred-feature stubs (e.g. when new grammar
+ // rules land in cpp that this parser hasn't
+ // caught up to yet) — keep the variant + helper
+ // around so callers can opt back in without
+ // adding back the enum case.
+pub enum ErrorKind {
+ Syntax,
+ NotImplemented,
+}
+
+impl ErrorKind {
+ fn type_str(self) -> &'static str {
+ match self {
+ ErrorKind::Syntax => "SyntaxError",
+ ErrorKind::NotImplemented => "NotImplementedError",
+ }
+ }
+}
+
+impl ParseError {
+ pub fn syntax(message: impl Into<String>, start: usize, end: usize) -> Self {
+ Self {
+ message: message.into(),
+ start,
+ end,
+ kind: ErrorKind::Syntax,
+ fatal: false,
+ }
+ }
+
+ #[allow(dead_code)] // Reserved for deferred-feature stubs; see
+ // `ErrorKind` for context.
+ pub fn not_implemented(message: impl Into<String>, start: usize, end: usize) -> Self {
+ Self {
+ message: message.into(),
+ start,
+ end,
+ kind: ErrorKind::NotImplemented,
+ fatal: false,
+ }
+ }
+
+ /// Like `not_implemented`, but marks the error fatal so `try_alt`
+ /// short-circuits and doesn't fall back to the next alternative.
+ pub fn not_implemented_fatal(message: impl Into<String>, start: usize, end: usize) -> Self {
+ Self {
+ message: message.into(),
+ start,
+ end,
+ kind: ErrorKind::NotImplemented,
+ fatal: true,
+ }
+ }
+
+ pub fn to_json_string(&self) -> String {
+ let value = json!({
+ "error": true,
+ "type": self.kind.type_str(),
+ "message": self.message,
+ "start": {"offset": self.start},
+ "end": {"offset": self.end},
+ });
+ // serde_json::to_string never fails for a Value, but be explicit.
+ serde_json::to_string(&value).unwrap_or_else(|_| {
+ r#"{"error":true,"type":"InternalError","message":"failed to serialize error envelope","start":{"offset":0},"end":{"offset":0}}"#.to_string()
+ })
+ }
+}
diff --git a/rust/hogql/parser/src/lex.rs b/rust/hogql/parser/src/lex.rs
new file mode 100644
index 000000000000..d5b69b760470
--- /dev/null
+++ b/rust/hogql/parser/src/lex.rs
@@ -0,0 +1,1279 @@
+//! HogQL lexer (default mode).
+//!
+//! Produces tokens matching the ANTLR grammar at
+//! [`posthog/hogql/grammar/HogQLLexer.common.g4`] for everything outside the
+//! template-string and HogQLX modes. Those modes maintain a stack and switch
+//! lexer state mid-stream; they're deferred until the relevant tests are
+//! reached.
+//!
+//! Keywords are case-insensitive (the ANTLR fragments expand to `[aA]`-style
+//! character classes). The keyword table is a static slice; lookup is a
+//! linear scan after lowering bytes — fine at this size and well below the
+//! cost of the parser's per-decision work.
+
+use crate::error::ParseError;
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub struct Token {
+ pub kind: TokenKind,
+ pub start: usize,
+ pub end: usize,
+}
+
+impl Token {
+ pub fn eof(at: usize) -> Self {
+ Self {
+ kind: TokenKind::Eof,
+ start: at,
+ end: at,
+ }
+ }
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub enum TokenKind {
+ // ---- Literals / names ----------------------------------------------
+ Ident,
+ QuotedIdent,
+ /// Decimal/octal/hex/float literal. The exact subform is decoded at
+ /// parse time from the source slice.
+ Number,
+ /// Single-quoted string literal. Source slice still contains the
+ /// surrounding quotes and any embedded escapes — `parse_string_literal`
+ /// in the parser strips and unescapes.
+ String,
+ /// `f'...'` / `F'...'` template-string literal. Source slice spans
+ /// the entire `f'…'`, including the leading `f`/`F`, both quotes,
+ /// and any embedded `{expr}` blocks. Body interpretation and
+ /// chunk-splitting happen in `parse_full_template_string` so the
+ /// lexer only has to find the matching closing quote (skipping
+ /// nested `{ ... }` expression blocks that may themselves contain
+ /// strings or further template strings).
+ TemplateString,
+
+ // ---- Punctuation / brackets ---------------------------------------
+ LParen,
+ RParen,
+ LBracket,
+ RBracket,
+ LBrace,
+ RBrace,
+ Comma,
+ Dot,
+ Colon,
+ Semicolon,
+ QMark, // `?`
+ Hash, // `#`
+ LtSlash, // `</` for HogQLX closing tags (recognised even outside
+ // tag mode so the parser can route on it)
+ SlashGt, // `/>` for HogQLX self-closing tags
+
+ // ---- Arithmetic / bitwise / concat --------------------------------
+ Plus,
+ Dash,
+ Asterisk,
+ Slash,
+ Percent,
+ Concat, // `||`
+
+ // ---- Comparison / equality ----------------------------------------
+ EqDouble, // `=` (the SQL "single equals" assignment-style equality)
+ EqSingle, // `==` (the SQL "double equals")
+ NotEq, // `!=` or `<>`
+ Lt,
+ LtEq,
+ Gt,
+ GtEq,
+
+ // ---- Regex --------------------------------------------------------
+ RegexSingle, // `~`
+ RegexDouble, // `=~`
+ NotRegex, // `!~`
+ IRegexSingle, // `~*`
+ IRegexDouble, // `=~*`
+ NotIRegex, // `!~*`
+
+ // ---- Composite operators -----------------------------------------
+ Arrow, // `->`
+ DoubleColon, // `::`
+ ColonEquals, // `:=`
+ Nullish, // `??`
+ NullProperty, // `?.`
+
+ // ---- Keywords -----------------------------------------------------
+ Keyword(Kw),
+
+ Eof,
+}
+
+/// One variant per keyword recognised by the HogQL lexer. Kept in
+/// sync with [`KEYWORDS`] below; if you add a variant, add the entry.
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub enum Kw {
+ All,
+ And,
+ Anti,
+ Any,
+ Array,
+ As,
+ Ascending,
+ Asof,
+ Between,
+ Both,
+ By,
+ Case,
+ Cast,
+ Catch,
+ Cohort,
+ Collate,
+ Columns,
+ Cross,
+ Cube,
+ Current,
+ Date,
+ Day,
+ Desc,
+ Descending,
+ Distinct,
+ Else,
+ End,
+ Except,
+ Exclude,
+ Extract,
+ False,
+ Fill,
+ Filter,
+ Final,
+ Finally,
+ First,
+ Fn,
+ Following,
+ For,
+ From,
+ Full,
+ Fun,
+ Group,
+ Grouping,
+ Having,
+ Hour,
+ Id,
+ If,
+ Ignore,
+ Ilike,
+ In,
+ Include,
+ Inf,
+ Inner,
+ Interpolate,
+ Intersect,
+ Interval,
+ Is,
+ Join,
+ Key,
+ Lambda,
+ Last,
+ Leading,
+ Left,
+ Let,
+ Like,
+ Limit,
+ Local,
+ Materialized,
+ Minute,
+ Month,
+ Name,
+ Nan,
+ Natural,
+ Not,
+ Null,
+ Nulls,
+ Offset,
+ On,
+ Or,
+ Order,
+ Outer,
+ Over,
+ Partition,
+ Pivot,
+ Positional,
+ Preceding,
+ Prewhere,
+ Qualify,
+ Quarter,
+ Range,
+ Recursive,
+ Replace,
+ Return,
+ Right,
+ Rollup,
+ Row,
+ Rows,
+ Sample,
+ Second,
+ Select,
+ Semi,
+ Sets,
+ Settings,
+ Step,
+ Substring,
+ Then,
+ Throw,
+ Ties,
+ Time,
+ Timestamp,
+ To,
+ Top,
+ Totals,
+ Trailing,
+ Trim,
+ True,
+ Truncate,
+ Try,
+ TryCast,
+ Unbounded,
+ Union,
+ Unpivot,
+ Using,
+ Values,
+ Week,
+ When,
+ Where,
+ While,
+ Window,
+ With,
+ Within,
+ Year,
+ Zone,
+}
+
+/// Static keyword table. Entries are matched against the lowercased
+/// identifier text. Order doesn't matter functionally; grouped roughly by
+/// the grammar's `keyword` rule for readability.
+const KEYWORDS: &[(&str, Kw)] = &[
+ ("all", Kw::All),
+ ("and", Kw::And),
+ ("anti", Kw::Anti),
+ ("any", Kw::Any),
+ ("array", Kw::Array),
+ ("as", Kw::As),
+ ("ascending", Kw::Ascending),
+ ("asc", Kw::Ascending),
+ ("asof", Kw::Asof),
+ ("between", Kw::Between),
+ ("both", Kw::Both),
+ ("by", Kw::By),
+ ("case", Kw::Case),
+ ("cast", Kw::Cast),
+ ("catch", Kw::Catch),
+ ("cohort", Kw::Cohort),
+ ("collate", Kw::Collate),
+ ("columns", Kw::Columns),
+ ("cross", Kw::Cross),
+ ("cube", Kw::Cube),
+ ("current", Kw::Current),
+ ("date", Kw::Date),
+ ("day", Kw::Day),
+ ("desc", Kw::Desc),
+ ("descending", Kw::Descending),
+ ("distinct", Kw::Distinct),
+ ("else", Kw::Else),
+ ("end", Kw::End),
+ ("except", Kw::Except),
+ ("exclude", Kw::Exclude),
+ ("extract", Kw::Extract),
+ ("false", Kw::False),
+ ("fill", Kw::Fill),
+ ("filter", Kw::Filter),
+ ("final", Kw::Final),
+ ("finally", Kw::Finally),
+ ("first", Kw::First),
+ ("fn", Kw::Fn),
+ ("following", Kw::Following),
+ ("for", Kw::For),
+ ("from", Kw::From),
+ ("full", Kw::Full),
+ ("fun", Kw::Fun),
+ ("group", Kw::Group),
+ ("grouping", Kw::Grouping),
+ ("having", Kw::Having),
+ ("hour", Kw::Hour),
+ ("id", Kw::Id),
+ ("if", Kw::If),
+ ("ignore", Kw::Ignore),
+ ("ilike", Kw::Ilike),
+ ("in", Kw::In),
+ ("include", Kw::Include),
+ ("inf", Kw::Inf),
+ ("infinity", Kw::Inf), // cpp grammar: `INF: I N F | I N F I N I T Y` — same keyword
+ ("inner", Kw::Inner),
+ ("interpolate", Kw::Interpolate),
+ ("intersect", Kw::Intersect),
+ ("interval", Kw::Interval),
+ ("is", Kw::Is),
+ ("join", Kw::Join),
+ ("key", Kw::Key),
+ ("lambda", Kw::Lambda),
+ ("last", Kw::Last),
+ ("leading", Kw::Leading),
+ ("left", Kw::Left),
+ ("let", Kw::Let),
+ ("like", Kw::Like),
+ ("limit", Kw::Limit),
+ ("local", Kw::Local),
+ ("materialized", Kw::Materialized),
+ ("minute", Kw::Minute),
+ ("month", Kw::Month),
+ ("name", Kw::Name),
+ ("nan", Kw::Nan),
+ ("natural", Kw::Natural),
+ ("not", Kw::Not),
+ ("null", Kw::Null),
+ ("nulls", Kw::Nulls),
+ ("offset", Kw::Offset),
+ ("on", Kw::On),
+ ("or", Kw::Or),
+ ("order", Kw::Order),
+ ("outer", Kw::Outer),
+ ("over", Kw::Over),
+ ("partition", Kw::Partition),
+ ("pivot", Kw::Pivot),
+ ("positional", Kw::Positional),
+ ("preceding", Kw::Preceding),
+ ("prewhere", Kw::Prewhere),
+ ("qualify", Kw::Qualify),
+ ("quarter", Kw::Quarter),
+ ("range", Kw::Range),
+ ("recursive", Kw::Recursive),
+ ("replace", Kw::Replace),
+ ("return", Kw::Return),
+ ("right", Kw::Right),
+ ("rollup", Kw::Rollup),
+ ("row", Kw::Row),
+ ("rows", Kw::Rows),
+ ("sample", Kw::Sample),
+ ("second", Kw::Second),
+ ("select", Kw::Select),
+ ("semi", Kw::Semi),
+ ("sets", Kw::Sets),
+ ("settings", Kw::Settings),
+ ("step", Kw::Step),
+ ("substring", Kw::Substring),
+ ("then", Kw::Then),
+ ("throw", Kw::Throw),
+ ("ties", Kw::Ties),
+ ("time", Kw::Time),
+ ("timestamp", Kw::Timestamp),
+ ("to", Kw::To),
+ ("top", Kw::Top),
+ ("totals", Kw::Totals),
+ ("trailing", Kw::Trailing),
+ ("trim", Kw::Trim),
+ ("true", Kw::True),
+ ("truncate", Kw::Truncate),
+ ("try", Kw::Try),
+ ("try_cast", Kw::TryCast),
+ ("unbounded", Kw::Unbounded),
+ ("union", Kw::Union),
+ ("unpivot", Kw::Unpivot),
+ ("using", Kw::Using),
+ ("values", Kw::Values),
+ ("week", Kw::Week),
+ ("when", Kw::When),
+ ("where", Kw::Where),
+ ("while", Kw::While),
+ ("window", Kw::Window),
+ ("with", Kw::With),
+ ("within", Kw::Within),
+ // YEAR has a `YYYY` alias per HogQLLexer.common.g4 line 140
+ // (`YEAR: Y E A R | Y Y Y Y`). The interval-unit keywords are
+ // singular only — cpp's lexer has no plural forms, so `hours`,
+ // `days`, … lex as plain identifiers and only the in-string
+ // `INTERVAL '5 days'` form accepts a plural (handled by the
+ // visitor, not the lexer).
+ ("year", Kw::Year),
+ ("yyyy", Kw::Year),
+ ("zone", Kw::Zone),
+];
+
+pub struct Lexer<'a> {
+ src: &'a [u8],
+ pos: usize,
+}
+
+impl<'a> Lexer<'a> {
+ /// Construct a lexer at the given byte offset of `src`. The parser
+ /// passes 0 for normal top-level lexing and a forward position when
+ /// it needs to spawn a shadow lexer for bounded lookahead (lambda
+ /// heads, CTE shape probes) or to resume after a template-string
+ /// expression block.
+ pub fn with_pos(src: &'a str, pos: usize) -> Self {
+ Self {
+ src: src.as_bytes(),
+ pos,
+ }
+ }
+
+ pub fn pos(&self) -> usize {
+ self.pos
+ }
+
+ pub fn next_token(&mut self) -> Result<Token, ParseError> {
+ self.skip_trivia()?;
+ let start = self.pos;
+ let Some(b) = self.peek_byte(0) else {
+ return Ok(Token::eof(start));
+ };
+
+ let kind = match b {
+ b'(' => {
+ self.pos += 1;
+ TokenKind::LParen
+ }
+ b')' => {
+ self.pos += 1;
+ TokenKind::RParen
+ }
+ b'[' => {
+ self.pos += 1;
+ TokenKind::LBracket
+ }
+ b']' => {
+ self.pos += 1;
+ TokenKind::RBracket
+ }
+ b'{' => {
+ self.pos += 1;
+ TokenKind::LBrace
+ }
+ b'}' => {
+ self.pos += 1;
+ TokenKind::RBrace
+ }
+ b',' => {
+ self.pos += 1;
+ TokenKind::Comma
+ }
+ b';' => {
+ self.pos += 1;
+ TokenKind::Semicolon
+ }
+ b'#' => {
+ self.pos += 1;
+ TokenKind::Hash
+ }
+
+ // Always emit a single dot. `.5` style literals are assembled
+ // at parse time via the grammar's `floatingLiteral` (DOT then
+ // DECIMAL_LITERAL) — folding here would misread `t.1` (tuple
+ // access) as `t` followed by the float `.1`.
+ b'.' => {
+ self.pos += 1;
+ TokenKind::Dot
+ }
+
+ b':' => match self.peek_byte(1) {
+ Some(b':') => {
+ self.pos += 2;
+ TokenKind::DoubleColon
+ }
+ Some(b'=') => {
+ self.pos += 2;
+ TokenKind::ColonEquals
+ }
+ _ => {
+ self.pos += 1;
+ TokenKind::Colon
+ }
+ },
+
+ b'?' => match self.peek_byte(1) {
+ Some(b'.') => {
+ self.pos += 2;
+ TokenKind::NullProperty
+ }
+ Some(b'?') => {
+ self.pos += 2;
+ TokenKind::Nullish
+ }
+ _ => {
+ self.pos += 1;
+ TokenKind::QMark
+ }
+ },
+
+ b'+' => {
+ self.pos += 1;
+ TokenKind::Plus
+ }
+
+ b'-' => match self.peek_byte(1) {
+ Some(b'>') => {
+ self.pos += 2;
+ TokenKind::Arrow
+ }
+ Some(b'-') => {
+ // `--` line comment. skip_trivia caught most of these
+ // already; this catches a `--` that follows a non-trivia
+ // token mid-expression. Re-route through trivia and
+ // restart.
+ self.skip_line_comment();
+ return self.next_token();
+ }
+ _ => {
+ self.pos += 1;
+ TokenKind::Dash
+ }
+ },
+
+ b'*' => {
+ self.pos += 1;
+ TokenKind::Asterisk
+ }
+
+ b'/' => match self.peek_byte(1) {
+ Some(b'>') => {
+ self.pos += 2;
+ TokenKind::SlashGt
+ }
+ Some(b'*') if self.block_comment_has_closer() => {
+ self.skip_block_comment(start)?;
+ return self.next_token();
+ }
+ Some(b'/') => {
+ // `//` line comment (C-style alias for `--`).
+ // `skip_trivia` catches most occurrences; this
+ // mid-stream branch covers `//` that follows a
+ // non-trivia token, same way the mid-stream `--`
+ // line below the dash arm does.
+ self.skip_line_comment();
+ return self.next_token();
+ }
+ _ => {
+ self.pos += 1;
+ TokenKind::Slash
+ }
+ },
+
+ b'%' => {
+ self.pos += 1;
+ TokenKind::Percent
+ }
+
+ b'|' => match self.peek_byte(1) {
+ Some(b'|') => {
+ self.pos += 2;
+ TokenKind::Concat
+ }
+ _ => return Err(self.err(start, "unexpected '|' (expected '||')")),
+ },
+
+ b'=' => match self.peek_byte(1) {
+ Some(b'=') => {
+ self.pos += 2;
+ TokenKind::EqSingle
+ }
+ Some(b'~') => match self.peek_byte(2) {
+ Some(b'*') => {
+ self.pos += 3;
+ TokenKind::IRegexDouble
+ }
+ _ => {
+ self.pos += 2;
+ TokenKind::RegexDouble
+ }
+ },
+ _ => {
+ self.pos += 1;
+ TokenKind::EqDouble
+ }
+ },
+
+ b'!' => match self.peek_byte(1) {
+ Some(b'=') => {
+ self.pos += 2;
+ TokenKind::NotEq
+ }
+ Some(b'~') => match self.peek_byte(2) {
+ Some(b'*') => {
+ self.pos += 3;
+ TokenKind::NotIRegex
+ }
+ _ => {
+ self.pos += 2;
+ TokenKind::NotRegex
+ }
+ },
+ // A bare `!` (not `!=` / `!~` / `!~*`) matches no token
+ // — the grammar's catch-all `UNEXPECTED_CHARACTER`.
+ // Report it by code point, same as the generic arm.
+ _ => return Err(self.err(start, "unexpected character '!' (U+0021)")),
+ },
+
+ b'<' => match self.peek_byte(1) {
+ Some(b'=') => {
+ self.pos += 2;
+ TokenKind::LtEq
+ }
+ Some(b'>') => {
+ self.pos += 2;
+ TokenKind::NotEq
+ }
+ Some(b'/') => {
+ self.pos += 2;
+ TokenKind::LtSlash
+ }
+ _ => {
+ self.pos += 1;
+ TokenKind::Lt
+ }
+ },
+
+ b'>' => match self.peek_byte(1) {
+ Some(b'=') => {
+ self.pos += 2;
+ TokenKind::GtEq
+ }
+ _ => {
+ self.pos += 1;
+ TokenKind::Gt
+ }
+ },
+
+ b'~' => match self.peek_byte(1) {
+ Some(b'*') => {
+ self.pos += 2;
+ TokenKind::IRegexSingle
+ }
+ _ => {
+ self.pos += 1;
+ TokenKind::RegexSingle
+ }
+ },
+
+ b'\'' => self.lex_string(start)?,
+ b'`' | b'"' => self.lex_quoted_ident(start)?,
+
+ b'0'..=b'9' => self.lex_number(start),
+
+ // `f'...'` / `F'...'` template string. Must intercept BEFORE
+ // the generic ident path, since `f` is a valid ident-start.
+ // Requires zero gap between the `f` and the `'` — `f 'x'` is
+ // still `Ident("f")` followed by `String`.
+ b'f' | b'F' if self.peek_byte(1) == Some(b'\'') => self.lex_template_string(start)?,
+
+ b'a'..=b'z' | b'A'..=b'Z' | b'_' | b'$' => self.lex_ident_or_keyword(start),
+
+ other => {
+ // No lexer rule matched — the grammar's catch-all
+ // `UNEXPECTED_CHARACTER` token. Decode the whole UTF-8
+ // scalar (not just the lead byte) and name it by code
+ // point: the only actionable signal when the character
+ // is invisible (a zero-width space / joiner).
+ let ch = self.peek_char().map(|(c, _)| c).unwrap_or(other as char);
+ return Err(self.err(
+ start,
+ format!("unexpected character {:?} (U+{:04X})", ch, ch as u32),
+ ));
+ }
+ };
+ Ok(Token {
+ kind,
+ start,
+ end: self.pos,
+ })
+ }
+
+ // ---- internals ---------------------------------------------------------
+
+ fn peek_byte(&self, ahead: usize) -> Option<u8> {
+ self.src.get(self.pos + ahead).copied()
+ }
+
+ /// Decode the UTF-8 scalar starting at `self.pos`, returning it
+ /// alongside its byte length. `None` at EOF or when `self.pos`
+ /// sits on a continuation / invalid lead byte — the lexer input is
+ /// always a valid `&str`, so the latter only happens mid-scalar.
+ fn peek_char(&self) -> Option<(char, usize)> {
+ let lead = self.peek_byte(0)?;
+ let len = match lead {
+ 0x00..=0x7F => 1,
+ 0xC0..=0xDF => 2,
+ 0xE0..=0xEF => 3,
+ 0xF0..=0xF7 => 4,
+ _ => return None,
+ };
+ let slice = self.src.get(self.pos..self.pos + len)?;
+ let c = std::str::from_utf8(slice).ok()?.chars().next()?;
+ Some((c, len))
+ }
+
+ fn err(&self, start: usize, msg: impl Into<String>) -> ParseError {
+ ParseError::syntax(msg, start, self.pos.max(start + 1))
+ }
+
+ fn skip_trivia(&mut self) -> Result<(), ParseError> {
+ loop {
+ // Whitespace. The ANTLR `WHITESPACE` rule is
+ // `[ \t\r\n]`; `u8::is_ascii_whitespace`
+ // covers all of those bar the vertical tab (` `),
+ // which is added explicitly. Non-ASCII whitespace
+ // (NO-BREAK SPACE, the Unicode line/paragraph separators,
+ // etc.) is also skipped: cpp's ANTLR lexer error-recovers
+ // past such characters, leaving the parser a clean token
+ // stream, and treating them as trivia reaches the same
+ // result without a hard reject.
+ while let Some(b) = self.peek_byte(0) {
+ if b < 0x80 {
+ if !(b.is_ascii_whitespace() || b == 0x0B) {
+ break;
+ }
+ self.pos += 1;
+ } else {
+ // `char::is_whitespace` is the Unicode `White_Space`
+ // set; the grammar's `WHITESPACE` rule also admits
+ // U+FEFF (BOM), so a file saved with a byte-order
+ // mark still parses.
+ match self.peek_char() {
+ Some((c, len)) if c.is_whitespace() || c == '\u{FEFF}' => self.pos += len,
+ _ => break,
+ }
+ }
+ }
+ // `--` or `//` line comment (HogQL accepts both forms).
+ if (self.peek_byte(0) == Some(b'-') && self.peek_byte(1) == Some(b'-'))
+ || (self.peek_byte(0) == Some(b'/') && self.peek_byte(1) == Some(b'/'))
+ {
+ self.skip_line_comment();
+ continue;
+ }
+ // `/* ... */` block comment. cpp's ANTLR lexer only matches
+ // the comment rule when a closing `*/` is found; an
+ // unterminated `/*` falls back to `/` and `*` tokens (which
+ // the parser then evaluates per the normal expression
+ // grammar). Probe for `*/` first; if missing, leave the
+ // characters in place for the regular lex path.
+ if self.peek_byte(0) == Some(b'/')
+ && self.peek_byte(1) == Some(b'*')
+ && self.block_comment_has_closer()
+ {
+ self.skip_block_comment(self.pos)?;
+ continue;
+ }
+ break;
+ }
+ Ok(())
+ }
+
+ /// Lookahead from a `/*` at `self.pos`: is there a matching `*/`
+ /// before EOF? Used by `skip_trivia` to commit to the comment-skip
+ /// path only when the comment is well-formed (matching cpp's ANTLR
+ /// `/* ... */` rule, which fails to match on unterminated comments).
+ fn block_comment_has_closer(&self) -> bool {
+ // We're positioned at `/`; the `*` is at +1, content at +2.
+ let mut i = self.pos + 2;
+ let bytes = self.src;
+ while i + 1 < bytes.len() {
+ if bytes[i] == b'*' && bytes[i + 1] == b'/' {
+ return true;
+ }
+ i += 1;
+ }
+ false
+ }
+
+ fn skip_line_comment(&mut self) {
+ // Caller already established the leading `--`.
+ while let Some(b) = self.peek_byte(0) {
+ if b == b'\n' {
+ break;
+ }
+ self.pos += 1;
+ }
+ }
+
+ fn skip_block_comment(&mut self, start: usize) -> Result<(), ParseError> {
+ // Caller has confirmed a closing `*/` exists ahead via
+ // `block_comment_has_closer` (matching cpp's ANTLR `/*...*/`
+ // rule, which fails on unterminated). Just walk to the close.
+ self.pos += 2;
+ loop {
+ match (self.peek_byte(0), self.peek_byte(1)) {
+ (Some(b'*'), Some(b'/')) => {
+ self.pos += 2;
+ return Ok(());
+ }
+ (Some(_), _) => self.pos += 1,
+ (None, _) => {
+ // Shouldn't be reachable when callers gate on
+ // `block_comment_has_closer`, but surface as an
+ // error rather than silently advancing.
+ return Err(ParseError::syntax(
+ "unterminated block comment",
+ start,
+ self.pos,
+ ));
+ }
+ }
+ }
+ }
+
+ fn lex_number(&mut self, start: usize) -> TokenKind {
+ let _ = start;
+ // Hex / octal prefix.
+ if self.peek_byte(0) == Some(b'0') {
+ match self.peek_byte(1) {
+ Some(b'x') | Some(b'X')
+ if self.peek_byte(2).is_some_and(|b| b.is_ascii_hexdigit()) =>
+ {
+ // Require at least one hex digit after `0x` — the
+ // grammar token is `'0' X HEX_DIGIT+`. A bare `0x`
+ // lexes as `0` + ident `x` (matches the `0b` / `0o`
+ // arms below); cpp's `HEXADECIMAL_LITERAL` rejects
+ // an empty body, so `SELECT 0x AS y` is a parse
+ // error, not a `0x` literal aliased to `y`.
+ self.pos += 2;
+ let prefix_end = self.pos;
+ while self.peek_byte(0).is_some_and(|b| b.is_ascii_hexdigit()) {
+ self.pos += 1;
+ }
+ let int_end = self.pos;
+ // Try to extend to a FLOATING_LITERAL hex-float —
+ // `HEX (DOT HEX*)? P [+-]? DEC+`. `p`/`P` is the
+ // only marker per grammar; `e`/`E` stays a hex
+ // digit. Requires at least one hex digit in the
+ // mantissa (per `HEXADECIMAL_LITERAL: '0' X HEX+`),
+ // so `0x.8p3` is *not* a hex-float — it stays a
+ // bare `0x` token the parser then rejects. If the
+ // suffix doesn't match cleanly we leave self.pos
+ // at int_end (never commit the `.` / `p` probes).
+ if int_end > prefix_end {
+ let mut probe = 0usize;
+ if self.peek_byte(probe) == Some(b'.') {
+ probe += 1;
+ while self.peek_byte(probe).is_some_and(|b| b.is_ascii_hexdigit()) {
+ probe += 1;
+ }
+ }
+ if matches!(self.peek_byte(probe), Some(b'p') | Some(b'P')) {
+ let mut exp_probe = probe + 1;
+ if matches!(self.peek_byte(exp_probe), Some(b'+') | Some(b'-')) {
+ exp_probe += 1;
+ }
+ if self
+ .peek_byte(exp_probe)
+ .is_some_and(|b| b.is_ascii_digit())
+ {
+ self.pos += exp_probe;
+ while self.peek_byte(0).is_some_and(|b| b.is_ascii_digit()) {
+ self.pos += 1;
+ }
+ }
+ }
+ }
+ return TokenKind::Number;
+ }
+ // `0b…` — BINARY_LITERAL (`0b<bin>+`) and the grammar's
+ // MALFORMED_BINARY_LITERAL (`0b<dec>+`, e.g. `0b22`).
+ // Scan the full decimal-digit run as one Number token;
+ // `parse_number_literal` decodes the value and rejects
+ // a non-binary digit. The `peek_byte(2)` digit guard
+ // keeps a bare `0b` lexing as `0` + ident `b`.
+ Some(b'b') | Some(b'B')
+ if self.peek_byte(2).is_some_and(|b| b.is_ascii_digit()) =>
+ {
+ self.pos += 2;
+ while self.peek_byte(0).is_some_and(|b| b.is_ascii_digit()) {
+ self.pos += 1;
+ }
+ return TokenKind::Number;
+ }
+ // `0o…` — OCTAL_PREFIX_LITERAL (`0o<dec>+`). cpp's
+ // `VISIT(NumberLiteral)` rejects it; scan the decimal
+ // run as one Number token so `parse_number_literal`
+ // surfaces that rejection. (`OCT_DIGIT` would stop at
+ // `0o9` and strand the `9`; the grammar token spans
+ // DEC_DIGIT.) The digit guard keeps `0o` lexing as
+ // `0` + ident `o`.
+ Some(b'o') | Some(b'O')
+ if self.peek_byte(2).is_some_and(|b| b.is_ascii_digit()) =>
+ {
+ self.pos += 2;
+ while self.peek_byte(0).is_some_and(|b| b.is_ascii_digit()) {
+ self.pos += 1;
+ }
+ return TokenKind::Number;
+ }
+ _ => {}
+ }
+ }
+ // Integer part only — the grammar's `floatingLiteral` rule is
+ // `DECIMAL_LITERAL DOT (DECIMAL_LITERAL | OCTAL_LITERAL)?`, i.e.
+ // the fractional `.<digits>` tail is assembled at parse time, NOT
+ // at lex time. This is deliberate: lexing it eagerly would
+ // misread `t.1.2` (tuple access) as `t.<float 1.2>`.
+ while self.peek_byte(0).is_some_and(|b| b.is_ascii_digit()) {
+ self.pos += 1;
+ }
+ // FLOATING_LITERAL with an exponent but no fractional digits:
+ // `1.e5` / `1.E+5`. The grammar's FLOATING_LITERAL token is
+ // `DECIMAL_LITERAL DOT DEC_DIGIT* E (PLUS|DASH)? DEC_DIGIT+`, so
+ // cpp's lexer munches the whole thing as one token. Consume the
+ // `.` here only when an exponent unambiguously follows; `1.2` /
+ // `t.1.2` (dot then digit, no `e`) is left for parse-time
+ // fractional assembly. The exponent block below then consumes
+ // the `e<digits>` tail.
+ if self.peek_byte(0) == Some(b'.') && matches!(self.peek_byte(1), Some(b'e') | Some(b'E')) {
+ let digit_at = if matches!(self.peek_byte(2), Some(b'+') | Some(b'-')) {
+ 3
+ } else {
+ 2
+ };
+ if self.peek_byte(digit_at).is_some_and(|b| b.is_ascii_digit()) {
+ self.pos += 1;
+ }
+ }
+ // Exponent
+ // Exponent: only consume `e`/`E` when followed by an optional
+ // sign and at least one digit (else it's a following identifier
+ // like `1eq`).
+ if matches!(self.peek_byte(0), Some(b'e') | Some(b'E')) {
+ let mut probe = 1;
+ if matches!(self.peek_byte(probe), Some(b'+') | Some(b'-')) {
+ probe += 1;
+ }
+ if self.peek_byte(probe).is_some_and(|b| b.is_ascii_digit()) {
+ self.pos += probe;
+ while self.peek_byte(0).is_some_and(|b| b.is_ascii_digit()) {
+ self.pos += 1;
+ }
+ }
+ }
+ TokenKind::Number
+ }
+
+ fn lex_ident_or_keyword(&mut self, start: usize) -> TokenKind {
+ while let Some(b) = self.peek_byte(0) {
+ if b.is_ascii_alphanumeric() || b == b'_' || b == b'$' {
+ self.pos += 1;
+ } else {
+ break;
+ }
+ }
+ let text = &self.src[start..self.pos];
+ if let Some(kw) = lookup_keyword(text) {
+ TokenKind::Keyword(kw)
+ } else {
+ TokenKind::Ident
+ }
+ }
+
+ fn lex_string(&mut self, start: usize) -> Result<TokenKind, ParseError> {
+ self.pos += 1; // opening quote
+ loop {
+ match self.peek_byte(0) {
+ None => {
+ return Err(ParseError::syntax(
+ "unterminated string literal",
+ start,
+ self.pos,
+ ))
+ }
+ Some(b'\'') => {
+ // `''` inside a single-quoted string is an escaped quote.
+ if self.peek_byte(1) == Some(b'\'') {
+ self.pos += 2;
+ continue;
+ }
+ self.pos += 1;
+ return Ok(TokenKind::String);
+ }
+ Some(b'\\') => {
+ // `ESCAPE_CHAR_COMMON` (`HogQLLexer.common.g4:145`)
+ // is a closed set: `\b \f \r \n \t \0 \a \v \\ \xNN`,
+ // plus the string-literal-only `\'`. cpp rejects
+ // anything else; rust was silently keeping the
+ // backslash + char as literal text.
+ let escape_pos = self.pos;
+ self.pos += 1;
+ match self.peek_byte(0) {
+ None => {} // unterminated — caught by the outer loop's None arm
+ Some(c) => match c {
+ b'b' | b'B' | b'f' | b'F' | b'r' | b'R' | b'n' | b'N' | b't' | b'T'
+ | b'0' | b'a' | b'A' | b'v' | b'V' | b'\\' | b'\'' => {
+ self.pos += 1;
+ }
+ b'x' | b'X' => {
+ // `\xNN` — exactly two hex digits required.
+ self.pos += 1;
+ if self.peek_byte(0).is_some_and(|b| b.is_ascii_hexdigit())
+ && self.peek_byte(1).is_some_and(|b| b.is_ascii_hexdigit())
+ {
+ self.pos += 2;
+ } else {
+ return Err(ParseError::syntax(
+ r"\x escape requires two hex digits",
+ escape_pos,
+ self.pos,
+ ));
+ }
+ }
+ _ => {
+ return Err(ParseError::syntax(
+ format!("unrecognised escape '\\{}'", c as char),
+ escape_pos,
+ self.pos + 1,
+ ));
+ }
+ },
+ }
+ }
+ Some(_) => self.pos += 1,
+ }
+ }
+ }
+
+ /// `f'…'` template string. Caller positioned at the leading `f`/`F`,
+ /// with byte 1 confirmed to be `'`. Scans the body until the
+ /// matching unescaped `'` at the outermost level, descending into
+ /// `{ … }` expression blocks via recursive token-level lexing so
+ /// nested strings and nested template strings inside `{…}` don't
+ /// confuse the boundary search.
+ fn lex_template_string(&mut self, start: usize) -> Result<TokenKind, ParseError> {
+ self.pos += 2; // consume `f'`
+ loop {
+ let Some(b) = self.peek_byte(0) else {
+ return Err(ParseError::syntax(
+ "unterminated template string",
+ start,
+ self.pos,
+ ));
+ };
+ match b {
+ b'\\' => {
+ // Generic escape: consume backslash + the escaped byte.
+ // The body parser re-interprets these.
+ self.pos += 1;
+ if self.peek_byte(0).is_some() {
+ self.pos += 1;
+ }
+ }
+ b'\'' => {
+ self.pos += 1;
+ return Ok(TokenKind::TemplateString);
+ }
+ b'{' => {
+ // Switch into expression-token mode for the body of
+ // the `{ … }` block. Recursively call next_token so
+ // nested strings, parens, and nested template
+ // strings are all parsed correctly. Stop when the
+ // matching `}` arrives at depth 0.
+ self.pos += 1; // consume `{`
+ let mut depth: i32 = 1;
+ while depth > 0 {
+ let t = self.next_token()?;
+ match t.kind {
+ TokenKind::LBrace => depth += 1,
+ TokenKind::RBrace => depth -= 1,
+ TokenKind::Eof => {
+ return Err(ParseError::syntax(
+ "unterminated template-string expression block",
+ start,
+ self.pos,
+ ));
+ }
+ _ => {}
+ }
+ }
+ }
+ _ => self.pos += 1,
+ }
+ }
+ }
+
+ fn lex_quoted_ident(&mut self, start: usize) -> Result<TokenKind, ParseError> {
+ let quote = self.src[self.pos];
+ self.pos += 1;
+ loop {
+ match self.peek_byte(0) {
+ None => {
+ return Err(ParseError::syntax(
+ "unterminated quoted identifier",
+ start,
+ self.pos,
+ ))
+ }
+ Some(b) if b == quote => {
+ // Doubled-quote inside the ident is an escaped quote
+ // (grammar: `BACKQUOTE BACKQUOTE` / `QUOTE_DOUBLE
+ // QUOTE_DOUBLE`).
+ if self.peek_byte(1) == Some(quote) {
+ self.pos += 2;
+ continue;
+ }
+ self.pos += 1;
+ return Ok(TokenKind::QuotedIdent);
+ }
+ Some(b'\\') => {
+ // The grammar's quoted-identifier rule admits:
+ // `ESCAPE_CHAR_COMMON` — `\b \f \r \n \t \0 \a \v \\ \xHH`
+ // `BACKSLASH QUOTE_DOUBLE` — only inside `"..."`
+ // `BACKSLASH QUOTE_SINGLE` — only inside `` `...` ``
+ // Otherwise `\` is a stray char and the grammar
+ // rejects (`~([\\<quote>])` excludes a bare
+ // backslash). Mirror the closed set so `"\"abc"`
+ // is a single quoted ident containing `"abc`.
+ let escape_pos = self.pos;
+ self.pos += 1;
+ match self.peek_byte(0) {
+ None => {}
+ Some(c) => match c {
+ b'b' | b'B' | b'f' | b'F' | b'r' | b'R' | b'n' | b'N' | b't' | b'T'
+ | b'0' | b'a' | b'A' | b'v' | b'V' | b'\\' => {
+ self.pos += 1;
+ }
+ b'"' if quote == b'"' => self.pos += 1,
+ b'\'' if quote == b'`' => self.pos += 1,
+ b'x' | b'X' => {
+ self.pos += 1;
+ if self.peek_byte(0).is_some_and(|b| b.is_ascii_hexdigit())
+ && self.peek_byte(1).is_some_and(|b| b.is_ascii_hexdigit())
+ {
+ self.pos += 2;
+ } else {
+ return Err(ParseError::syntax(
+ r"\x escape in quoted identifier requires two hex digits",
+ escape_pos,
+ self.pos,
+ ));
+ }
+ }
+ _ => {
+ return Err(ParseError::syntax(
+ format!(
+ "unrecognised escape '\\{}' in quoted identifier",
+ c as char
+ ),
+ escape_pos,
+ self.pos + 1,
+ ));
+ }
+ },
+ }
+ }
+ Some(_) => self.pos += 1,
+ }
+ }
+ }
+}
+
+/// Case-insensitive keyword lookup against [`KEYWORDS`]. Linear scan over
+/// ~120 entries, ASCII-lowered byte compare; well under the cost of any
+/// per-token decision. Returns `None` for plain identifiers.
+fn lookup_keyword(bytes: &[u8]) -> Option<Kw> {
+ for (text, kw) in KEYWORDS {
+ if eq_ignore_ascii_case(bytes, text.as_bytes()) {
+ return Some(*kw);
+ }
+ }
+ None
+}
+
+fn eq_ignore_ascii_case(a: &[u8], b: &[u8]) -> bool {
+ if a.len() != b.len() {
+ return false;
+ }
+ a.iter()
+ .zip(b.iter())
+ .all(|(x, y)| x.eq_ignore_ascii_case(y))
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ fn lex_all(src: &str) -> Vec<TokenKind> {
+ let mut lx = Lexer::with_pos(src, 0);
+ let mut kinds = Vec::new();
+ loop {
+ let t = lx.next_token().expect("lex error in test corpus");
+ if t.kind == TokenKind::Eof {
+ break;
+ }
+ kinds.push(t.kind);
+ }
+ kinds
+ }
+
+ #[test]
+ fn arithmetic() {
+ assert_eq!(
+ lex_all("1 + 2 * 3"),
+ vec![
+ TokenKind::Number,
+ TokenKind::Plus,
+ TokenKind::Number,
+ TokenKind::Asterisk,
+ TokenKind::Number
+ ],
+ );
+ }
+
+ #[test]
+ fn keywords_case_insensitive() {
+ assert_eq!(lex_all("SELECT")[0], TokenKind::Keyword(Kw::Select));
+ assert_eq!(lex_all("select")[0], TokenKind::Keyword(Kw::Select));
+ assert_eq!(lex_all("SeLeCt")[0], TokenKind::Keyword(Kw::Select));
+ }
+
+ #[test]
+ fn tuple_access_is_dot_then_number() {
+ assert_eq!(
+ lex_all("t.1"),
+ vec![TokenKind::Ident, TokenKind::Dot, TokenKind::Number],
+ );
+ }
+
+ #[test]
+ fn strings_with_doubled_quote() {
+ let kinds = lex_all("'it''s'");
+ assert_eq!(kinds, vec![TokenKind::String]);
+ }
+
+ #[test]
+ fn line_comment_skipped() {
+ assert_eq!(
+ lex_all("1 -- the answer\n+ 2"),
+ vec![TokenKind::Number, TokenKind::Plus, TokenKind::Number]
+ );
+ }
+
+ #[test]
+ fn block_comment_skipped() {
+ assert_eq!(
+ lex_all("1 /* nope */ + 2"),
+ vec![TokenKind::Number, TokenKind::Plus, TokenKind::Number]
+ );
+ }
+
+ #[test]
+ fn regex_family() {
+ assert_eq!(
+ lex_all("a ~ b =~ c !~ d ~* e =~* f !~* g"),
+ vec![
+ TokenKind::Ident,
+ TokenKind::RegexSingle,
+ TokenKind::Ident,
+ TokenKind::RegexDouble,
+ TokenKind::Ident,
+ TokenKind::NotRegex,
+ TokenKind::Ident,
+ TokenKind::IRegexSingle,
+ TokenKind::Ident,
+ TokenKind::IRegexDouble,
+ TokenKind::Ident,
+ TokenKind::NotIRegex,
+ TokenKind::Ident,
+ ],
+ );
+ }
+}
diff --git a/rust/hogql/parser/src/lib.rs b/rust/hogql/parser/src/lib.rs
new file mode 100644
index 000000000000..d057328f27ad
--- /dev/null
+++ b/rust/hogql/parser/src/lib.rs
@@ -0,0 +1,71 @@
+//! Hand-rolled Rust HogQL parser — ALL(*) variant.
+//!
+//! Forked from `hogql_parser_rs` at the ~99.88% cpp-parity baseline.
+//! From here we make per-site upgrades to match cpp's ALL(*) behavior
+//! exactly at the structural decision points that the Pratt+heuristic
+//! parser couldn't resolve (BETWEEN body absorbing trailing AND,
+//! lambda body inside an outer construct, paren-vs-subquery dispatch,
+//! …). Each upgrade hard-codes whatever technique is fastest for that
+//! specific site — AST surgery, scan probe, targeted backtrack — with
+//! the cpp output as the spec.
+//!
+//! Each PyO3 entry point catches `ParseError`s and emits the JSON error
+//! envelope expected by [`posthog/hogql/json_ast.py`] so the Python side
+//! can raise `ExposedHogQLError` / `SyntaxError` from it.
+
+use pyo3::prelude::*;
+
+mod emit;
+mod error;
+mod lex;
+mod parse;
+
+fn run<F>(f: F) -> String
+where
+ F: FnOnce() -> Result<serde_json::Value, error::ParseError>,
+{
+ match f() {
+ Ok(value) => serde_json::to_string(&value).unwrap_or_else(|_| {
+ // serde_json::Value -> string never fails in practice, but emit
+ // a structured error rather than panicking across the FFI.
+ error::ParseError::syntax("internal: failed to serialize AST", 0, 0).to_json_string()
+ }),
+ Err(err) => err.to_json_string(),
+ }
+}
+
+#[pyfunction]
+#[pyo3(signature = (statement, is_internal=false))]
+fn parse_expr_json(statement: &str, is_internal: bool) -> String {
+ run(|| parse::parse_expr(statement, is_internal))
+}
+
+#[pyfunction]
+fn parse_order_expr_json(statement: &str) -> String {
+ run(|| parse::parse_order_expr(statement))
+}
+
+#[pyfunction]
+fn parse_select_json(statement: &str) -> String {
+ run(|| parse::parse_select(statement))
+}
+
+#[pyfunction]
+fn parse_program_json(source: &str) -> String {
+ run(|| parse::parse_program(source))
+}
+
+#[pyfunction]
+fn parse_full_template_string_json(string: &str) -> String {
+ run(|| parse::parse_full_template_string(string))
+}
+
+#[pymodule]
+fn hogql_parser_rs(m: &Bound<'_, PyModule>) -> PyResult<()> {
+ m.add_function(wrap_pyfunction!(parse_expr_json, m)?)?;
+ m.add_function(wrap_pyfunction!(parse_order_expr_json, m)?)?;
+ m.add_function(wrap_pyfunction!(parse_select_json, m)?)?;
+ m.add_function(wrap_pyfunction!(parse_program_json, m)?)?;
+ m.add_function(wrap_pyfunction!(parse_full_template_string_json, m)?)?;
+ Ok(())
+}
diff --git a/rust/hogql/parser/src/parse.rs b/rust/hogql/parser/src/parse.rs
new file mode 100644
index 000000000000..85a4f0d4191f
--- /dev/null
+++ b/rust/hogql/parser/src/parse.rs
@@ -0,0 +1,1382 @@
+//! HogQL parser entry points + Pratt expression parser.
+//!
+//! Public API is a set of `parse_*` functions that return `Result<Value,
+//! ParseError>`. The PyO3 wrappers in [`crate::lib`] catch errors and emit
+//! the JSON error envelope expected by [`posthog/hogql/json_ast.py`].
+//!
+//! Implementation strategy: Pratt parser with explicit binding powers, full
+//! precedence ladder from [`posthog/hogql/grammar/HogQLParser.g4`]'s
+//! `columnExpr` rule. The spike validated that the grammar's tricky spots
+//! (function-call dispatch, tuple-vs-parens-vs-subquery, `NOT (e)` being a
+//! function call by grammar accident, BETWEEN low-binding) need only
+//! bounded lookahead.
+
+use serde_json::Value;
+
+use crate::emit;
+use crate::error::ParseError;
+use crate::lex::{Kw, Lexer, Token, TokenKind};
+
+mod bp;
+mod cte;
+mod expr;
+mod hogqlx;
+mod join;
+mod program;
+mod select;
+mod template;
+
+use bp::{
+ build_infix, fold_call_or_exprcall, infix_bp, postfix_bp, BP_ADDITIVE, BP_ALIAS, BP_BETWEEN,
+ BP_COMPARE, BP_IGNORE_NULLS, BP_IS_DISTINCT_FROM, BP_IS_NULL, BP_MULT, BP_NOT, BP_OR,
+ BP_POSTFIX, BP_TERNARY, BP_UNARY_MINUS,
+};
+use template::parse_template_body;
+
+// ============================================================================
+// Public entry points
+// ============================================================================
+
+pub fn parse_expr(src: &str, _is_internal: bool) -> Result<Value, ParseError> {
+ let mut p = Parser::new(src)?;
+ // Bare-list lambda `IDENT (, IDENT)* -> body` is only valid at the
+ // outermost expression level; inside an argument list each item parses
+ // independently and the commas are separators. So we try it here
+ // before falling into the Pratt loop.
+ //
+ // A bare-list lambda is still a regular expression value — it can
+ // be the LHS of a trailing operator (`a, b -> body BETWEEN c`,
+ // `x -> {block} [i]`, `x -> {block} * y`). With an expression
+ // body the body parse is greedy and absorbs those operators, but
+ // a `{ … }` Hog-block body stops at `}`, leaving the operator for
+ // the Pratt loop. So feed the lambda through `pratt_continue_with_lhs`
+ // rather than demanding EOF immediately after it.
+ if let Some(lambda) = p.try_bare_list_lambda()? {
+ let expr = p.pratt_continue_with_lhs(lambda, 0, 0)?;
+ p.expect_eof()?;
+ return Ok(expr);
+ }
+ let expr = p.parse_expr_bp(0)?;
+ p.expect_eof()?;
+ Ok(expr)
+}
+
+pub fn parse_order_expr(src: &str) -> Result<Value, ParseError> {
+ let mut p = Parser::new(src)?;
+ let exprs = p.parse_order_expr_list()?;
+ // cpp's `parse_order_expr_json` entry point silently drops any
+ // trailing tokens after the first OrderExpr — `a ASC extra` parses
+ // as just `OrderExpr(a, ASC)`, and `a WITH FILL INTERPOLATE (b)`
+ // drops the INTERPOLATE since INTERPOLATE lives at the
+ // orderByClause level, not on the orderExpr itself. Mirror that
+ // permissive behaviour; the `parse_expr_json` and
+ // `parse_select_json` entry points still enforce expect_eof so
+ // callers there see real syntax errors.
+ exprs
+ .into_iter()
+ .next()
+ .ok_or_else(|| ParseError::syntax("empty order expression", 0, 0))
+}
+
+pub fn parse_select(src: &str) -> Result<Value, ParseError> {
+ let mut p = Parser::new(src)?;
+ // `select` rule top-level admits a bare HogQLX tag element as the
+ // third alternative (alongside selectSetStmt / selectStmt). The tag
+ // covers both standalone-`<Tag />` use and the `from <Tag />` shape
+ // (via `parse_table_expr`).
+ let result = if p.peek_starts_hogqlx_tag() {
+ p.parse_hogqlx_tag_element()?
+ } else {
+ p.parse_select_set_stmt()?
+ };
+ let _ = p.eat(TokenKind::Semicolon)?;
+ p.expect_eof()?;
+ Ok(result)
+}
+
+pub fn parse_program(src: &str) -> Result<Value, ParseError> {
+ let mut p = Parser::new(src)?;
+ let prog = p.parse_program()?;
+ p.expect_eof()?;
+ Ok(prog)
+}
+
+pub fn parse_full_template_string(src: &str) -> Result<Value, ParseError> {
+ // The Python wrapper `parse_string_template` prepends `F'` to the
+ // template body before handing the source off to either backend
+ // (see `posthog/hogql/parser.py::parse_string_template`). Strip
+ // that prefix here so the body splitter operates on the real
+ // template contents; if it's absent we fall back to treating the
+ // whole input as the body.
+ let body_offset = if src.starts_with("F'") || src.starts_with("f'") {
+ 2
+ } else {
+ 0
+ };
+ // `parse_template_body` walks the body inside `full_src` between
+ // `body_offset` and `body_end`. For the standalone entry point the
+ // body extends to the end of `src` — there is no trailing `'`.
+ let body_end = src.len();
+ parse_template_body(src, body_offset, body_end)
+}
+
+// ============================================================================
+// Parser core
+// ============================================================================
+
+pub(crate) struct Parser<'a> {
+ pub(crate) src: &'a str,
+ pub(crate) lexer: Lexer<'a>,
+ /// One-token-ahead cursor. We carry a second peek for the few
+ /// bounded-lookahead spots (`NOT IN`, `IS NULL`, `<.>` for tuple access
+ /// vs. Field chain).
+ pub(crate) peek0: Token,
+ pub(crate) peek1: Token,
+ /// End byte offset of the most recently consumed token. Used by
+ /// callers that need the end-of-the-expression span without
+ /// re-deriving it from the AST.
+ pub(crate) last_consumed_end: usize,
+ /// Byte offset of the `AS` reserved as a structural separator by
+ /// the enclosing construct. cpp's `columnExpr` greedily absorbs
+ /// alias forms (`expr AS ident`), so when the value carries one or
+ /// more `AS` aliases the *last* AS at paren-depth zero is the
+ /// separator: the `AS` before the type in a CAST argument, or the
+ /// `AS` before the replacement name in a `columnsReplaceItem`. The
+ /// alias-infix bails out when it would consume the AS at this
+ /// position. None outside such a construct. Saved/restored across
+ /// nesting.
+ pub(crate) cast_as_stop: Option<usize>,
+ /// Depth tracker for nested `parse_between_body` calls. Used to
+ /// switch arm ordering: the outermost call uses WIDE-first
+ /// (consuming all in-between tokens greedy so split can find the
+ /// rightmost AND), but nested calls switch to NARROW-first so an
+ /// inner BETWEEN's body parse doesn't over-consume the outer's
+ /// trailing ternary / AND / etc. Mirrors cpp's ANTLR left-recursive
+ /// expansion where each nested BETWEEN matches the SHORTEST body
+ /// that lets the outer rule succeed.
+ pub(crate) between_body_depth: u32,
+ /// When set, `parse_trailing_set_decorators` skips a trailing
+ /// `ORDER BY` at the selectSetStmt-wrapper level. Used by
+ /// `parse_call_argument_select` so that for inputs like
+ /// `f((select 1) order by 1)` the ORDER BY is left for the outer
+ /// function-call's `orderByClause` slot rather than being
+ /// consumed-and-dropped by the SetStmt wrapper. cpp's ANTLR
+ /// ALL(*) prefers ColumnExprFunction over ColumnExprCallSelect
+ /// (line 236 < 237 in HogQLParser.g4), so the ORDER BY there
+ /// belongs to the Function's outer `orderByClause`. Saved/
+ /// restored around each call-argument parse.
+ pub(crate) suppress_setstmt_trailing_order_by: bool,
+ /// When set, the SELECT parser skips the two ARRAY JOIN *visitor*
+ /// checks ("Using ARRAY JOIN without a FROM clause is not
+ /// permitted" / "ARRAY JOIN arrays must have an alias"). Set by
+ /// `parse_optional_filter` while parsing a `FILTER (WHERE …)`
+ /// body: cpp's `VISIT(ColumnExprWinFunction)` parses the FILTER
+ /// where-expression at the *grammar* level but never visits it
+ /// into the AST, so the SelectStmt-visitor semantic checks never
+ /// run for a subquery nested inside it. `f() FILTER (WHERE
+ /// (SELECT 1 ARRAY JOIN 2)) OVER w` is accepted by cpp for
+ /// exactly this reason. Saved/restored around the FILTER parse.
+ pub(crate) suppress_array_join_checks: bool,
+ /// When set, the Pratt postfix loop stops before folding a
+ /// `(…)`-call onto its LHS if a `:=` follows the matching `)`.
+ /// Set by the Hog-program statement parser while parsing a
+ /// statement RHS expression (a `varAssignment` / `varDecl` /
+ /// `return` / `throw` value). cpp's ALL(*) does whole-program
+ /// lookahead: in `(a) := (b) (c) := (d)` the first RHS is `(b)`,
+ /// not `(b)(c)` — the trailing `(c)` is the next statement's
+ /// lvalue. A single-pass parser would greedily fold `(b)(c)` and
+ /// strand the second `:=`; the probe mirrors the backtrack.
+ /// Saved/restored around each statement-RHS parse.
+ pub(crate) stop_postfix_call_before_colon_equals: bool,
+ /// When set, the Pratt loop's infix-RHS parse is wrapped with
+ /// checkpoint-restore: a failing RHS parse rolls back to before
+ /// the infix operator and the loop breaks (returning the LHS
+ /// built so far). cpp's ALL(*) handles `let x := {} * ()` by
+ /// splitting into two statements (`let x := {}` plus
+ /// `ExprStatement(Call(Field("*"), []))`) — the `* ()` infix
+ /// can't extend the rhs because `()` isn't a valid expression,
+ /// so the operator + failing operand become the next statement.
+ /// `parse_stmt_rhs_expr` sets this flag.
+ pub(crate) stmt_rhs_recover_on_pratt_rhs_failure: bool,
+ /// Non-zero while the Pratt loop is parsing the compound body of a
+ /// `LIMIT` clause. `%` is overloaded as both the modulo operator
+ /// and the `LIMIT … PERCENT` marker; inside the limit body the
+ /// `%` handler resolves the two via `try_limit_modulo_extension`
+ /// (cpp's ALL(*) takes the modulo alt only when it lands at a
+ /// clean limit boundary). Incremented around the body's Pratt
+ /// continuation in `parse_limit_clauses` / `parse_trailing_set_decorators`.
+ pub(crate) limit_body_depth: u32,
+ /// When set, the Pratt `IN` infix handler stops (yields the
+ /// operator back) at this byte offset. A PIVOT/UNPIVOT
+ /// `columnExprTupleOrSingle` operand is a full `columnExpr` that
+ /// may itself contain `in`, but the *last* depth-0 `in (` is the
+ /// structural separator before the `( columnExprList )` values.
+ /// `parse_expr_tuple_or_single` sets this to that `in` so the
+ /// operand parse stops there.
+ pub(crate) pivot_in_stop: Option<usize>,
+ /// When non-zero, `bump()` converts a lex error on the new peek1
+ /// to a synthetic `Eof` token. Used inside HogQLX tag-body parsing:
+ /// cpp's `HOGQLX_TEXT` lexer mode admits any byte except `<` / `{`,
+ /// but rust's mode-less lexer would reject punctuation like `&` /
+ /// `!` / `@` when pre-loading peek1 across a `>` / `/>` / closing
+ /// `>` boundary. `parse_hogqlx_children` byte-walks the body
+ /// directly and re-seeks the lexer, so peek1's transient invalid
+ /// state is recoverable.
+ pub(crate) hogqlx_text_lookahead_depth: u32,
+ /// Sorted byte offsets of each line start in `src` (line 1 starts at 0,
+ /// line N starts at `line_starts[N-1]`). Built once at construction;
+ /// `pos(offset)` binary-searches for line / column. Used to emit cpp's
+ /// per-node `{line, column, offset}` position objects.
+ pub(crate) line_starts: Vec<usize>,
+ /// Sorted byte offsets of each character start in `src`. Lazily built
+ /// on first conversion when the source contains any non-ASCII bytes;
+ /// stays `None` for pure-ASCII sources where byte offset == char index.
+ /// `byte_to_char(byte_offset)` returns the character index by binary
+ /// searching this vector — matches cpp's ANTLR `getStartIndex()`
+ /// semantics (character-based, not byte-based).
+ pub(crate) char_offsets: std::cell::OnceCell<Option<Vec<usize>>>,
+ /// Cached `src.is_ascii()` result — `pos_obj` reads it on every emitted
+ /// node, and the underlying `str::is_ascii` is O(n) per call. Computed
+ /// once at construction so the hot wrap_pos path stays O(log n) via the
+ /// line-starts binary search.
+ pub(crate) is_ascii_src: bool,
+}
+
+impl<'a> Parser<'a> {
+ pub(crate) fn new(src: &'a str) -> Result<Self, ParseError> {
+ Self::with_pos(src, 0)
+ }
+
+ /// Construct a Parser whose lexer starts at the given byte offset.
+ /// Used by the template-body splitter to parse a `{ … }` expression
+ /// block without lexing the literal text on either side.
+ pub(crate) fn with_pos(src: &'a str, pos: usize) -> Result<Self, ParseError> {
+ let mut lexer = Lexer::with_pos(src, pos);
+ let peek0 = lexer.next_token()?;
+ let peek1 = lexer.next_token()?;
+ let line_starts = build_line_starts(src);
+ let is_ascii_src = src.is_ascii();
+ Ok(Self {
+ src,
+ lexer,
+ peek0,
+ peek1,
+ last_consumed_end: pos,
+ cast_as_stop: None,
+ between_body_depth: 0,
+ suppress_setstmt_trailing_order_by: false,
+ suppress_array_join_checks: false,
+ stop_postfix_call_before_colon_equals: false,
+ stmt_rhs_recover_on_pratt_rhs_failure: false,
+ limit_body_depth: 0,
+ pivot_in_stop: None,
+ hogqlx_text_lookahead_depth: 0,
+ line_starts,
+ char_offsets: std::cell::OnceCell::new(),
+ is_ascii_src,
+ })
+ }
+
+ pub(crate) fn peek(&self) -> TokenKind {
+ self.peek0.kind
+ }
+ pub(crate) fn peek_next(&self) -> TokenKind {
+ self.peek1.kind
+ }
+
+ pub(crate) fn bump(&mut self) -> Result<Token, ParseError> {
+ let next = match self.lexer.next_token() {
+ Ok(t) => t,
+ Err(_e) if self.hogqlx_text_lookahead_depth > 0 => {
+ // We're inside a HogQLX tag body (`HOGQLX_TEXT` lexer
+ // mode in cpp). Defer the error — the immediate caller
+ // is about to byte-walk the text body and re-seek the
+ // lexer via `set_lexer_pos`, so peek1's invalid state
+ // is transient. Stash a synthetic Eof at the current
+ // lexer position; if `peek_next()` is consulted before
+ // the re-seek, the parser will see Eof and bail out
+ // cleanly (matching what it would have done in a
+ // boundary token's presence).
+ let pos = self.lexer.pos();
+ Token {
+ kind: TokenKind::Eof,
+ start: pos,
+ end: pos,
+ }
+ }
+ Err(e) => return Err(e),
+ };
+ let old = std::mem::replace(&mut self.peek0, self.peek1);
+ self.peek1 = next;
+ self.last_consumed_end = old.end;
+ Ok(old)
+ }
+
+ pub(crate) fn eat(&mut self, k: TokenKind) -> Result<bool, ParseError> {
+ if self.peek() == k {
+ self.bump()?;
+ Ok(true)
+ } else {
+ Ok(false)
+ }
+ }
+
+ pub(crate) fn eat_kw(&mut self, kw: Kw) -> Result<bool, ParseError> {
+ if self.peek() == TokenKind::Keyword(kw) {
+ self.bump()?;
+ Ok(true)
+ } else {
+ Ok(false)
+ }
+ }
+
+ pub(crate) fn expect(&mut self, k: TokenKind, what: &str) -> Result<Token, ParseError> {
+ if self.peek() == k {
+ self.bump()
+ } else {
+ Err(self.err(format!("expected {what}, got {:?}", self.peek())))
+ }
+ }
+
+ pub(crate) fn expect_kw(&mut self, kw: Kw, what: &str) -> Result<(), ParseError> {
+ if self.peek() == TokenKind::Keyword(kw) {
+ self.bump()?;
+ Ok(())
+ } else {
+ Err(self.err(format!("expected {what}, got {:?}", self.peek())))
+ }
+ }
+
+ pub(crate) fn expect_eof(&mut self) -> Result<(), ParseError> {
+ if self.peek() == TokenKind::Eof {
+ return Ok(());
+ }
+ // If the trailing token is a keyword, surface it as a reserved-
+ // keyword problem so the Python side maps the envelope to
+ // `HogQLSyntaxError` (the deserialiser triggers on the substring
+ // "reserved keyword"). Plain identifier or punctuation trailing
+ // gets the generic message.
+ let extra = match self.peek() {
+ TokenKind::Keyword(_) => " (reserved keyword cannot appear in this position)",
+ _ => "",
+ };
+ Err(self.err(format!(
+ "trailing tokens after expression: {:?}{extra}",
+ self.peek()
+ )))
+ }
+
+ pub(crate) fn err(&self, message: impl Into<String>) -> ParseError {
+ ParseError::syntax(message, self.peek0.start, self.peek0.end)
+ }
+
+ pub(crate) fn text(&self, t: Token) -> &'a str {
+ &self.src[t.start..t.end]
+ }
+
+ /// Resolve a byte offset to a cpp-shape `{line, column, offset}` object.
+ /// Lines are 1-based, columns are 0-based — matches the C++ visitor's
+ /// `start` / `end` emission. The `offset` and `column` fields are
+ /// CHARACTER indices (Unicode code points), not byte indices — cpp's
+ /// ANTLR `getStartIndex()` / `getCharPositionInLine()` are
+ /// character-based, so byte offsets need converting through `src`
+ /// slicing for any source containing non-ASCII bytes.
+ pub(crate) fn pos_obj(&self, byte_offset: usize) -> Value {
+ let (line, byte_col, line_start_byte) = offset_to_line_col(&self.line_starts, byte_offset);
+ // ASCII fast path: byte == char in every dimension. Avoid the
+ // `byte_to_char_index` binary search and the line-slice chars
+ // count entirely.
+ if self.is_ascii_src {
+ return emit::position(line, byte_col, byte_offset);
+ }
+ let char_offset = self.byte_to_char_index(byte_offset);
+ // Column needs to be characters-in-line, not bytes-in-line. For
+ // lines with multi-byte chars we count chars between the line
+ // start and the offset.
+ let column = if byte_col == 0 {
+ 0
+ } else {
+ self.src[line_start_byte..byte_offset].chars().count() as u32
+ };
+ emit::position(line, column, char_offset)
+ }
+
+ /// Convert a byte offset into the source into a character (Unicode
+ /// code point) index. Pure-ASCII sources short-circuit (byte index
+ /// == char index). Mixed sources lazily build a sorted `char_offsets`
+ /// vector on first call and binary-search subsequent lookups.
+ fn byte_to_char_index(&self, byte_offset: usize) -> usize {
+ let char_offsets = self.char_offsets.get_or_init(|| {
+ // Pure-ASCII fast path: skip the vector allocation entirely.
+ if self.src.is_ascii() {
+ None
+ } else {
+ Some(build_char_offsets(self.src))
+ }
+ });
+ match char_offsets {
+ None => byte_offset,
+ Some(offsets) => match offsets.binary_search(&byte_offset) {
+ Ok(idx) => idx,
+ // `byte_offset` lands inside a multi-byte char — return the
+ // index of the character starting at or before it.
+ Err(idx) => idx.saturating_sub(1),
+ },
+ }
+ }
+
+ /// Inject `start` / `end` position objects on `value` using `start`
+ /// (the byte offset of the first token consumed) and the parser's
+ /// `last_consumed_end` (the end of the last token consumed). The
+ /// canonical wrap-on-return helper for every `parse_*` fn that emits
+ /// an AST node.
+ pub(crate) fn wrap_pos(&self, value: Value, start: usize) -> Value {
+ let s = self.pos_obj(start);
+ let e = self.pos_obj(self.last_consumed_end);
+ emit::with_pos(value, s, e)
+ }
+
+ /// Variant of [`Self::wrap_pos`] that takes an explicit end offset —
+ /// used when the natural end of the node isn't `last_consumed_end`
+ /// (e.g. composite chain re-tagged with the rightmost child's end).
+ pub(crate) fn wrap_pos_to(&self, value: Value, start: usize, end: usize) -> Value {
+ let s = self.pos_obj(start);
+ let e = self.pos_obj(end);
+ emit::with_pos(value, s, e)
+ }
+
+ /// Like [`Self::wrap_pos_to`] but overrides any existing `start` /
+ /// `end` on the node. Use when the inner expression's wrap missed
+ /// tokens that the outer grammar rule includes — e.g. cpp's
+ /// `ColumnExprColumnsReplace` ctx covers the outer parens but the
+ /// inner ColumnsExpr was wrapped at the `*` position only.
+ pub(crate) fn replace_pos_to(&self, value: Value, start: usize, end: usize) -> Value {
+ let s = self.pos_obj(start);
+ let e = self.pos_obj(end);
+ emit::replace_pos(value, s, e)
+ }
+
+ /// Snapshot the parser cursor + per-call context so a failed
+ /// alternative can be rolled back. Carries the byte position of
+ /// `peek0`, the end of the last-consumed token, and the CAST/AS
+ /// stop. The lexer itself is `(src, pos)` — restoring re-derives
+ /// the peek window via `set_lexer_pos`.
+ ///
+ /// AST construction is purely returned-by-value, never stored on
+ /// `Parser`, so the checkpoint doesn't need to capture any AST
+ /// state. If a future change adds parser-stored AST state, it must
+ /// be added here (and a `restore` regression test added).
+ pub(crate) fn checkpoint(&self) -> Checkpoint {
+ Checkpoint {
+ pos: self.peek0.start,
+ last_consumed_end: self.last_consumed_end,
+ cast_as_stop: self.cast_as_stop,
+ }
+ }
+
+ /// Restore the parser to a prior checkpoint. Re-lexes `peek0` and
+ /// `peek1` from the saved byte offset.
+ pub(crate) fn restore(&mut self, c: Checkpoint) -> Result<(), ParseError> {
+ self.set_lexer_pos(c.pos)?;
+ self.last_consumed_end = c.last_consumed_end;
+ self.cast_as_stop = c.cast_as_stop;
+ Ok(())
+ }
+
+ /// ALL(*)-style adaptive lookahead via bounded backtrack: try each
+ /// alternative in order; commit to the first that parses to
+ /// completion. Failed alternatives roll the parser cursor back to
+ /// the checkpoint before the call, so the next alt sees the same
+ /// input.
+ ///
+ /// **Invariant**: each alternative must consume at least one token
+ /// before recursing into a Pratt loop on the same rule — otherwise
+ /// a re-entrant `try_alt` on the same decision can loop forever.
+ /// Callers are expected to enforce this via their grammar shape
+ /// (the alts correspond to grammar rule arms, each of which has at
+ /// least one mandatory terminal).
+ ///
+ /// **Error reporting**: the error from the last-tried alt
+ /// surfaces. For better diagnostics we should later prefer the
+ /// alt that progressed furthest into the input (deepest
+ /// `peek0.start`); deferring that until we see whether error
+ /// messages regress in practice.
+ #[allow(clippy::type_complexity)]
+ pub(crate) fn try_alt<T>(
+ &mut self,
+ alts: &[&dyn Fn(&mut Self) -> Result<T, ParseError>],
+ ) -> Result<T, ParseError> {
+ let cp = self.checkpoint();
+ let mut last_err: Option<ParseError> = None;
+ for alt in alts {
+ match alt(self) {
+ Ok(v) => return Ok(v),
+ Err(e) if e.fatal => {
+ // Alt committed to its parse and failed validation
+ // past the point of no return; cpp's ANTLR would
+ // raise visitor-level NotImplementedError here.
+ // Short-circuit so the outer error is the actual
+ // diagnostic, not "no matching alternative".
+ return Err(e);
+ }
+ Err(e) => {
+ self.restore(cp)?;
+ last_err = Some(e);
+ }
+ }
+ }
+ Err(last_err.unwrap_or_else(|| self.err("no matching alternative")))
+ }
+
+ /// Cross-arm backtrack with a follow-set check. Each alternative
+ /// parses its branch; AFTER a successful parse, the `followup_ok`
+ /// predicate is consulted against the post-parse `peek` token. If
+ /// the alt's parse succeeds AND the follow-up token is in the
+ /// caller's accepted set, the alt commits. Otherwise the alt is
+ /// rolled back like a parse failure and the next alt is tried.
+ ///
+ /// This extends `try_alt` to handle decisions whose discriminator
+ /// is what comes AFTER the arm's parse, not just whether the arm
+ /// parsed. The motivating case is `NOT (a,) -> 1` vs
+ /// `NOT ((a,) -> 1)`: with bare `try_alt`, the function-call arm
+ /// successfully parses `not((a,))` for the first input, leaving
+ /// `-> 1` as trailing tokens for the OUTER caller to choke on —
+ /// by which point we've already committed. With a follow-up check
+ /// that rejects `Arrow` at expression-follow position, the
+ /// function-call arm fails on the first input (allowing the
+ /// NOT-prefix arm to take over) but succeeds on the second (where
+ /// `(a,) -> 1` is a single inner columnExpr and the post-parse
+ /// peek is EOF / clean).
+ ///
+ /// **Cost**: each alt that parses successfully but fails the
+ /// follow-up check is wasted work (parses then rolls back). This
+ /// is the bounded-backtrack analogue of ANTLR's adaptive LL
+ /// prediction without the DFA cache. For our grammar's decision
+ /// points the wasted work is bounded by the arm depth.
+ #[allow(dead_code, clippy::type_complexity)]
+ pub(crate) fn try_alt_with_followup<T, F>(
+ &mut self,
+ alts: &[&dyn Fn(&mut Self) -> Result<T, ParseError>],
+ followup_ok: F,
+ ) -> Result<T, ParseError>
+ where
+ F: Fn(TokenKind) -> bool,
+ {
+ let cp = self.checkpoint();
+ let mut last_err: Option<ParseError> = None;
+ for alt in alts {
+ match alt(self) {
+ Ok(v) => {
+ if followup_ok(self.peek()) {
+ return Ok(v);
+ }
+ // Alt parsed but the follow-up isn't acceptable.
+ // Roll back; the next alt should fit better. Build
+ // an error in case all alts fail follow-up.
+ let what = self.peek();
+ self.restore(cp)?;
+ last_err = Some(self.err(format!(
+ "alt parsed but follow-up token {:?} isn't accepted",
+ what
+ )));
+ }
+ Err(e) => {
+ self.restore(cp)?;
+ last_err = Some(e);
+ }
+ }
+ }
+ Err(last_err.unwrap_or_else(|| self.err("no matching alternative")))
+ }
+}
+
+/// Snapshot of `Parser` cursor + per-call context for backtracking via
+/// [`Parser::try_alt`]. Returned by [`Parser::checkpoint`]; consumed by
+/// [`Parser::restore`].
+#[derive(Clone, Copy)]
+pub(crate) struct Checkpoint {
+ pos: usize,
+ last_consumed_end: usize,
+ cast_as_stop: Option<usize>,
+}
+
+// Per-section method bodies live in the submodules:
+// - `bp.rs` : binding powers, infix/postfix dispatch tables
+// - `expr.rs` : Pratt loop, primary forms, postfix, special infix
+// - `select.rs` : SELECT statement + clauses + WINDOW + LIMIT
+// - `join.rs` : FROM/JOIN chain, table expressions, PIVOT/UNPIVOT
+// - `cte.rs` : WITH/CTE
+// - `template.rs` : `f'…'` template-string body splitter
+
+// ============================================================================
+// Lexeme helpers (number / string / identifier text decoding)
+// ============================================================================
+
+/// Parse the post-`0x` text of a strict-C99 hex-float literal to f64:
+/// `<hex>+(.<hex>*)?p[+-]?<dec>+`. Rust's f64 `FromStr` doesn't accept
+/// a `0x` prefix, so accumulate the mantissa from the hex digits and
+/// scale by `2^exp`. Bounded-precision when the mantissa overflows
+/// f64 (matches what `strtod` would do anyway).
+fn parse_hex_float_value(rest: &str) -> f64 {
+ let p_idx = rest
+ .bytes()
+ .position(|b| b == b'p' || b == b'P')
+ .expect("caller guarantees a p/P marker is present");
+ let mantissa = &rest[..p_idx];
+ let exp_str = &rest[p_idx + 1..];
+ let (int_part, frac_part) = match mantissa.find('.') {
+ Some(i) => (&mantissa[..i], &mantissa[i + 1..]),
+ None => (mantissa, ""),
+ };
+ let mut m = 0.0_f64;
+ for c in int_part.chars() {
+ m = m * 16.0 + f64::from(c.to_digit(16).unwrap_or(0));
+ }
+ let mut scale = 1.0_f64 / 16.0;
+ for c in frac_part.chars() {
+ m += f64::from(c.to_digit(16).unwrap_or(0)) * scale;
+ scale /= 16.0;
+ }
+ let exp: i32 = exp_str.parse().unwrap_or(0);
+ m * 2.0_f64.powi(exp)
+}
+
+/// Emit a finite float as a numeric Constant, or `±Infinity` / `NaN`
+/// when the value isn't finite — mirrors cpp's `stod` result (and its
+/// `out_of_range` → `±Infinity` fallthrough).
+fn emit_float_constant(f: f64) -> Value {
+ if !f.is_finite() {
+ return emit::constant_special_number(if f.is_nan() {
+ "NaN"
+ } else if f > 0.0 {
+ "Infinity"
+ } else {
+ "-Infinity"
+ });
+ }
+ emit::constant(
+ serde_json::Number::from_f64(f)
+ .map(Value::Number)
+ .unwrap_or(Value::Null),
+ )
+}
+
+pub(crate) fn parse_number_literal(src: &str, negative: bool) -> Result<Value, ParseError> {
+ // Hex literal — `0x…`. Three cases:
+ // - Contains `p`/`P`: hex-float (`FLOATING_LITERAL` strict C99
+ // `HEX (DOT HEX*)? P [+-]? DEC+`). Parse to f64 — Rust's f64
+ // `FromStr` doesn't accept a `0x` prefix, so hand-roll it.
+ // - Fits i64: native int.
+ // - Beyond i64: lossless via the `value_type: "number"` digit
+ // string envelope (serde_json::Value can't hold an arbitrary
+ // bigint as a native JSON number).
+ if let Some(rest) = src.strip_prefix("0x").or_else(|| src.strip_prefix("0X")) {
+ if rest.bytes().any(|b| b == b'p' || b == b'P') {
+ let f = parse_hex_float_value(rest);
+ return Ok(emit_float_constant(if negative { -f } else { f }));
+ }
+ let signed = if negative {
+ format!("-{rest}")
+ } else {
+ rest.to_string()
+ };
+ match i64::from_str_radix(&signed, 16) {
+ Ok(n) => return Ok(emit::constant(Value::from(n))),
+ Err(_) => {
+ let lit = if negative {
+ format!("-{src}")
+ } else {
+ src.to_string()
+ };
+ return Ok(emit::constant_number_string(lit));
+ }
+ }
+ }
+ // `0o`-prefixed octal — cpp 1.3.45's `VISIT(NumberLiteral)`
+ // unconditionally rejects it (matches ClickHouse and pre-pg16
+ // Postgres). The lexer captures `0o<dec digits>` as one Number
+ // token purely so we can raise the error here.
+ if src.starts_with("0o") || src.starts_with("0O") {
+ return Err(ParseError::syntax(
+ format!(
+ "HogQL does not support `0o`-prefixed octal integer literals; got `{src}`. Use a plain decimal literal instead."
+ ),
+ 0,
+ src.len(),
+ ));
+ }
+ // `0b`-prefixed binary. cpp: a non-binary digit makes it a
+ // MALFORMED_BINARY_LITERAL token (no grammar rule references it →
+ // reject); the magnitude must fit UInt64 (positive) or 2^63
+ // (negative).
+ if let Some(rest) = src.strip_prefix("0b").or_else(|| src.strip_prefix("0B")) {
+ if rest.is_empty() || !rest.bytes().all(|b| b == b'0' || b == b'1') {
+ return Err(ParseError::syntax(
+ format!("invalid binary integer literal `{src}` (digits must be 0 or 1)"),
+ 0,
+ src.len(),
+ ));
+ }
+ let magnitude = u64::from_str_radix(rest, 2).map_err(|_| {
+ ParseError::syntax(
+ format!("HogQL binary integer literals are limited to 64 bits; got `{src}`."),
+ 0,
+ src.len(),
+ )
+ })?;
+ if negative {
+ // cpp: magnitude > 2^63 rejects; == 2^63 is i64::MIN;
+ // otherwise the negated i64.
+ if magnitude > (1u64 << 63) {
+ return Err(ParseError::syntax(
+ format!("HogQL binary integer literals are limited to 64 bits; got `{src}`."),
+ 0,
+ src.len(),
+ ));
+ }
+ let v = if magnitude == (1u64 << 63) {
+ i64::MIN
+ } else {
+ -(magnitude as i64)
+ };
+ return Ok(emit::constant(Value::from(v)));
+ }
+ // Positive: `Value::from(u64)` emits the exact magnitude as a
+ // JSON number — for magnitude > i64::MAX this preserves the
+ // full unsigned value (cpp emits the same via Json::raw).
+ return Ok(emit::constant(Value::from(magnitude)));
+ }
+ // cpp 1.3.45's `VISIT(NumberLiteral)` parses integer text with
+ // `stoll(text, nullptr, 10)` — base 10, NOT base-0 auto-detect.
+ // Leading zeros are no-ops, never octal: `017` → 17, `09` → 9.
+ // (Pre-1.3.45 cpp used base-0, which made `017` C-style octal 15;
+ // that's been removed upstream.) The plain `src.parse()` path
+ // below already does base-10 parsing, so leading-zero integers
+ // need no special handling.
+ let is_float = src.contains('.') || src.contains('e') || src.contains('E');
+ if is_float {
+ let f: f64 = src.parse().unwrap_or(0.0);
+ return Ok(emit_float_constant(if negative { -f } else { f }));
+ }
+ // Integer. The signed text carries the sign so
+ // `-9223372036854775808` (i64::MIN) parses exactly. A literal
+ // wider than i64 is kept lossless as a digit string — see the hex
+ // branch above for why it can't round-trip as a JSON number.
+ let signed = if negative {
+ format!("-{src}")
+ } else {
+ src.to_string()
+ };
+ match signed.parse::<i64>() {
+ Ok(i) => Ok(emit::constant(Value::from(i))),
+ Err(_) => Ok(emit::constant_number_string(signed)),
+ }
+}
+
+/// Decode a quoted body — the text between matching quotes, with the
+/// quotes already stripped. Processes backslash escapes (`\n`, `\t`,
+/// `\r`, `\0`, `\\`, `\'`, `\"`, `\b`, `\f`) and the SQL doubled-quote
+/// escape (`quote` `quote` → `quote`). Shared by single-quoted string
+/// literals and `"`/`` ` ``-quoted identifiers — the grammar's
+/// `STRING_LITERAL` and quoted-`IDENTIFIER` rules admit the same
+/// `ESCAPE_CHAR_COMMON` set. Mirrors `parse_string_literal_ctx` on the
+/// C++ side.
+fn decode_quoted_body(inner: &str, quote: char) -> String {
+ let mut out = String::with_capacity(inner.len());
+ let mut chars = inner.chars().peekable();
+ while let Some(c) = chars.next() {
+ if c == '\\' {
+ match chars.next() {
+ Some('n') => out.push('\n'),
+ Some('t') => out.push('\t'),
+ Some('r') => out.push('\r'),
+ // cpp's `string.cpp` ignores `\0` (NUL is dropped, not
+ // emitted) and decodes `\a` → BEL, `\v` → VT.
+ Some('0') => {}
+ Some('a') => out.push('\u{07}'),
+ Some('v') => out.push('\u{0B}'),
+ Some('\'') => out.push('\''),
+ Some('"') => out.push('"'),
+ Some('\\') => out.push('\\'),
+ Some('b') => out.push('\u{08}'),
+ Some('f') => out.push('\u{0C}'),
+ Some(other) => {
+ out.push('\\');
+ out.push(other);
+ }
+ None => out.push('\\'),
+ }
+ } else if c == quote {
+ // Doubled `quote quote` inside the body -> one `quote`.
+ if chars.peek() == Some(&quote) {
+ chars.next();
+ out.push(quote);
+ } else {
+ out.push(c);
+ }
+ } else {
+ out.push(c);
+ }
+ }
+ out
+}
+
+/// Decode a single-quoted string literal: strip the surrounding quotes
+/// and process the escapes handled by [`decode_quoted_body`].
+pub(crate) fn unquote_single_string(src: &str) -> String {
+ decode_quoted_body(&src[1..src.len() - 1], '\'')
+}
+
+pub(crate) fn identifier_text(src: &str, kind: TokenKind) -> String {
+ match kind {
+ TokenKind::QuotedIdent => {
+ let bytes = src.as_bytes();
+ let quote = bytes[0] as char;
+ // The quoted-`IDENTIFIER` rule admits the same
+ // `ESCAPE_CHAR_COMMON` escapes as a string literal (plus the
+ // doubled-quote escape), so the identifier name carries
+ // `\n` / `\t` / … decoded, not literal.
+ decode_quoted_body(&src[1..src.len() - 1], quote)
+ }
+ _ => src.to_string(),
+ }
+}
+
+/// Keywords accepted as the type-cast target on the `::` postfix. Maps to
+/// the grammar's `columnTypeCastIdentifier` rule: IDENTIFIER /
+/// QUOTED_IDENTIFIER / interval-units / `DATE` / `TIME` / `TIMESTAMP` /
+/// `INTERVAL`. Any other keyword (e.g. `WITH`, `ZONE`, `LOCAL`) is
+/// rejected so `1::with` doesn't silently parse as a TypeCast.
+pub(crate) fn kw_valid_type_cast_ident(kw: Kw) -> bool {
+ matches!(
+ kw,
+ Kw::Date
+ | Kw::Time
+ | Kw::Timestamp
+ | Kw::Interval
+ | Kw::Second
+ | Kw::Minute
+ | Kw::Hour
+ | Kw::Day
+ | Kw::Week
+ | Kw::Month
+ | Kw::Quarter
+ | Kw::Year
+ )
+}
+
+/// Reserved keywords that can't be used as bare (unquoted) aliases. Mirrors
+/// `posthog.hogql.constants.RESERVED_KEYWORDS = [*KEYWORDS, "team_id"]`
+/// where `KEYWORDS = ["true", "false", "null"]`.
+pub(crate) fn is_reserved_alias_name(name: &str) -> bool {
+ let n = name.to_ascii_lowercase();
+ matches!(n.as_str(), "true" | "false" | "null" | "team_id")
+}
+
+/// cpp's `assertValidAlias`: an unquoted alias / identifier equal to a
+/// reserved keyword is rejected. Callers invoke this only for the
+/// *unquoted* alias forms — a quoted alias (`"true"`, `` `team_id` ``)
+/// opts out, exactly as cpp's `isQuotedIdentifier` guard does.
+pub(crate) fn check_alias_not_reserved(
+ name: &str,
+ start: usize,
+ end: usize,
+) -> Result<(), ParseError> {
+ if is_reserved_alias_name(name) {
+ return Err(ParseError::syntax(
+ format!("\"{name}\" cannot be an alias or identifier, as it's a reserved keyword"),
+ start,
+ end,
+ ));
+ }
+ Ok(())
+}
+
+/// Keywords accepted as implicit column aliases (no `AS`). Matches the
+/// grammar's `keywordForImplicitAlias` rule.
+pub(crate) fn kw_allowed_as_implicit_alias(kw: Kw) -> bool {
+ matches!(
+ kw,
+ Kw::Ascending
+ | Kw::Cohort
+ | Kw::Date
+ | Kw::Descending
+ | Kw::Final
+ | Kw::Id
+ | Kw::Return
+ | Kw::Top
+ | Kw::Totals
+ )
+}
+
+/// Keywords admissible wherever the grammar's `identifier` rule
+/// applies — `identifier: IDENTIFIER | QUOTED_IDENTIFIER | interval |
+/// keyword`. The `keyword` rule omits:
+/// - the literal keywords TRUE / FALSE / NULL / INF / NAN,
+/// - the hard set-op introducers INTERSECT / EXCEPT,
+/// - the Hog-statement keywords FN / FUN / LET / WHILE / THROW / TRY
+/// / CATCH / FINALLY — these head a `statement` and are NOT in the
+/// `keyword` rule, so they are not valid identifiers / Field names
+/// (cpp rejects `fn`, `let`, … in expression position).
+///
+/// `interval` adds the unit keywords, which are never in the omitted
+/// set anyway.
+///
+/// Unlike `kw_acts_as_ident_in_primary` this does NOT also exclude the
+/// special-form heads (CASE / CAST / SELECT / LAMBDA / INTERVAL / NOT):
+/// in a plain `identifier` position — e.g. a table alias after `AS`,
+/// per `tableExpr: … | tableExpr (alias | AS identifier) …` — there is
+/// no special-form ambiguity to guard against, and cpp accepts them.
+pub(crate) fn kw_valid_as_identifier(kw: Kw) -> bool {
+ // `true` / `false` are NOT lexer-level keywords in the cpp
+ // grammar (they're plain IDENTIFIERs), so they pass through as
+ // valid identifiers in chain / table-ident / CTE column / etc.
+ // positions. The bare-Field branch in parse_primary still
+ // promotes them to Bool Constants; only positions that route
+ // through this predicate (postfix `.`, table identifiers, CTE
+ // columns, columnAliases) admit them as identifier text.
+ !matches!(
+ kw,
+ Kw::Null
+ | Kw::Inf
+ | Kw::Nan
+ | Kw::Intersect
+ | Kw::Except
+ | Kw::Fn
+ | Kw::Fun
+ | Kw::Let
+ | Kw::While
+ | Kw::Throw
+ | Kw::Try
+ | Kw::Catch
+ | Kw::Finally
+ )
+}
+
+pub(crate) fn kw_acts_as_ident_in_primary(kw: Kw) -> bool {
+ !matches!(
+ kw,
+ // Reserved primary forms — handled by their own parse_primary
+ // branches. `COLUMNS` and `WITH` aren't in this list: the
+ // dedicated `COLUMNS(...)` branch gates on a `(` follow-up,
+ // and `WITH` only consumes CTEs at the start of a SELECT
+ // stmt context (parse_select_*). In any other position both
+ // fall through here and parse as identifiers per the
+ // grammar's keyword rule.
+ Kw::Case | Kw::Select
+ | Kw::Cast | Kw::TryCast | Kw::Lambda | Kw::Interval
+ // Already handled by parse_primary as their own variants.
+ | Kw::True | Kw::False | Kw::Null | Kw::Inf | Kw::Nan
+ // Prefix operators handled by parse_prefix.
+ | Kw::Not
+ // Hard set-op keywords — cpp's grammar `keyword` rule
+ // explicitly OMITS Intersect and Except (UNION is included).
+ // Treating them as identifiers would let `intersect (select)`
+ // parse as Call(intersect, [select]) in a column-list context,
+ // diverging from cpp which uses them only as set-op
+ // introducers.
+ | Kw::Intersect | Kw::Except
+ // Hog-statement keywords — also OMITTED from the `keyword`
+ // rule, so they are not Field names / call heads in an
+ // expression (`fn`, `let`, `while`, … are rejected by cpp in
+ // expression position).
+ | Kw::Fn | Kw::Fun | Kw::Let | Kw::While
+ | Kw::Throw | Kw::Try | Kw::Catch | Kw::Finally
+ )
+}
+
+/// Walk into a SelectQuery / SelectSetQuery and attach the given CTE
+/// list to the innermost SelectQuery's `ctes` field. Used by the
+/// `WITH ctes (selectSet)` form where the CTEs declared before the
+/// wrapper paren belong to the inner SELECT. cpp's `VISIT(SelectStmtWithParens)`
+/// **appends** the outer CTEs after any existing inner CTEs — so if the
+/// inner already has `WITH a AS ...`, the outer's CTEs come *after* `a`
+/// in declaration order. Match that.
+pub(crate) fn inject_ctes_into_select(node: &mut Value, ctes: Vec<Value>) {
+ let mut cursor: &mut Value = node;
+ loop {
+ let Some(obj) = cursor.as_object_mut() else {
+ return;
+ };
+ match obj.get("node").and_then(Value::as_str) {
+ Some("SelectQuery") => {
+ match obj.get_mut("ctes") {
+ Some(existing) if existing.is_array() => {
+ if let Some(arr) = existing.as_array_mut() {
+ arr.extend(ctes);
+ }
+ }
+ _ => {
+ obj.insert("ctes".into(), Value::Array(ctes));
+ }
+ }
+ return;
+ }
+ Some("SelectSetQuery") => {
+ let Some(inner) = obj.get_mut("initial_select_query") else {
+ return;
+ };
+ cursor = inner;
+ }
+ _ => return,
+ }
+ }
+}
+
+/// Format a set operator from its base + modifier + by_name. Mirrors the
+/// C++ visitor's switch-tree; returns None for impossible combinations
+/// (e.g. `EXCEPT DISTINCT`).
+pub(crate) fn format_set_op(base: &str, modifier: Option<&str>, by_name: bool) -> Option<String> {
+ let stem = match (base, modifier) {
+ ("UNION", Some("ALL")) => "UNION ALL",
+ ("UNION", Some("DISTINCT")) => "UNION DISTINCT",
+ ("UNION", None) => "UNION DISTINCT", // C++ default for bare UNION
+ ("INTERSECT", Some("ALL")) => "INTERSECT ALL",
+ ("INTERSECT", Some("DISTINCT")) => "INTERSECT DISTINCT",
+ ("INTERSECT", None) => "INTERSECT",
+ ("EXCEPT", Some("ALL")) => "EXCEPT ALL",
+ ("EXCEPT", None) => "EXCEPT",
+ _ => return None,
+ };
+ Some(if by_name {
+ format!("{stem} BY NAME")
+ } else {
+ stem.to_string()
+ })
+}
+
+/// Merge top-level decorators (`order_by` / `limit` / `offset`) into a
+/// SELECT/SelectSetQuery node. When the target is a SelectSetQuery they
+/// land on the wrapper; for a single SelectQuery they merge into its
+/// existing fields. We pass through whatever shape we have.
+pub(crate) fn merge_select_decorators(mut node: Value, decorators: Vec<(String, Value)>) -> Value {
+ if decorators.is_empty() {
+ return node;
+ }
+ if let Some(obj) = node.as_object_mut() {
+ for (k, v) in decorators {
+ // Clobber pre-existing values on the inner SelectQuery —
+ // cpp's `VISIT(SelectSetStmt)` walks the inner select
+ // first, then the trailing `orderByClause` /
+ // `limitAndOffsetClauseOptional`, so later writes (the SET
+ // level) overwrite earlier ones (the inner STMT level).
+ // A `Value::Null` is a sentinel for "remove this key" —
+ // the SET-level visitor writes all four limit-related
+ // fields, clearing the inner's `offset` even when the
+ // outer clause has no OFFSET of its own.
+ if v.is_null() {
+ obj.remove(&k);
+ } else {
+ obj.insert(k, v);
+ }
+ }
+ }
+ node
+}
+
+/// Build / extend a JoinExpr chain. `left` is the existing chain root; we
+/// walk down its `next_join` pointers and attach `right` (carrying its
+/// `join_type` + `constraint`) at the tail.
+pub(crate) fn chain_join(
+ mut left: Value,
+ mut right: Value,
+ join_type: &str,
+ constraint: Option<Value>,
+) -> Value {
+ if let Some(obj) = right.as_object_mut() {
+ obj.insert("join_type".into(), Value::String(join_type.into()));
+ if let Some(c) = constraint {
+ obj.insert("constraint".into(), c);
+ }
+ }
+ // Walk to the tail of `left`'s next_join chain.
+ {
+ let mut cursor: &mut Value = &mut left;
+ loop {
+ let next_exists = cursor
+ .as_object()
+ .and_then(|o| o.get("next_join"))
+ .map(|v| !v.is_null())
+ .unwrap_or(false);
+ if !next_exists {
+ break;
+ }
+ let obj = cursor.as_object_mut().unwrap();
+ cursor = obj.get_mut("next_join").unwrap();
+ }
+ if let Some(obj) = cursor.as_object_mut() {
+ obj.insert("next_join".into(), right);
+ }
+ }
+ left
+}
+
+/// Map an INTERVAL unit name (e.g. "month") to the call name the C++
+/// visitor emits (`toIntervalMonth`). Case-insensitive, accepts singular
+/// and pluralised forms.
+pub(crate) fn interval_call_name(unit: &str) -> Option<&'static str> {
+ let u = unit.to_ascii_lowercase();
+ // `yyyy` is a lexer-level alias for YEAR (HogQLLexer.common.g4
+ // line 140: `YEAR: Y E A R | Y Y Y Y`).
+ if u == "yyyy" {
+ return Some("toIntervalYear");
+ }
+ match u.trim_end_matches('s') {
+ "second" => Some("toIntervalSecond"),
+ "minute" => Some("toIntervalMinute"),
+ "hour" => Some("toIntervalHour"),
+ "day" => Some("toIntervalDay"),
+ "week" => Some("toIntervalWeek"),
+ "month" => Some("toIntervalMonth"),
+ "quarter" => Some("toIntervalQuarter"),
+ "year" => Some("toIntervalYear"),
+ _ => None,
+ }
+}
+
+/// Case-sensitive variant of `interval_call_name` used by the
+/// `INTERVAL '<n> <unit>'` combined-string form. cpp's
+/// `visitColumnExprIntervalString` matches the unit against a
+/// literal-lowercase set, so `'1 SECOND'` is rejected. The keyword-form
+/// (`INTERVAL 5 SECOND`) uses the case-insensitive helper because
+/// keywords come from the lexer (which is case-insensitive).
+pub(crate) fn interval_call_name_case_sensitive(unit: &str) -> Option<&'static str> {
+ match unit.trim_end_matches('s') {
+ "second" => Some("toIntervalSecond"),
+ "minute" => Some("toIntervalMinute"),
+ "hour" => Some("toIntervalHour"),
+ "day" => Some("toIntervalDay"),
+ "week" => Some("toIntervalWeek"),
+ "month" => Some("toIntervalMonth"),
+ "quarter" => Some("toIntervalQuarter"),
+ "year" => Some("toIntervalYear"),
+ _ => None,
+ }
+}
+
+/// Collect the byte offset of each line start in `src`. Line 1 begins at
+/// offset 0; each `\n` byte begins the next line. Single pass over the
+/// source, used by `offset_to_line_col` for O(log N) lookups.
+fn build_line_starts(src: &str) -> Vec<usize> {
+ let mut starts = Vec::with_capacity(src.len() / 40 + 1);
+ starts.push(0);
+ for (i, b) in src.as_bytes().iter().enumerate() {
+ if *b == b'\n' {
+ starts.push(i + 1);
+ }
+ }
+ starts
+}
+
+/// Resolve a byte offset to `(line, byte_column, line_start_byte)` using
+/// a sorted line-starts table. cpp's visitor uses 1-based lines and
+/// 0-based columns. The caller converts `byte_column` to character
+/// column via `src[line_start_byte..byte_offset].chars().count()` when
+/// the source contains non-ASCII bytes.
+fn offset_to_line_col(line_starts: &[usize], offset: usize) -> (u32, u32, usize) {
+ let line_idx = match line_starts.binary_search(&offset) {
+ Ok(i) => i,
+ Err(i) => i.saturating_sub(1),
+ };
+ let line = (line_idx + 1) as u32;
+ let line_start_byte = line_starts[line_idx];
+ let byte_column = (offset - line_start_byte) as u32;
+ (line, byte_column, line_start_byte)
+}
+
+/// Collect the byte offset of each character start in `src`. The i-th
+/// entry is the byte index where character i begins. `byte_to_char_index`
+/// binary-searches this to convert from byte offsets (our lexer's
+/// position units) to character indices (cpp's ANTLR `getStartIndex()`
+/// semantics). Only called for non-ASCII sources — pure-ASCII parses
+/// short-circuit to `byte_offset == char_index`.
+fn build_char_offsets(src: &str) -> Vec<usize> {
+ let mut offsets: Vec<usize> = Vec::with_capacity(src.len());
+ for (i, _) in src.char_indices() {
+ offsets.push(i);
+ }
+ offsets.push(src.len()); // sentinel for end-of-source
+ offsets
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ /// `checkpoint` + `restore` on a freshly-constructed parser must
+ /// leave it indistinguishable from one constructed at the same
+ /// byte offset: same peek window, same `last_consumed_end`, same
+ /// CAST stop. Validates that the snapshot captures everything that
+ /// matters to subsequent parsing.
+ #[test]
+ fn checkpoint_restore_roundtrip() {
+ let src = "select 1 from a";
+ let mut p = Parser::new(src).expect("init parser");
+ // Move the cursor past `select`.
+ p.bump().expect("bump select");
+ let cp = p.checkpoint();
+ let saved_peek0 = p.peek0;
+ let saved_peek1 = p.peek1;
+ let saved_last_end = p.last_consumed_end;
+
+ // Consume a couple more tokens, then restore.
+ p.bump().expect("bump 1");
+ p.bump().expect("bump from");
+ assert_ne!(p.peek0.kind, saved_peek0.kind, "advanced past cp");
+
+ p.restore(cp).expect("restore");
+ assert_eq!(p.peek0.kind, saved_peek0.kind);
+ assert_eq!(p.peek0.start, saved_peek0.start);
+ assert_eq!(p.peek1.kind, saved_peek1.kind);
+ assert_eq!(p.peek1.start, saved_peek1.start);
+ assert_eq!(p.last_consumed_end, saved_last_end);
+ }
+
+ /// `try_alt` commits to the first alt that succeeds. Failing alts
+ /// must roll the cursor back so the next alt sees pristine input.
+ /// Uses two trivial alts: alt A expects `FROM` (fails on `select`);
+ /// alt B consumes `SELECT` and succeeds.
+ #[test]
+ fn try_alt_picks_first_success() {
+ // Alt A: insists on seeing FROM as first token. Fails on
+ // `select` and rolls back.
+ // Alt B: consumes SELECT. Succeeds.
+ let src = "select 1";
+ let mut p = Parser::new(src).expect("init parser");
+ let result = p
+ .try_alt(&[
+ &|p: &mut Parser<'_>| {
+ p.expect_kw(Kw::From, "FROM")?;
+ Ok("from")
+ },
+ &|p: &mut Parser<'_>| {
+ p.expect_kw(Kw::Select, "SELECT")?;
+ Ok("select")
+ },
+ ])
+ .expect("alt B should win");
+ assert_eq!(result, "select");
+ // Cursor should be just past SELECT now (since alt B committed).
+ assert_eq!(p.peek0.kind, TokenKind::Number);
+ }
+
+ /// When every alt fails, `try_alt` surfaces an error and leaves
+ /// the cursor at the original checkpoint (so the caller can try
+ /// something else or report a meaningful error).
+ #[test]
+ fn try_alt_all_fail_restores_cursor() {
+ let src = "select 1";
+ let mut p = Parser::new(src).expect("init parser");
+ let start_peek = p.peek0;
+ let result: Result<(), ParseError> = p.try_alt(&[
+ &|p: &mut Parser<'_>| {
+ p.expect_kw(Kw::From, "FROM")?;
+ Ok(())
+ },
+ &|p: &mut Parser<'_>| {
+ p.expect_kw(Kw::Where, "WHERE")?;
+ Ok(())
+ },
+ ]);
+ assert!(result.is_err(), "both alts should fail");
+ assert_eq!(p.peek0.kind, start_peek.kind, "cursor unchanged");
+ assert_eq!(p.peek0.start, start_peek.start);
+ }
+
+ /// `try_alt` correctly rolls back arbitrary forward progress.
+ /// Alt A consumes 3 tokens then fails; the cursor must return all
+ /// the way to the original position before alt B runs.
+ #[test]
+ fn try_alt_rolls_back_deep_progress() {
+ let src = "select a from b";
+ let mut p = Parser::new(src).expect("init parser");
+ let result = p
+ .try_alt(&[
+ // Alt A: consumes 3 tokens then demands a NUMBER (after
+ // 3 bumps we're on `b`, an Ident). Fails.
+ &|p: &mut Parser<'_>| {
+ p.bump()?;
+ p.bump()?;
+ p.bump()?;
+ p.expect(TokenKind::Number, "number")?;
+ Ok("a")
+ },
+ // Alt B: consumes SELECT. Should see the original
+ // `select`, not whatever alt A advanced to.
+ &|p: &mut Parser<'_>| {
+ p.expect_kw(Kw::Select, "SELECT")?;
+ Ok("b")
+ },
+ ])
+ .expect("alt B should win");
+ assert_eq!(result, "b");
+ // Cursor is past SELECT. Next token should be `a` (Ident).
+ assert_eq!(p.peek0.kind, TokenKind::Ident);
+ }
+
+ /// `try_alt_with_followup` rejects an alt whose parse succeeded
+ /// but left the cursor on a follow-up token the caller forbids.
+ /// Models the `NOT (a,) -> 1` case: the function-call arm parses
+ /// `not((a,))` happily but leaves `->` at peek; the follow-up
+ /// check (rejecting Arrow) rolls it back so the NOT-prefix arm
+ /// can take over.
+ #[test]
+ fn try_alt_with_followup_rejects_unwanted_followup() {
+ let src = "select a";
+ let mut p = Parser::new(src).expect("init parser");
+ let start_peek = p.peek0;
+ // Alt A: parses SELECT but leaves `a` at peek. Follow-up check
+ // rejects Ident, so this rolls back.
+ // Alt B: parses SELECT, then consumes `a` so peek is EOF.
+ // Follow-up accepts Eof, so this commits.
+ let result = p
+ .try_alt_with_followup(
+ &[
+ &|p: &mut Parser<'_>| {
+ p.expect_kw(Kw::Select, "SELECT")?;
+ Ok("partial")
+ },
+ &|p: &mut Parser<'_>| {
+ p.expect_kw(Kw::Select, "SELECT")?;
+ p.bump()?; // a
+ Ok("complete")
+ },
+ ],
+ |t| matches!(t, TokenKind::Eof),
+ )
+ .expect("alt B should win");
+ assert_eq!(result, "complete");
+ assert_eq!(p.peek0.kind, TokenKind::Eof);
+ // Sanity: the starting peek shouldn't have changed before
+ // we started parsing.
+ assert_eq!(start_peek.kind, TokenKind::Keyword(Kw::Select));
+ }
+
+ /// `try_alt_with_followup` falls back when ALL alts succeed but
+ /// none have an acceptable follow-up. Returns the last alt's
+ /// follow-up rejection as the error and restores the cursor.
+ #[test]
+ fn try_alt_with_followup_all_followup_fail_restores_cursor() {
+ let src = "select a";
+ let mut p = Parser::new(src).expect("init parser");
+ let start_peek = p.peek0;
+ let result: Result<&'static str, ParseError> = p.try_alt_with_followup(
+ &[
+ &|p: &mut Parser<'_>| {
+ p.expect_kw(Kw::Select, "SELECT")?;
+ Ok("a")
+ },
+ &|p: &mut Parser<'_>| {
+ p.expect_kw(Kw::Select, "SELECT")?;
+ p.bump()?; // a
+ Ok("b")
+ },
+ ],
+ // Accept only Semicolon, neither alt leaves us there.
+ |t| matches!(t, TokenKind::Semicolon),
+ );
+ assert!(result.is_err());
+ assert_eq!(p.peek0.kind, start_peek.kind);
+ assert_eq!(p.peek0.start, start_peek.start);
+ }
+}
diff --git a/rust/hogql/parser/src/parse/bp.rs b/rust/hogql/parser/src/parse/bp.rs
new file mode 100644
index 000000000000..458bb907831d
--- /dev/null
+++ b/rust/hogql/parser/src/parse/bp.rs
@@ -0,0 +1,239 @@
+//! Pratt binding powers and the infix/postfix dispatch tables.
+//!
+//! The constants here are the only place precedence levels live; every
+//! other module reads them through `pub(super)` re-exports rather than
+//! hard-coding numbers. Higher value = tighter binding.
+
+use serde_json::Value;
+
+use crate::emit;
+use crate::lex::{Kw, TokenKind};
+
+pub(super) const BP_ALIAS: u8 = 10;
+pub(super) const BP_TERNARY: u8 = 20;
+pub(super) const BP_BETWEEN: u8 = 30;
+pub(super) const BP_OR: u8 = 40;
+pub(super) const BP_AND: u8 = 50;
+pub(super) const BP_NOT: u8 = 60;
+pub(super) const BP_NULLISH: u8 = 70;
+/// `IS [NOT] DISTINCT FROM` — declared *after* `IS NULL` in the grammar,
+/// so it binds looser. `a IS NOT DISTINCT FROM b IS NOT NULL` parses
+/// as `IsDistinctFrom(a, IsNull(b))` rather than `IsNull(IsDistinctFrom)`.
+pub(super) const BP_IS_DISTINCT_FROM: u8 = 80;
+/// `IS [NOT] NULL` — declared first in the grammar, binds tightest of
+/// the `IS …` family.
+pub(super) const BP_IS_NULL: u8 = 85;
+/// `IGNORE NULLS` — declared *before* `IS NULL` in the grammar but
+/// *after* arithmetic/comparison Precedence levels, so it binds
+/// tighter than IS NULL and looser than `*` / `+` / comparisons.
+pub(super) const BP_IGNORE_NULLS: u8 = 87;
+pub(super) const BP_COMPARE: u8 = 90;
+pub(super) const BP_ADDITIVE: u8 = 100;
+pub(super) const BP_MULT: u8 = 110;
+#[allow(dead_code)]
+pub(super) const BP_UNARY_MINUS: u8 = 120;
+pub(super) const BP_POSTFIX: u8 = 130;
+
+#[derive(Debug, Clone, Copy)]
+pub(super) enum InfixOp {
+ Mul,
+ Div,
+ Mod,
+ Add,
+ Sub,
+ Concat,
+ Eq,
+ NotEq,
+ Lt,
+ LtEq,
+ Gt,
+ GtEq,
+ Regex,
+ IRegex,
+ NotRegex,
+ NotIRegex,
+ And,
+ Or,
+ Nullish,
+}
+
+pub(super) fn infix_bp(kind: TokenKind) -> Option<(u8, u8, InfixOp)> {
+ let (lbp, op) = match kind {
+ TokenKind::Asterisk => (BP_MULT, InfixOp::Mul),
+ TokenKind::Slash => (BP_MULT, InfixOp::Div),
+ TokenKind::Percent => (BP_MULT, InfixOp::Mod),
+ TokenKind::Plus => (BP_ADDITIVE, InfixOp::Add),
+ TokenKind::Dash => (BP_ADDITIVE, InfixOp::Sub),
+ TokenKind::Concat => (BP_ADDITIVE, InfixOp::Concat),
+ TokenKind::EqDouble | TokenKind::EqSingle => (BP_COMPARE, InfixOp::Eq),
+ TokenKind::NotEq => (BP_COMPARE, InfixOp::NotEq),
+ TokenKind::Lt => (BP_COMPARE, InfixOp::Lt),
+ TokenKind::LtEq => (BP_COMPARE, InfixOp::LtEq),
+ TokenKind::Gt => (BP_COMPARE, InfixOp::Gt),
+ TokenKind::GtEq => (BP_COMPARE, InfixOp::GtEq),
+ TokenKind::RegexSingle | TokenKind::RegexDouble => (BP_COMPARE, InfixOp::Regex),
+ TokenKind::IRegexSingle | TokenKind::IRegexDouble => (BP_COMPARE, InfixOp::IRegex),
+ TokenKind::NotRegex => (BP_COMPARE, InfixOp::NotRegex),
+ TokenKind::NotIRegex => (BP_COMPARE, InfixOp::NotIRegex),
+ TokenKind::Keyword(Kw::And) => (BP_AND, InfixOp::And),
+ TokenKind::Keyword(Kw::Or) => (BP_OR, InfixOp::Or),
+ TokenKind::Nullish => (BP_NULLISH, InfixOp::Nullish),
+ _ => return None,
+ };
+ Some((lbp, lbp + 1, op))
+}
+
+pub(super) fn postfix_bp(kind: TokenKind) -> Option<u8> {
+ match kind {
+ TokenKind::LParen
+ | TokenKind::LBracket
+ | TokenKind::Dot
+ | TokenKind::NullProperty
+ | TokenKind::DoubleColon => Some(BP_POSTFIX),
+ _ => None,
+ }
+}
+
+pub(super) fn build_infix(op: InfixOp, lhs: Value, rhs: Value) -> Value {
+ match op {
+ InfixOp::Mul => emit::arith(lhs, "*", rhs),
+ InfixOp::Div => emit::arith(lhs, "/", rhs),
+ InfixOp::Mod => emit::arith(lhs, "%", rhs),
+ InfixOp::Add => emit::arith(lhs, "+", rhs),
+ InfixOp::Sub => emit::arith(lhs, "-", rhs),
+ InfixOp::Concat => merge_concat(lhs, rhs),
+ InfixOp::Eq => emit::compare(lhs, "==", rhs),
+ InfixOp::NotEq => emit::compare(lhs, "!=", rhs),
+ InfixOp::Lt => emit::compare(lhs, "<", rhs),
+ InfixOp::LtEq => emit::compare(lhs, "<=", rhs),
+ InfixOp::Gt => emit::compare(lhs, ">", rhs),
+ InfixOp::GtEq => emit::compare(lhs, ">=", rhs),
+ InfixOp::Regex => emit::compare(lhs, "=~", rhs),
+ InfixOp::IRegex => emit::compare(lhs, "=~*", rhs),
+ InfixOp::NotRegex => emit::compare(lhs, "!~", rhs),
+ InfixOp::NotIRegex => emit::compare(lhs, "!~*", rhs),
+ InfixOp::And => merge_and_or("And", lhs, rhs),
+ InfixOp::Or => merge_and_or("Or", lhs, rhs),
+ InfixOp::Nullish => emit::call("ifNull", vec![lhs, rhs]),
+ }
+}
+
+/// Flatten left-deep AND/OR trees into a single list to match the C++
+/// visitor. Parsing `a AND b AND c` left-assoc gives nested And's; the C++
+/// visitor pushes inner-And's children into the outer-And's list. Mirror
+/// that here so JSON parity holds.
+/// Flatten `||` chains the way cpp's `VISIT(ColumnExprPrecedence2)` does
+/// for the CONCAT alt: `a || b || c` becomes `concat(a, b, c)` rather
+/// than `concat(concat(a, b), c)`. Either side that's already a
+/// `Call(name="concat", ...)` contributes its existing args.
+pub(super) fn merge_concat(lhs: Value, rhs: Value) -> Value {
+ let mut args: Vec<Value> = Vec::new();
+ if is_concat_call(&lhs) {
+ if let Some(left_args) = lhs.get("args").and_then(Value::as_array).cloned() {
+ args.extend(left_args);
+ } else {
+ args.push(lhs);
+ }
+ } else {
+ args.push(lhs);
+ }
+ if is_concat_call(&rhs) {
+ if let Some(right_args) = rhs.get("args").and_then(Value::as_array).cloned() {
+ args.extend(right_args);
+ } else {
+ args.push(rhs);
+ }
+ } else {
+ args.push(rhs);
+ }
+ emit::call("concat", args)
+}
+
+fn is_concat_call(v: &Value) -> bool {
+ v.get("node").and_then(Value::as_str) == Some("Call")
+ && v.get("name").and_then(Value::as_str) == Some("concat")
+}
+
+pub(super) fn merge_and_or(node: &str, mut lhs: Value, rhs: Value) -> Value {
+ // cpp's `And` / `Or` visitor flattens BOTH operands, so `a AND b AND
+ // c` and `a AND (b AND c)` both produce a single flat `And` with
+ // three exprs — parenthesisation does not nest. Flatten the rhs's
+ // children in when it is the same node type.
+ let rhs_children: Vec<Value> = match rhs {
+ Value::Object(mut o) if o.get("node").and_then(Value::as_str) == Some(node) => {
+ match o.remove("exprs") {
+ Some(Value::Array(a)) => a,
+ other => {
+ if let Some(v) = other {
+ o.insert("exprs".into(), v);
+ }
+ vec![Value::Object(o)]
+ }
+ }
+ }
+ other => vec![other],
+ };
+ if let Some(obj) = lhs.as_object_mut() {
+ if obj.get("node").and_then(Value::as_str) == Some(node) {
+ if let Some(exprs) = obj.get_mut("exprs").and_then(Value::as_array_mut) {
+ exprs.extend(rhs_children);
+ // Clear positions so the pratt loop's outer `wrap_pos` can
+ // re-stamp them with the new span — without this the
+ // idempotent `with_pos` would keep the pre-merge `[start,
+ // end]` (end of the second operand only) and `a or b or c`
+ // would end at `b`'s position instead of `c`'s.
+ obj.remove("start");
+ obj.remove("end");
+ return lhs;
+ }
+ }
+ }
+ let mut exprs = Vec::with_capacity(rhs_children.len() + 1);
+ exprs.push(lhs);
+ exprs.extend(rhs_children);
+ if node == "And" {
+ emit::and_(exprs)
+ } else {
+ emit::or_(exprs)
+ }
+}
+
+/// Function-call postfix on an already-parsed `lhs`. The cpp grammar
+/// has two distinct alts for this position:
+///
+/// - `ColumnExprCallSelect` — single arg is a `selectSetStmt`. cpp
+/// folds a `Field(chain=[name])` LHS into `Call(name, args=[select])`,
+/// otherwise emits `ExprCall(expr=lhs, args=[select])`.
+/// - `ColumnExprCall` — args are a regular `columnExprList`. cpp ALWAYS
+/// emits `ExprCall(expr=lhs, args)`, never folds. The bare identifier
+/// call shape (`f(1, 2)`) doesn't reach this rule because it matches
+/// the earlier `ColumnExprFunction` alt and is emitted as `Call`
+/// directly during identifier-led parsing.
+///
+/// We mirror that split here: fold only when args is exactly one
+/// SelectQuery / SelectSetQuery / Placeholder and the LHS is a
+/// single-element Field chain. `Placeholder` is included because
+/// cpp's `selectSetStmt` grammar admits a bare `{X}` placeholder as
+/// a set-stmt alternative, so `* ({x})` matches `ColumnExprCallSelect`
+/// even when there's no SELECT keyword.
+pub(super) fn fold_call_or_exprcall(lhs: Value, args: Vec<Value>) -> Value {
+ let is_select_call = args.len() == 1
+ && matches!(
+ args[0].get("node").and_then(Value::as_str),
+ Some("SelectQuery") | Some("SelectSetQuery") | Some("Placeholder")
+ );
+ if is_select_call {
+ if let Some(obj) = lhs.as_object() {
+ if obj.get("node").and_then(Value::as_str) == Some("Field") {
+ if let Some(chain) = obj.get("chain").and_then(Value::as_array) {
+ if chain.len() == 1 {
+ if let Some(name) = chain[0].as_str() {
+ return emit::call(name, args);
+ }
+ }
+ }
+ }
+ }
+ }
+ serde_json::json!({"node": "ExprCall", "expr": lhs, "args": args})
+}
diff --git a/rust/hogql/parser/src/parse/cte.rs b/rust/hogql/parser/src/parse/cte.rs
new file mode 100644
index 000000000000..1b478e0182c1
--- /dev/null
+++ b/rust/hogql/parser/src/parse/cte.rs
@@ -0,0 +1,293 @@
+//! `WITH` clause / Common Table Expression parsing.
+//!
+//! Two grammar shapes:
+//!
+//! - Subquery form: `ident [USING KEY (cols)] AS [NOT? MATERIALIZED] LPAREN selectSet RPAREN`
+//! - Column form: `columnExpr AS ident`
+//!
+//! Disambiguation is done by a shadow-lexer probe: when the leading
+//! token is an identifier-or-keyword-acting-as-identifier and the
+//! follow-up sequence ends with `AS (`, we commit to subquery form.
+
+use serde_json::{json, Value};
+
+use super::{identifier_text, kw_valid_as_identifier, Parser, BP_ALIAS};
+use crate::error::ParseError;
+use crate::lex::{Kw, Lexer, TokenKind};
+
+impl<'a> Parser<'a> {
+ pub(crate) fn parse_with_expr_list(&mut self) -> Result<Vec<Value>, ParseError> {
+ // The C++ visitor returns CTEs as a list; the Python deserialiser
+ // turns it into a dict keyed by name. We follow the same shape.
+ // ANTLR ALL(*) tolerates a trailing comma before the SELECT
+ // that terminates the CTE list; mirror that. A bare `LPAREN`
+ // following the comma can ALSO be the leading `(` of the next
+ // CTE element (column-form `(SELECT 1) AS x` / `(a + b) AS y`),
+ // so peek past the matching `)` to see if an `AS identifier`
+ // pattern follows before terminating the loop.
+ let mut out = Vec::new();
+ loop {
+ out.push(self.parse_with_expr()?);
+ if !self.eat(TokenKind::Comma)? {
+ break;
+ }
+ if matches!(self.peek(), TokenKind::Keyword(Kw::Select)) {
+ break;
+ }
+ if self.peek() == TokenKind::LParen && !self.paren_group_followed_by_as_identifier() {
+ break;
+ }
+ }
+ Ok(out)
+ }
+
+ /// `self.peek()` is `(`. Probe whether the matching `)` is followed
+ /// by an `AS identifier` pattern — the shape that marks the paren
+ /// group as the head of the next column-form CTE
+ /// (`(SELECT 1) AS x`, `(a + b) AS y`) rather than the leading
+ /// paren of the enclosing SELECT statement.
+ fn paren_group_followed_by_as_identifier(&self) -> bool {
+ let mut probe = Lexer::with_pos(self.src, self.peek0.end);
+ let mut depth: i32 = 1;
+ while depth > 0 {
+ let tok = match probe.next_token() {
+ Ok(t) => t,
+ Err(_) => return false,
+ };
+ match tok.kind {
+ TokenKind::LParen | TokenKind::LBracket | TokenKind::LBrace => depth += 1,
+ TokenKind::RParen | TokenKind::RBracket | TokenKind::RBrace => depth -= 1,
+ TokenKind::Eof => return false,
+ _ => {}
+ }
+ }
+ let after = match probe.next_token() {
+ Ok(t) => t,
+ Err(_) => return false,
+ };
+ if after.kind != TokenKind::Keyword(Kw::As) {
+ return false;
+ }
+ let ident = match probe.next_token() {
+ Ok(t) => t,
+ Err(_) => return false,
+ };
+ matches!(
+ ident.kind,
+ TokenKind::Ident | TokenKind::QuotedIdent | TokenKind::Keyword(_)
+ )
+ }
+
+ fn parse_with_expr(&mut self) -> Result<Value, ParseError> {
+ let cte_start = self.peek0.start;
+ // The grammar's `identifier` rule accepts plain IDENTIFIERs,
+ // QUOTED_IDENTIFIERs, and (most) reserved keywords — see
+ // HogQLParser.g4's `identifier` and `keyword` rules — so we
+ // include those keywords here too. Otherwise a CTE named
+ // `final`, `date`, etc. would fall through to the expr-form
+ // fallback and mis-parse. Use `kw_valid_as_identifier` rather
+ // than `kw_acts_as_ident_in_primary` — the latter excludes the
+ // primary-form heads (CASE / SELECT / CAST / NOT) that have
+ // their own parse_primary branches, but those names ARE valid
+ // CTE identifiers in cpp's grammar (CASE / CAST / SELECT / NOT
+ // are all in the `keyword` rule).
+ let head_is_identifierlike =
+ matches!(self.peek(), TokenKind::Ident | TokenKind::QuotedIdent)
+ || matches!(self.peek(), TokenKind::Keyword(kw) if kw_valid_as_identifier(kw));
+ if head_is_identifierlike {
+ let mut probe = Lexer::with_pos(self.src, self.peek0.start);
+ drop(probe.next_token()); // ident
+ // Optional column name list immediately after the ident.
+ let mut after = probe.next_token().ok();
+ if matches!(after.as_ref().map(|t| t.kind), Some(TokenKind::LParen)) {
+ let mut depth = 1;
+ loop {
+ let t = probe.next_token().ok();
+ match t.as_ref().map(|t| t.kind) {
+ Some(TokenKind::LParen) => depth += 1,
+ Some(TokenKind::RParen) => {
+ depth -= 1;
+ if depth == 0 {
+ break;
+ }
+ }
+ None | Some(TokenKind::Eof) => break,
+ _ => {}
+ }
+ }
+ after = probe.next_token().ok();
+ }
+ // After optional col list, `USING KEY (cols)`.
+ if matches!(
+ after.as_ref().map(|t| t.kind),
+ Some(TokenKind::Keyword(Kw::Using))
+ ) {
+ if let Ok(next) = probe.next_token() {
+ if next.kind == TokenKind::Keyword(Kw::Key) {
+ drop(probe.next_token()); // LPAREN
+ let mut depth = 1;
+ loop {
+ let t = probe.next_token().ok();
+ match t.as_ref().map(|t| t.kind) {
+ Some(TokenKind::LParen) => depth += 1,
+ Some(TokenKind::RParen) => {
+ depth -= 1;
+ if depth == 0 {
+ break;
+ }
+ }
+ None | Some(TokenKind::Eof) => break,
+ _ => {}
+ }
+ }
+ after = probe.next_token().ok();
+ }
+ }
+ }
+ // The shape is the CTE-with-subquery form if next is `AS` and
+ // after-AS comes `(` (possibly after `NOT? MATERIALIZED`).
+ if matches!(
+ after.as_ref().map(|t| t.kind),
+ Some(TokenKind::Keyword(Kw::As))
+ ) {
+ let mut nxt = probe.next_token().ok();
+ if matches!(
+ nxt.as_ref().map(|t| t.kind),
+ Some(TokenKind::Keyword(Kw::Not))
+ ) {
+ nxt = probe.next_token().ok();
+ }
+ if matches!(
+ nxt.as_ref().map(|t| t.kind),
+ Some(TokenKind::Keyword(Kw::Materialized))
+ ) {
+ nxt = probe.next_token().ok();
+ }
+ if matches!(nxt.as_ref().map(|t| t.kind), Some(TokenKind::LParen)) {
+ let sub = self.parse_with_expr_subquery()?;
+ return Ok(self.wrap_pos(sub, cte_start));
+ }
+ }
+ }
+ // Fallback: `expr AS ident` form. Parse the expression at a min
+ // binding power above BP_ALIAS so the CTE's `AS` doesn't get
+ // swallowed by the Pratt-level Alias operator.
+ let expr = self.parse_expr_bp(BP_ALIAS + 1)?;
+ self.expect_kw(Kw::As, "AS")?;
+ // `withExpr: columnExpr AS identifier` — the post-AS token must
+ // be a valid identifier (`IDENTIFIER | QUOTED_IDENTIFIER |
+ // interval | keyword`), NOT an arbitrary token. Without this
+ // check rust accepted `WITH a AS 1` with name="1" (raw token
+ // text) and `WITH ... AS 'foo'` with name="'foo'" (quotes
+ // preserved).
+ let id = self.bump()?;
+ let name = match id.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent => identifier_text(self.text(id), id.kind),
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
+ identifier_text(self.text(id), id.kind)
+ }
+ _ => {
+ return Err(self.err(format!(
+ "expected identifier after AS in CTE, got {:?}",
+ id.kind
+ )));
+ }
+ };
+ Ok(self.wrap_pos(
+ json!({"node": "CTE", "name": name, "expr": expr, "cte_type": "column"}),
+ cte_start,
+ ))
+ }
+
+ fn parse_with_expr_subquery(&mut self) -> Result<Value, ParseError> {
+ let id = self.bump()?;
+ let name = identifier_text(self.text(id), id.kind);
+ // Optional column-name list (parenthesised idents).
+ let mut columns: Option<Vec<String>> = None;
+ if self.eat(TokenKind::LParen)? {
+ let mut cols = Vec::new();
+ loop {
+ let t = self.bump()?;
+ // Grammar's CTE column-name list elements are
+ // `identifier` (`IDENTIFIER | QUOTED_IDENTIFIER |
+ // interval | keyword`); exclude reserved keywords.
+ let col_name = match t.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent => {
+ identifier_text(self.text(t), t.kind)
+ }
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
+ identifier_text(self.text(t), t.kind)
+ }
+ _ => {
+ return Err(self.err(format!(
+ "expected identifier in CTE column-list, got {:?}",
+ t.kind
+ )));
+ }
+ };
+ cols.push(col_name);
+ if !self.eat(TokenKind::Comma)? {
+ break;
+ }
+ if self.peek() == TokenKind::RParen {
+ break;
+ }
+ }
+ self.expect(TokenKind::RParen, ")")?;
+ columns = Some(cols);
+ }
+ // Optional `USING KEY (col, ...)` — recursive-CTE key.
+ let using_key = if self.eat_kw(Kw::Using)? {
+ self.expect_kw(Kw::Key, "KEY")?;
+ self.expect(TokenKind::LParen, "(")?;
+ let mut keys = Vec::new();
+ loop {
+ let t = self.bump()?;
+ keys.push(identifier_text(self.text(t), t.kind));
+ if !self.eat(TokenKind::Comma)? {
+ break;
+ }
+ if self.peek() == TokenKind::RParen {
+ break;
+ }
+ }
+ self.expect(TokenKind::RParen, ")")?;
+ Some(keys)
+ } else {
+ None
+ };
+ self.expect_kw(Kw::As, "AS")?;
+ let materialized = if self.eat_kw(Kw::Not)? {
+ self.expect_kw(Kw::Materialized, "MATERIALIZED")?;
+ Some(false)
+ } else if self.eat_kw(Kw::Materialized)? {
+ Some(true)
+ } else {
+ None
+ };
+ self.expect(TokenKind::LParen, "(")?;
+ let sub = self.parse_select_set_stmt()?;
+ self.expect(TokenKind::RParen, ")")?;
+ let mut obj = serde_json::Map::new();
+ obj.insert("node".into(), Value::String("CTE".into()));
+ obj.insert("name".into(), Value::String(name));
+ obj.insert("expr".into(), sub);
+ obj.insert("cte_type".into(), Value::String("subquery".into()));
+ if let Some(c) = columns {
+ obj.insert(
+ "columns".into(),
+ Value::Array(c.into_iter().map(Value::String).collect()),
+ );
+ }
+ if let Some(uk) = using_key {
+ obj.insert(
+ "using_key".into(),
+ Value::Array(uk.into_iter().map(Value::String).collect()),
+ );
+ }
+ if let Some(m) = materialized {
+ obj.insert("materialized".into(), Value::Bool(m));
+ }
+ Ok(Value::Object(obj))
+ }
+}
diff --git a/rust/hogql/parser/src/parse/expr.rs b/rust/hogql/parser/src/parse/expr.rs
new file mode 100644
index 000000000000..ff6cdadba3fc
--- /dev/null
+++ b/rust/hogql/parser/src/parse/expr.rs
@@ -0,0 +1,5503 @@
+//! Expression parsing: Pratt loop, prefix/primary forms, postfix
+//! handlers, special infix operators (BETWEEN, IS NULL, NOT IN, etc.).
+//!
+//! All operator binding powers come from `bp.rs`. The parser body lives
+//! here as additional `impl<'a> Parser<'a>` blocks; the few utility
+//! methods (`set_lexer_pos`, `parse_expr_list_until_*`,
+//! `parse_order_expr_list`, `peek_is_clause_terminator`) stay in
+//! `parse.rs` because both the SELECT/JOIN/CTE modules and the
+//! expression parser reach them.
+
+use serde_json::{json, Value};
+
+use super::template::parse_template_body;
+use super::{
+ build_infix, fold_call_or_exprcall, identifier_text, infix_bp, interval_call_name,
+ interval_call_name_case_sensitive, is_reserved_alias_name, kw_acts_as_ident_in_primary,
+ kw_valid_as_identifier, kw_valid_type_cast_ident, parse_number_literal, postfix_bp,
+ unquote_single_string, Parser, BP_ADDITIVE, BP_ALIAS, BP_BETWEEN, BP_COMPARE, BP_IGNORE_NULLS,
+ BP_IS_DISTINCT_FROM, BP_IS_NULL, BP_NOT, BP_OR, BP_POSTFIX, BP_TERNARY, BP_UNARY_MINUS,
+};
+use crate::emit;
+use crate::error::ParseError;
+use crate::lex::{Kw, Lexer, Token, TokenKind};
+
+/// Return value of [`Parser::parse_columns_decorators`]: optional
+/// `EXCLUDE` name list, plus an optional `REPLACE` `(expr AS name, …)`
+/// list as (name, expr) pairs in declaration order.
+type ColumnsDecorators = (Option<Vec<String>>, Option<Vec<(String, Value)>>);
+
+/// Return value of [`Parser::parse_function_args_inner`]: the
+/// `DISTINCT` flag, the positional args, and an optional in-arg
+/// `ORDER BY` list.
+type FunctionArgs = (bool, Vec<Value>, Option<Vec<Value>>);
+
+impl<'a> Parser<'a> {
+ pub(crate) fn parse_expr_bp(&mut self, min_bp: u8) -> Result<Value, ParseError> {
+ let lhs_start = self.peek0.start;
+ let lhs = self.parse_prefix()?;
+ let lhs = self.wrap_pos(lhs, lhs_start);
+ self.pratt_continue_with_lhs(lhs, min_bp, lhs_start)
+ }
+
+ /// Run the Pratt infix/postfix loop with an externally-provided
+ /// LHS. Used by code paths that already have a partial expression
+ /// to extend (e.g. modulo-promoted LIMIT expressions chaining into
+ /// trailing `* …` arithmetic).
+ pub(crate) fn pratt_continue_with_lhs(
+ &mut self,
+ mut lhs: Value,
+ min_bp: u8,
+ lhs_start: usize,
+ ) -> Result<Value, ParseError> {
+ loop {
+ let kind = self.peek();
+ if let Some((lbp, rbp, op)) = infix_bp(kind) {
+ if lbp < min_bp {
+ break;
+ }
+ // `%` doubles as the modulo operator and the
+ // LIMIT/SAMPLE `PERCENT` clause marker. Bind it as
+ // modulo only when an operand actually follows; a `%`
+ // with no right-hand side (clause boundary, EOF) is the
+ // PERCENT marker and belongs to the enclosing clause.
+ // cpp's ALL(*) makes the same call — it won't take
+ // `columnExpr % columnExpr` when the right operand
+ // can't be matched (e.g. `LIMIT lambda x : 1 %`, where
+ // the lambda body is `1` and `%` marks LIMIT PERCENT).
+ if kind == TokenKind::Percent {
+ // Inside a LIMIT body the modulo-vs-PERCENT call
+ // can't be made from the next token alone (a `%`
+ // followed by a keyword may be modulo on a
+ // keyword-Field or the PERCENT marker). Resolve it
+ // with the same speculative parse cpp's ALL(*)
+ // uses: `Some` → modulo extension committed; `None`
+ // → the `%` is the PERCENT marker, left for the
+ // enclosing LIMIT clause.
+ if self.limit_body_depth > 0 {
+ match self.try_limit_modulo_extension(lhs.clone(), lhs_start)? {
+ Some(extended) => {
+ lhs = extended;
+ continue;
+ }
+ None => break,
+ }
+ }
+ let next = self.peek_next();
+ if !peek_can_start_clause_body(next) || is_pure_infix_op(next) {
+ break;
+ }
+ }
+ // Statement-rhs recovery: when this Pratt loop is the
+ // rhs of a statement-level `:=` / `let X := …` /
+ // `return …` parse, an infix operator whose RHS fails
+ // to parse (e.g. `{} * ()` where `()` is an empty
+ // paren) is cpp's "split into two statements" shape:
+ // the rhs ends at the LHS so far, and the operator +
+ // failing RHS becomes the next statement. Mirror that
+ // via checkpoint-restore — without the flag the
+ // behaviour is the historical immediate error.
+ if self.stmt_rhs_recover_on_pratt_rhs_failure {
+ let cp = self.checkpoint();
+ self.bump()?;
+ match self.parse_expr_bp(rbp) {
+ Ok(rhs) => {
+ lhs = self.wrap_pos(build_infix(op, lhs, rhs), lhs_start);
+ continue;
+ }
+ Err(_) => {
+ self.restore(cp)?;
+ break;
+ }
+ }
+ }
+ self.bump()?;
+ let rhs = self.parse_expr_bp(rbp)?;
+ lhs = self.wrap_pos(build_infix(op, lhs, rhs), lhs_start);
+ continue;
+ }
+ if let Some(handled) = self.try_special_infix(kind, &mut lhs, min_bp, lhs_start)? {
+ if handled {
+ // `try_special_infix` mutates `lhs` in place with a fresh
+ // unpositioned JSON node (`CompareOperation`, `BetweenExpr`,
+ // `IsDistinctFrom`, etc.). Wrap with the pratt loop's
+ // running span so the new outer node carries `start` /
+ // `end` matching cpp's `addPositionInfo` calls.
+ lhs = self.wrap_pos(lhs, lhs_start);
+ continue;
+ }
+ }
+ if let Some(lbp) = postfix_bp(kind) {
+ if lbp < min_bp {
+ break;
+ }
+ // Statement-RHS guard: `(a) := (b) (c) := (d)` — when
+ // parsing the first assignment's RHS, the postfix `(`
+ // of `(c)` would greedily fold as a `(…)`-call onto
+ // `(b)`, stranding the second `:=`. cpp's ALL(*)
+ // backtracks; we stop the fold when a `:=` follows the
+ // matching `)`, leaving `(c)` to start the next
+ // statement.
+ if kind == TokenKind::LParen
+ && self.stop_postfix_call_before_colon_equals
+ && self.paren_block_then_colon_equals(self.peek0.end)
+ {
+ break;
+ }
+ lhs = self.parse_postfix(kind, lhs)?;
+ lhs = self.wrap_pos(lhs, lhs_start);
+ continue;
+ }
+ break;
+ }
+ Ok(self.wrap_pos(lhs, lhs_start))
+ }
+
+ pub(crate) fn parse_prefix(&mut self) -> Result<Value, ParseError> {
+ // `IDENT (, IDENT)* -> body` — a bare-list arrow lambda may
+ // appear as the RHS of any binary operator (e.g. `x =~* y, z ->
+ // body` parses as `x =~* (lambda y, z -> body)`). The probe is
+ // cheap and only commits on a confirmed `id (, id)* ->` run.
+ // A lambda parameter is an `identifier`, which the grammar lets
+ // any keyword fill (`name -> 1`, `select -> 1`), so a leading
+ // keyword is a candidate head too.
+ if matches!(
+ self.peek(),
+ TokenKind::Ident | TokenKind::QuotedIdent | TokenKind::Keyword(_)
+ ) {
+ if let Some(lambda) = self.try_bare_list_lambda()? {
+ return Ok(lambda);
+ }
+ }
+ match self.peek() {
+ TokenKind::Dash => {
+ // `-<number>` / `-.<number>` / `-inf` / `-nan` is a signed
+ // Constant per grammar's `numberLiteral: (PLUS | DASH)?
+ // (... | floatingLiteral)` and `floatingLiteral: DOT
+ // DECIMAL_LITERAL`. Treat all four as a single negative
+ // literal, not a unary minus.
+ match self.peek_next() {
+ TokenKind::Number => {
+ self.bump()?;
+ let n = self.bump()?;
+ let src = self.consume_optional_fractional(self.text(n));
+ return parse_number_literal(&src, true);
+ }
+ TokenKind::Dot => {
+ // `-.<digits>` — leading-dot float. Peek one
+ // ahead to confirm `<digits>` actually follows;
+ // otherwise fall through to unary-minus.
+ if let Some(num) = self.consume_signed_dot_float(true)? {
+ return Ok(num);
+ }
+ }
+ TokenKind::Keyword(Kw::Inf) => {
+ // cpp 1.3.45's `VISIT(NumberLiteral)` lowercases
+ // the `(PLUS|DASH)? INF` text, strips a leading
+ // `+`, then string-compares: `-inf` / `-infinity`
+ // → "-Infinity"; `inf` / `infinity` → "Infinity".
+ // The INF lexer token only ever matches `inf` /
+ // `infinity`, so a signed-DASH INF is always
+ // "-Infinity" (no NaN fallback reachable here).
+ self.bump()?;
+ self.bump()?;
+ return Ok(emit::constant_special_number("-Infinity"));
+ }
+ TokenKind::Keyword(Kw::Nan) => {
+ // -NaN is still NaN — match the C++ behaviour of
+ // emitting "NaN".
+ self.bump()?;
+ self.bump()?;
+ return Ok(emit::constant_special_number("NaN"));
+ }
+ _ => {}
+ }
+ self.bump()?;
+ let rhs = self.parse_expr_bp(BP_UNARY_MINUS)?;
+ Ok(emit::arith(emit::constant(Value::from(0)), "-", rhs))
+ }
+ TokenKind::Plus => {
+ // `+` is only a sign on a `numberLiteral` per grammar
+ // (`(PLUS | DASH)? (floatingLiteral | … | INF |
+ // NAN_SQL)`). There is no general unary-plus rule on
+ // columnExpr, so `+a`, `+f(x)`, `+(a)` etc. should all
+ // reject — only the numeric / INF / NAN forms below are
+ // valid.
+ match self.peek_next() {
+ TokenKind::Number => {
+ self.bump()?;
+ let n = self.bump()?;
+ let src = self.consume_optional_fractional(self.text(n));
+ parse_number_literal(&src, false)
+ }
+ TokenKind::Dot => {
+ if let Some(num) = self.consume_signed_dot_float(false)? {
+ return Ok(num);
+ }
+ Err(self.err("unary `+` only applies to a number literal"))
+ }
+ TokenKind::Keyword(Kw::Inf) => {
+ // cpp 1.3.45 strips a leading `+` before the
+ // text-equality check, so `+inf` → "inf" and
+ // `+infinity` → "infinity" — both → "Infinity".
+ self.bump()?;
+ self.bump()?;
+ Ok(emit::constant_special_number("Infinity"))
+ }
+ TokenKind::Keyword(Kw::Nan) => {
+ self.bump()?;
+ self.bump()?;
+ Ok(emit::constant_special_number("NaN"))
+ }
+ _ => Err(self.err("unary `+` only applies to a number literal")),
+ }
+ }
+ TokenKind::Keyword(Kw::Not) => {
+ // `NOT <X>` competes between three grammar rules:
+ // ColumnExprFunction: not(args) - cpp Call('not', args)
+ // ColumnExprNot: NOT <expr> - cpp Not(<expr>)
+ // parens-arrow lambda primary with NOT as param name
+ // (per the `keyword` rule).
+ //
+ // ANTLR prefers ColumnExprFunction (line 236) when the
+ // parens content is a valid columnExprList. It backtracks
+ // to ColumnExprNot only when ColumnExprFunction can't
+ // fit — the content is a SELECT/WITH/placeholder-set-op
+ // selectSetStmt, OR the parens are part of a parens-arrow
+ // lambda head with `->` after the matching `)`.
+ //
+ // Bounded probes detect those two cases (cheaper than a
+ // try_alt with an expr-parse for the false-positive case
+ // `not ((a,) -> 1)` where the lambda is fully wrapped in
+ // outer parens — function-call form, not NOT-prefix).
+ if self.peek_next() == TokenKind::LParen
+ && (self.parens_open_select_or_set_stmt()
+ || self.parens_followed_by_arrow()
+ || self.parens_open_self_contained_columns_expr())
+ {
+ self.bump()?; // NOT
+ let rhs = self.parse_expr_bp(BP_NOT)?;
+ return Ok(emit::not_(rhs));
+ }
+ if self.peek_next() == TokenKind::LParen {
+ return self.parse_ident_lead();
+ }
+ // `NOT -> body` is a single-arg arrow lambda with NOT
+ // as the parameter name (the `keyword` rule admits NOT
+ // as identifier). The single-arg lambda primary at
+ // parse_prefix only fires for Ident; route the keyword
+ // case here so the lambda head consumes both NOT and
+ // the Arrow.
+ if self.peek_next() == TokenKind::Arrow {
+ return self.parse_single_arg_arrow_lambda();
+ }
+ // Bare `NOT` followed by a token that can't start an
+ // expression (alias / list-terminator / EOF) is the
+ // identifier "not" — cpp's `keyword` rule admits NOT
+ // as an identifier and falls back to a Field. Without
+ // this check, parse_prefix would eagerly consume NOT
+ // and then error on the unexpected following token.
+ if matches!(
+ self.peek_next(),
+ TokenKind::Keyword(Kw::As)
+ | TokenKind::Comma
+ | TokenKind::RParen
+ | TokenKind::RBracket
+ | TokenKind::RBrace
+ | TokenKind::Eof
+ // Postfix operators that take Field as LHS:
+ // `not ?. x`, `not .x`, `not :: type` — cpp's
+ // ALL(*) reads NOT as the LHS Field rather than
+ // a unary prefix here.
+ | TokenKind::NullProperty
+ | TokenKind::Dot
+ | TokenKind::DoubleColon
+ // *Pure* binary operators (other than `+`/`-`,
+ // which double as unary prefixes) that need a
+ // LHS: NOT becomes a Field identifier and the
+ // operator joins it to its RHS. Note this set
+ // excludes IS / BETWEEN / IN / LIKE / ILIKE:
+ // those keywords are also valid `identifier`s,
+ // so at expression start cpp reads `NOT` as the
+ // unary prefix and the keyword as a Field
+ // operand (`not like` → `Not(Field('like'))`,
+ // `not in(1,2)` → `Not(Call('in', …))`). The
+ // genuine `x NOT IN y` infix form has a real
+ // LHS and is handled by the Pratt loop instead.
+ | TokenKind::Nullish
+ | TokenKind::Concat
+ | TokenKind::EqDouble
+ | TokenKind::EqSingle
+ | TokenKind::NotEq
+ | TokenKind::Lt
+ | TokenKind::LtEq
+ | TokenKind::Gt
+ | TokenKind::GtEq
+ | TokenKind::RegexSingle
+ | TokenKind::RegexDouble
+ | TokenKind::IRegexSingle
+ | TokenKind::IRegexDouble
+ | TokenKind::NotRegex
+ | TokenKind::NotIRegex
+ | TokenKind::Slash
+ | TokenKind::Percent
+ // `not := value` — NamedArgument with NOT as the
+ // parameter name (the `keyword` rule admits NOT
+ // as an identifier). parse_ident_lead handles
+ // the `:=` postfix.
+ | TokenKind::ColonEquals
+ ) {
+ return self.parse_ident_lead();
+ }
+ // `not <kw-infix> <rhs>`: cpp's ALL(*) prefers
+ // `Field([not]) <kw-infix> <rhs>` over `Not(Field([kw]))`
+ // when the infix has a valid trailing RHS. `not like 'a'`
+ // → `Compare(Field(not), "like", 'a')`, but `not like`
+ // alone → `Not(Field(like))`. Probe the post-keyword
+ // token to decide. Applies to LIKE / ILIKE / BETWEEN
+ // (which take an expression on the right) and IS
+ // (which takes NULL / NOT NULL / DISTINCT FROM).
+ if matches!(
+ self.peek_next(),
+ TokenKind::Keyword(Kw::Like | Kw::Ilike | Kw::Between)
+ ) {
+ let mut probe = Lexer::with_pos(self.src, self.peek1.end);
+ if let Ok(after) = probe.next_token() {
+ if !matches!(
+ after.kind,
+ TokenKind::Eof
+ | TokenKind::Comma
+ | TokenKind::RParen
+ | TokenKind::RBracket
+ | TokenKind::RBrace
+ | TokenKind::Semicolon
+ // `NOT ilike(args)` / `NOT like(a, b)` /
+ // `NOT between(a, b, c)` are function-call
+ // forms — cpp treats the `(args)` as a
+ // Call (ANTLR's `ColumnExprFunction` alt
+ // wins because the keyword reads as an
+ // identifier function-name), so NOT
+ // applies as a unary prefix to the whole
+ // call: `Not(Call(ilike, [a, b]))`.
+ // Treating LParen as a "terminator" here
+ // keeps the unary-NOT path so we recurse
+ // into parse_ident_lead → Call rather
+ // than falling through to the binary
+ // `Field(not) NOT-ILIKE rhs` interpretation.
+ | TokenKind::LParen
+ ) {
+ return self.parse_ident_lead();
+ }
+ }
+ }
+ if matches!(self.peek_next(), TokenKind::Keyword(Kw::Is)) {
+ let mut probe = Lexer::with_pos(self.src, self.peek1.end);
+ if let Ok(after) = probe.next_token() {
+ if matches!(
+ after.kind,
+ TokenKind::Keyword(Kw::Null)
+ | TokenKind::Keyword(Kw::Not)
+ | TokenKind::Keyword(Kw::Distinct)
+ ) {
+ return self.parse_ident_lead();
+ }
+ }
+ }
+ // `not * <rhs>`: cpp picks unary-NOT when `* <rhs>` is a
+ // valid columnExpr (i.e. `*` is a complete primary
+ // Field('*') and what follows is a postfix op, infix op,
+ // EXCLUDE/COLUMNS decoration, or an expression
+ // terminator). Otherwise (`*` followed by a primary atom
+ // like a Number / Ident / String / primary keyword) it's
+ // multiplication and NOT becomes a Field. Probe one more
+ // token past the `*` to disambiguate.
+ if self.peek_next() == TokenKind::Asterisk
+ && !self.asterisk_after_not_starts_columnexpr()
+ {
+ return self.parse_ident_lead();
+ }
+ // `NOT AND <expr>` / `NOT OR <expr>` — when a binary
+ // boolean keyword has a real RHS, cpp's ALL(*) reads
+ // NOT as the LHS Field and the keyword as the binary
+ // op (the unary-NOT path would leave the RHS trailing).
+ // Probe one more token via the shadow lexer; only flip
+ // to identifier-NOT when the third token can begin an
+ // expression.
+ if matches!(
+ self.peek_next(),
+ TokenKind::Keyword(Kw::And) | TokenKind::Keyword(Kw::Or)
+ ) {
+ let mut probe = Lexer::with_pos(self.src, self.peek1.end);
+ if let Ok(t) = probe.next_token() {
+ if peek_can_start_clause_body(t.kind) {
+ return self.parse_ident_lead();
+ }
+ }
+ }
+ // `NOT IGNORE NULLS …`: cpp's ANTLR reads NOT as a
+ // Field (via the `keyword` rule), then the
+ // `ColumnExprIgnoreNulls` postfix (`<expr> IGNORE
+ // NULLS`) consumes-and-drops the IGNORE NULLS pair on
+ // the resulting Field. Without this flip, the
+ // unary-NOT path would consume NOT, then the inner
+ // recursion would parse `ignore` as a Field and leave
+ // `nulls` as a trailing reserved keyword (rust would
+ // then reject; cpp accepts because Field-then-postfix
+ // is the only complete parse).
+ //
+ // Distinguishing IGNORE NULLS (pair) from a bare
+ // `NOT IGNORE` (single Field) requires a 3-token
+ // peek: only flip when the third token is NULLS.
+ // RESPECT NULLS is grammar-parallel but cpp doesn't
+ // actually accept `NOT RESPECT NULLS . ...`
+ // (rejected with "mismatched input 'nulls'") — so
+ // the flip only fires for IGNORE.
+ if self.peek_next() == TokenKind::Keyword(Kw::Ignore) {
+ let mut probe = Lexer::with_pos(self.src, self.peek1.end);
+ if matches!(
+ probe.next_token().map(|t| t.kind),
+ Ok(TokenKind::Keyword(Kw::Nulls))
+ ) {
+ return self.parse_ident_lead();
+ }
+ }
+ self.bump()?;
+ let rhs = self.parse_expr_bp(BP_NOT)?;
+ Ok(emit::not_(rhs))
+ }
+ _ => {
+ // `<Tag ...>` — HogQLX tag in column position (cpp's
+ // `ColumnExprTagElement` alt). Distinguish from `<`
+ // comparison by peek_next: a tag's first inner token
+ // is an identifier (or keyword-as-ident); a `<` infix
+ // doesn't reach this prefix branch in the first place
+ // (it fires later via `infix_bp`).
+ if self.peek_starts_hogqlx_tag() {
+ return self.parse_hogqlx_tag_element();
+ }
+ self.parse_primary()
+ }
+ }
+ }
+
+ fn parse_primary(&mut self) -> Result<Value, ParseError> {
+ let tok = self.peek0;
+ match tok.kind {
+ TokenKind::Number => {
+ self.bump()?;
+ let src = self.consume_optional_fractional(self.text(tok));
+ Ok(parse_number_literal(&src, false)?)
+ }
+ // `.<digits>` — bare-decimal float per the grammar's
+ // `floatingLiteral: DOT (DECIMAL_LITERAL | ...)`.
+ TokenKind::Dot if matches!(self.peek_next(), TokenKind::Number) => {
+ self.bump()?;
+ let n = self.bump()?;
+ let src = format!(".{}", self.text(n));
+ Ok(parse_number_literal(&src, false)?)
+ }
+ TokenKind::String => {
+ self.bump()?;
+ Ok(emit::constant(Value::String(unquote_single_string(
+ self.text(tok),
+ ))))
+ }
+ TokenKind::TemplateString => {
+ // Lexer captured the whole `f'…'` or `F'…'` span. The
+ // grammar has two distinct tokens:
+ // `QUOTE_SINGLE_TEMPLATE: 'f\'' -> pushMode(IN_TEMPLATE_STRING);`
+ // `QUOTE_SINGLE_TEMPLATE_FULL: 'F\'' -> pushMode(IN_FULL_TEMPLATE_STRING);`
+ // The lowercase `f'` is the regular template string —
+ // valid as a `columnExpr` per the `templateString` rule.
+ // The uppercase `F'` is the "full" template-string-only
+ // form reached only from `fullTemplateString` (an
+ // entry-rule for `parse_string_template`); it is *not*
+ // a `columnExpr`. Reject it here.
+ let raw = self.text(tok);
+ debug_assert!(raw.len() >= 3 && (raw.starts_with("f'") || raw.starts_with("F'")));
+ if raw.starts_with("F'") {
+ return Err(self.err("mismatched input 'F''"));
+ }
+ let body_offset = tok.start + 2; // past `f'`
+ let body_end = tok.end - 1; // before closing `'`
+ self.bump()?;
+ parse_template_body(self.src, body_offset, body_end)
+ }
+ TokenKind::Keyword(Kw::True | Kw::False)
+ if self.peek_next() == TokenKind::LParen || self.peek_next() == TokenKind::Dot =>
+ {
+ // `true`/`false` are not lexer tokens in the grammar —
+ // they are ordinary identifiers, and become Bool
+ // Constants only as a bare `columnIdentifier`. cpp
+ // treats them as identifiers in two columnExpr-leading
+ // postfix positions:
+ // `true(…)` → Call(name='true') (function call)
+ // `true.x` → Field(['true', 'x']) (chain)
+ // The Pratt loop would otherwise wrap a `Constant(true)`
+ // in an `ArrayAccess` for the `.x`, diverging from cpp's
+ // Field shape. Route both shapes through ident-lead so
+ // the chain accumulates correctly. `null` differs —
+ // `NULL` is a real keyword, so `null(…)` stays an
+ // `ExprCall` on the Null constant.
+ self.parse_ident_lead()
+ }
+ TokenKind::Keyword(Kw::True) => {
+ self.bump()?;
+ Ok(emit::constant(Value::Bool(true)))
+ }
+ TokenKind::Keyword(Kw::False) => {
+ self.bump()?;
+ Ok(emit::constant(Value::Bool(false)))
+ }
+ TokenKind::Keyword(Kw::Null) => {
+ self.bump()?;
+ Ok(emit::constant(Value::Null))
+ }
+ TokenKind::Keyword(Kw::Inf) => {
+ // cpp 1.3.45's `VISIT(NumberLiteral)` maps both `inf`
+ // and `infinity` (the two spellings the INF lexer token
+ // matches, any case) to "Infinity". (Pre-1.3.45 cpp
+ // collapsed bare `infinity` to NaN — that's been fixed
+ // upstream, so unsigned INF is unconditionally Infinity.)
+ self.bump()?;
+ Ok(emit::constant_special_number("Infinity"))
+ }
+ TokenKind::Keyword(Kw::Nan) => {
+ self.bump()?;
+ Ok(emit::constant_special_number("NaN"))
+ }
+
+ // CASE/CAST/TRY_CAST/INTERVAL/LAMBDA — special grammar
+ // forms when followed by their expected continuation; bare
+ // (no continuation) parses as a Field identifier per cpp's
+ // `keyword`-fallthrough rule.
+ TokenKind::Keyword(Kw::Case)
+ if can_start_case_body(self.peek_next())
+ // Skip when peek_next is empty `()` UNLESS the `()` is a
+ // lambda head — `case () -> 1 when ... end` is valid in
+ // cpp because `() -> 1` is the case's value expression.
+ && !(self.peek_next() == TokenKind::LParen
+ && self.peek_lparen_is_empty()
+ && !self.parens_followed_by_arrow())
+ && !(self.peek_next() == TokenKind::LParen
+ && self.peek_lparen_starts_with_order_or_distinct()) =>
+ {
+ // `case(args)` (no WHEN) is a regular function call —
+ // cpp falls back to ColumnExprFunction via the keyword
+ // rule. try_alt: parse_case_expr first; if it bails
+ // (typically "requires at least one WHEN"), retry as
+ // ident_lead so the function-call path picks up.
+ self.try_alt(&[&Self::parse_case_expr, &Self::parse_ident_lead])
+ }
+ // Grammar (lines 208-209): CAST/TRY_CAST special form
+ // `LPAREN columnExpr AS columnTypeExpr RPAREN` vs the
+ // function-call alternative `cast(args)` per the keyword
+ // rule. The disambiguator is `AS` at the outer paren's
+ // depth, which `parse_cast_expr` checks for naturally as
+ // it consumes the body — when it fails (no AS, or the
+ // body doesn't fit `columnExpr AS columnTypeExpr`),
+ // try_alt rolls back and reroutes through `parse_ident_lead`
+ // so CAST becomes a Field. Fast-path: skip the try when
+ // peek_next isn't `(` or is empty `()` — neither form fits
+ // the CAST special form, so the ident-lead path is the
+ // only option.
+ TokenKind::Keyword(Kw::Cast) | TokenKind::Keyword(Kw::TryCast)
+ if self.peek_next() == TokenKind::LParen && !self.peek_lparen_is_empty() =>
+ {
+ let is_try = matches!(self.peek(), TokenKind::Keyword(Kw::TryCast));
+ self.try_alt(&[&|p| p.parse_cast_expr(is_try), &Self::parse_ident_lead])
+ }
+ // ColumnExprInterval (`INTERVAL columnExpr interval-unit`) vs
+ // ColumnExprFunction (`interval LPAREN args RPAREN ...`). cpp's
+ // ANTLR ALL(*) tries both and picks the longest match: with a
+ // valid unit at end it's INTERVAL, otherwise the keyword falls
+ // back to identifier and parses as a function call (which also
+ // covers `interval(distinct …)`, `interval(a, b) within group …`,
+ // `interval(a, b) over …`, and the empty `interval()` no-args
+ // form). Mirror with `try_alt`.
+ TokenKind::Keyword(Kw::Interval) if can_start_interval_value(self.peek_next()) => {
+ self.try_alt(&[&Self::parse_interval_expr, &Self::parse_ident_lead])
+ }
+ // Grammar (line 289): LAMBDA identifier (COMMA identifier)* COMMA? COLON columnExpr
+ // vs the keyword rule's "LAMBDA as identifier in primary position."
+ // Try the lambda form first; if it fails (no params, no `:`,
+ // or malformed body header), `try_alt` rolls back to the
+ // ident-lead path and LAMBDA becomes a Field.
+ TokenKind::Keyword(Kw::Lambda) => {
+ self.try_alt(&[&Self::parse_lambda_keyword, &Self::parse_ident_lead])
+ }
+ // CAST / TRY_CAST without `(<expr> AS …)` shape, plus CASE
+ // / INTERVAL / SELECT when their own special-form guards
+ // didn't fire. `SELECT` is here because cpp's `keyword`
+ // rule admits it as a function-call name, e.g. `select(1)`;
+ // subquery dispatch happens at parse_paren_or_tuple where
+ // the leading `(` is consumed BEFORE parse_primary sees
+ // SELECT.
+ TokenKind::Keyword(Kw::Case)
+ | TokenKind::Keyword(Kw::Cast)
+ | TokenKind::Keyword(Kw::TryCast)
+ | TokenKind::Keyword(Kw::Interval)
+ | TokenKind::Keyword(Kw::Select) => self.parse_ident_lead(),
+ // `COLUMNS(...)` is the ColumnsExpr keyword form; bare
+ // `columns` (no `(`) is accepted by the grammar as a
+ // plain identifier per the `keyword` rule. Route to the
+ // ident-lead path so it ends up as a Field, matching cpp.
+ //
+ // Empty `columns()` is *not* a columns-expr — none of the
+ // columns-special grammar rules admit an empty inner. cpp's
+ // ANTLR backs off to ColumnExprFunction (Call with no
+ // parametric, empty args). Skip the columns-expr dispatch
+ // in that case so it falls through to ident-lead.
+ //
+ // `columns(...) OVER ...` — the trailing OVER tail means
+ // cpp's ANTLR pivots to the window-function alt with
+ // `columns` as the function name (not the ColumnsExpr
+ // spread-companion). Route to ident-lead so the
+ // function-call path picks up the OVER postfix.
+ //
+ // `columns(ORDER BY …)` / `columns(DISTINCT …)` — same
+ // routing: an ORDER BY or DISTINCT at the head of the
+ // parens belongs to the function-call form's argument
+ // list (cpp's `ColumnExprFunction` with the `DISTINCT?`
+ // and `orderByClause?` slots), not the COLUMNS spread.
+ // Falling through to ident-lead here matches cpp's
+ // ColumnExprFunction-over-ColumnExprColumns preference
+ // when the inner has those function-only tokens.
+ TokenKind::Keyword(Kw::Columns)
+ if self.peek_next() == TokenKind::LParen
+ && !self.peek_lparen_is_empty()
+ && !self.peek_columns_paren_followed_by_over() =>
+ {
+ // ColumnsExpr (`ColumnExprColumnsList` etc.) vs the
+ // plain function-call form (`columns(args)` → Call) is
+ // an ALL(*) ambiguity. cpp's ANTLR tries `ColumnsList`
+ // first and backs off to `ColumnExprFunction` only when
+ // the paren content can't parse as a `columnExprList`:
+ // - `columns(DISTINCT (a, b))` → ColumnsExpr —
+ // `distinct` is a soft-keyword Field and `(a, b)` a
+ // postfix call, so the content IS one columnExpr.
+ // - `columns(distinct x)` → Call — `distinct x` is
+ // two bare idents with no operator between, NOT a
+ // columnExpr; DISTINCT is the call distinct-marker.
+ // - `columns(ORDER BY 1)` → Call — `ORDER BY` can't
+ // open a columnExpr; it's the call's orderByClause.
+ // Mirror with `try_alt`: parse_columns_expr first (it
+ // `expect`s the closing `)`, so a non-columnExprList
+ // body fails cleanly and rolls back), ident-lead next.
+ self.try_alt(&[&Self::parse_columns_expr, &Self::parse_ident_lead])
+ }
+ // `TRIM (LEADING|TRAILING|BOTH 'str' FROM expr)` — special
+ // syntax form that rewrites to `Call("trimLeft"|"trimRight"|
+ // "trim", [expr, str])`. A leading directional keyword only
+ // makes the special form *possible*: `LEADING` / `TRAILING`
+ // / `BOTH` are also valid `keyword`-rule identifiers, so
+ // `trim(leading)` is a plain call. try_alt the special form
+ // first, then fall back to the `trim(args)` call.
+ TokenKind::Keyword(Kw::Trim)
+ if self.peek_next() == TokenKind::LParen && self.is_trim_keyword_form() =>
+ {
+ self.try_alt(&[&Self::parse_trim_keyword_form, &Self::parse_ident_lead])
+ }
+
+ TokenKind::Hash => self.parse_positional(),
+
+ TokenKind::LParen => self.parse_paren_or_lambda(),
+ TokenKind::LBracket => self.parse_array_literal(),
+ TokenKind::LBrace => self.parse_brace_dict_or_placeholder(),
+ // `ARRAY [ … ]` — the optional-keyword form of the array
+ // literal per the grammar's `ARRAY? LBRACKET columnExprList?
+ // RBRACKET` alt. Strip the keyword and delegate to the
+ // bracket-only path so both shapes produce the same Array node.
+ TokenKind::Keyword(Kw::Array) if self.peek_next() == TokenKind::LBracket => {
+ self.bump()?;
+ self.parse_array_literal()
+ }
+ // Bare `*` at primary position is the columns-asterisk form, which
+ // can carry `EXCLUDE (...)` / `REPLACE (...)` decorations.
+ TokenKind::Asterisk => self.parse_top_level_asterisk(),
+
+ // Single-identifier arrow lambda: `x -> body`.
+ TokenKind::Ident if self.peek_next() == TokenKind::Arrow => {
+ self.parse_single_arg_arrow_lambda()
+ }
+
+ TokenKind::Ident | TokenKind::QuotedIdent => self.parse_ident_lead(),
+
+ // Almost every keyword can stand in for an identifier in
+ // expression positions per the grammar's `identifier` rule.
+ // The `kw_acts_as_ident_in_primary` predicate filters out the
+ // few that would shadow primary forms (e.g. `case`, `select`).
+ TokenKind::Keyword(k) if kw_acts_as_ident_in_primary(k) => self.parse_ident_lead(),
+
+ // Orphan `}` outside any brace-grouping: cpp's lexer emits
+ // a specific "Unmatched curly bracket" error here.
+ TokenKind::RBrace => Err(self.err("Unmatched curly bracket")),
+ _ => Err(self.err(format!("unexpected token in expression: {:?}", tok.kind))),
+ }
+ }
+
+ // ====================================================================
+ // Primary-form helpers
+ // ====================================================================
+
+ /// `CASE [scrutinee] WHEN c1 THEN r1 [WHEN c2 THEN r2 ...] [ELSE r] END`
+ /// rewrites to `Call("if"|"multiIf"|"transform", ...)` per the C++
+ /// visitor's [`VISIT(ColumnExprCase)`] logic.
+ fn parse_case_expr(&mut self) -> Result<Value, ParseError> {
+ self.expect_kw(Kw::Case, "CASE")?;
+ // Optional scrutinee. The simple case (peek != WHEN) parses
+ // greedy and uses the result. The WHEN-first case is more
+ // subtle: cpp's ANTLR ALL(*) prefers the WITH-scrutinee alt
+ // whenever the greedy columnExpr starting with `when` as a
+ // soft identifier can extend through an infix operator into
+ // a full expression AND land on a real WHEN keyword for the
+ // CASE-WHEN structure that follows. Speculatively try the
+ // scrutinee alt; commit only when it consumed beyond a bare
+ // `when` Field AND peek lands on WHEN.
+ //
+ // Examples:
+ // `case when * then(1)() when 2 then 3 end`
+ // → scrutinee = Mul(Field(when), Call(then, [1])).
+ // CASE-WHEN follows: `when 2 then 3 end`. transform.
+ // `case when 1 then 2 when 3 then 4 end`
+ // → speculation returns bare Field(when) at peek=`1`; not
+ // WHEN, so roll back. No scrutinee. multiIf.
+ let scrutinee = if self.peek() != TokenKind::Keyword(Kw::When) {
+ Some(self.parse_expr_bp(0)?)
+ } else {
+ let cp = self.checkpoint();
+ match self.parse_expr_bp(0) {
+ Ok(s) if self.peek() == TokenKind::Keyword(Kw::When) && !is_bare_field(&s) => {
+ Some(s)
+ }
+ _ => {
+ self.restore(cp)?;
+ None
+ }
+ }
+ };
+ let mut whens: Vec<Value> = Vec::new();
+ let mut thens: Vec<Value> = Vec::new();
+ while self.eat_kw(Kw::When)? {
+ whens.push(self.parse_expr_bp(0)?);
+ self.expect_kw(Kw::Then, "THEN")?;
+ thens.push(self.parse_expr_bp(0)?);
+ }
+ if whens.is_empty() {
+ return Err(self.err("CASE expression requires at least one WHEN"));
+ }
+ let else_branch = if self.eat_kw(Kw::Else)? {
+ Some(self.parse_expr_bp(0)?)
+ } else {
+ None
+ };
+ self.expect_kw(Kw::End, "END")?;
+
+ if let Some(scrut) = scrutinee {
+ // `case S when v then r [else d] end` → `transform(S,
+ // [whens], [thens], else)`. The cpp visitor builds a flat
+ // column list and unconditionally treats the LAST item as
+ // the else-position default — so when ELSE is omitted, the
+ // final THEN value migrates into the else slot and the
+ // `thens` array loses its last element. Mirror that quirk
+ // exactly:
+ //
+ // case S when v then r end → transform(S, [v], [], r)
+ // case S when v then r else d end → transform(S, [v], [r], d)
+ // case S when v1 then r1 when v2 then r2 end
+ // → transform(S, [v1, v2], [r1], r2)
+ let mut flat: Vec<Value> = Vec::with_capacity(whens.len() * 2 + 2);
+ for (w, t) in whens.into_iter().zip(thens) {
+ flat.push(w);
+ flat.push(t);
+ }
+ if let Some(d) = else_branch {
+ flat.push(d);
+ }
+ let else_arg = flat.pop().unwrap_or_else(|| emit::constant(Value::Null));
+ let mut whens_arr: Vec<Value> = Vec::new();
+ let mut thens_arr: Vec<Value> = Vec::new();
+ for (i, col) in flat.into_iter().enumerate() {
+ if i % 2 == 0 {
+ whens_arr.push(col);
+ } else {
+ thens_arr.push(col);
+ }
+ }
+ return Ok(emit::call(
+ "transform",
+ vec![
+ scrut,
+ emit::array_(whens_arr),
+ emit::array_(thens_arr),
+ else_arg,
+ ],
+ ));
+ }
+
+ // No scrutinee. Build the flat column list the C++ visitor
+ // sees: when/then pairs interleaved, optionally followed by
+ // the ELSE value. The visitor dispatches purely on length:
+ // 3 items → `if(c, r, d)`
+ // anything else → `multiIf(...)`
+ // Notably an implicit-NULL else is NOT synthesised here, so
+ // `case when c then r end` produces `multiIf(c, r)`, not
+ // `if(c, r, null)`.
+ let mut columns: Vec<Value> = Vec::with_capacity(whens.len() * 2 + 1);
+ for (w, t) in whens.into_iter().zip(thens) {
+ columns.push(w);
+ columns.push(t);
+ }
+ if let Some(d) = else_branch {
+ columns.push(d);
+ }
+ if columns.len() == 3 {
+ Ok(emit::call("if", columns))
+ } else {
+ Ok(emit::call("multiIf", columns))
+ }
+ }
+
+ /// `CAST(expr AS type)` / `TRY_CAST(expr AS type)`.
+ fn parse_cast_expr(&mut self, is_try: bool) -> Result<Value, ParseError> {
+ self.bump()?; // consume CAST / TRY_CAST
+ self.expect(TokenKind::LParen, "(")?;
+ // cpp grammar: `castFunction: CAST LPAREN columnExpr AS
+ // columnTypeExpr RPAREN`. columnExpr greedily absorbs Alias
+ // forms (`expr AS ident`), so when the argument itself carries
+ // aliases the AS that belongs to CAST is the *last* AS at
+ // paren-depth zero before the matching `)`. Pre-scan to find
+ // that position and gate the AS-infix on it for the inner
+ // parse. `parse_expr_bp(0)` then naturally consumes the
+ // earlier aliases as Alias nodes and stops before the CAST AS.
+ let cast_as_pos = self.find_cast_separator_pos()?;
+ let prev_stop = std::mem::replace(&mut self.cast_as_stop, cast_as_pos);
+ let expr_result = self.parse_expr_bp(0);
+ self.cast_as_stop = prev_stop;
+ let expr = expr_result?;
+ self.expect_kw(Kw::As, "AS")?;
+ let type_name = self.parse_type_expr()?;
+ self.expect(TokenKind::RParen, ")")?;
+ if is_try {
+ Ok(emit::try_cast(expr, &type_name))
+ } else {
+ Ok(emit::type_cast(expr, &type_name))
+ }
+ }
+
+ /// Scan forward from the current position to find the matching
+ /// close paren for the enclosing CAST, returning the byte offset
+ /// of the *last* `AS` keyword at paren-depth zero before it. The
+ /// scan uses a shadow lexer so it does not advance our own cursor.
+ /// Returns `None` if no AS is found (degenerate input — the parser
+ /// will error on the missing AS later).
+ fn find_cast_separator_pos(&self) -> Result<Option<usize>, ParseError> {
+ let mut probe = Lexer::with_pos(self.src, self.peek0.start);
+ let mut depth: i32 = 0;
+ let mut last_as: Option<usize> = None;
+ loop {
+ let tok = probe.next_token()?;
+ match tok.kind {
+ TokenKind::LParen | TokenKind::LBracket | TokenKind::LBrace => depth += 1,
+ TokenKind::RParen | TokenKind::RBracket | TokenKind::RBrace => {
+ if depth == 0 {
+ break;
+ }
+ depth -= 1;
+ }
+ TokenKind::Keyword(Kw::As) if depth == 0 => {
+ last_as = Some(tok.start);
+ }
+ TokenKind::Eof => break,
+ _ => {}
+ }
+ }
+ Ok(last_as)
+ }
+
+ /// Like `find_cast_separator_pos`, but for a `columnsReplaceItem`
+ /// (`columnExpr AS identifier`) inside a `REPLACE (…)` list. The
+ /// `identifier` replacement name is the item's *last* token and the
+ /// separator `AS` is the token immediately before it. The last
+ /// `AS`-token of the item is NOT a reliable separator: the name can
+ /// itself be the keyword `as` (`a AS as`), so the trailing `Kw::As`
+ /// is the name, not the separator.
+ ///
+ /// The item terminates at a depth-0 `)` / `]` / `}` or — once the
+ /// item has shown an `AS` — a depth-0 `,`. The `AS`-gate keeps the
+ /// scan blind to lambda-parameter commas: `lambda x, y : …` and the
+ /// bare `a, b -> …` arrow form place their commas before the item's
+ /// `AS`, so they are treated as internal rather than as a boundary.
+ fn find_replace_item_as_pos(&self) -> Result<Option<usize>, ParseError> {
+ let mut probe = Lexer::with_pos(self.src, self.peek0.start);
+ let mut depth: i32 = 0;
+ let mut seen_as = false;
+ let mut prev_start: Option<usize> = None;
+ let mut last_start: Option<usize> = None;
+ loop {
+ let tok = probe.next_token()?;
+ let terminator = match tok.kind {
+ TokenKind::RParen | TokenKind::RBracket | TokenKind::RBrace if depth == 0 => true,
+ TokenKind::Comma if depth == 0 && seen_as => true,
+ TokenKind::Eof => true,
+ _ => false,
+ };
+ if terminator {
+ break;
+ }
+ match tok.kind {
+ TokenKind::LParen | TokenKind::LBracket | TokenKind::LBrace => depth += 1,
+ TokenKind::RParen | TokenKind::RBracket | TokenKind::RBrace => depth -= 1,
+ TokenKind::Keyword(Kw::As) if depth == 0 => seen_as = true,
+ _ => {}
+ }
+ prev_start = last_start;
+ last_start = Some(tok.start);
+ }
+ // The separator `AS` is the second-to-last token of the item.
+ Ok(prev_start)
+ }
+
+ /// `INTERVAL <expr> <unit>` or `INTERVAL '<n> <unit>'`. Both forms
+ /// rewrite to `Call("toInterval<Unit>", [expr])` per the C++ visitor.
+ fn parse_interval_expr(&mut self) -> Result<Value, ParseError> {
+ self.expect_kw(Kw::Interval, "INTERVAL")?;
+ // `INTERVAL '5 day'` — a single string literal carrying both
+ // count and unit. Only take this branch when the string is the
+ // *entire* interval value: if a unit keyword follows the
+ // string, cpp uses the string as the expr in the
+ // `INTERVAL <expr> <unit>` form (e.g. `interval '1' hour` →
+ // `Call(toIntervalHour, [Constant("1")])`).
+ //
+ // Also: only commit to the combined-string form when the string
+ // contains a space. cpp's ALL(*) backtracks to expr+unit when
+ // the string can't be split (e.g. `interval 'ef' … month` —
+ // 'ef' is the start of a longer expression and `month` is the
+ // unit). The literal-only `interval 'ef'` form errors in cpp
+ // too, so falling through here doesn't mask any acceptances.
+ if matches!(self.peek(), TokenKind::String) && !self.peek_next_is_interval_unit() {
+ let str_tok = self.peek0;
+ let raw = unquote_single_string(self.text(str_tok));
+ if let Some((count_str, unit)) = raw.split_once(' ') {
+ // cpp's `visitColumnExprIntervalString` requires the
+ // count to be a non-negative decimal integer (`isdigit`
+ // per char, `stoi` for the convert), and matches the
+ // unit against a literal-lowercase set (so `SECOND`
+ // rejects with "Unsupported interval unit: SECOND").
+ // Rust used to lowercase the unit and silently
+ // substitute `Constant(0)` for any unparseable count
+ // — `INTERVAL 'twenty days'` quietly became "0 days".
+ let count_valid =
+ !count_str.is_empty() && count_str.bytes().all(|b| b.is_ascii_digit());
+ if !count_valid {
+ self.bump()?;
+ return Err(ParseError::not_implemented_fatal(
+ format!("Unsupported interval count: {count_str}"),
+ str_tok.start,
+ str_tok.end,
+ ));
+ }
+ let count: i64 = match count_str.parse() {
+ Ok(n) => n,
+ Err(_) => {
+ self.bump()?;
+ return Err(ParseError::not_implemented_fatal(
+ "Unknown error: stoi: out of range",
+ str_tok.start,
+ str_tok.end,
+ ));
+ }
+ };
+ // cpp's unit check is literal-lowercase — case-sensitive
+ // against the lowercase singular / plural forms. Match
+ // that here rather than `interval_call_name`'s
+ // case-insensitive helper.
+ let unit_name = interval_call_name_case_sensitive(unit);
+ if let Some(unit_name) = unit_name {
+ self.bump()?;
+ return Ok(emit::call(
+ unit_name,
+ vec![emit::constant(Value::from(count))],
+ ));
+ }
+ // Unit not lowercase / not recognised — cpp errors
+ // here even though the count was valid.
+ self.bump()?;
+ return Err(ParseError::not_implemented_fatal(
+ format!("Unsupported interval unit: {unit}"),
+ str_tok.start,
+ str_tok.end,
+ ));
+ }
+ // Fall through to the expr+unit form: parse the string as
+ // the value expression and let the trailing unit keyword
+ // close the INTERVAL.
+ }
+ // `INTERVAL <expr> <unit>` — the grammar admits a full
+ // columnExpr for the value, so we parse at BP=0 (greedy).
+ // The unit-keyword tokens (SECOND/MINUTE/…/YEAR) aren't binary
+ // or postfix operators, so the Pratt loop naturally halts
+ // before them. AND/OR/BETWEEN that surround the INTERVAL in
+ // an outer expression bind correctly because the SECOND
+ // keyword terminates the interval value before they're seen
+ // — the outer call gets to those operators after parse_interval_expr
+ // returns.
+ let expr = self.parse_expr_bp(0)?;
+ // The grammar's `interval` rule is the eight singular unit
+ // *keyword* tokens (`SECOND | MINUTE | HOUR | DAY | WEEK |
+ // MONTH | QUARTER | YEAR`, with `YYYY` lexed as `YEAR`). A
+ // plural (`hours`) lexes as an identifier and an arbitrary
+ // identifier / quoted identifier is never a unit — cpp rejects
+ // all of those (`INTERVAL 1 hours`, `INTERVAL 1 "hour"`). The
+ // plural-tolerant `INTERVAL '5 days'` form is the *string*
+ // branch above, handled before this point.
+ let unit_tok = self.bump()?;
+ let unit_name = match unit_tok.kind {
+ TokenKind::Keyword(
+ Kw::Second
+ | Kw::Minute
+ | Kw::Hour
+ | Kw::Day
+ | Kw::Week
+ | Kw::Month
+ | Kw::Quarter
+ | Kw::Year,
+ ) => interval_call_name(self.text(unit_tok)).ok_or_else(|| {
+ self.err(format!(
+ "unsupported INTERVAL unit: {}",
+ self.text(unit_tok)
+ ))
+ })?,
+ _ => {
+ return Err(self.err(format!(
+ "expected interval unit keyword, got {:?}",
+ unit_tok.kind
+ )))
+ }
+ };
+ Ok(emit::call(unit_name, vec![expr]))
+ }
+
+ /// Is `peek_next` a recognised INTERVAL unit keyword? Used by
+ /// parse_interval_expr to decide between the combined-string form
+ /// (`INTERVAL '5 day'`) and the expr-plus-unit form (`INTERVAL '1'
+ /// HOUR`). When a unit keyword immediately follows the string,
+ /// cpp treats the string as the value expression.
+ fn peek_next_is_interval_unit(&self) -> bool {
+ match self.peek_next() {
+ TokenKind::Keyword(_) | TokenKind::Ident | TokenKind::QuotedIdent => {
+ interval_call_name(self.text(self.peek1)).is_some()
+ }
+ _ => false,
+ }
+ }
+
+ /// Is the current token a `WITH` that begins a `WITH (LOCAL)? TIME
+ /// ZONE` type-cast suffix? Used by the `::` cast handler so a bare
+ /// `WITH` (e.g. a trailing `WITH FILL` order-by modifier) is left
+ /// for the enclosing clause rather than mis-parsed as a timezone
+ /// type. Mirrors cpp's ALL(*) lookahead on `columnTypeCastExpr`.
+ fn peek_is_with_time_zone(&self) -> bool {
+ if !matches!(self.peek(), TokenKind::Keyword(Kw::With)) {
+ return false;
+ }
+ // Resolve the TIME token and the byte offset just past it,
+ // skipping an optional LOCAL right after WITH.
+ let (time_kind, time_end) = match self.peek_next() {
+ TokenKind::Keyword(Kw::Local) => {
+ let mut probe = Lexer::with_pos(self.src, self.peek1.end);
+ match probe.next_token() {
+ Ok(t) => (t.kind, t.end),
+ Err(_) => return false,
+ }
+ }
+ other => (other, self.peek1.end),
+ };
+ if !matches!(time_kind, TokenKind::Keyword(Kw::Time)) {
+ return false;
+ }
+ let mut probe = Lexer::with_pos(self.src, time_end);
+ matches!(
+ probe.next_token().map(|t| t.kind),
+ Ok(TokenKind::Keyword(Kw::Zone))
+ )
+ }
+
+ /// Peek past `TRIM (` to check whether the next token is a
+ /// directional keyword (LEADING / TRAILING / BOTH). If so, this is
+ /// the special TRIM grammar form; otherwise it's a regular function
+ /// call to a function literally named `trim`.
+ fn is_trim_keyword_form(&self) -> bool {
+ let mut probe = Lexer::with_pos(self.src, self.peek0.start);
+ drop(probe.next_token()); // TRIM
+ drop(probe.next_token()); // (
+ match probe.next_token() {
+ Ok(t) => matches!(
+ t.kind,
+ TokenKind::Keyword(Kw::Leading)
+ | TokenKind::Keyword(Kw::Trailing)
+ | TokenKind::Keyword(Kw::Both),
+ ),
+ Err(_) => false,
+ }
+ }
+
+ fn parse_trim_keyword_form(&mut self) -> Result<Value, ParseError> {
+ self.expect_kw(Kw::Trim, "TRIM")?;
+ self.expect(TokenKind::LParen, "(")?;
+ let name = if self.eat_kw(Kw::Leading)? {
+ "trimLeft"
+ } else if self.eat_kw(Kw::Trailing)? {
+ "trimRight"
+ } else if self.eat_kw(Kw::Both)? {
+ "trim"
+ } else {
+ // Caller (parse_primary) only routes here when one of these
+ // keywords is present, so this branch is unreachable.
+ return Err(self.err("expected LEADING / TRAILING / BOTH after TRIM("));
+ };
+ // Trim substring: per grammar
+ // `TRIM (LEADING|TRAILING|BOTH string FROM columnExpr)`, where
+ // `string: STRING_LITERAL | templateString`. cpp rejects any
+ // other expression (Field, Call, etc.) here. The earlier comment
+ // claiming `string` resolves to columnExpr was wrong.
+ if !matches!(self.peek(), TokenKind::String | TokenKind::TemplateString,) {
+ return Err(self.err("TRIM substring must be a string literal or template string"));
+ }
+ let str_value = self.parse_expr_bp(0)?;
+ self.expect_kw(Kw::From, "FROM")?;
+ let expr = self.parse_expr_bp(0)?;
+ self.expect(TokenKind::RParen, ")")?;
+ // Args order matches the C++ visitor: expr first, then the trim
+ // substring.
+ Ok(emit::call(name, vec![expr, str_value]))
+ }
+
+ /// `lambda IDENT (, IDENT)* : body`. The body admits a bare-list
+ /// arrow lambda (`a, b -> body`) as a full columnExpr, so we try
+ /// that form first before falling back to the regular Pratt parse.
+ fn parse_lambda_keyword(&mut self) -> Result<Value, ParseError> {
+ self.expect_kw(Kw::Lambda, "lambda")?;
+ let mut params: Vec<String> = Vec::new();
+ loop {
+ let t = self.bump()?;
+ let name = match t.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent => identifier_text(self.text(t), t.kind),
+ // Lambda params route through the grammar's
+ // `identifier` rule, which omits NULL / INF / NAN and
+ // the Hog-statement keywords.
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
+ identifier_text(self.text(t), t.kind)
+ }
+ _ => return Err(self.err(format!("expected lambda parameter, got {:?}", t.kind))),
+ };
+ params.push(name);
+ if !self.eat(TokenKind::Comma)? {
+ break;
+ }
+ if self.peek() == TokenKind::Colon {
+ break;
+ }
+ }
+ self.expect(TokenKind::Colon, ":")?;
+ let body = if let Some(inner) = self.try_bare_list_lambda()? {
+ inner
+ } else {
+ self.parse_lambda_body()?
+ };
+ Ok(emit::lambda(params, body))
+ }
+
+ /// `COLUMNS('regex')` / `COLUMNS(expr, …)` / `COLUMNS(*)` with optional
+ /// `EXCLUDE (…)` / `REPLACE (…)` decoration and an optional
+ /// `IDENT.*` qualifier. Plus the leading-`ASTERISK COLUMNS(…)` spread
+ /// forms. Covers the full ColumnExprColumns* family from the grammar.
+ fn parse_columns_expr(&mut self) -> Result<Value, ParseError> {
+ self.expect_kw(Kw::Columns, "COLUMNS")?;
+ self.expect(TokenKind::LParen, "(")?;
+ // Three shapes inside the parens:
+ // 1. `'regex'` → ColumnsRegex
+ // 2. `*` [EXCLUDE (...)] [REPLACE (...)]
+ // 3. `ident DOT *` [EXCLUDE (...)] [REPLACE (...)]
+ // 4. `expr_list` → ColumnsList
+ let result =
+ if matches!(self.peek(), TokenKind::String) && self.peek_next() == TokenKind::RParen {
+ let str_tok = self.bump()?;
+ let s = unquote_single_string(self.text(str_tok));
+ emit::columns_expr(Some(s), None, false, None, None)
+ } else if self.peek() == TokenKind::Asterisk
+ && matches!(
+ self.peek_next(),
+ TokenKind::Keyword(Kw::Exclude) | TokenKind::Keyword(Kw::Replace)
+ )
+ {
+ let asterisk_pos = self.peek0.start;
+ self.bump()?;
+ let (exclude, replace) = self.parse_columns_decorators()?;
+ // ANTLR resolves `COLUMNS(* …)` against five alternatives in
+ // declared order. The interesting split:
+ //
+ // `COLUMNS(* EXCLUDE …)` only
+ // → matches `ColumnExprColumnsList` first because
+ // `ColumnExprAsterisk` admits a trailing EXCLUDE
+ // (line 288 of HogQLParser.g4). cpp wraps the asterisk
+ // columns-expr inside an outer `ColumnsExpr(columns=…)`.
+ //
+ // `COLUMNS(* REPLACE …)`
+ // `COLUMNS(* EXCLUDE … REPLACE …)`
+ // → list path can't match (REPLACE isn't a valid trailing
+ // decoration on `ColumnExprAsterisk`), so ANTLR falls
+ // through to the specialised `ColumnExprColumnsReplace`
+ // / `…ExcludeReplace` rule, which returns the
+ // UNWRAPPED `ColumnsExpr(all_columns=True, …)` shape.
+ //
+ // Mirror that split here.
+ if replace.is_some() {
+ emit::columns_expr(None, None, true, exclude, replace)
+ } else {
+ // cpp's `ColumnExprAsterisk` ctx covers `*` plus the
+ // optional `EXCLUDE(...)` trailer. Wrap the inner
+ // ColumnsExpr from the `*` position so it carries the
+ // span before the outer columns_list_from_first picks
+ // it up as `columns[0]`.
+ let inner = self.wrap_pos(
+ emit::columns_expr(None, None, true, exclude, None),
+ asterisk_pos,
+ );
+ self.columns_list_from_first(inner)?
+ }
+ } else {
+ // Could be `ident . *` or an expression list.
+ // Peek for the qualified-asterisk pattern: IDENT DOT ASTERISK.
+ if matches!(
+ self.peek(),
+ TokenKind::Ident | TokenKind::QuotedIdent | TokenKind::Keyword(_)
+ ) && self.peek_next() == TokenKind::Dot
+ {
+ // Try to consume `IDENT.*` (or longer dotted chain ending in `*`).
+ let saved_pos = self.peek0.start;
+ let mut chain: Vec<String> = Vec::new();
+ let mut probe = Lexer::with_pos(self.src, saved_pos);
+ let first = probe.next_token()?;
+ chain.push(identifier_text(
+ &self.src[first.start..first.end],
+ first.kind,
+ ));
+ let mut ok = true;
+ let mut saw_star = false;
+ loop {
+ let dot = probe.next_token()?;
+ if dot.kind != TokenKind::Dot {
+ ok = false;
+ break;
+ }
+ let nxt = probe.next_token()?;
+ if nxt.kind == TokenKind::Asterisk {
+ saw_star = true;
+ break;
+ }
+ if matches!(
+ nxt.kind,
+ TokenKind::Ident | TokenKind::QuotedIdent | TokenKind::Keyword(_)
+ ) {
+ chain.push(identifier_text(&self.src[nxt.start..nxt.end], nxt.kind));
+ } else {
+ ok = false;
+ break;
+ }
+ }
+ if ok && saw_star {
+ // Capture the end of the `*` token before committing
+ // the cursor — we want the Field span to cover the
+ // qualified asterisk (`table.*`), matching cpp's
+ // `ColumnExprColumnsQualifiedAll` ctx span.
+ let asterisk_end = probe.pos();
+ // Commit the qualified-asterisk consumption.
+ self.set_lexer_pos(probe.pos())?;
+ let (exclude, replace) = self.parse_columns_decorators()?;
+ let mut chain_values: Vec<Value> =
+ chain.into_iter().map(Value::String).collect();
+ chain_values.push(Value::String("*".into()));
+ let qualified_field =
+ self.wrap_pos_to(emit::field(chain_values), saved_pos, asterisk_end);
+ // Four C++-visitor shapes, all reachable here:
+ // QualifiedAll: ColumnsExpr(columns=[Field(table.*)])
+ // QualifiedExclude: ColumnsExpr(columns=[ColumnsExpr(all_columns=True, exclude=...)])
+ // QualifiedReplace: ColumnsExpr(all_columns=True, replace=...) // qualifier dropped
+ // QualifiedExcludeReplace: ColumnsExpr(all_columns=True, exclude=..., replace=...) // qualifier dropped
+ match (exclude, replace) {
+ (None, None) => self.columns_list_from_first(qualified_field)?,
+ (Some(ex), None) => {
+ // cpp's `ColumnExprColumnsQualifiedExclude`
+ // ctx covers `IDENT.* EXCLUDE(...)`; the
+ // inner ColumnsExpr inherits that span.
+ // Wrap before passing to the outer list.
+ let inner = self.wrap_pos(
+ emit::columns_expr(None, None, true, Some(ex), None),
+ saved_pos,
+ );
+ self.columns_list_from_first(inner)?
+ }
+ (ex, repl @ Some(_)) => {
+ // cpp's `ColumnExprColumnsQualifiedReplace` /
+ // `…QualifiedExcludeReplace` ctx covers the
+ // full `COLUMNS LPAREN IDENT.* [EXCLUDE(...)]
+ // REPLACE(...) RPAREN`. The outer
+ // `parse_expr_bp` wrap captures positions
+ // from the COLUMNS keyword, so emit the
+ // ColumnsExpr without a local wrap and let
+ // that outer wrap stamp the span.
+ emit::columns_expr(None, None, true, ex, repl)
+ }
+ }
+ } else {
+ let list = self.parse_arg_list(TokenKind::RParen)?;
+ emit::columns_expr(None, Some(list), false, None, None)
+ }
+ } else {
+ let list = self.parse_arg_list(TokenKind::RParen)?;
+ emit::columns_expr(None, Some(list), false, None, None)
+ }
+ };
+ self.expect(TokenKind::RParen, ")")?;
+ Ok(result)
+ }
+
+ /// An asterisk-form (`*`, `id.*`, `* EXCLUDE (...)`) inside
+ /// `COLUMNS (...)` has already been parsed into `first`. cpp's
+ /// ANTLR resolves the `COLUMNS LPAREN columnExprList RPAREN`
+ /// alternative before the dedicated `* …` / `id.* …` ones, so when
+ /// a `)` follows immediately this was the sole list element. When
+ /// anything else follows, the asterisk-form is the head of a
+ /// larger `columnExpr` (a postfix `(…)` call etc.) and may be the
+ /// first of a comma list — continue it through the Pratt loop and
+ /// collect the rest as `ColumnExprColumnsList`.
+ fn columns_list_from_first(&mut self, first: Value) -> Result<Value, ParseError> {
+ if self.peek() == TokenKind::RParen {
+ return Ok(emit::columns_expr(
+ None,
+ Some(vec![first]),
+ false,
+ None,
+ None,
+ ));
+ }
+ let cont_start = self.peek0.start;
+ let first = self.pratt_continue_with_lhs(first, 0, cont_start)?;
+ let mut list = vec![first];
+ while self.eat(TokenKind::Comma)? {
+ if self.peek() == TokenKind::RParen {
+ break;
+ }
+ list.push(self.parse_expr_bp(0)?);
+ }
+ Ok(emit::columns_expr(None, Some(list), false, None, None))
+ }
+
+ fn parse_columns_decorators(&mut self) -> Result<ColumnsDecorators, ParseError> {
+ let exclude = if self.eat_kw(Kw::Exclude)? {
+ self.expect(TokenKind::LParen, "(")?;
+ let mut names = Vec::new();
+ loop {
+ // Each entry is a `nestedIdentifier`: identifier
+ // (DOT identifier)*. The cpp `visitNestedIdentifier`
+ // joins the parts with `.` into a single string.
+ let mut parts: Vec<String> = Vec::new();
+ let first = self.bump()?;
+ parts.push(match first.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent => {
+ identifier_text(self.text(first), first.kind)
+ }
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
+ identifier_text(self.text(first), first.kind)
+ }
+ _ => {
+ return Err(self.err(format!(
+ "expected identifier in EXCLUDE list, got {:?}",
+ first.kind
+ )))
+ }
+ });
+ while self.peek() == TokenKind::Dot {
+ self.bump()?;
+ let part = self.bump()?;
+ parts.push(match part.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent => {
+ identifier_text(self.text(part), part.kind)
+ }
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
+ identifier_text(self.text(part), part.kind)
+ }
+ _ => {
+ return Err(self.err(format!(
+ "expected identifier after `.` in EXCLUDE list, got {:?}",
+ part.kind
+ )))
+ }
+ });
+ }
+ names.push(parts.join("."));
+ if !self.eat(TokenKind::Comma)? {
+ break;
+ }
+ if self.peek() == TokenKind::RParen {
+ break;
+ }
+ }
+ self.expect(TokenKind::RParen, ")")?;
+ Some(names)
+ } else {
+ None
+ };
+
+ let replace = if self.eat_kw(Kw::Replace)? {
+ self.expect(TokenKind::LParen, "(")?;
+ let mut items = Vec::new();
+ loop {
+ // `columnsReplaceItem: columnExpr AS identifier`. The
+ // separator `AS` is the item's second-to-last token
+ // (the last token is the replacement `identifier`).
+ // Gate the alias-infix on that offset (same mechanism
+ // as CAST) so the inner `columnExpr` parse takes any
+ // earlier aliases and stops before the separator.
+ let item_as = self.find_replace_item_as_pos()?;
+ let prev_stop = std::mem::replace(&mut self.cast_as_stop, item_as);
+ let expr_result = self.parse_expr_bp(0);
+ self.cast_as_stop = prev_stop;
+ let expr = expr_result?;
+ self.expect_kw(Kw::As, "AS")?;
+ let t = self.bump()?;
+ let name = match t.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent => {
+ identifier_text(self.text(t), t.kind)
+ }
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
+ identifier_text(self.text(t), t.kind)
+ }
+ _ => {
+ return Err(self.err(format!(
+ "expected identifier in REPLACE clause, got {:?}",
+ t.kind
+ )))
+ }
+ };
+ items.push((name, expr));
+ if !self.eat(TokenKind::Comma)? {
+ break;
+ }
+ // `columnsReplaceList: columnsReplaceItem (COMMA
+ // columnsReplaceItem)*` — no trailing comma; cpp rejects
+ // `REPLACE (b AS c,)`.
+ if self.peek() == TokenKind::RParen {
+ return Err(self.err("trailing comma in REPLACE clause"));
+ }
+ }
+ self.expect(TokenKind::RParen, ")")?;
+ Some(items)
+ } else {
+ None
+ };
+
+ Ok((exclude, replace))
+ }
+
+ /// Bare `*` at primary position. Three forms, in grammar-declared
+ /// order:
+ ///
+ /// - `* COLUMNS(…)` → `SpreadExpr(ColumnsExpr(…))` (the spread form,
+ /// either regex or list)
+ /// - `* EXCLUDE (…)` / `* REPLACE (…)` → `ColumnsExpr(all_columns=True, …)`
+ /// - bare `*` → `Field(["*"])` (C++ visitor's `ColumnExprAsterisk`)
+ fn parse_top_level_asterisk(&mut self) -> Result<Value, ParseError> {
+ self.expect(TokenKind::Asterisk, "*")?;
+ // `* COLUMNS(…)` — spread-columns form. The inner is whatever
+ // parse_columns_expr produces (regex / list / qualified-all);
+ // we wrap it in a SpreadExpr to match the visitor's
+ // `ColumnExprSpreadColumns*` family. Only enter this branch
+ // when COLUMNS is actually followed by `(` — bare `* COLUMNS`
+ // is rejected by cpp / falls back to a bare `*` Field.
+ if matches!(self.peek(), TokenKind::Keyword(Kw::Columns))
+ && self.peek_next() == TokenKind::LParen
+ {
+ let inner = self.parse_columns_expr()?;
+ return Ok(emit::spread_expr(inner));
+ }
+ // `ColumnExprAsterisk` (grammar line 289) admits ONLY an
+ // optional trailing EXCLUDE on a bare `*`. `REPLACE` after `*`
+ // is valid only inside the paren-wrapped forms (lines 220-225)
+ // — `(* REPLACE (…))`, `(* EXCLUDE (…) REPLACE (…))`, and the
+ // `COLUMNS(* … REPLACE …)` family. We detect the paren-wrapped
+ // case by looking at what follows the REPLACE-list's closing
+ // `)`: if it's `)` we're inside a wrapping paren (cpp's
+ // ColumnExprColumnsReplace alt); anything else means the bare-
+ // `*` REPLACE attempted at top level, which cpp rejects.
+ let cp_before_decorators = self.checkpoint();
+ let (exclude, replace) = self.parse_columns_decorators()?;
+ if replace.is_some() && self.peek() != TokenKind::RParen {
+ self.restore(cp_before_decorators)?;
+ return Err(self.err(
+ "REPLACE after a bare `*` is only valid inside `(* REPLACE …)` / `COLUMNS(* REPLACE …)`",
+ ));
+ }
+ if exclude.is_none() && replace.is_none() {
+ Ok(emit::field(vec![Value::String("*".into())]))
+ } else {
+ Ok(emit::columns_expr(None, None, true, exclude, replace))
+ }
+ }
+
+ /// `#<integer>` — positional column reference from a SELECT.
+ fn parse_positional(&mut self) -> Result<Value, ParseError> {
+ self.expect(TokenKind::Hash, "#")?;
+ let tok = self.bump()?;
+ if tok.kind != TokenKind::Number {
+ return Err(self.err(format!("expected integer after '#', got {:?}", tok.kind)));
+ }
+ let n: i64 = self.text(tok).parse().unwrap_or(0);
+ Ok(json!({"node": "PositionalRef", "index": n}))
+ }
+
+ pub(crate) fn parse_brace_dict_or_placeholder(&mut self) -> Result<Value, ParseError> {
+ // Capture the `{` start so the resulting Dict / Placeholder carries
+ // a span from `{` through `}`. Callers reached via `parse_expr_bp`
+ // also wrap, but `parse_table_expr` and the join-expr placeholder
+ // arm call this directly without an outer Pratt wrap — without
+ // wrapping here the resulting table-position is None.
+ let brace_start = self.peek0.start;
+ self.expect(TokenKind::LBrace, "{")?;
+ if self.peek() == TokenKind::RBrace {
+ self.bump()?;
+ return Ok(self.wrap_pos(emit::dict_(vec![]), brace_start));
+ }
+ let first = self.parse_expr_bp(0)?;
+ if self.eat(TokenKind::Colon)? {
+ let v = self.parse_expr_bp(0)?;
+ let mut items = vec![(first, v)];
+ while self.eat(TokenKind::Comma)? {
+ if self.peek() == TokenKind::RBrace {
+ break;
+ }
+ let k = self.parse_expr_bp(0)?;
+ self.expect(TokenKind::Colon, ":")?;
+ let v = self.parse_expr_bp(0)?;
+ items.push((k, v));
+ }
+ self.expect(TokenKind::RBrace, "}")?;
+ Ok(self.wrap_pos(emit::dict_(items), brace_start))
+ } else {
+ self.expect(TokenKind::RBrace, "}")?;
+ Ok(self.wrap_pos(emit::placeholder(first), brace_start))
+ }
+ }
+
+ fn parse_single_arg_arrow_lambda(&mut self) -> Result<Value, ParseError> {
+ let ident = self.bump()?;
+ let name = identifier_text(self.text(ident), ident.kind);
+ self.expect(TokenKind::Arrow, "->")?;
+ let body = self.parse_lambda_body()?;
+ Ok(emit::lambda(vec![name], body))
+ }
+
+ /// Lambda body — either a single expression (`(x) -> expr`) or a
+ /// Hog block (`(x) -> { stmt stmt }`). The block form lets a
+ /// lambda contain imperative statements with the trailing
+ /// expression / return statement as the value.
+ ///
+ /// A `{…}` body is genuinely ambiguous: `{1: 2}` is a Dict, `{x}`
+ /// is a Placeholder, `{ a b }` / `{ let x }` is a Block. cpp's
+ /// ALL(*) prefers the expression and falls back to the block. We
+ /// mirror that with bounded backtracking rather than a heuristic
+ /// scan: try to parse the brace as one whole expression, and if it
+ /// does not parse as one, parse it as a block. This is faithful at
+ /// any nesting depth — a heuristic that pattern-matches the brace
+ /// contents inevitably misses shapes (e.g. a block of juxtaposed
+ /// `exprStmt`s carries no `;`, keyword, or `:=` to key on).
+ pub(crate) fn parse_lambda_body(&mut self) -> Result<Value, ParseError> {
+ if self.peek() == TokenKind::LBrace {
+ return self.try_alt(&[&Self::parse_brace_expr_body, &Self::parse_block]);
+ }
+ self.parse_expr_bp(0)
+ }
+
+ /// `try_alt` arm: parse a `{…}` lambda body as a single Dict /
+ /// Placeholder expression. Fails (so the block arm takes over) when
+ /// the brace contents are not one whole `columnExpr`.
+ fn parse_brace_expr_body(&mut self) -> Result<Value, ParseError> {
+ self.parse_expr_bp(0)
+ }
+
+ /// Try the bare-list arrow lambda form: `IDENT (, IDENT)* -> body`.
+ /// Only valid at the outermost expression level (inside argument lists
+ /// the commas are separators, so we never need to detect it there).
+ pub(crate) fn try_bare_list_lambda(&mut self) -> Result<Option<Value>, ParseError> {
+ // `IDENT (, IDENT)* COMMA? -> body`. A lambda parameter is an
+ // `identifier`: a plain Ident, a QuotedIdent, or any keyword
+ // admitted by `kw_valid_as_identifier` (`name -> 1`,
+ // `select -> 1`; but not `null -> 1` — cpp's `identifier`
+ // rule omits NULL / INF / NAN and the Hog-statement keywords).
+ let is_ident_kind = |k: TokenKind| -> bool {
+ matches!(k, TokenKind::Ident | TokenKind::QuotedIdent)
+ || matches!(k, TokenKind::Keyword(kw) if kw_valid_as_identifier(kw))
+ };
+ if !is_ident_kind(self.peek()) {
+ return Ok(None);
+ }
+ // Probe with a shadow lexer that doesn't disturb the parser state.
+ let mut probe = Lexer::with_pos(self.src, self.peek0.start);
+ let mut names: Vec<String> = Vec::new();
+ let first = probe.next_token()?;
+ if !is_ident_kind(first.kind) {
+ return Ok(None);
+ }
+ names.push(identifier_text(
+ &self.src[first.start..first.end],
+ first.kind,
+ ));
+ loop {
+ let t = probe.next_token()?;
+ match t.kind {
+ TokenKind::Arrow => {
+ // Confirmed; commit the consumption.
+ self.set_lexer_pos(probe.pos())?;
+ let body = self.parse_lambda_body()?;
+ return Ok(Some(emit::lambda(names, body)));
+ }
+ TokenKind::Comma => {
+ // Peek past the comma to handle the trailing-comma
+ // case (`a, -> body`): if the next token is the
+ // arrow itself we still want to commit.
+ let after = probe.next_token()?;
+ match after.kind {
+ TokenKind::Arrow => {
+ self.set_lexer_pos(probe.pos())?;
+ let body = self.parse_lambda_body()?;
+ return Ok(Some(emit::lambda(names, body)));
+ }
+ k if is_ident_kind(k) => {
+ names.push(identifier_text(
+ &self.src[after.start..after.end],
+ after.kind,
+ ));
+ }
+ _ => return Ok(None),
+ }
+ }
+ _ => return Ok(None),
+ }
+ }
+ }
+
+ /// `(...)` may be a paren-wrapped expression, a tuple, or a lambda
+ /// head followed by `->`. We probe for the lambda shape first because
+ /// it's the only one that needs to refuse non-identifier contents.
+ fn parse_paren_or_lambda(&mut self) -> Result<Value, ParseError> {
+ // Probe for `( [IDENT (, IDENT)* COMMA?]? ) ARROW`.
+ let mut probe = Lexer::with_pos(self.src, self.peek0.start);
+ let lp = probe.next_token()?;
+ debug_assert_eq!(lp.kind, TokenKind::LParen);
+ let mut names: Vec<String> = Vec::new();
+ let mut next = probe.next_token()?;
+ let mut ok = true;
+ if next.kind == TokenKind::RParen {
+ // Empty `()` — only valid as a lambda head.
+ } else {
+ loop {
+ // The grammar's lambda head admits any `identifier` —
+ // plain IDENT, quoted idents (`"x"`), or any keyword
+ // admitted by `kw_valid_as_identifier` (`(name) -> body`,
+ // `(select) -> body`; but not `(null) -> body` — cpp's
+ // `identifier` rule omits NULL / INF / NAN and the
+ // Hog-statement keywords).
+ let is_ident_kind = matches!(next.kind, TokenKind::Ident | TokenKind::QuotedIdent)
+ || matches!(next.kind, TokenKind::Keyword(kw) if kw_valid_as_identifier(kw));
+ if !is_ident_kind {
+ ok = false;
+ break;
+ }
+ names.push(identifier_text(&self.src[next.start..next.end], next.kind));
+ let after = probe.next_token()?;
+ match after.kind {
+ TokenKind::Comma => {
+ next = probe.next_token()?;
+ if next.kind == TokenKind::RParen {
+ break;
+ } // trailing comma
+ }
+ TokenKind::RParen => break,
+ _ => {
+ ok = false;
+ break;
+ }
+ }
+ }
+ }
+ if ok {
+ let arrow = probe.next_token()?;
+ if arrow.kind == TokenKind::Arrow {
+ self.set_lexer_pos(probe.pos())?;
+ let body = self.parse_lambda_body()?;
+ return Ok(emit::lambda(names, body));
+ }
+ }
+ // Not a lambda — fall through to the normal paren/tuple parse.
+ self.parse_paren_or_tuple()
+ }
+
+ /// If the just-consumed numeric token is followed by `.<digits>`,
+ /// consume the dot + fractional and return the combined source text.
+ /// Implements the grammar's `floatingLiteral: DECIMAL_LITERAL DOT
+ /// (DECIMAL_LITERAL | OCTAL_LITERAL)?` assembled at parse time so that
+ /// `t.1.2` can lex as 5 tokens instead of mis-folding into `t .<float>`.
+ /// On any lex error during the fractional consumption we return the
+ /// leading text unchanged — the parser will encounter the error on
+ /// its next token fetch.
+ fn consume_optional_fractional(&mut self, leading: &str) -> String {
+ if self.peek() != TokenKind::Dot {
+ return leading.to_string();
+ }
+ // Hex / `0b` binary literals never carry a fractional —
+ // `0xc.5` is hex-12 then `.5`, `0b10.5` is binary-2 then `.5`
+ // (a tuple access / float-chain fragment), not a hex-/binary-
+ // float. Stop here so the Pratt postfix loop can take the dot.
+ if leading.starts_with("0x")
+ || leading.starts_with("0X")
+ || leading.starts_with("0b")
+ || leading.starts_with("0B")
+ {
+ return leading.to_string();
+ }
+ // Same for C-style leading-zero octal: cpp's ANTLR lexer
+ // tokenizes `017.5` as OCTAL_LITERAL `017` then DOT then
+ // DECIMAL_LITERAL `5` (TupleAccess), not as a float `17.5`.
+ // Recognize "valid octal" as leading-`0` plus only octal
+ // digits — `08.5` (with a non-octal `8`) IS a float in cpp
+ // because the OCTAL_LITERAL rule doesn't match.
+ if leading.len() > 1
+ && leading.starts_with('0')
+ && leading.chars().all(|c| ('0'..='7').contains(&c))
+ {
+ return leading.to_string();
+ }
+ // Trailing-dot float: `1.` with no digit/ident after — cpp's
+ // FLOATING_LITERAL grammar admits the empty fractional. Don't
+ // consume the dot if it's followed by a Number (full `.5`,
+ // handled below) or an Ident (could be a tuple-access /
+ // field-chain dot, handled by the Pratt postfix loop).
+ //
+ // Exception: when peek_next is an INFIX-only keyword (AND,
+ // OR, IS, LIKE, IN, BETWEEN, etc.) that needs an LHS, cpp's
+ // ANTLR ALL(*) absorbs the dot as the float's empty
+ // fractional (`123 .` → `123.0`) so the keyword can apply
+ // to the resulting float. Without the dot absorbed our Pratt
+ // postfix loop takes `.` as a property access, then errors
+ // when the keyword can't be a property name.
+ let consume_as_float = match self.peek_next() {
+ TokenKind::Number | TokenKind::Ident | TokenKind::QuotedIdent => false,
+ // `<n> . IGNORE NULLS` — `IGNORE NULLS` is a postfix
+ // modifier (the cpp visitor drops it), not a `.property`
+ // access. cpp's ALL(*) absorbs the dot as the float's
+ // empty fractional so IGNORE NULLS applies to the float;
+ // the `.ignore` property reading would strand `nulls` as
+ // a trailing reserved keyword. Needs a 3-token probe:
+ // only absorb when `nulls` actually follows `ignore`
+ // (`<n> . ignore` alone IS a `.ignore` property access).
+ TokenKind::Keyword(Kw::Ignore) => {
+ let mut probe = Lexer::with_pos(self.src, self.peek1.end);
+ matches!(
+ probe.next_token().map(|t| t.kind),
+ Ok(TokenKind::Keyword(Kw::Nulls))
+ )
+ }
+ // Soft identifier keywords — would be valid property
+ // names. Leave the dot for postfix-property access.
+ TokenKind::Keyword(kw) => matches!(
+ kw,
+ // Infix-only keywords: each needs an LHS, so the
+ // preceding number must be the float-with-empty-
+ // fractional rather than the `.kw` property-access
+ // chain head.
+ Kw::And | Kw::Or | Kw::Is | Kw::Like | Kw::Ilike | Kw::In | Kw::Between | Kw::Not
+ ),
+ _ => true,
+ };
+ if consume_as_float {
+ // Consume the dot as part of the float and emit `<n>.0`.
+ if self.bump().is_ok() {
+ return format!("{leading}.0");
+ }
+ return leading.to_string();
+ }
+ if !matches!(self.peek_next(), TokenKind::Number) {
+ return leading.to_string();
+ }
+ match self.bump() {
+ Err(_) => return leading.to_string(),
+ Ok(_dot) => {}
+ }
+ match self.bump() {
+ Err(_) => leading.to_string(),
+ Ok(frac) => format!("{leading}.{}", self.text(frac)),
+ }
+ }
+
+ /// Consume a leading-dot float (`.<digits>`) prefixed by an
+ /// optional sign — the `-.<digits>` / `+.<digits>` shape that
+ /// pairs with the unsigned `.<digits>` branch in `parse_primary`.
+ /// Caller has confirmed `peek()` is the sign token and
+ /// `peek_next()` is `Dot`; here we additionally check that the
+ /// token after the dot is `Number` before committing. Returns
+ /// `Ok(None)` (without moving the cursor) when the lookahead
+ /// doesn't fit, so the caller can fall through to unary-minus.
+ fn consume_signed_dot_float(&mut self, negative: bool) -> Result<Option<Value>, ParseError> {
+ // Probe the token after `.` via a shadow lexer; only commit if
+ // it's a Number.
+ let mut probe = Lexer::with_pos(self.src, self.peek1.end);
+ let after_dot = probe.next_token()?;
+ if after_dot.kind != TokenKind::Number {
+ return Ok(None);
+ }
+ self.bump()?; // sign
+ self.bump()?; // dot
+ let n = self.bump()?; // digits
+ let src = format!(".{}", self.text(n));
+ Ok(Some(parse_number_literal(&src, negative)?))
+ }
+
+ pub(crate) fn set_lexer_pos(&mut self, pos: usize) -> Result<(), ParseError> {
+ self.lexer = Lexer::with_pos(self.src, pos);
+ self.peek0 = self.lexer.next_token()?;
+ self.peek1 = self.lexer.next_token()?;
+ Ok(())
+ }
+
+ fn parse_paren_or_tuple(&mut self) -> Result<Value, ParseError> {
+ // Capture the outer-LParen start before consuming it. cpp's
+ // `ColumnExprColumnsReplace` / `ColumnExprColumnsExcludeReplace`
+ // grammar alts (`LPAREN ASTERISK [EXCLUDE(...)]? REPLACE(...) RPAREN`)
+ // include the outer parens in the ctx span, but our inner parser
+ // wraps the ColumnsExpr at the `*` position only. We override the
+ // span with the outer paren bounds for those shapes after parsing.
+ let outer_start = self.peek0.start;
+ self.expect(TokenKind::LParen, "(")?;
+ // Empty `()` isn't a valid expression form (lambdas use `() -> ...`).
+ if self.peek() == TokenKind::RParen {
+ return Err(self.err("empty parentheses are not a valid expression"));
+ }
+ // Three competing grammar arms when the inner is non-empty:
+ // ColumnExprSubquery: LPAREN selectSetStmt RPAREN
+ // ColumnExprParens: LPAREN columnExpr RPAREN
+ // ColumnExprTuple: LPAREN columnExprList RPAREN
+ //
+ // The subquery alt covers (SELECT …), (WITH … SELECT …), the
+ // bare placeholder ({x}) used as selectStmtWithParens, and
+ // arbitrarily-nested `((SELECT …) OFFSET n)` shapes whose inner
+ // is itself paren-wrapped.
+ //
+ // The parens/tuple alts share the same prefix (columnExpr); the
+ // tuple arm fires when a comma appears at depth 0 after the
+ // first expression. Encoded as a single arm with a runtime
+ // comma probe.
+ let result = self.try_alt(&[
+ // Alt 1: subquery
+ &|p| {
+ let sub = p.parse_select_set_stmt()?;
+ p.expect(TokenKind::RParen, ")")?;
+ Ok(sub)
+ },
+ // Alt 2: parens / tuple
+ &Self::parse_paren_expr_or_tuple_arm,
+ ])?;
+ // Re-wrap ColumnsExpr-with-REPLACE shapes whose grammar rule
+ // (`LPAREN ASTERISK [EXCLUDE(...)]? REPLACE(...) RPAREN`) makes the
+ // outer parens part of the ctx span — the inner wrap missed them.
+ // Exclude-only `(* EXCLUDE (...))` is a regular ColumnExprAsterisk
+ // inside ColumnExprParens (pass-through), so REPLACE is the
+ // distinguishing marker.
+ if is_paren_form_columns_replace(&result) {
+ let end = self.last_consumed_end;
+ return Ok(self.replace_pos_to(result, outer_start, end));
+ }
+ Ok(result)
+ }
+
+ /// `parse_paren_or_tuple` arm: ColumnExprParens or ColumnExprTuple
+ /// after the leading `(` has been consumed.
+ fn parse_paren_expr_or_tuple_arm(&mut self) -> Result<Value, ParseError> {
+ let first = self.parse_expr_bp(0)?;
+ if self.eat(TokenKind::Comma)? {
+ let mut exprs = vec![first];
+ if self.peek() != TokenKind::RParen {
+ loop {
+ exprs.push(self.parse_expr_bp(0)?);
+ if !self.eat(TokenKind::Comma)? {
+ break;
+ }
+ if self.peek() == TokenKind::RParen {
+ break;
+ }
+ }
+ }
+ self.expect(TokenKind::RParen, ")")?;
+ Ok(emit::tuple_(exprs))
+ } else {
+ self.expect(TokenKind::RParen, ")")?;
+ Ok(first)
+ }
+ }
+
+ /// Probe: after `NOT *`, does `*` head a spread-columns expression
+ /// (`* COLUMNS(...)` / `* EXCLUDE(...)` / `* REPLACE(...)`)?
+ /// Used to keep NOT as a unary prefix when a spread operand
+ /// follows; otherwise (`*` followed by anything else, including
+ /// COLUMNS without `(`) NOT falls back to a Field identifier and
+ /// `*` becomes the multiplication operator.
+ /// Probe: when NOT is followed by ASTERISK, can the ASTERISK plus what
+ /// follows it start a valid columnExpr? If yes, cpp's ANTLR picks
+ /// `ColumnExprNot` (unary NOT) with `*` as the Field('*') head of the
+ /// inner columnExpr. If no, the asterisk is treated as multiplication
+ /// and NOT becomes a Field identifier via the keyword rule.
+ ///
+ /// `* X` is a valid columnExpr when X is:
+ /// - End-of-expression (bare `*` is the whole columnExpr).
+ /// - A postfix op on Field('*'): `(` (call), `[` (array access),
+ /// `.` (chain → ArrayAccess split), `::` (typecast), `?.`.
+ /// - A binary infix op or infix keyword (Field('*') OP X is valid).
+ /// - `EXCLUDE` / `COLUMNS` keyword (ColumnExprAsterisk's optional
+ /// EXCLUDE decoration, or `* COLUMNS(...)` spread form).
+ ///
+ /// `* X` is NOT a valid columnExpr when X is a primary atom that can
+ /// only start a fresh expression (Number, String, Ident, LBrace,
+ /// primary keywords like CASE / CAST / TRUE / etc.). In that case
+ /// `* X` would be two adjacent primaries with no operator between
+ /// them, so cpp falls back to `Field('not') * <primary>`.
+ fn asterisk_after_not_starts_columnexpr(&self) -> bool {
+ debug_assert_eq!(self.peek_next(), TokenKind::Asterisk);
+ let mut probe = Lexer::with_pos(self.src, self.peek1.end);
+ let p2 = match probe.next_token() {
+ Ok(t) => t,
+ Err(_) => return true, // EOF → bare `*` is the columnExpr.
+ };
+ match p2.kind {
+ // End-of-expression markers — bare `*` is the entire columnExpr.
+ TokenKind::Eof
+ | TokenKind::RParen
+ | TokenKind::RBracket
+ | TokenKind::RBrace
+ | TokenKind::Comma
+ | TokenKind::Semicolon => true,
+ // Postfix operators that extend Field('*'):
+ TokenKind::LParen
+ | TokenKind::LBracket
+ | TokenKind::Dot
+ | TokenKind::DoubleColon
+ | TokenKind::NullProperty => true,
+ // Binary infix operators (Field('*') OP X is a valid columnExpr):
+ TokenKind::Plus
+ | TokenKind::Dash
+ | TokenKind::Slash
+ | TokenKind::Percent
+ | TokenKind::Asterisk
+ | TokenKind::Concat
+ | TokenKind::Nullish
+ | TokenKind::EqDouble
+ | TokenKind::EqSingle
+ | TokenKind::NotEq
+ | TokenKind::Lt
+ | TokenKind::LtEq
+ | TokenKind::Gt
+ | TokenKind::GtEq
+ | TokenKind::RegexSingle
+ | TokenKind::RegexDouble
+ | TokenKind::IRegexSingle
+ | TokenKind::IRegexDouble
+ | TokenKind::NotRegex
+ | TokenKind::NotIRegex
+ | TokenKind::QMark
+ | TokenKind::Colon => true,
+ // Binary infix keywords:
+ TokenKind::Keyword(
+ Kw::And
+ | Kw::Or
+ | Kw::Is
+ | Kw::In
+ | Kw::Like
+ | Kw::Ilike
+ | Kw::Between
+ | Kw::Not
+ | Kw::As,
+ ) => true,
+ // ColumnExprAsterisk's `EXCLUDE (...)` decoration and the
+ // `* COLUMNS(...)` spread form. (REPLACE alone after a bare
+ // `*` is NOT a valid columnExpr in cpp's grammar — only the
+ // surrounded `(* REPLACE ...)` form matches, which is handled
+ // separately by `parens_open_self_contained_columns_expr`.)
+ TokenKind::Keyword(Kw::Exclude | Kw::Columns) => true,
+ // `* IGNORE NULLS` — the postfix that cpp's visitor
+ // drops, leaving Field('*') unchanged. So `* IGNORE
+ // NULLS` IS a complete columnExpr, and NOT applies to it
+ // as unary prefix per ColumnExprNot. (cpp's grammar
+ // pairs IGNORE with NULLS; we accept IGNORE as a
+ // single-token lookahead here and let the postfix
+ // handler enforce the NULLS pairing.)
+ TokenKind::Keyword(Kw::Ignore) => true,
+ // Anything else (Number, String, Ident, primary keywords) is
+ // a pure primary that doesn't extend Field('*') — multiplication
+ // wins and NOT becomes a Field.
+ _ => false,
+ }
+ }
+
+ /// Probe: do the parens at peek1 hold a `selectSetStmt` shape — i.e.
+ /// either a SELECT/WITH-led statement, or a placeholder-led set-stmt
+ /// (`{X} UNION/INTERSECT/EXCEPT …`)? Used by the NOT-prefix
+ /// disambiguator: cpp picks `ColumnExprFunction` (Call) over
+ /// `ColumnExprNot` (Not) for `not(args)`, but backtracks to NOT-prefix
+ /// when the content isn't a valid `columnExprList` — bare SELECT/WITH
+ /// and placeholder + set-op are the two shapes that don't fit.
+ fn parens_open_select_or_set_stmt(&self) -> bool {
+ debug_assert_eq!(self.peek_next(), TokenKind::LParen);
+ let mut probe = Lexer::with_pos(self.src, self.peek1.end);
+ let first = match probe.next_token() {
+ Ok(t) => t,
+ Err(_) => return false,
+ };
+ // (a) Immediate SELECT/WITH after the `(`.
+ if matches!(
+ first.kind,
+ TokenKind::Keyword(Kw::Select) | TokenKind::Keyword(Kw::With)
+ ) {
+ return true;
+ }
+ // (b) The outer paren content contains a SET-OP (UNION /
+ // INTERSECT / EXCEPT) at depth 0 — that's a selectSetStmt
+ // shape regardless of whether the first token is a `{X}`
+ // placeholder, a nested `(` paren-wrapped subquery, or any
+ // other paren-wrapped/placeholder-led selectStmtWithParens.
+ // Also recognize selectSetStmt's trailing decorators
+ // (ORDER BY / LIMIT / OFFSET / SETTINGS) at depth 0 — cpp's
+ // grammar (line 65) admits `selectStmtWithParens
+ // (subsequentSelectSetClause)* orderByClause?
+ // limitAndOffsetClauseOptional?` so a trailing LIMIT etc.
+ // after a paren-wrapped subquery still means selectSetStmt.
+ // Scan tokens at depth 0 of the outer paren.
+ let mut depth: i32 = 0; // depth relative to outer paren's interior
+ let mut tok = first;
+ loop {
+ match tok.kind {
+ TokenKind::Keyword(Kw::Union)
+ | TokenKind::Keyword(Kw::Intersect)
+ | TokenKind::Keyword(Kw::Except)
+ if depth == 0 =>
+ {
+ return true;
+ }
+ // Trailing decorators at depth 0 of the outer paren
+ // mean the inside is a selectStmtWithParens whose
+ // tail extends — still selectSetStmt territory. cpp
+ // includes LIMIT / OFFSET / SETTINGS here but NOT
+ // ORDER: an `order by` inside the parens can also
+ // appear as a windowExpr / function-arg-with-order
+ // (e.g. inside `not ((select 1) order by 1)` cpp
+ // dispatches to Call with the order_by absorbed
+ // into the function arg's expression), so ORDER
+ // alone doesn't disambiguate.
+ TokenKind::Keyword(Kw::Limit)
+ | TokenKind::Keyword(Kw::Offset)
+ | TokenKind::Keyword(Kw::Settings)
+ if depth == 0 =>
+ {
+ return true;
+ }
+ TokenKind::LParen | TokenKind::LBracket | TokenKind::LBrace => depth += 1,
+ TokenKind::RParen | TokenKind::RBracket | TokenKind::RBrace => {
+ if depth == 0 {
+ return false; // closed the outer paren without finding SET-OP
+ }
+ depth -= 1;
+ }
+ TokenKind::Eof => return false,
+ _ => {}
+ }
+ tok = match probe.next_token() {
+ Ok(t) => t,
+ Err(_) => return false,
+ };
+ }
+ }
+
+ /// Probe: do the parens at peek1 hold a self-contained
+ /// `* REPLACE (...)` or `* EXCLUDE (...) REPLACE (...)` columnExpr?
+ /// cpp's grammar (HogQLParser.g4:219-225) has these as bare-LPAREN
+ /// `ColumnExprColumnsExcludeReplace` / `ColumnExprColumnsReplace`
+ /// alts — the LPAREN is part of the columnExpr itself, not a
+ /// function-call's args. `NOT (* REPLACE …)` is therefore
+ /// `Not(ColumnsExpr)` (cpp picks ColumnExprNot wrapping the
+ /// bare-LPAREN columnExpr), not `Call('not', [ColumnsExpr])`.
+ ///
+ /// Plain `* EXCLUDE (…)` (no REPLACE) is NOT a self-contained
+ /// bare-LPAREN form — it stays a valid `ColumnExprAsterisk` arg
+ /// inside `(args)`, so `NOT (* EXCLUDE (…))` is a function call.
+ /// Returns true only for shapes that consume the outer parens
+ /// as part of the columnExpr.
+ fn parens_open_self_contained_columns_expr(&self) -> bool {
+ debug_assert_eq!(self.peek_next(), TokenKind::LParen);
+ let mut probe = Lexer::with_pos(self.src, self.peek1.end);
+ let first = match probe.next_token() {
+ Ok(t) => t,
+ Err(_) => return false,
+ };
+ if first.kind != TokenKind::Asterisk {
+ return false;
+ }
+ let second = match probe.next_token() {
+ Ok(t) => t,
+ Err(_) => return false,
+ };
+ match second.kind {
+ TokenKind::Keyword(Kw::Replace) => true,
+ TokenKind::Keyword(Kw::Exclude) => {
+ // `* EXCLUDE ( identList )` then look for REPLACE at
+ // depth 1. Skip the balanced EXCLUDE paren-group first.
+ if !matches!(probe.next_token().map(|t| t.kind), Ok(TokenKind::LParen)) {
+ return false;
+ }
+ let mut depth: i32 = 1;
+ while depth > 0 {
+ let tok = match probe.next_token() {
+ Ok(t) => t,
+ Err(_) => return false,
+ };
+ match tok.kind {
+ TokenKind::LParen | TokenKind::LBracket | TokenKind::LBrace => depth += 1,
+ TokenKind::RParen | TokenKind::RBracket | TokenKind::RBrace => depth -= 1,
+ TokenKind::Eof => return false,
+ _ => {}
+ }
+ }
+ // After EXCLUDE's closing `)`, REPLACE should follow.
+ matches!(
+ probe.next_token().map(|t| t.kind),
+ Ok(TokenKind::Keyword(Kw::Replace))
+ )
+ }
+ _ => false,
+ }
+ }
+
+ /// Probe: is the LParen at `peek0` followed (after its matching
+ /// `)`) by another `(`? Used by `parse_ident_lead` to detect the
+ /// `name(params)(args)` parametric-function form: cpp's ANTLR
+ /// commits to the parametric alternative when the second paren is
+ /// present, parsing the first paren as a plain `columnExprList?`
+ /// (no DISTINCT / no ORDER BY). The args-inner parser would
+ /// otherwise eagerly consume `DISTINCT` or choke on a comma after
+ /// it (`(distinct, x)`).
+ fn peek0_paren_followed_by_lparen(&self) -> bool {
+ debug_assert_eq!(self.peek(), TokenKind::LParen);
+ let mut probe = Lexer::with_pos(self.src, self.peek0.end);
+ let mut depth: i32 = 1;
+ while depth > 0 {
+ let tok = match probe.next_token() {
+ Ok(t) => t,
+ Err(_) => return false,
+ };
+ match tok.kind {
+ TokenKind::LParen | TokenKind::LBracket | TokenKind::LBrace => depth += 1,
+ TokenKind::RParen | TokenKind::RBracket | TokenKind::RBrace => depth -= 1,
+ TokenKind::Eof => return false,
+ _ => {}
+ }
+ }
+ matches!(probe.next_token().map(|t| t.kind), Ok(TokenKind::LParen))
+ }
+
+ /// Probe: are the parens at peek1 followed (after their matching
+ /// `)`) by `->`? Used by the NOT-prefix disambiguator: `(params) ->
+ /// body` is the parens-arrow form of a `columnLambdaExpr` — a single
+ /// columnExpr — so `NOT (...) -> body` is `Not(Lambda(...))`, not a
+ /// function call `not(...)` followed by a stray `->`.
+ fn parens_followed_by_arrow(&self) -> bool {
+ debug_assert_eq!(self.peek_next(), TokenKind::LParen);
+ let mut probe = Lexer::with_pos(self.src, self.peek1.end);
+ let mut depth: i32 = 1;
+ while depth > 0 {
+ let tok = match probe.next_token() {
+ Ok(t) => t,
+ Err(_) => return false,
+ };
+ match tok.kind {
+ TokenKind::LParen | TokenKind::LBracket | TokenKind::LBrace => depth += 1,
+ TokenKind::RParen | TokenKind::RBracket | TokenKind::RBrace => depth -= 1,
+ TokenKind::Eof => return false,
+ _ => {}
+ }
+ }
+ matches!(probe.next_token().map(|t| t.kind), Ok(TokenKind::Arrow))
+ }
+
+ /// Probe: is the LParen at peek1 immediately followed by RParen?
+ /// `()` is a function-call form with no args, not a cast/case
+ /// special-form opener.
+ pub(crate) fn peek_lparen_is_empty(&self) -> bool {
+ debug_assert_eq!(self.peek_next(), TokenKind::LParen);
+ let mut probe = Lexer::with_pos(self.src, self.peek1.end);
+ matches!(probe.next_token().map(|t| t.kind), Ok(TokenKind::RParen))
+ }
+
+ /// Probe: does the LParen at peek1 close with a matching RParen
+ /// followed by `OVER`, OR by another `(...)` paren block then
+ /// `OVER`? Used by the COLUMNS-vs-function dispatch:
+ /// - `columns(...) OVER ...` is a window function (cpp's
+ /// `ColumnExprWinFunction` with `columns` as the function name).
+ /// - `columns(...)(...) OVER ...` matches the parametric form of
+ /// ColumnExprFunction (`identifier (LPAREN list RPAREN)? LPAREN
+ /// args RPAREN`) with the OVER tail. Both alts dispatch through
+ /// the function-call path with `columns` as the function name,
+ /// NOT the SpreadExpr-companion ColumnsExpr form. Mirrors ANTLR's
+ /// adaptive lookahead which picks the alt that allows the rest
+ /// of the input (the OVER tail) to parse cleanly.
+ fn peek_columns_paren_followed_by_over(&self) -> bool {
+ debug_assert_eq!(self.peek_next(), TokenKind::LParen);
+ let mut probe = Lexer::with_pos(self.src, self.peek1.end);
+ if !Self::probe_skip_balanced_paren_block(&mut probe) {
+ return false;
+ }
+ // After the first paren block, look at the next token. OVER
+ // directly → window function. Another LPAREN means we have a
+ // parametric-form function call; skip that block too and then
+ // check for OVER.
+ let next = match probe.next_token() {
+ Ok(t) => t,
+ Err(_) => return false,
+ };
+ match next.kind {
+ TokenKind::Keyword(Kw::Over) => true,
+ TokenKind::LParen => {
+ if !Self::probe_skip_balanced_paren_block(&mut probe) {
+ return false;
+ }
+ matches!(
+ probe.next_token().map(|t| t.kind),
+ Ok(TokenKind::Keyword(Kw::Over))
+ )
+ }
+ _ => false,
+ }
+ }
+
+ /// Consume tokens from `probe` until the currently-open LParen
+ /// closes. Returns `true` if the matching RParen was found, `false`
+ /// on lex error / EOF before close. The caller is expected to be
+ /// positioned just past the opening LParen.
+ fn probe_skip_balanced_paren_block(probe: &mut Lexer<'_>) -> bool {
+ let mut depth: i32 = 1;
+ loop {
+ let tok = match probe.next_token() {
+ Ok(t) => t,
+ Err(_) => return false,
+ };
+ match tok.kind {
+ TokenKind::LParen | TokenKind::LBracket | TokenKind::LBrace => depth += 1,
+ TokenKind::RParen | TokenKind::RBracket | TokenKind::RBrace => {
+ depth -= 1;
+ if depth == 0 {
+ return true;
+ }
+ }
+ TokenKind::Eof => return false,
+ _ => {}
+ }
+ }
+ }
+
+ /// Probe: does the `(…)` group whose interior starts at byte
+ /// `content_start`, followed by any `.ident` / `.DECIMAL` / `[…]`
+ /// access suffixes, lead into a `:=`? Used by the Pratt loop's
+ /// statement-RHS guard — a `(…)<chain> :=` run opens the next
+ /// statement's `<assignmentTarget> :=`, so the current postfix `(`
+ /// must NOT fold it into this expression as a call. The suffix
+ /// chain matters because `assignmentTarget` admits `.`/`[]` access
+ /// after the parenthesised primary (`(a).b[0] := …`).
+ fn paren_block_then_colon_equals(&self, content_start: usize) -> bool {
+ let mut probe = Lexer::with_pos(self.src, content_start);
+ if !Self::probe_skip_balanced_paren_block(&mut probe) {
+ return false;
+ }
+ loop {
+ let tok = match probe.next_token() {
+ Ok(t) => t,
+ Err(_) => return false,
+ };
+ match tok.kind {
+ TokenKind::ColonEquals => return true,
+ // `.ident` / `.DECIMAL` tuple-or-property access.
+ TokenKind::Dot => match probe.next_token().map(|t| t.kind) {
+ Ok(
+ TokenKind::Ident
+ | TokenKind::QuotedIdent
+ | TokenKind::Keyword(_)
+ | TokenKind::Number,
+ ) => {}
+ _ => return false,
+ },
+ // `[ … ]` subscript access — skip the balanced block.
+ TokenKind::LBracket => {
+ if !Self::probe_skip_balanced_paren_block(&mut probe) {
+ return false;
+ }
+ }
+ _ => return false,
+ }
+ }
+ }
+
+ /// Probe: does the LParen at peek1 start with ORDER or DISTINCT?
+ /// Those tokens belong inside the function-call form's arg list
+ /// (\`fn(DISTINCT a, b ORDER BY c)\`), so when we see them at the
+ /// head of a CAST / TRY_CAST paren list the surrounding keyword is
+ /// being used as a function-call name rather than the special form.
+ fn peek_lparen_starts_with_order_or_distinct(&self) -> bool {
+ debug_assert_eq!(self.peek_next(), TokenKind::LParen);
+ let mut probe = Lexer::with_pos(self.src, self.peek1.end);
+ matches!(
+ probe.next_token().map(|t| t.kind),
+ Ok(TokenKind::Keyword(Kw::Order) | TokenKind::Keyword(Kw::Distinct))
+ )
+ }
+
+ fn parse_array_literal(&mut self) -> Result<Value, ParseError> {
+ self.expect(TokenKind::LBracket, "[")?;
+ let mut exprs = Vec::new();
+ if self.peek() != TokenKind::RBracket {
+ loop {
+ exprs.push(self.parse_expr_bp(0)?);
+ if !self.eat(TokenKind::Comma)? {
+ break;
+ }
+ if self.peek() == TokenKind::RBracket {
+ break;
+ }
+ }
+ }
+ self.expect(TokenKind::RBracket, "]")?;
+ Ok(emit::array_(exprs))
+ }
+
+ /// Identifier-led primary: either a function call (`IDENT (args)`) or
+ /// a Field whose chain greedily consumes `.IDENT...` segments. The
+ /// function-call form covers the full grammar shape: parametric calls
+ /// (`quantile(0.95)(x)`), DISTINCT, in-arg ORDER BY, trailing FILTER,
+ /// and WITHIN GROUP (which forces the first paren list to be params).
+ pub(crate) fn parse_ident_lead(&mut self) -> Result<Value, ParseError> {
+ let head = self.bump()?;
+ let name = identifier_text(self.text(head), head.kind);
+
+ // `name := value` — the `ColumnExprNamedArg` form (passed as
+ // an alternative shape into call argument lists, but also
+ // valid as a standalone column expression).
+ if self.peek() == TokenKind::ColonEquals {
+ self.bump()?;
+ // Value is parsed at BP_ALIAS so an AS-alias trailer
+ // becomes part of the named argument's value rather than
+ // wrapping the whole NamedArgument node. Matches cpp's
+ // `name := <columnExpr>` where columnExpr admits AS.
+ let value = self.parse_expr_bp(BP_ALIAS)?;
+ // cpp's `ColumnExprNamedArg` visitor emits the node without
+ // `addPositionInfo`, so NamedArgument has no `start`/`end`.
+ // Mark via `no_pos` so the outer `parse_expr_bp` pratt-loop
+ // wrap leaves it bare.
+ return Ok(emit::named_argument(&name, value));
+ }
+
+ // Statement-RHS guard: `f (x) := y` is `f` (an exprStmt) then
+ // `(x) := y` (a varAssignment) — the `(…)` opens the next
+ // statement's parenthesised `assignmentTarget`, not a call on
+ // `f`. The Pratt-loop postfix guard can't catch this because
+ // `IDENT (` is folded into a call here, before the loop runs.
+ if self.peek() == TokenKind::LParen
+ && self.stop_postfix_call_before_colon_equals
+ && self.paren_block_then_colon_equals(self.peek0.end)
+ {
+ return Ok(json!({"node": "Field", "chain": [name]}));
+ }
+
+ if self.peek() == TokenKind::LParen {
+ // Probe: is there a SECOND `(` after the matching `)` of this
+ // first one? If yes, cpp's ANTLR prefers the ColumnExprFunction
+ // alternative with parametric+args, parsing the first paren as
+ // a plain `columnExprList?` (no DISTINCT, no ORDER BY). The
+ // args-inner parser would consume DISTINCT eagerly and choke
+ // on `(distinct, x)` or pick the wrong AST shape for
+ // `foo(distinct)()`. Try the parametric form first; on failure
+ // (e.g. `(order by x)` or `(distinct x)` — neither a valid
+ // columnExprList), fall back to the args-inner parse and let
+ // any trailing `(` become a postfix `ColumnExprCall` via the
+ // Pratt loop.
+ let parametric_likely = self.peek0_paren_followed_by_lparen();
+ if parametric_likely {
+ let cp = self.checkpoint();
+ if let Ok(v) = self.try_parametric_call(&name) {
+ return Ok(v);
+ }
+ self.restore(cp)?;
+ }
+ self.bump()?;
+ // Parse the first paren list with full args-shape awareness
+ // (DISTINCT, in-arg ORDER BY).
+ let (first_distinct, first_args, first_order_by) = self.parse_function_args_inner()?;
+ self.expect(TokenKind::RParen, ")")?;
+
+ // `name(args) [FILTER (WHERE …)] OVER (windowExpr | name)` —
+ // window function form. Distinguishable from the plain-call
+ // case by the trailing `OVER` keyword.
+ // Optional `FILTER (WHERE …)` between the args and OVER.
+ let filter_expr_for_window = self.parse_optional_filter()?;
+ if matches!(self.peek(), TokenKind::Keyword(Kw::Over)) {
+ // `ColumnExprWinFunction` (grammar line 235) takes a
+ // plain `columnExprList` — NO DISTINCT, NO in-arg
+ // ORDER BY. cpp rejects `foo(DISTINCT a) OVER ()` /
+ // `foo(a ORDER BY b) OVER ()`. Surface the divergence
+ // instead of silently dropping the DISTINCT / ORDER BY.
+ if first_distinct {
+ return Err(self.err(
+ "DISTINCT in window-function args — ColumnExprWinFunction takes a plain columnExprList",
+ ));
+ }
+ if first_order_by.is_some() {
+ return Err(self.err(
+ "ORDER BY inside window-function args — ColumnExprWinFunction takes a plain columnExprList",
+ ));
+ }
+ self.bump()?;
+ let mut obj = serde_json::Map::new();
+ obj.insert("node".into(), Value::String("WindowFunction".into()));
+ obj.insert("name".into(), Value::String(name.clone()));
+ obj.insert("exprs".into(), Value::Array(first_args.clone()));
+ // cpp's `VISIT(ColumnExprWinFunction)` always emits an
+ // `args` field — the empty list for the single-paren
+ // form, the second paren list for the parametric form.
+ // The Python AST has `args: Optional[list[Expr]]` where
+ // `[]` and `None` are NOT equal under dataclass `__eq__`,
+ // so emitting `[]` here matches cpp's deserialised shape.
+ obj.insert("args".into(), Value::Array(Vec::new()));
+ // WindowFunction has no `filter_expr` field on the AST;
+ // drop the captured FILTER expression. The C++ side
+ // similarly doesn't model it on the window-function path.
+ drop(filter_expr_for_window);
+ if self.peek() == TokenKind::LParen {
+ self.bump()?;
+ let we = self.parse_window_expr()?;
+ self.expect(TokenKind::RParen, ")")?;
+ obj.insert("over_expr".into(), we);
+ } else {
+ let tok = self.bump()?;
+ let id = match tok.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent | TokenKind::Keyword(_) => {
+ identifier_text(self.text(tok), tok.kind)
+ }
+ _ => {
+ return Err(self.err(format!(
+ "expected window name or `(` after OVER, got {:?}",
+ tok.kind,
+ )))
+ }
+ };
+ obj.insert("over_identifier".into(), Value::String(id));
+ }
+ return Ok(Value::Object(obj));
+ }
+
+ // `name(params) WITHIN GROUP (ORDER BY ... [INTERPOLATE (...)])`.
+ // The grammar's `ColumnExprFunctionWithinGroup` (line 234)
+ // is `identifier LPAREN columnExprList? RPAREN
+ // withinGroupClause` — NO FILTER slot. cpp rejects
+ // `f(args) FILTER (WHERE …) WITHIN GROUP (…)`. If the
+ // `parse_optional_filter` above ate a FILTER we have to
+ // surface the divergence instead of silently dropping it.
+ if matches!(self.peek(), TokenKind::Keyword(Kw::Within))
+ && self.peek_next() == TokenKind::Keyword(Kw::Group)
+ {
+ if filter_expr_for_window.is_some() {
+ return Err(self.err(
+ "FILTER (WHERE ...) is not valid before WITHIN GROUP — the grammar's ColumnExprFunctionWithinGroup has no FILTER slot",
+ ));
+ }
+ self.bump()?;
+ self.bump()?;
+ self.expect(TokenKind::LParen, "(")?;
+ self.expect_kw(Kw::Order, "ORDER")?;
+ self.expect_kw(Kw::By, "BY")?;
+ let order_by = self.parse_order_expr_list()?;
+ // Skip an optional `INTERPOLATE [( … )]` clause without
+ // recording it — the AST has no slot for it here.
+ if self.eat_kw(Kw::Interpolate)? && self.eat(TokenKind::LParen)? {
+ let mut depth = 1;
+ while depth > 0 {
+ match self.peek() {
+ TokenKind::LParen => {
+ self.bump()?;
+ depth += 1;
+ }
+ TokenKind::RParen => {
+ self.bump()?;
+ depth -= 1;
+ }
+ TokenKind::Eof => {
+ return Err(
+ self.err("unterminated INTERPOLATE clause inside WITHIN GROUP")
+ )
+ }
+ _ => {
+ self.bump()?;
+ }
+ }
+ }
+ }
+ self.expect(TokenKind::RParen, ")")?;
+ return Ok(emit::call_full(
+ &name,
+ Some(first_args),
+ vec![],
+ false,
+ None,
+ None,
+ Some(order_by),
+ ));
+ }
+
+ // Trailing `(` here is a ColumnExprCall postfix → ExprCall.
+ // The parametric form was already handled by the lookahead
+ // probe + `try_parametric_call` above; if we got here with a
+ // trailing `(`, parametric was either ruled out (no second
+ // paren) or attempted and rejected (e.g. `(distinct x)` —
+ // not a valid columnExprList). Returning here lets the Pratt
+ // postfix loop fold it as ExprCall via `fold_call_or_exprcall`.
+
+ // Single-paren call. `filter_expr_for_window` was consumed
+ // by the window-function probe above; re-use it so we don't
+ // double-parse the FILTER.
+ return Ok(emit::call_full(
+ &name,
+ None,
+ first_args,
+ first_distinct,
+ first_order_by,
+ filter_expr_for_window,
+ None,
+ ));
+ }
+
+ let mut chain: Vec<Value> = vec![Value::String(name)];
+ let mut ended_with_star = false;
+ while self.peek() == TokenKind::Dot {
+ // `.<number>` is a tuple access, handled by the postfix loop.
+ if self.peek_next() == TokenKind::Number {
+ break;
+ }
+ self.bump()?; // consume '.'
+ let part = self.bump()?;
+ match part.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent => {}
+ // Grammar's `identifier` rule excludes NULL/INF/NAN/
+ // EXCEPT/INTERSECT and Hog-statement keywords; gate
+ // chain links through `kw_valid_as_identifier`.
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {}
+ TokenKind::Asterisk => {
+ // cpp's grammar splits `a.b.*.c` into
+ // ColumnExprAsterisk(tableIdentifier=a.b) followed by
+ // ColumnExprPropertyAccess(.c) — the visitor emits
+ // `ArrayAccess(Field([a, b, *]), Constant('c'))`.
+ // Stop the chain at the `*` and let the outer Pratt
+ // postfix loop apply DOT → ArrayAccess to whatever
+ // follows.
+ chain.push(Value::String("*".into()));
+ ended_with_star = true;
+ break;
+ }
+ _ => {
+ return Err(self.err(format!(
+ "expected identifier after '.', got {:?}",
+ part.kind
+ )))
+ }
+ }
+ chain.push(Value::String(identifier_text(self.text(part), part.kind)));
+ ended_with_star = false;
+ }
+ // `IDENT(.IDENT)*.* EXCLUDE (…)` — the grammar's `ColumnExprAsterisk`
+ // alt admits a trailing EXCLUDE, and the cpp visitor drops the
+ // qualifier in that branch (returning `ColumnsExpr(all_columns=True,
+ // exclude=[…])`, NOT a Field chain).
+ if ended_with_star && matches!(self.peek(), TokenKind::Keyword(Kw::Exclude)) {
+ let (exclude, _) = self.parse_columns_decorators()?;
+ return Ok(emit::columns_expr(None, None, true, exclude, None));
+ }
+ Ok(emit::field(chain))
+ }
+
+ /// Parse a function-call argument list with the grammar's
+ /// `DISTINCT? args (ORDER BY orderExprList)?` shape. Caller has
+ /// already consumed the opening `(` and must consume the closing one.
+ /// Parametric function call: `name(params)(args) [FILTER(…)] [OVER …]`.
+ /// Caller must have verified (via `peek0_paren_followed_by_lparen`)
+ /// that two paren pairs are present, then wrapped this call in
+ /// checkpoint / restore so the caller can fall back to the args-only
+ /// path when the first paren content isn't a valid `columnExprList`
+ /// (e.g. `(order by x)`, `(distinct x)`).
+ ///
+ /// First paren is parsed as a plain `columnExprList` (`parse_arg_list`,
+ /// no DISTINCT / ORDER BY recognition). Second paren is parsed as the
+ /// args paren (full DISTINCT / ORDER BY semantics).
+ /// Probe: after consuming the first paren-pair of a parametric
+ /// call (cursor at peek = LParen for the second paren), does the
+ /// second paren OPEN with a bare `selectSetStmt`? cpp's grammar
+ /// matches that shape via `ColumnExprCallSelect` (postfix →
+ /// ExprCall) rather than the parametric `ColumnExprFunction` (Call).
+ /// A bare selectSetStmt is: SELECT / WITH starting at the LPAREN's
+ /// inside, OR a `{X}`-led placeholder set-stmt where the
+ /// placeholder is immediately followed (at outer-paren depth) by a
+ /// UNION / INTERSECT / EXCEPT keyword. A paren-wrapped subquery
+ /// (`((select 1))`) does NOT count — that's a regular columnExpr.
+ fn peek_next_paren_opens_bare_select_set_stmt(&self) -> bool {
+ debug_assert_eq!(self.peek(), TokenKind::LParen);
+ // Reuse the existing scanner that walks tokens at depth 0
+ // looking for SELECT / WITH first OR a SET-OP later. The probe
+ // is keyed off `peek_next` being LParen, so temporarily shift
+ // perspective: scan from `self.peek0.end` as if the LParen at
+ // peek0 was at peek1.
+ let mut probe = Lexer::with_pos(self.src, self.peek0.end);
+ let first = match probe.next_token() {
+ Ok(t) => t,
+ Err(_) => return false,
+ };
+ if matches!(
+ first.kind,
+ TokenKind::Keyword(Kw::Select) | TokenKind::Keyword(Kw::With)
+ ) {
+ return true;
+ }
+ let mut depth: i32 = 0;
+ let mut tok = first;
+ loop {
+ match tok.kind {
+ TokenKind::Keyword(Kw::Union)
+ | TokenKind::Keyword(Kw::Intersect)
+ | TokenKind::Keyword(Kw::Except)
+ if depth == 0 =>
+ {
+ return true;
+ }
+ TokenKind::LParen | TokenKind::LBracket | TokenKind::LBrace => depth += 1,
+ TokenKind::RParen | TokenKind::RBracket | TokenKind::RBrace => {
+ if depth == 0 {
+ return false;
+ }
+ depth -= 1;
+ }
+ TokenKind::Eof => return false,
+ _ => {}
+ }
+ tok = match probe.next_token() {
+ Ok(t) => t,
+ Err(_) => return false,
+ };
+ }
+ }
+
+ fn try_parametric_call(&mut self, name: &str) -> Result<Value, ParseError> {
+ self.expect(TokenKind::LParen, "(")?;
+ let params = self.parse_arg_list(TokenKind::RParen)?;
+ // A bare `selectSetStmt` inside the first paren means this is
+ // actually a `ColumnExprCallSelect` (subquery-as-arg) followed
+ // by a postfix `ColumnExprCall`, not a parametric
+ // `ColumnExprFunction` — cpp's ANTLR backs off Function
+ // because its first paren slot is `columnExprList`, which a
+ // bare select-set-stmt isn't. Bail so the caller's fallback
+ // path runs `parse_function_args_inner` (with subquery
+ // support) for the first paren and lets the Pratt loop append
+ // the second paren as `ExprCall`.
+ if params.iter().any(|p| {
+ matches!(
+ p.get("node").and_then(Value::as_str),
+ Some("SelectQuery") | Some("SelectSetQuery")
+ )
+ }) {
+ return Err(self.err(
+ "first paren opens a bare select-set-stmt — caller falls back to CallSelect + Call postfix",
+ ));
+ }
+ self.expect(TokenKind::RParen, ")")?;
+ // Peek the SECOND paren's content. cpp's grammar prefers
+ // ColumnExprCallSelect (postfix → ExprCall) over the parametric
+ // ColumnExprFunction (Call) ONLY when the second paren's
+ // content is a BARE selectSetStmt — `(select ...)`,
+ // `(with ...)`, or `({X} <SETOP> ...)`. When the content is a
+ // paren-wrapped subquery (`((select 1))`) or anything else,
+ // Function wins → Call. Mirror by rejecting parametric only
+ // when the bare-select-set-stmt shape is detected.
+ if self.peek_next_paren_opens_bare_select_set_stmt() {
+ return Err(self.err(
+ "second paren opens a bare select-set-stmt — caller falls back to CallSelect postfix",
+ ));
+ }
+ self.expect(TokenKind::LParen, "(")?;
+ let (distinct, args, order_by) = self.parse_function_args_inner()?;
+ self.expect(TokenKind::RParen, ")")?;
+ let filter_expr = self.parse_optional_filter()?;
+ if matches!(self.peek(), TokenKind::Keyword(Kw::Over)) {
+ self.bump()?;
+ let mut obj = serde_json::Map::new();
+ obj.insert("node".into(), Value::String("WindowFunction".into()));
+ obj.insert("name".into(), Value::String(name.to_string()));
+ obj.insert("exprs".into(), Value::Array(params));
+ obj.insert("args".into(), Value::Array(args));
+ // WindowFunction has no slots for FILTER / DISTINCT / ORDER
+ // BY in the args paren; drop them to mirror the cpp visitor.
+ drop((distinct, order_by, filter_expr));
+ if self.peek() == TokenKind::LParen {
+ self.bump()?;
+ let we = self.parse_window_expr()?;
+ self.expect(TokenKind::RParen, ")")?;
+ obj.insert("over_expr".into(), we);
+ } else {
+ let tok = self.bump()?;
+ let id = match tok.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent | TokenKind::Keyword(_) => {
+ identifier_text(self.text(tok), tok.kind)
+ }
+ _ => {
+ return Err(self.err(format!(
+ "expected window name or `(` after OVER, got {:?}",
+ tok.kind,
+ )))
+ }
+ };
+ obj.insert("over_identifier".into(), Value::String(id));
+ }
+ return Ok(Value::Object(obj));
+ }
+ Ok(emit::call_full(
+ name,
+ Some(params),
+ args,
+ distinct,
+ order_by,
+ filter_expr,
+ None,
+ ))
+ }
+
+ /// Does the cursor sit on an in-argument `ORDER BY` clause —
+ /// `ORDER` immediately followed by `BY`? `ORDER` on its own is a
+ /// `keyword`-rule identifier (`fn(x, order?.items)` passes `order`
+ /// as a plain Field argument), so the arg-list scan must require
+ /// the `BY` before treating `ORDER` as the clause introducer.
+ fn peek_starts_in_arg_order_by(&self) -> bool {
+ matches!(self.peek(), TokenKind::Keyword(Kw::Order))
+ && matches!(self.peek_next(), TokenKind::Keyword(Kw::By))
+ }
+
+ fn parse_function_args_inner(&mut self) -> Result<FunctionArgs, ParseError> {
+ // Only consume DISTINCT as the args-keyword when what follows can
+ // legitimately continue the rule (`RPAREN`, `ORDER`, or the start
+ // of a columnExpr). cpp's ANTLR otherwise parses DISTINCT as a
+ // Field (via the keyword rule) inside the args list — e.g.
+ // `(distinct, x)` and `(distinct.x)` and `(distinct ?. y)`
+ // all keep DISTINCT as a Field. The follow-set heuristic here
+ // mirrors that: bail out when peek_next is Comma or any pure
+ // infix/postfix op that can't start a fresh expression.
+ let distinct = if self.peek() == TokenKind::Keyword(Kw::Distinct)
+ && !matches!(self.peek_next(), TokenKind::Comma)
+ && !is_pure_infix_op(self.peek_next())
+ {
+ self.bump()?;
+ true
+ } else {
+ false
+ };
+ let mut args: Vec<Value> = Vec::new();
+ if self.peek() != TokenKind::RParen && !self.peek_starts_in_arg_order_by() {
+ loop {
+ args.push(self.parse_call_argument_for_function()?);
+ if !self.eat(TokenKind::Comma)? {
+ break;
+ }
+ if self.peek() == TokenKind::RParen || self.peek_starts_in_arg_order_by() {
+ break;
+ }
+ }
+ }
+ let order_by = if self.peek_starts_in_arg_order_by() {
+ self.bump()?;
+ self.bump()?;
+ Some(self.parse_order_expr_list()?)
+ } else {
+ None
+ };
+ Ok((distinct, args, order_by))
+ }
+
+ fn parse_optional_filter(&mut self) -> Result<Option<Value>, ParseError> {
+ if !matches!(self.peek(), TokenKind::Keyword(Kw::Filter)) {
+ return Ok(None);
+ }
+ self.bump()?;
+ self.expect(TokenKind::LParen, "(")?;
+ self.expect_kw(Kw::Where, "WHERE")?;
+ // cpp's `VISIT(ColumnExprWinFunction)` parses the FILTER
+ // where-expression at the grammar level but never visits it
+ // into the AST — so the SelectStmt-visitor semantic checks
+ // (ARRAY JOIN without FROM / unaliased ARRAY JOIN arrays)
+ // never fire for a subquery nested in here. Suppress them
+ // during this parse so `f() FILTER (WHERE (SELECT 1 ARRAY
+ // JOIN 2)) OVER w` is accepted the same way.
+ let prev = self.suppress_array_join_checks;
+ self.suppress_array_join_checks = true;
+ let result = self.parse_expr_bp(0);
+ self.suppress_array_join_checks = prev;
+ let expr = result?;
+ self.expect(TokenKind::RParen, ")")?;
+ Ok(Some(expr))
+ }
+
+ /// Parse a comma-separated list of `orderExpr` items — `expr [ASC|DESC]
+ /// [NULLS FIRST|LAST] [COLLATE STRING_LITERAL] [WITH FILL …]`.
+ pub(crate) fn parse_order_expr_list(&mut self) -> Result<Vec<Value>, ParseError> {
+ let mut out = Vec::new();
+ loop {
+ let order_start = self.peek0.start;
+ let expr = self.parse_expr_bp(0)?;
+ let order = if self.eat_kw(Kw::Ascending)? {
+ "ASC"
+ } else if self.eat_kw(Kw::Desc)? || self.eat_kw(Kw::Descending)? {
+ "DESC"
+ } else {
+ "ASC"
+ };
+ if self.eat_kw(Kw::Nulls)? {
+ let _ = self.eat_kw(Kw::First)? || self.eat_kw(Kw::Last)?;
+ }
+ // `COLLATE 'name'` — swallow; no AST slot yet.
+ if self.eat_kw(Kw::Collate)? {
+ if !matches!(self.peek(), TokenKind::String) {
+ return Err(self.err(format!(
+ "expected string literal after COLLATE, got {:?}",
+ self.peek(),
+ )));
+ }
+ self.bump()?;
+ }
+ // `WITH FILL [FROM e] [TO e] [STEP e]` — postfix decorator on
+ // a single OrderExpr.
+ let with_fill = if matches!(self.peek(), TokenKind::Keyword(Kw::With))
+ && self.peek_next() == TokenKind::Keyword(Kw::Fill)
+ {
+ let with_fill_start = self.peek0.start;
+ self.bump()?;
+ self.bump()?;
+ let from_value = if self.eat_kw(Kw::From)? {
+ Some(self.parse_expr_bp(0)?)
+ } else {
+ None
+ };
+ let to_value = if self.eat_kw(Kw::To)? {
+ Some(self.parse_expr_bp(0)?)
+ } else {
+ None
+ };
+ let step_value = if self.eat_kw(Kw::Step)? {
+ Some(self.parse_expr_bp(0)?)
+ } else {
+ None
+ };
+ let mut obj = serde_json::Map::new();
+ obj.insert("node".into(), Value::String("WithFillExpr".into()));
+ if let Some(v) = from_value {
+ obj.insert("from_value".into(), v);
+ }
+ if let Some(v) = to_value {
+ obj.insert("to_value".into(), v);
+ }
+ if let Some(v) = step_value {
+ obj.insert("step_value".into(), v);
+ }
+ // cpp's `WithFill` visitor calls `addPositionInfo(json, ctx)`,
+ // so the JSON has `start` / `end` spanning the `WITH FILL ...`
+ // tokens. Wrap before stuffing into OrderExpr.
+ Some(self.wrap_pos(Value::Object(obj), with_fill_start))
+ } else {
+ None
+ };
+ out.push(self.wrap_pos(emit::order_expr(expr, order, with_fill), order_start));
+ if !self.eat(TokenKind::Comma)? {
+ break;
+ }
+ }
+ Ok(out)
+ }
+
+ fn parse_type_expr(&mut self) -> Result<String, ParseError> {
+ // Parse `columnTypeExpr` greedy: base ident (or compound `IDENT
+ // IDENT+`) followed by optional `LPAREN ...types... RPAREN` or
+ // `LBRACKET [size] RBRACKET` suffixes.
+ let mut name = self.parse_type_atom()?;
+ // Trailing `[...]` / `[N]` array suffixes.
+ while self.peek() == TokenKind::LBracket {
+ self.bump()?;
+ let mut suffix = String::from("[");
+ if self.peek() == TokenKind::Number {
+ let n = self.bump()?;
+ suffix.push_str(self.text(n));
+ }
+ self.expect(TokenKind::RBracket, "]")?;
+ suffix.push(']');
+ name.push_str(&suffix);
+ }
+ Ok(name)
+ }
+
+ fn parse_type_atom(&mut self) -> Result<String, ParseError> {
+ // Decode a single type-name token, unquoting quoted-idents and
+ // lowercasing the rest. The grammar's `columnTypeExpr` resolves
+ // through `identifier`, so a `"foo"` type token is semantically
+ // the bare ident `foo`; cpp `visitIdentifier` strips the quotes.
+ fn token_text(parser: &Parser<'_>, t: Token) -> String {
+ let raw = parser.text(t);
+ match t.kind {
+ TokenKind::QuotedIdent => identifier_text(raw, t.kind).to_ascii_lowercase(),
+ _ => raw.to_ascii_lowercase(),
+ }
+ }
+
+ let head = self.bump()?;
+ // cpp's `columnTypeExpr` routes through `identifier`, which
+ // excludes NULL / INF / NAN — so a bare `NULL` is not a type
+ // name. Use `kw_valid_as_identifier` to gate the keyword arm.
+ let mut head_name = match head.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent => token_text(self, head),
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => token_text(self, head),
+ _ => return Err(self.err(format!("expected type identifier, got {:?}", head.kind))),
+ };
+
+ // Parametric / nested / complex form: `IDENT ( … )`.
+ if self.peek() == TokenKind::LParen {
+ self.bump()?;
+ // `ColumnTypeExprEnum` matches `IDENT LPAREN enumValue (COMMA
+ // enumValue)* COMMA? RPAREN` where `enumValue: STRING_LITERAL
+ // EQ_SINGLE numberLiteral`. cpp/python both reject the visit
+ // with "Unsupported rule: ColumnTypeExprEnum", so rust must
+ // also error rather than fall through to the Param raw-text
+ // path (which would happily emit `enum8('a'=1)`).
+ // Detect the enumValue shape at the head of the paren body —
+ // STRING `=` Number — and short-circuit with the same error.
+ if matches!(self.peek(), TokenKind::String)
+ && matches!(self.peek_next(), TokenKind::EqDouble | TokenKind::EqSingle)
+ {
+ let start = self.peek0.start;
+ let end = self.peek0.end;
+ // Fatal so the outer `try_alt`'s parse_ident_lead
+ // fallback doesn't mask the error by re-parsing
+ // `cast(...)` as a function call.
+ return Err(ParseError::not_implemented_fatal(
+ "Unsupported rule: ColumnTypeExprEnum",
+ start,
+ end,
+ ));
+ }
+ // Pre-classify the whole paren group. cpp's ANTLR ALL(*) commits the
+ // entire `IDENT(...)` to a single alt (Nested/Complex/Param/Enum). If
+ // ANY depth-0 token forces Param (e.g. `#1`, `{}`, a bare literal,
+ // or a top-level operator like `a+b`), then every sibling item also
+ // takes the Param path — visited via `ctx->getText()` which keeps
+ // case + quoting and concatenates spacelessly. Otherwise Complex/
+ // Nested kicks in per-item (recursive visit, lowercased + `, `).
+ let raw_mode = self.group_is_param_mode();
+ let mut parts: Vec<String> = Vec::new();
+ if self.peek() != TokenKind::RParen {
+ loop {
+ if raw_mode {
+ parts.push(self.consume_raw_type_param_text()?);
+ } else {
+ parts.push(self.parse_type_param_item()?);
+ }
+ if !self.eat(TokenKind::Comma)? {
+ break;
+ }
+ if self.peek() == TokenKind::RParen {
+ break;
+ }
+ }
+ }
+ self.expect(TokenKind::RParen, ")")?;
+ return Ok(format!("{head_name}({})", parts.join(", ")));
+ }
+
+ // Compound form: `IDENT IDENT+` (e.g. `TIME WITH TIME ZONE`).
+ // cpp's `ColumnTypeExprCompound: identifier identifier+` routes
+ // through the grammar's `identifier` rule, which omits NULL /
+ // INF / NAN — so trailing `Int NULL` / `Int NOT NULL` does NOT
+ // form a compound type in cpp (it errors at the outer `)`). The
+ // Rust loop used to admit any Keyword, silently eating the
+ // trailing `NULL` and emitting `int null` as the type name.
+ while {
+ let p = self.peek();
+ matches!(p, TokenKind::Ident | TokenKind::QuotedIdent)
+ || matches!(p, TokenKind::Keyword(kw) if kw_valid_as_identifier(kw))
+ } && !matches!(self.peek(), TokenKind::Keyword(Kw::As))
+ {
+ // Stop at LPAREN / LBRACKET / RPAREN / comma — those are
+ // structural separators rather than parts of the type name.
+ // Also stop on AS so we don't gobble outer alias keywords.
+ let next = self.bump()?;
+ head_name.push(' ');
+ head_name.push_str(&token_text(self, next));
+ }
+ Ok(head_name)
+ }
+
+ // ========================================================================
+ // SELECT statement parser
+ // ========================================================================
+
+ /// Top-level entry for `select : selectSetStmt | selectStmt`. Handles
+ /// `UNION`/`INTERSECT`/`EXCEPT` chains plus top-level `ORDER BY` /
+ /// `LIMIT` / `OFFSET` that decorate the whole set.
+ pub(crate) fn peek_is_clause_terminator(&self) -> bool {
+ // Group/Order on their own are identifier-like per the grammar
+ // (e.g. a column literally named `group`); they only terminate a
+ // column list when followed by `BY`. The two-token form lives
+ // in `peek_is_two_token_clause_terminator`.
+ let is_clause_kw = matches!(
+ self.peek(),
+ TokenKind::Keyword(Kw::From)
+ | TokenKind::Keyword(Kw::Where)
+ | TokenKind::Keyword(Kw::Prewhere)
+ | TokenKind::Keyword(Kw::Having)
+ | TokenKind::Keyword(Kw::Qualify)
+ | TokenKind::Keyword(Kw::Window)
+ | TokenKind::Keyword(Kw::Limit)
+ | TokenKind::Keyword(Kw::Offset)
+ | TokenKind::Keyword(Kw::Union)
+ | TokenKind::Keyword(Kw::Intersect)
+ | TokenKind::Keyword(Kw::Except)
+ | TokenKind::Keyword(Kw::Settings)
+ );
+ // A clause keyword that has no valid body following it isn't
+ // actually starting a clause — cpp falls back to parsing it as
+ // a Field identifier in column position. We mirror that by not
+ // terminating on the keyword. The "no valid body" set covers:
+ // - explicit list-terminators (Eof / `)` / `,` / `;`)
+ // - another clause keyword (its own body would have to start
+ // with that, which it can't — clause keywords aren't
+ // expression / table-reference starters)
+ // - select-level keywords like `WITH (TOTALS|CUBE|ROLLUP)` /
+ // `GROUP BY` / `USING SAMPLE` that lead with what would
+ // otherwise be a clause keyword.
+ if is_clause_kw && !peek_can_start_clause_body(self.peek_next()) {
+ return false;
+ }
+ // Even when peek_next looks like it could begin a body, the
+ // *combined* peek_next + the token after may form a known
+ // two-token clause introducer (`WITH ROLLUP`, `GROUP BY`,
+ // `WITH FILL`, `USING SAMPLE`, `ARRAY JOIN`). When that
+ // happens, the current clause keyword has no body of its own
+ // and should be parsed as a Field. Use a shadow-lexer probe
+ // to peek one more token ahead.
+ if is_clause_kw && self.peek_after_starts_two_token_clause() {
+ return false;
+ }
+ // `OFFSET *`: bare-asterisk OFFSET only sticks as the actual
+ // OFFSET clause when `*` ends cleanly (end-of-clause, or
+ // followed by COLUMNS|EXCLUDE|REPLACE + `(`). With anything
+ // else following the `*`, cpp reads `OFFSET * <rhs>` as
+ // `offset_field * <rhs>` arithmetic, so OFFSET is a Field
+ // identifier rather than a clause introducer.
+ // `<clause-kw> *`: bare-asterisk only sticks as the clause body
+ // when `*` ends cleanly (end-of-clause / asterisk-companion).
+ // With a multiplication-RHS following, the clause-kw is a Field
+ // identifier instead. Applies to OFFSET / WHERE / PREWHERE /
+ // HAVING / QUALIFY / FROM — any clause taking a single columnExpr
+ // as its body.
+ if matches!(
+ self.peek(),
+ TokenKind::Keyword(Kw::Offset)
+ | TokenKind::Keyword(Kw::Where)
+ | TokenKind::Keyword(Kw::Prewhere)
+ | TokenKind::Keyword(Kw::Having)
+ | TokenKind::Keyword(Kw::Qualify)
+ | TokenKind::Keyword(Kw::From)
+ ) && self.peek_next() == TokenKind::Asterisk
+ && self.asterisk_after_offset_continues_arith()
+ {
+ return false;
+ }
+ // `WINDOW` only opens the WINDOW clause when a `<name> AS
+ // LParen` (the windowExpr definition) follows. Otherwise the
+ // WINDOW keyword is a Field identifier in the column list.
+ // The probe covers any name token (`window x …`, `window from
+ // …`) — `WINDOW from events` is `window` the Field followed by
+ // a FROM clause, not a malformed WINDOW clause.
+ if self.peek() == TokenKind::Keyword(Kw::Window)
+ && !self.window_ident_followed_by_as_lparen()
+ {
+ return false;
+ }
+ // `FROM`'s clause body is a `joinExpr` — a table reference,
+ // not a `columnExpr` — so it only opens the FROM clause when a
+ // table-reference starter follows: an identifier, `(`
+ // subquery, `{}` placeholder, or a hogqlx `<` tag. `from + 1`
+ // / `from 5` keep `from` as a Field column. (Empty `from ()`
+ // is already caught as a call by the two-token probe above.)
+ if self.peek() == TokenKind::Keyword(Kw::From)
+ && !matches!(
+ self.peek_next(),
+ TokenKind::Ident
+ | TokenKind::QuotedIdent
+ | TokenKind::Keyword(_)
+ | TokenKind::LParen
+ | TokenKind::LBrace
+ | TokenKind::Lt
+ )
+ {
+ return false;
+ }
+ is_clause_kw || self.peek_is_two_token_clause_terminator()
+ }
+
+ /// Probe: after `WINDOW <ident>`, do `AS LParen` follow? cpp's
+ /// WINDOW clause requires the windowExpr in parens, so without
+ /// that pair the WINDOW keyword falls back to a Field identifier
+ /// in the column list (and the ident is its alias).
+ fn window_ident_followed_by_as_lparen(&self) -> bool {
+ let mut probe = Lexer::with_pos(self.src, self.peek1.end);
+ let t = match probe.next_token() {
+ Ok(t) => t,
+ Err(_) => return false,
+ };
+ if t.kind != TokenKind::Keyword(Kw::As) {
+ return false;
+ }
+ let next = match probe.next_token() {
+ Ok(t) => t,
+ Err(_) => return false,
+ };
+ next.kind == TokenKind::LParen
+ }
+
+ /// Probe: after `OFFSET *`, does the token after `*` mean the
+ /// asterisk is the LHS of arithmetic (so OFFSET is a Field) rather
+ /// than a clean asterisk-spread expression terminating the clause?
+ fn asterisk_after_offset_continues_arith(&self) -> bool {
+ let mut probe = Lexer::with_pos(self.src, self.peek1.end);
+ let p3 = match probe.next_token() {
+ Ok(t) => t.kind,
+ Err(_) => return false,
+ };
+ match p3 {
+ TokenKind::Eof
+ | TokenKind::RParen
+ | TokenKind::RBracket
+ | TokenKind::RBrace
+ | TokenKind::Comma
+ | TokenKind::Semicolon => false,
+ TokenKind::Keyword(Kw::Columns)
+ | TokenKind::Keyword(Kw::Exclude)
+ | TokenKind::Keyword(Kw::Replace) => {
+ let p4 = match probe.next_token() {
+ Ok(t) => t.kind,
+ Err(_) => return false,
+ };
+ p4 != TokenKind::LParen
+ }
+ // A pure infix / postfix operator after `*` cannot be a
+ // multiplication RHS — `* ?.` / `* ::` is the asterisk
+ // spread extended by the postfix op, so the `*` does NOT
+ // continue arithmetic and the clause keyword stays a
+ // clause (`qualify * ?. q`).
+ _ if is_pure_infix_op(p3) => false,
+ // A clause-starting keyword after `*` also can't be a
+ // multiplication RHS — it's the next clause beginning, and
+ // the `*` here is a bare-asterisk clause body
+ // (`where * limit 1`, `having * with totals`, …).
+ TokenKind::Keyword(
+ Kw::From
+ | Kw::Where
+ | Kw::Prewhere
+ | Kw::Having
+ | Kw::Qualify
+ | Kw::Window
+ | Kw::Limit
+ | Kw::Offset
+ | Kw::Group
+ | Kw::Order
+ | Kw::Union
+ | Kw::Intersect
+ | Kw::Except
+ | Kw::Settings
+ | Kw::With,
+ ) => false,
+ _ => true,
+ }
+ }
+
+ /// Probe: do peek_next + the token after it form one of the
+ /// two-token clause introducers? Same set as
+ /// `peek_is_two_token_clause_terminator` checks, but with the
+ /// match offset by one — used to decide whether the *current*
+ /// clause keyword has a real body or whether the body's leading
+ /// token is itself the start of a sibling clause.
+ fn peek_after_starts_two_token_clause(&self) -> bool {
+ let p1 = self.peek_next();
+ let mut probe = Lexer::with_pos(self.src, self.peek1.end);
+ let p2 = match probe.next_token() {
+ Ok(t) => t.kind,
+ Err(_) => return false,
+ };
+ // GROUP BY / ORDER BY
+ if matches!(
+ p1,
+ TokenKind::Keyword(Kw::Group) | TokenKind::Keyword(Kw::Order)
+ ) && p2 == TokenKind::Keyword(Kw::By)
+ {
+ return true;
+ }
+ // WITH (TOTALS | CUBE | ROLLUP | FILL)
+ if p1 == TokenKind::Keyword(Kw::With)
+ && matches!(
+ p2,
+ TokenKind::Keyword(Kw::Totals)
+ | TokenKind::Keyword(Kw::Cube)
+ | TokenKind::Keyword(Kw::Rollup)
+ | TokenKind::Keyword(Kw::Fill),
+ )
+ {
+ return true;
+ }
+ // USING SAMPLE
+ if p1 == TokenKind::Keyword(Kw::Using) && p2 == TokenKind::Keyword(Kw::Sample) {
+ return true;
+ }
+ // ARRAY JOIN, LEFT/INNER ARRAY
+ if p1 == TokenKind::Keyword(Kw::Array) && p2 == TokenKind::Keyword(Kw::Join) {
+ return true;
+ }
+ if matches!(
+ p1,
+ TokenKind::Keyword(Kw::Left) | TokenKind::Keyword(Kw::Inner)
+ ) && p2 == TokenKind::Keyword(Kw::Array)
+ {
+ return true;
+ }
+ // `SAMPLE <ratio>` — the SELECT-level sampleClause slot. cpp's
+ // visitor silently drops it but still recognises the clause
+ // boundary, so the preceding clause keyword should be a Field.
+ if p1 == TokenKind::Keyword(Kw::Sample)
+ && matches!(
+ p2,
+ TokenKind::Number
+ | TokenKind::Plus
+ | TokenKind::Dash
+ | TokenKind::Dot
+ | TokenKind::LBrace
+ | TokenKind::Keyword(Kw::Inf)
+ | TokenKind::Keyword(Kw::Nan),
+ )
+ {
+ return true;
+ }
+ // `LIMIT <expr>` / `OFFSET <expr>` — single-token clause
+ // introducers when followed by a real expression starter that's
+ // not itself another clause keyword. cpp's ALL(*) prefers the
+ // FROM-clause + trailing-clause shape when the third token is
+ // itself a clause-introducer (e.g. `FROM limit prewhere x` parses
+ // as `FROM table=limit PREWHERE x`, not `FROM identifier + LIMIT
+ // expr=prewhere + leftover x`). For a non-clause expression
+ // starter (Number, Ident, `*`, `#`, etc.) the LIMIT/OFFSET path
+ // wins.
+ if matches!(
+ p1,
+ TokenKind::Keyword(Kw::Limit) | TokenKind::Keyword(Kw::Offset)
+ ) && peek_can_start_clause_body(p2)
+ && !is_clause_introducer_kw(p2)
+ {
+ return true;
+ }
+ // `WHERE`/`PREWHERE`/`HAVING`/`QUALIFY` followed by a token
+ // that can't be an alias on the FROM table (Hash, Asterisk,
+ // Number, String, LBrace, …). cpp's ALL(*) drops the FROM-as-
+ // table interpretation in this case (no valid alias slot for
+ // the predicate-clause's first token) and treats the prior FROM
+ // as a Field, with WHERE/etc. as the actual clause.
+ if matches!(
+ p1,
+ TokenKind::Keyword(Kw::Where)
+ | TokenKind::Keyword(Kw::Prewhere)
+ | TokenKind::Keyword(Kw::Having)
+ | TokenKind::Keyword(Kw::Qualify)
+ ) && !can_be_table_continuation(p2)
+ && peek_can_start_clause_body(p2)
+ && !is_clause_introducer_kw(p2)
+ {
+ return true;
+ }
+ // `<clause-kw> ( )` — empty parens after a clause keyword
+ // is a function-call form on the keyword as identifier (cpp's
+ // ALL(*) emits `Call(name="from", args=[])` etc.). Empty parens
+ // can't open a valid clause body for FROM / WHERE / etc., so
+ // the surrounding clause keyword falls back to a Field.
+ // Exception: `( ) ->` is a zero-arg lambda parameter list — a
+ // valid clause body (`LIMIT () -> 2`) — so the keyword stays a
+ // clause introducer there.
+ if p1 == TokenKind::LParen && p2 == TokenKind::RParen {
+ let p3 = probe.next_token().map(|t| t.kind).unwrap_or(TokenKind::Eof);
+ if p3 != TokenKind::Arrow {
+ return true;
+ }
+ }
+ // `UNION` / `INTERSECT` / `EXCEPT` followed by a select-stmt
+ // starter or set-op modifier — the set operator binds the
+ // preceding clause keyword (FROM, etc.) to a Field identifier
+ // so the set op can chain a sibling select. cpp's ALL(*) for
+ // \`from UNION select 2\` produces a SelectSetQuery with FROM
+ // promoted into the column list.
+ if matches!(
+ p1,
+ TokenKind::Keyword(Kw::Union)
+ | TokenKind::Keyword(Kw::Intersect)
+ | TokenKind::Keyword(Kw::Except)
+ ) && matches!(
+ p2,
+ TokenKind::Keyword(Kw::Select)
+ | TokenKind::Keyword(Kw::With)
+ | TokenKind::Keyword(Kw::All)
+ | TokenKind::Keyword(Kw::Distinct)
+ | TokenKind::Keyword(Kw::By)
+ | TokenKind::LParen
+ | TokenKind::LBrace
+ ) {
+ return true;
+ }
+ false
+ }
+
+ /// Two-token sequences that introduce a SELECT-stmt clause and
+ /// thus terminate a column-expression list when seen after a
+ /// trailing comma. Kept separate from the single-token cases above
+ /// because the FIRST token of each pair (`USING`, `ARRAY`, `LEFT`,
+ /// etc.) is also legitimately usable as a bare identifier or
+ /// expression in other contexts.
+ pub(crate) fn peek_is_two_token_clause_terminator(&self) -> bool {
+ let p0 = self.peek();
+ let p1 = self.peek_next();
+ // `USING SAMPLE` — second select-level SAMPLE position.
+ if p0 == TokenKind::Keyword(Kw::Using) && p1 == TokenKind::Keyword(Kw::Sample) {
+ return true;
+ }
+ // `ARRAY JOIN`, `LEFT ARRAY`, `INNER ARRAY` — array-join prefix.
+ if p0 == TokenKind::Keyword(Kw::Array) && p1 == TokenKind::Keyword(Kw::Join) {
+ return true;
+ }
+ if matches!(
+ p0,
+ TokenKind::Keyword(Kw::Left) | TokenKind::Keyword(Kw::Inner)
+ ) && p1 == TokenKind::Keyword(Kw::Array)
+ {
+ return true;
+ }
+ // ORDER BY / GROUP BY — when the second token is `BY`, the
+ // first token introduces a clause. Bare `Group`/`Order` may
+ // appear as identifiers in column position (e.g. a literally-
+ // named `group` column), so we require the pair.
+ if matches!(
+ p0,
+ TokenKind::Keyword(Kw::Group) | TokenKind::Keyword(Kw::Order)
+ ) && p1 == TokenKind::Keyword(Kw::By)
+ {
+ return true;
+ }
+ // `SAMPLE <ratio>` — the selectStmt-level sampleClause slot
+ // (silently dropped by cpp's visitor). ANTLR's ALL(*)
+ // disambiguates `sample` as a Field vs the start of the
+ // sampleClause by the second token: a ratio-value starter
+ // (number, sign, `.<digits>`, `{placeholder}`, `inf`/`nan`)
+ // means clause.
+ if p0 == TokenKind::Keyword(Kw::Sample)
+ && matches!(
+ p1,
+ TokenKind::Number
+ | TokenKind::Plus
+ | TokenKind::Dash
+ | TokenKind::Dot
+ | TokenKind::LBrace
+ | TokenKind::Keyword(Kw::Inf)
+ | TokenKind::Keyword(Kw::Nan)
+ )
+ {
+ return true;
+ }
+ // `WITH TOTALS`, `WITH CUBE`, `WITH ROLLUP`, `WITH FILL` —
+ // selectStmt's `(WITH (CUBE|ROLLUP))? (WITH TOTALS)?` trailers
+ // and orderBy's `WITH FILL`. The bare `WITH` token also starts
+ // a CTE list, but only at the *very* start of a SELECT — by
+ // the time we're past the column list, a `WITH <ident>` after
+ // it can't be a CTE.
+ if p0 == TokenKind::Keyword(Kw::With)
+ && matches!(
+ p1,
+ TokenKind::Keyword(Kw::Totals)
+ | TokenKind::Keyword(Kw::Cube)
+ | TokenKind::Keyword(Kw::Rollup)
+ | TokenKind::Keyword(Kw::Fill),
+ )
+ {
+ return true;
+ }
+ false
+ }
+
+ pub(crate) fn parse_expr_list_until_paren(&mut self) -> Result<Vec<Value>, ParseError> {
+ let mut out = Vec::new();
+ if self.peek() == TokenKind::RParen {
+ return Ok(out);
+ }
+ loop {
+ out.push(self.parse_expr_bp(0)?);
+ if !self.eat(TokenKind::Comma)? {
+ break;
+ }
+ if self.peek() == TokenKind::RParen {
+ break;
+ }
+ }
+ Ok(out)
+ }
+
+ pub(crate) fn parse_expr_list_until_terminators(&mut self) -> Result<Vec<Value>, ParseError> {
+ let mut out = Vec::new();
+ out.push(self.parse_expr_bp(0)?);
+ // cpp's `columnExprList: columnExpr (COMMA columnExpr)*` — after
+ // each comma ANTLR's adaptive lookahead decides whether the
+ // upcoming tokens form another columnExpr or whether the comma
+ // was trailing (and the next clause starts).
+ //
+ // When `peek_is_clause_terminator()` fires after a comma the
+ // keyword can still be the next list item — cpp resolves the
+ // ambiguity in favour of another `columnExpr`, even a bare
+ // keyword-as-Field one (`GROUP BY a, window` keeps `window` as
+ // the second column, not the start of a WINDOW clause). The
+ // comma is only trailing when treating the keyword as a column
+ // would strand a clause body — which the post-parse boundary
+ // check below catches: `, FROM t` parses `from` as a Field but
+ // leaves the cursor on `t` (not a list boundary), and
+ // `, LIMIT (1) by (2)` parses `LIMIT(1)` but leaves it on `by`.
+ while self.eat(TokenKind::Comma)? {
+ if matches!(
+ self.peek(),
+ TokenKind::Eof | TokenKind::RParen | TokenKind::Semicolon
+ ) {
+ break;
+ }
+ if self.peek_is_clause_terminator() {
+ // Speculatively parse the next item; accept it only
+ // when the post-parse cursor lands on a clean
+ // `columnExprList` boundary. Otherwise cpp's adaptive
+ // prediction would have treated the comma as trailing
+ // and dispatched the keyword as the next clause.
+ let cp = self.checkpoint();
+ let speculated = match self.parse_expr_bp(0) {
+ Ok(_) if !self.peek_is_column_expr_list_boundary() => {
+ self.restore(cp)?;
+ None
+ }
+ Ok(expr) => Some(expr),
+ Err(_) => {
+ self.restore(cp)?;
+ None
+ }
+ };
+ match speculated {
+ Some(expr) => out.push(expr),
+ None => break,
+ }
+ } else {
+ out.push(self.parse_expr_bp(0)?);
+ }
+ }
+ Ok(out)
+ }
+
+ /// True when peek is a valid boundary AFTER a generic
+ /// `columnExprList` item in a SELECT context: structural
+ /// terminator, comma (next item), or any keyword that cpp's
+ /// adaptive prediction would consider as the start of a sibling
+ /// clause (FROM, WHERE, HAVING, ORDER, GROUP, LIMIT, OFFSET,
+ /// WINDOW, QUALIFY, SETTINGS, set operators). Crucially does NOT
+ /// include `BY` alone — that token following a successfully-
+ /// parsed expression item indicates the speculative parse
+ /// over-consumed (e.g. `LIMIT (1)` absorbed `LIMIT` as a Field
+ /// when `LIMIT (1) by (2)` was the intended LIMIT-BY clause).
+ pub(crate) fn peek_is_column_expr_list_boundary(&self) -> bool {
+ matches!(
+ self.peek(),
+ TokenKind::Eof
+ | TokenKind::RParen
+ | TokenKind::RBracket
+ | TokenKind::RBrace
+ | TokenKind::Comma
+ | TokenKind::Semicolon
+ | TokenKind::Keyword(Kw::From)
+ | TokenKind::Keyword(Kw::Where)
+ | TokenKind::Keyword(Kw::Prewhere)
+ | TokenKind::Keyword(Kw::Having)
+ | TokenKind::Keyword(Kw::Qualify)
+ | TokenKind::Keyword(Kw::Window)
+ | TokenKind::Keyword(Kw::Order)
+ | TokenKind::Keyword(Kw::Group)
+ | TokenKind::Keyword(Kw::Limit)
+ | TokenKind::Keyword(Kw::Offset)
+ | TokenKind::Keyword(Kw::Settings)
+ | TokenKind::Keyword(Kw::Union)
+ | TokenKind::Keyword(Kw::Intersect)
+ | TokenKind::Keyword(Kw::Except)
+ | TokenKind::Keyword(Kw::With)
+ // USING is included for the SELECT-level USING SAMPLE
+ // clause that can follow GROUP BY (per the grammar's
+ // `sampleClause` at line 144). It's also the JOIN-USING
+ // and ARRAY-JOIN-USING introducer, both of which end
+ // any columnExprList that was being parsed.
+ | TokenKind::Keyword(Kw::Using)
+ )
+ }
+
+ // parse_with_expr_list / parse_with_expr / parse_with_expr_subquery
+ // live in `cte.rs`.
+
+ /// One item inside a parametric type's paren list: either a nested type
+ /// (`Tuple(Int, String)`), a `field type` pair (`Struct(a Int, b
+ /// String)`), or a numeric / expression parameter (`Decimal(10, 2)`,
+ /// `FixedString(8)`).
+ fn parse_type_param_item(&mut self) -> Result<String, ParseError> {
+ // `IDENT TYPE` nested struct field: an ident at peek0 followed
+ // by another type-starting token at peek1 (but not a `(` —
+ // that's a parametric type, not a field). Speculative — the
+ // shape `case when …`, `if expr …` etc. trips this matcher
+ // (both `case` and `when` are admissible identifiers), so we
+ // require the inner type-parse to land cleanly at a `,` / `)`
+ // terminator before committing. On failure, restore and fall
+ // through to the heuristic + speculative-type-expr branches
+ // below, which route the expression form to spaceless raw
+ // text.
+ // The nested-struct heuristic (`field type`) routes through cpp's
+ // `identifier identifier+` grammar, which excludes NULL / INF /
+ // NAN from the keyword alternative. Filter both peek positions.
+ let is_type_ident_kind = |k: TokenKind| -> bool {
+ matches!(k, TokenKind::Ident | TokenKind::QuotedIdent)
+ || matches!(k, TokenKind::Keyword(kw) if kw_valid_as_identifier(kw))
+ };
+ if is_type_ident_kind(self.peek())
+ && is_type_ident_kind(self.peek_next())
+ && self.peek_next() != TokenKind::LParen
+ {
+ let cp = self.checkpoint();
+ let name_tok = self.bump()?;
+ let raw = self.text(name_tok);
+ // Unquote QuotedIdents the same way parse_type_atom does
+ // for the head token — the cpp visitor resolves both
+ // through `visitIdentifier`, so quotes are stripped.
+ let field_name = match name_tok.kind {
+ TokenKind::QuotedIdent => identifier_text(raw, name_tok.kind).to_ascii_lowercase(),
+ _ => raw.to_ascii_lowercase(),
+ };
+ match self.parse_type_expr() {
+ Ok(type_str) if matches!(self.peek(), TokenKind::Comma | TokenKind::RParen) => {
+ return Ok(format!("{field_name} {type_str}"));
+ }
+ _ => self.restore(cp)?,
+ }
+ }
+ // The grammar declares the parametric-type alternatives in this
+ // order: Nested, Complex, Param. ANTLR tries each alt in turn.
+ // The group-level `group_is_param_mode` pre-classifier has already
+ // routed obvious Param shapes (any depth-0 `#1` / `{}` / literal /
+ // operator across the whole paren group) to the raw-text path;
+ // by the time we reach here we know the group "looks like Complex/
+ // Nested", so we try `parse_type_expr` first.
+ //
+ // A type-expr success only counts when it consumes the whole
+ // param — i.e. lands on a `,` / `)` terminator. `case when (c)
+ // then d end` happens to start `case when (c)` in a way that
+ // `parse_type_expr`'s compound + param-list loops accept as a
+ // pseudo-type `case when(c)`, then chokes on `then` instead of
+ // a terminator. Restore and treat as expression in that case,
+ // matching cpp's ANTLR fallback to the Param alt.
+ let cp = self.checkpoint();
+ match self.parse_type_expr() {
+ Ok(name) if matches!(self.peek(), TokenKind::Comma | TokenKind::RParen) => Ok(name),
+ _ => {
+ self.restore(cp)?;
+ self.consume_raw_type_param_text()
+ }
+ }
+ }
+
+ /// Scan the whole `IDENT(...)` group and decide whether ANTLR would
+ /// commit to `ColumnTypeExprParam` (items are `columnExpr`, visited
+ /// via `ctx->getText()`) vs Complex/Nested (items are recursive
+ /// `columnTypeExpr`, visited with `, ` joining). Looks for **depth-0
+ /// only** expression markers — markers at deeper levels belong to a
+ /// nested sub-type's own classification (e.g. `Foo(FixedString(8))`
+ /// keeps Foo in Complex even though `8` appears at depth 1).
+ fn group_is_param_mode(&self) -> bool {
+ let mut probe = Lexer::with_pos(self.src, self.peek0.start);
+ let mut depth: i32 = 0;
+ for _ in 0..4096 {
+ let Ok(t) = probe.next_token() else {
+ return false;
+ };
+ match t.kind {
+ TokenKind::Eof => return false,
+ // End of this group — no Param markers found, stay in
+ // Complex/Nested mode. Commas at depth 0 are item
+ // separators; we keep scanning for the next item.
+ TokenKind::RParen if depth == 0 => return false,
+ TokenKind::LBrace if depth == 0 => return true,
+ TokenKind::LParen | TokenKind::LBracket | TokenKind::LBrace => depth += 1,
+ TokenKind::RParen | TokenKind::RBracket | TokenKind::RBrace => depth -= 1,
+ // Depth-0 expression-only tokens force Param mode for the
+ // whole group: literals, positional refs, and any binary
+ // / unary operator surrounded by item tokens.
+ TokenKind::String
+ | TokenKind::TemplateString
+ | TokenKind::Number
+ | TokenKind::Hash
+ | TokenKind::Plus
+ | TokenKind::Dash
+ | TokenKind::Slash
+ | TokenKind::Percent
+ | TokenKind::Asterisk
+ | TokenKind::Dot
+ | TokenKind::EqDouble
+ | TokenKind::EqSingle
+ | TokenKind::NotEq
+ | TokenKind::Lt
+ | TokenKind::LtEq
+ | TokenKind::Gt
+ | TokenKind::GtEq
+ | TokenKind::Arrow
+ | TokenKind::ColonEquals
+ | TokenKind::Concat
+ | TokenKind::Nullish
+ if depth == 0 =>
+ {
+ return true;
+ }
+ _ => {}
+ }
+ }
+ false
+ }
+
+ /// Collect the concatenated token text of a single type-param
+ /// entry, with paren-depth tracking; stop at the next top-level
+ /// comma or closing paren. Mirrors the cpp visitor's recursive
+ /// output for parametric types:
+ ///
+ /// - Tokens are concatenated without intervening whitespace,
+ /// matching ANTLR's `getText()` (which sees the hidden-channel
+ /// whitespace as absent).
+ /// - **Except** between two adjacent identifier-like tokens, where
+ /// we insert a single space. This preserves `Compound`-form CTs
+ /// like `a b` / `time with time zone` whose visitor explicitly
+ /// joins parts with spaces.
+ /// - Trailing commas at any depth (i.e. immediately before a
+ /// matching close) are dropped, since the cpp visitor's
+ /// columnExprList iteration never emits the separator token.
+ fn consume_raw_type_param_text(&mut self) -> Result<String, ParseError> {
+ // Mirrors ANTLR's `ctx.getText()` on `ColumnTypeExprParam`:
+ // join every token verbatim with no separator at all
+ // (whitespace is on a hidden channel and dropped). So
+ // `case when (c) then d end` → `casewhen(c)thendend`,
+ // `if((c), d, e)` → `if((c),d,e)`. Stops at the param's own
+ // depth-0 `,` or `)` terminator. Trailing commas at any depth
+ // (i.e. immediately before a matching close) are dropped,
+ // since the cpp recursive visit skips them. Every token's
+ // original input text is used verbatim — case is preserved
+ // (`ABC` stays `ABC`) and QuotedIdents keep their quotes
+ // (`"a"` stays `"a"`).
+ let mut out = String::new();
+ let mut depth: i32 = 0;
+ loop {
+ let kind = self.peek();
+ match kind {
+ TokenKind::Eof => break,
+ TokenKind::Comma | TokenKind::RParen if depth == 0 => break,
+ TokenKind::LParen | TokenKind::LBracket | TokenKind::LBrace => {
+ depth += 1;
+ let t = self.bump()?;
+ out.push_str(self.text(t));
+ }
+ TokenKind::RParen | TokenKind::RBracket | TokenKind::RBrace => {
+ depth -= 1;
+ let t = self.bump()?;
+ out.push_str(self.text(t));
+ }
+ TokenKind::Comma => {
+ self.bump()?;
+ if !matches!(
+ self.peek(),
+ TokenKind::RParen | TokenKind::RBracket | TokenKind::RBrace
+ ) {
+ out.push(',');
+ }
+ }
+ // The cpp `columnTypeExpr` grammar routes identifier-
+ // shaped tokens through the `identifier` rule, which
+ // omits NULL / INF / NAN. A bare `Int NULL` inside
+ // `Tuple(Int NULL)` would error at the outer paren in
+ // cpp because the inner type couldn't extend through
+ // the NULL keyword. Rust's raw-text fallback used to
+ // happily concatenate `IntNULL` and emit a malformed
+ // type name. Reject the forbidden keywords as soon as
+ // they appear at any depth.
+ TokenKind::Keyword(kw) if !kw_valid_as_identifier(kw) => {
+ return Err(
+ self.err(format!("unexpected `{:?}` keyword in type expression", kw))
+ );
+ }
+ _ => {
+ let t = self.bump()?;
+ out.push_str(self.text(t));
+ }
+ }
+ }
+ Ok(out)
+ }
+
+ pub(crate) fn parse_arg_list(
+ &mut self,
+ terminator: TokenKind,
+ ) -> Result<Vec<Value>, ParseError> {
+ let mut args = Vec::new();
+ if self.peek() == terminator {
+ return Ok(args);
+ }
+ loop {
+ args.push(self.parse_call_argument()?);
+ if !self.eat(TokenKind::Comma)? {
+ break;
+ }
+ if self.peek() == terminator {
+ break;
+ }
+ }
+ Ok(args)
+ }
+
+ /// One argument in a function call's argument list. Supports the named
+ /// argument shape `ident := expr` which is grammar-bound to call sites,
+ /// and a `SELECT …` subquery (`f(select 1)`) which the grammar's
+ /// `ColumnExprCallSelect` allows.
+ fn parse_call_argument(&mut self) -> Result<Value, ParseError> {
+ // Default caller: `parse_arg_list`, which is the postfix `(...)`
+ // form (cpp's `ColumnExprCallSelect`). The grammar there admits
+ // a selectSetStmt as the entire body — including its
+ // wrapper-level `orderByClause?` — so DON'T suppress trailing
+ // ORDER BY consumption. The named-call form
+ // (`parse_function_args_inner`) uses `parse_call_argument_for_function`
+ // instead, which DOES suppress so the ORDER BY surfaces on the
+ // outer `Call.order_by` per cpp's `ColumnExprFunction`
+ // preference.
+ self.parse_call_argument_with(false)
+ }
+
+ /// Call-argument parse used by `parse_function_args_inner` — the
+ /// named-function-call form (cpp's `ColumnExprFunction`). Here
+ /// cpp's ANTLR prefers Function over CallSelect (grammar lines 236
+ /// vs 237), so a trailing `ORDER BY` after the inner paren-wrapped
+ /// SELECT belongs to the outer `Call.order_by`, not the inner
+ /// SetStmt wrapper.
+ fn parse_call_argument_for_function(&mut self) -> Result<Value, ParseError> {
+ self.parse_call_argument_with(true)
+ }
+
+ fn parse_call_argument_with(
+ &mut self,
+ suppress_inner_trailing_order_by: bool,
+ ) -> Result<Value, ParseError> {
+ // cpp's `ColumnExprNamedArg: identifier COLONEQUALS columnExpr`
+ // admits the full `identifier` rule — IDENT / QUOTED_IDENTIFIER /
+ // any keyword accepted by `kw_valid_as_identifier`. That includes
+ // `true` / `false` (which cpp lexes as plain IDENTIFIERs) plus
+ // any soft keyword that doubles as an identifier. The fast-path
+ // here used to gate on IDENT / QUOTED_IDENTIFIER only, so
+ // `f(true := 1)` fell through to `parse_expr_bp` and choked on
+ // the trailing `:=`.
+ let name_kw_ok =
+ matches!(self.peek(), TokenKind::Keyword(kw) if kw_valid_as_identifier(kw));
+ if (matches!(self.peek(), TokenKind::Ident | TokenKind::QuotedIdent) || name_kw_ok)
+ && self.peek_next() == TokenKind::ColonEquals
+ {
+ let name_tok = self.bump()?;
+ let name = identifier_text(self.text(name_tok), name_tok.kind);
+ self.bump()?; // consume `:=`
+ let value = self.parse_expr_bp(0)?;
+ return Ok(emit::named_argument(&name, value));
+ }
+ // A function-call argument is either a selectSetStmt (cpp's
+ // ColumnExprCallSelect) or a regular columnExpr. The grammar
+ // arms overlap on leading `(` (paren-wrapped SELECT vs
+ // paren-wrapped expression); try_alt commits to whichever
+ // parses to a clean comma/RParen boundary.
+ //
+ // `parse_select_set_stmt` is permissive: a bare `{}` (empty
+ // braces — Dict) hits the LBrace branch and returns a Dict
+ // node, then the set-stmt's trailing-decorators handler
+ // silently consumes any `ORDER BY` / `LIMIT` / `OFFSET` that
+ // follows. cpp's grammar doesn't admit `{} ORDER BY ...` as
+ // a valid selectSetStmt, so this misreads function-call
+ // arg-list ORDER BY (`foo(x, {} order by z)`) as belonging to
+ // the inner. Validate the result: only commit when it's an
+ // actual select-set-stmt shape (SelectQuery, SelectSetQuery,
+ // or a real Placeholder `{name}`).
+ self.try_alt(&[
+ &|p| p.parse_call_argument_select(suppress_inner_trailing_order_by),
+ &|p| p.parse_expr_bp(0),
+ ])
+ }
+
+ fn parse_call_argument_select(
+ &mut self,
+ suppress_trailing_order_by: bool,
+ ) -> Result<Value, ParseError> {
+ // Selectively suppress the SetStmt-wrapper-level ORDER BY when
+ // the caller is the named-function-call path (cpp's
+ // `ColumnExprFunction`). For the postfix call-select form
+ // (`<expr>(<set-stmt>)`), cpp's `ColumnExprCallSelect` lets the
+ // ORDER BY ride on the inner set-stmt's wrapper, so we leave
+ // it alone in that path.
+ let prev = self.suppress_setstmt_trailing_order_by;
+ if suppress_trailing_order_by {
+ self.suppress_setstmt_trailing_order_by = true;
+ }
+ let result = self.parse_select_set_stmt();
+ self.suppress_setstmt_trailing_order_by = prev;
+ let v = result?;
+ let kind = v.get("node").and_then(Value::as_str);
+ if matches!(
+ kind,
+ Some("SelectQuery") | Some("SelectSetQuery") | Some("Placeholder")
+ ) {
+ // The select-set-stmt arg must be complete here. If an infix
+ // or postfix operator follows, the `{…}` placeholder or
+ // `(…)` was only the operand of a larger columnExpr (e.g.
+ // `f({x} = 1)`, `f((select 1) + 2)`, `f({x}[0])`, `f({x} as a)`),
+ // so fail and let try_alt fall back to the columnExpr parse.
+ // `infix_bp` covers the symbolic / AND / OR infixes; the
+ // keyword infixes (`IN`, `LIKE`, `ILIKE`, `IS`, `BETWEEN`,
+ // plus the `NOT <kw>` shapes) and the `AS alias` postfix
+ // are dispatched directly out of the Pratt loop, so call
+ // them out here too.
+ let starts_kw_infix = matches!(
+ self.peek(),
+ TokenKind::Keyword(Kw::In | Kw::Like | Kw::Ilike | Kw::Is | Kw::Between | Kw::As)
+ ) || (matches!(self.peek(), TokenKind::Keyword(Kw::Not))
+ && matches!(
+ self.peek_next(),
+ TokenKind::Keyword(Kw::In | Kw::Like | Kw::Ilike | Kw::Between)
+ ));
+ if infix_bp(self.peek()).is_some()
+ || postfix_bp(self.peek()).is_some()
+ || starts_kw_infix
+ {
+ return Err(self.err("select-set-stmt call argument is followed by an operator"));
+ }
+ Ok(v)
+ } else {
+ // Bare Dict / anything else — let parse_expr_bp take over so
+ // the trailing ORDER BY / LIMIT / OFFSET belong to the outer
+ // function-args parser, not to a fake set-stmt.
+ Err(self.err(format!(
+ "parse_select_set_stmt returned {kind:?}, expected SelectQuery/SelectSetQuery/Placeholder"
+ )))
+ }
+ }
+
+ // ---- Postfix --------------------------------------------------------
+
+ fn parse_postfix(&mut self, kind: TokenKind, lhs: Value) -> Result<Value, ParseError> {
+ match kind {
+ TokenKind::LParen => {
+ self.bump()?;
+ let args = self.parse_arg_list(TokenKind::RParen)?;
+ self.expect(TokenKind::RParen, ")")?;
+ Ok(fold_call_or_exprcall(lhs, args))
+ }
+ TokenKind::LBracket => {
+ self.bump()?;
+ // `arr[a:b]` / `arr[:b]` / `arr[a:]` / `arr[:]` — array
+ // slice. Detected by a `:` either at the immediate start
+ // or after the first expression.
+ if self.peek() == TokenKind::Colon {
+ self.bump()?;
+ let end = if self.peek() == TokenKind::RBracket {
+ None
+ } else {
+ Some(self.parse_expr_bp(0)?)
+ };
+ self.expect(TokenKind::RBracket, "]")?;
+ return Ok(emit::array_slice(lhs, None, end));
+ }
+ let first = self.parse_expr_bp(0)?;
+ if self.eat(TokenKind::Colon)? {
+ let end = if self.peek() == TokenKind::RBracket {
+ None
+ } else {
+ Some(self.parse_expr_bp(0)?)
+ };
+ self.expect(TokenKind::RBracket, "]")?;
+ return Ok(emit::array_slice(lhs, Some(first), end));
+ }
+ self.expect(TokenKind::RBracket, "]")?;
+ Ok(emit::array_access(lhs, first, false))
+ }
+ TokenKind::DoubleColon => {
+ self.bump()?;
+ // The grammar's `columnTypeCastExpr` only admits a
+ // restricted keyword set (IDENTIFIER, QUOTED_IDENTIFIER,
+ // the eight `interval` unit keywords, and DATE / TIME /
+ // TIMESTAMP / INTERVAL), optionally followed by
+ // `WITH (LOCAL)? TIME ZONE`. Reject anything outside
+ // that — otherwise `1::with` would silently parse as a
+ // TypeCast to a `with` type name.
+ let tok = self.bump()?;
+ let name = match tok.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent => {
+ identifier_text(self.text(tok), tok.kind).to_ascii_lowercase()
+ }
+ TokenKind::Keyword(kw) if kw_valid_type_cast_ident(kw) => {
+ self.text(tok).to_ascii_lowercase()
+ }
+ _ => {
+ return Err(ParseError::syntax(
+ format!(
+ "invalid type cast target {:?} (a reserved keyword cannot be used as a type name here)",
+ tok.kind,
+ ),
+ tok.start, tok.end,
+ ));
+ }
+ };
+ // Only consume `WITH` for the cast suffix when the full
+ // `WITH (LOCAL)? TIME ZONE` shape follows. cpp's ALL(*)
+ // lookahead rejects this alternative on a bare `WITH`,
+ // leaving e.g. a trailing `WITH FILL` (an ORDER BY
+ // modifier) for the enclosing clause to claim.
+ let full = if self.peek_is_with_time_zone() {
+ self.bump()?; // WITH
+ let mut suffix = String::from(" with");
+ if self.eat_kw(Kw::Local)? {
+ suffix.push_str(" local");
+ }
+ self.expect_kw(Kw::Time, "TIME")?;
+ self.expect_kw(Kw::Zone, "ZONE")?;
+ suffix.push_str(" time zone");
+ format!("{name}{suffix}")
+ } else {
+ name
+ };
+ Ok(emit::type_cast(lhs, &full))
+ }
+ TokenKind::Dot => {
+ self.bump()?;
+ let part = self.bump()?;
+ match part.kind {
+ TokenKind::Number => {
+ // cpp's lexer matches `0123` as OCTAL_PREFIX_LITERAL,
+ // not DECIMAL_LITERAL — so a leading-zero multi-digit
+ // index is grammatically rejected at the tuple-access
+ // alt. Rust's lexer collapses both forms into one
+ // `Number` token and used to silently re-parse it as
+ // decimal (`a.0123` → TupleAccess(a, 123)).
+ let text = self.text(part);
+ if text.len() > 1 && text.starts_with('0') && !text.contains('.') {
+ return Err(self
+ .err(format!("expected decimal integer after '.', got {text:?}")));
+ }
+ let n: i64 = text.parse().map_err(|_| {
+ self.err(format!("expected integer after '.', got {:?}", text))
+ })?;
+ Ok(emit::tuple_access(lhs, n, false))
+ }
+ TokenKind::Ident | TokenKind::QuotedIdent => {
+ let name = identifier_text(self.text(part), part.kind);
+ Ok(emit::array_access(
+ lhs,
+ emit::constant(Value::String(name)),
+ false,
+ ))
+ }
+ // Grammar (`identifier: IDENTIFIER | QUOTED_IDENTIFIER |
+ // interval | keyword`) — `keyword` excludes NULL/INF/
+ // NAN/EXCEPT/INTERSECT and the Hog-statement keywords
+ // (FN/FUN/LET/WHILE/THROW/TRY/CATCH/FINALLY). Gate
+ // every chain-link keyword through `kw_valid_as_identifier`
+ // so e.g. `a.null` / `a.fn` reject instead of becoming
+ // `ArrayAccess(a, "null")`.
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
+ let name = identifier_text(self.text(part), part.kind);
+ Ok(emit::array_access(
+ lhs,
+ emit::constant(Value::String(name)),
+ false,
+ ))
+ }
+ _ => Err(self.err(format!(
+ "expected identifier or number after '.', got {:?}",
+ part.kind
+ ))),
+ }
+ }
+ TokenKind::NullProperty => {
+ self.bump()?;
+ // `?.[expr]` is the bracketed nullish form.
+ if self.peek() == TokenKind::LBracket {
+ self.bump()?;
+ let property = self.parse_expr_bp(0)?;
+ self.expect(TokenKind::RBracket, "]")?;
+ return Ok(emit::array_access(lhs, property, true));
+ }
+ let part = self.bump()?;
+ match part.kind {
+ TokenKind::Number => {
+ // Same OCTAL_PREFIX_LITERAL vs DECIMAL_LITERAL
+ // split as the regular `.<N>` branch above.
+ let text = self.text(part);
+ if text.len() > 1 && text.starts_with('0') && !text.contains('.') {
+ return Err(self.err(format!(
+ "expected decimal integer after '?.', got {text:?}"
+ )));
+ }
+ let n: i64 = text.parse().map_err(|_| {
+ self.err(format!("expected integer after '?.', got {:?}", text))
+ })?;
+ Ok(emit::tuple_access(lhs, n, true))
+ }
+ TokenKind::Ident | TokenKind::QuotedIdent => {
+ let name = identifier_text(self.text(part), part.kind);
+ Ok(emit::array_access(
+ lhs,
+ emit::constant(Value::String(name)),
+ true,
+ ))
+ }
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
+ let name = identifier_text(self.text(part), part.kind);
+ Ok(emit::array_access(
+ lhs,
+ emit::constant(Value::String(name)),
+ true,
+ ))
+ }
+ _ => Err(self.err(format!(
+ "expected identifier or number after '?.', got {:?}",
+ part.kind
+ ))),
+ }
+ }
+ _ => unreachable!("postfix_bp returned for unhandled token {:?}", kind),
+ }
+ }
+
+ /// Consume the optional `COHORT` marker on `IN COHORT <expr>` /
+ /// `NOT IN COHORT <expr>`. cpp's grammar (`(NOT)? IN COHORT?
+ /// columnExpr`) routes through adaptive prediction: it only takes
+ /// the `COHORT?` alternative when a `columnExpr` follows. If the
+ /// next token can't start a columnExpr (EOF / `,` / `)` / `;` / a
+ /// clause-keyword terminator like FROM / LIMIT / WHERE / GROUP /
+ /// ORDER / HAVING / SETTINGS / UNION / ...), the bare `cohort`
+ /// keyword is the IN rhs identifier instead — cpp emits
+ /// `Compare(lhs, "in", Field([cohort]))`. Rust used to greedily
+ /// eat COHORT and then choke parsing an empty rhs.
+ fn try_consume_cohort_marker(&mut self) -> Result<bool, ParseError> {
+ if self.peek() != TokenKind::Keyword(Kw::Cohort) {
+ return Ok(false);
+ }
+ let next = self.peek_next();
+ // Hard terminators that obviously can't begin an expression.
+ let hard_terminator = matches!(
+ next,
+ TokenKind::Eof
+ | TokenKind::Comma
+ | TokenKind::RParen
+ | TokenKind::RBracket
+ | TokenKind::RBrace
+ | TokenKind::Semicolon
+ );
+ // Clause-keyword introducers that terminate a columnExpr in the
+ // outer SELECT context. Mirror the set in `peek_is_clause_terminator`.
+ let clause_kw = matches!(
+ next,
+ TokenKind::Keyword(Kw::From)
+ | TokenKind::Keyword(Kw::Where)
+ | TokenKind::Keyword(Kw::Prewhere)
+ | TokenKind::Keyword(Kw::Having)
+ | TokenKind::Keyword(Kw::Qualify)
+ | TokenKind::Keyword(Kw::Window)
+ | TokenKind::Keyword(Kw::Limit)
+ | TokenKind::Keyword(Kw::Offset)
+ | TokenKind::Keyword(Kw::Union)
+ | TokenKind::Keyword(Kw::Intersect)
+ | TokenKind::Keyword(Kw::Except)
+ | TokenKind::Keyword(Kw::Settings)
+ | TokenKind::Keyword(Kw::Order)
+ | TokenKind::Keyword(Kw::Group)
+ );
+ if hard_terminator || clause_kw {
+ return Ok(false);
+ }
+ self.bump()?;
+ Ok(true)
+ }
+
+ // ---- Multi-token / context-sensitive infix --------------------------
+
+ /// Returns `Some(true)` if it consumed and produced an infix.
+ /// `Some(false)` is reserved for "we matched but didn't act — break"
+ /// (currently unused). `None` means no special infix matched.
+ fn try_special_infix(
+ &mut self,
+ kind: TokenKind,
+ lhs: &mut Value,
+ min_bp: u8,
+ lhs_start: usize,
+ ) -> Result<Option<bool>, ParseError> {
+ match kind {
+ // `IS [NOT] NULL` / `IS [NOT] DISTINCT FROM e`. The two
+ // `IGNORE NULLS` — postfix modifier the cpp visitor
+ // silently drops (`visitColumnExprIgnoreNulls` just returns
+ // the inner expression). Gated at BP_IGNORE_NULLS so it
+ // attaches at the same precedence as the grammar's
+ // declaration order (tighter than IS NULL, looser than
+ // arithmetic/compare). A trailing `(...)` postfix on a
+ // larger expression like `a * b IGNORE NULLS ()` ends up
+ // wrapping the whole `a * b`, not just `b`.
+ TokenKind::Keyword(Kw::Ignore) if self.peek_next() == TokenKind::Keyword(Kw::Nulls) => {
+ if BP_IGNORE_NULLS < min_bp {
+ return Ok(None);
+ }
+ self.bump()?;
+ self.bump()?;
+ Ok(Some(true))
+ }
+ // shapes have different precedences in the grammar — IS NULL
+ // is declared first and so binds tighter. Disambiguate via
+ // bounded lookahead (peek past an optional NOT for DISTINCT)
+ // so each shape uses its own BP for the `< min_bp` gate.
+ TokenKind::Keyword(Kw::Is) => {
+ // cpp's grammar admits IS only in two shapes: `x IS [NOT] NULL`
+ // (ColumnExprIsNull) and `x IS [NOT] DISTINCT FROM y`. When
+ // neither follows (e.g. Hog program source like `this is a
+ // string`, where `is` is a bare identifier-statement),
+ // ANTLR's ALL(*) lookahead backs off and lets each token
+ // start its own ExprStatement. Mirror that: only commit
+ // when the next-two tokens form a known IS-tail, otherwise
+ // return None so the caller can stop the Pratt loop.
+ let (is_distinct_form, is_null_form) = match self.peek_next() {
+ TokenKind::Keyword(Kw::Null) => (false, true),
+ TokenKind::Keyword(Kw::Distinct) => (true, false),
+ TokenKind::Keyword(Kw::Not) => {
+ // Look one further for `NOT NULL` / `NOT DISTINCT`.
+ let mut probe = Lexer::with_pos(self.src, self.peek1.end);
+ match probe.next_token().ok().map(|t| t.kind) {
+ Some(TokenKind::Keyword(Kw::Null)) => (false, true),
+ Some(TokenKind::Keyword(Kw::Distinct)) => (true, false),
+ _ => (false, false),
+ }
+ }
+ _ => (false, false),
+ };
+ if !is_distinct_form && !is_null_form {
+ return Ok(None);
+ }
+ let op_bp = if is_distinct_form {
+ BP_IS_DISTINCT_FROM
+ } else {
+ BP_IS_NULL
+ };
+ if op_bp < min_bp {
+ return Ok(None);
+ }
+ self.bump()?;
+ let negated = self.eat_kw(Kw::Not)?;
+ if self.eat_kw(Kw::Distinct)? {
+ self.expect_kw(Kw::From, "FROM")?;
+ // Left-associative + admit IS-NULL inside: RHS at
+ // BP_IS_DISTINCT_FROM + 1 lets `b IS NOT NULL`
+ // chain (since BP_IS_NULL > BP_IS_DISTINCT_FROM)
+ // but blocks a second IS NOT DISTINCT FROM.
+ let rhs = self.parse_expr_bp(BP_IS_DISTINCT_FROM + 1)?;
+ let prev = lhs.take();
+ *lhs = emit::is_distinct_from(prev, rhs, negated);
+ return Ok(Some(true));
+ }
+ self.expect_kw(Kw::Null, "NULL")?;
+ let prev = lhs.take();
+ *lhs = emit::compare_is_null(prev, negated);
+ Ok(Some(true))
+ }
+ // `NOT BETWEEN ...` / `NOT IN ...` / `NOT LIKE ...` / `NOT ILIKE ...`
+ TokenKind::Keyword(Kw::Not) => match self.peek_next() {
+ TokenKind::Keyword(Kw::Between) => {
+ if BP_BETWEEN < min_bp {
+ return Ok(None);
+ }
+ self.bump()?;
+ self.bump()?;
+ let (low, high, hoisted) = self.parse_between_body(min_bp)?;
+ let prev = lhs.take();
+ // Wrap the inner BetweenExpr with positions BEFORE the hoist loop. When a hoist
+ // wrapper (Or / Ternary / Alias / Arith) is applied, the outer pratt-loop wrap_pos
+ // at line ~126 stamps positions onto the OUTERMOST wrapper, but the BetweenExpr
+ // is now buried inside (e.g. as `Call(if, [BetweenExpr, …])` for the ternary hoist)
+ // and would not otherwise receive a span. cpp emits position info on BetweenExpr
+ // unconditionally — match that. Use `high.end` (not `last_consumed_end`) — see
+ // the BETWEEN arm below for the rationale.
+ let high_end = high.get("end").cloned();
+ let between_inner = emit::between(prev, low, high, true);
+ let mut between = match high_end {
+ Some(end) => emit::with_pos(between_inner, self.pos_obj(lhs_start), end),
+ None => self.wrap_pos(between_inner, lhs_start),
+ };
+ for hoist in hoisted {
+ between = apply_between_hoist(between, hoist);
+ }
+ *lhs = between;
+ Ok(Some(true))
+ }
+ TokenKind::Keyword(Kw::In) => {
+ if BP_COMPARE < min_bp {
+ return Ok(None);
+ }
+ self.bump()?;
+ self.bump()?;
+ let cohort = self.try_consume_cohort_marker()?;
+ let rhs = self.parse_expr_bp(BP_COMPARE + 1)?;
+ let op = if cohort { "not in cohort" } else { "not in" };
+ let prev = lhs.take();
+ *lhs = emit::compare(prev, op, rhs);
+ Ok(Some(true))
+ }
+ TokenKind::Keyword(Kw::Like) => {
+ if BP_COMPARE < min_bp {
+ return Ok(None);
+ }
+ self.bump()?;
+ self.bump()?;
+ let rhs = self.parse_expr_bp(BP_COMPARE + 1)?;
+ let prev = lhs.take();
+ *lhs = emit::compare(prev, "not like", rhs);
+ Ok(Some(true))
+ }
+ TokenKind::Keyword(Kw::Ilike) => {
+ if BP_COMPARE < min_bp {
+ return Ok(None);
+ }
+ self.bump()?;
+ self.bump()?;
+ let rhs = self.parse_expr_bp(BP_COMPARE + 1)?;
+ let prev = lhs.take();
+ *lhs = emit::compare(prev, "not ilike", rhs);
+ Ok(Some(true))
+ }
+ _ => Ok(None),
+ },
+ // `[e] BETWEEN low AND high`
+ TokenKind::Keyword(Kw::Between) => {
+ if BP_BETWEEN < min_bp {
+ return Ok(None);
+ }
+ self.bump()?;
+ let (low, high, hoisted) = self.parse_between_body(min_bp)?;
+ let prev = lhs.take();
+ // The inner BetweenExpr's structural end is `high.end`, not `self.last_consumed_end`.
+ // When `parse_between_body`'s WIDE arm absorbs a nested BETWEEN and the split hoists
+ // it back out (`BetweenHoist::Between`), `last_consumed_end` is past the high we'll
+ // actually use; mirror cpp's per-ctx span by reading the end off `high` directly.
+ let high_end = high.get("end").cloned();
+ let between_inner = emit::between(prev, low, high, false);
+ let mut between = match high_end {
+ Some(end) => emit::with_pos(between_inner, self.pos_obj(lhs_start), end),
+ None => self.wrap_pos(between_inner, lhs_start),
+ };
+ for hoist in hoisted {
+ between = apply_between_hoist(between, hoist);
+ }
+ *lhs = between;
+ Ok(Some(true))
+ }
+ // `[e] IN ...` (plain, no NOT)
+ TokenKind::Keyword(Kw::In) => {
+ if BP_COMPARE < min_bp {
+ return Ok(None);
+ }
+ // The structural `IN` separating a PIVOT/UNPIVOT
+ // operand from its `( columnExprList )` values — yield
+ // it back so the caller consumes it.
+ if Some(self.peek0.start) == self.pivot_in_stop {
+ return Ok(None);
+ }
+ self.bump()?;
+ let cohort = self.try_consume_cohort_marker()?;
+ let rhs = self.parse_expr_bp(BP_COMPARE + 1)?;
+ let op = if cohort { "in cohort" } else { "in" };
+ let prev = lhs.take();
+ *lhs = emit::compare(prev, op, rhs);
+ Ok(Some(true))
+ }
+ TokenKind::Keyword(Kw::Like) => {
+ if BP_COMPARE < min_bp {
+ return Ok(None);
+ }
+ self.bump()?;
+ let rhs = self.parse_expr_bp(BP_COMPARE + 1)?;
+ let prev = lhs.take();
+ *lhs = emit::compare(prev, "like", rhs);
+ Ok(Some(true))
+ }
+ TokenKind::Keyword(Kw::Ilike) => {
+ if BP_COMPARE < min_bp {
+ return Ok(None);
+ }
+ self.bump()?;
+ let rhs = self.parse_expr_bp(BP_COMPARE + 1)?;
+ let prev = lhs.take();
+ *lhs = emit::compare(prev, "ilike", rhs);
+ Ok(Some(true))
+ }
+ // `e IGNORE NULLS` is a postfix that the C++ visitor drops
+ // entirely — the expression returns as-is. Detect via two-token
+ // peek so we don't accidentally consume `IGNORE` mid-stream.
+ TokenKind::Keyword(Kw::Ignore) if self.peek_next() == TokenKind::Keyword(Kw::Nulls) => {
+ if BP_IS_NULL < min_bp {
+ return Ok(None);
+ }
+ self.bump()?;
+ self.bump()?;
+ *lhs = emit::ignore_nulls(lhs.take());
+ Ok(Some(true))
+ }
+
+ // Ternary `? a : b` (right-assoc; rhs recurses at the same bp).
+ TokenKind::QMark => {
+ if BP_TERNARY < min_bp {
+ return Ok(None);
+ }
+ self.bump()?;
+ let then_branch = self.parse_expr_bp(0)?;
+ self.expect(TokenKind::Colon, ":")?;
+ let else_branch = self.parse_expr_bp(BP_TERNARY)?;
+ let prev = lhs.take();
+ *lhs = emit::call("if", vec![prev, then_branch, else_branch]);
+ Ok(Some(true))
+ }
+ // `AS alias`
+ TokenKind::Keyword(Kw::As) => {
+ if BP_ALIAS < min_bp {
+ return Ok(None);
+ }
+ // Bail when this AS is the CAST argument separator —
+ // the columnExpr ends here and the CAST grammar
+ // consumes the AS itself.
+ if Some(self.peek0.start) == self.cast_as_stop {
+ return Ok(None);
+ }
+ // The alias-target slot is restricted to identifier /
+ // quoted-identifier / string literal (per grammar). The
+ // grammar's `identifier` rule excludes a set of reserved
+ // keywords (NULL/INF/NAN/EXCEPT/INTERSECT and the Hog-
+ // statement keywords) which `kw_valid_as_identifier`
+ // mirrors. TRUE/FALSE are also excluded but the existing
+ // `is_reserved_alias_name` check inside the fold raises
+ // a more specific "cannot be an alias" error for them,
+ // so we admit them through the gate and let the inner
+ // check produce that error. NULL is in both sets but the
+ // gate yields a useful error too.
+ let next_is_alias_target = match self.peek_next() {
+ TokenKind::Ident | TokenKind::QuotedIdent | TokenKind::String => true,
+ TokenKind::Keyword(kw) => {
+ kw_valid_as_identifier(kw) || matches!(kw, Kw::True | Kw::False | Kw::Null)
+ }
+ _ => false,
+ };
+ if !next_is_alias_target {
+ return Ok(None);
+ }
+ // `LAMBDA` after `AS` always starts a `lambdaExpr`
+ // (`LAMBDA identifier (COMMA identifier)* COMMA?
+ // COLON columnExpr`), not an alias name. cpp's ALL(*)
+ // sees the lambda body's `:` and backtracks the alias
+ // alt; Pratt can't, so refuse the alias here so the
+ // outer `INTERPOLATE (expr AS columnExpr)` form picks
+ // the AS up itself.
+ if matches!(self.peek_next(), TokenKind::Keyword(Kw::Lambda)) {
+ return Ok(None);
+ }
+ // `AS <ident> ->` is the arrow-form lambda. The single
+ // ident would otherwise look like a valid alias name,
+ // but it's actually the lambda's parameter list. Same
+ // ALL(*) backtrack reasoning as above.
+ if matches!(self.peek_next(), TokenKind::Ident | TokenKind::Keyword(_)) {
+ if let Ok(probe_tok) = {
+ let mut lex = Lexer::with_pos(self.src, self.peek1.end);
+ lex.next_token()
+ } {
+ if probe_tok.kind == TokenKind::Arrow {
+ return Ok(None);
+ }
+ }
+ }
+ self.bump()?;
+ let tok = self.bump()?;
+ let raw = self.text(tok);
+ let name = match tok.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent | TokenKind::Keyword(_) => {
+ identifier_text(raw, tok.kind)
+ }
+ TokenKind::String => unquote_single_string(raw),
+ _ => {
+ return Err(self.err(format!("expected alias after AS, got {:?}", tok.kind)))
+ }
+ };
+ // Reject unquoted reserved-keyword aliases. Quoted forms
+ // (`"true"` / `` `true` ``) opt out of the keyword check.
+ let is_quoted = matches!(tok.kind, TokenKind::QuotedIdent | TokenKind::String);
+ if !is_quoted && is_reserved_alias_name(&name) {
+ // C++ ANTLR spans this error from the start of the
+ // aliased expression through the alias token, matching
+ // the visitor's reported error range.
+ return Err(ParseError::syntax(
+ format!(
+ "\"{raw}\" cannot be an alias or identifier, as it's a reserved keyword"
+ ),
+ lhs_start,
+ tok.end,
+ ));
+ }
+ let prev = lhs.take();
+ *lhs = emit::alias(prev, &name);
+ Ok(Some(true))
+ }
+ _ => Ok(None),
+ }
+ }
+
+ /// Parse the body of a BETWEEN (`<low> AND <high>`). cpp's grammar
+ /// at line 285 is `columnExpr NOT? BETWEEN columnExpr AND columnExpr`,
+ /// left-recursive; the line-284 TODO acknowledges cpp's resolution is
+ /// "rightmost AND in body is the separator." Across body shapes:
+ ///
+ /// `a BETWEEN b AND c AND d` → low=And(b,c), high=d
+ /// `a NOT BETWEEN b AND c OR d` → low=b, high=Or(c,d)
+ /// `a BETWEEN y AS alias AND high` → low=Alias(y,alias), high=high
+ /// `a BETWEEN lambda y : a AND b AND high` → low=Lambda(y, And(a,b)), high=high
+ /// `a BETWEEN x ? y : c AND high` → low=if(x,y,c), high=high
+ /// `a BETWEEN name := value AND high` → low=NamedArg(name,value), high=high
+ /// `a BETWEEN b AND c ? then : else` → if(BETWEEN(a,b,c), then, else)
+ /// `a NBT b AND c NBT 4 AND 5` → BETWEEN(BETWEEN(a,b,c), 4, 5)
+ ///
+ /// Strategy: `try_alt` between two alternatives that cover this set.
+ ///
+ /// **Narrow alt** (`BP_BETWEEN + 1`): the body parse stops at any
+ /// operator with BP ≤ BP_BETWEEN — that's `TERNARY` (20), `ALIAS`
+ /// (10), and BETWEEN itself (30). Everything tighter (AND, OR,
+ /// comparison, arithmetic) chains into the body. The split then
+ /// peels the rightmost AND.
+ ///
+ /// The narrow alt handles the trailing-construct cases cleanly:
+ /// `a BTWN b AND c ? then : else` — body stops at `?`, returns
+ /// (b, c); the outer Pratt loop applies the ternary OUTSIDE the
+ /// BetweenExpr. `a NBT b AND c NBT 4 AND 5` — body stops at the
+ /// second NBT, returns (b, c); the outer Pratt loop chains a
+ /// second BETWEEN with the first as `.expr`. This is what made the
+ /// `BetweenWrap` machinery unnecessary.
+ ///
+ /// **Wide alt** (`BP = 0`): handles the cases where the construct
+ /// carrying the rightmost AND lives INSIDE the body — lambda's
+ /// expression slot (`lambda y : a AND b AND high`), named-arg's
+ /// value (`name := value AND high`), AS-alias's expression (`y AS
+ /// alias AND high`), ternary's else-arm (`x ? y : c AND high`).
+ /// `parse_expr_bp(0)` absorbs the lower-precedence wrappers; the
+ /// split's descent rules in `split_at_rightmost_and` then walk
+ /// into them to find the rightmost AND.
+ ///
+ /// Both alts share the same post-parse split + literal-AND
+ /// fallback; the difference is just the starting BP.
+ fn parse_between_body(&mut self, outer_min_bp: u8) -> Result<BetweenSplit, ParseError> {
+ // Depth-aware arm ordering:
+ // - OUTERMOST call (depth=0): WIDE first. The body greedy
+ // parse maximizes what's inside the OUTER BETWEEN; split
+ // reassociates via low-peel / expr-hoist / alias-hoist /
+ // ternary-hoist to produce cpp's shape.
+ // - NESTED call (depth>=1): NARROW first. Inside an outer
+ // body parse, a nested BETWEEN must NOT consume the outer's
+ // trailing ternary / AND / etc. — cpp's left-recursive
+ // grammar gives each nested BETWEEN the SHORTEST body that
+ // lets the chain succeed.
+ //
+ // Arm ordering plus a hoist-compatibility filter on the WIDE
+ // arm together model cpp's ANTLR ALL(*) "longest-parse-that-
+ // lets-outer-succeed". WIDE explores the maximum body extent
+ // (BP=0). If the resulting split's hoist contains a wrapper
+ // whose precedence is below the outer context's `outer_min_bp`,
+ // the WIDE arm REJECTS — the outer context owns that wrapper.
+ // Example: in `x ? a : b BETWEEN c AND d AS al` with
+ // outer_min_bp=BP_TERNARY=20, WIDE absorbs `c AND d AS al`,
+ // splits to `(c, d, [Alias('al')])`. Alias' BP_ALIAS=10 <= 20,
+ // so the WIDE alt rejects and the next narrower arm runs at
+ // BP_ALIAS+1=11 (floored by outer_min_bp), which doesn't
+ // absorb AS — letting the outer Pratt apply Alias(if(...),
+ // al). For `... AS al AND y` (with a trailing AND), WIDE's
+ // split gives `(Alias(And(c,d), al), y, [])` — empty hoist,
+ // commit.
+ self.between_body_depth += 1;
+ let alt_bps: [u8; 3] = if self.between_body_depth == 1 {
+ [0, BP_ALIAS + 1, BP_BETWEEN + 1]
+ } else {
+ [BP_BETWEEN + 1, BP_ALIAS + 1, 0]
+ };
+ // Narrower arms still respect outer_min_bp via flooring — they
+ // serve as the fallback when WIDE rejects. WIDE itself is
+ // intentionally UN-floored so its hoist-compatibility check
+ // is the sole disambiguator at the top of the arm chain.
+ let floored: [u8; 3] = [
+ alt_bps[0],
+ alt_bps[1].max(outer_min_bp),
+ alt_bps[2].max(outer_min_bp),
+ ];
+ let result = self.try_alt(&[
+ &|p| Self::parse_between_body_arm_wide(p, floored[0], outer_min_bp),
+ &|p| Self::parse_between_body_arm(p, floored[1]),
+ &|p| Self::parse_between_body_arm(p, floored[2]),
+ ]);
+ self.between_body_depth -= 1;
+ result
+ }
+
+ /// Wide-arm wrapper: parses at the unfloored BP, then post-filters
+ /// the split's hoist by `outer_min_bp`. A hoist of type X with BP <=
+ /// outer_min_bp means the outer context wants to apply X itself,
+ /// not have it inside BETWEEN's hoist chain — so we REJECT this
+ /// arm and let `try_alt` fall to the next (narrower, floored) arm.
+ fn parse_between_body_arm_wide(
+ &mut self,
+ start_bp: u8,
+ outer_min_bp: u8,
+ ) -> Result<BetweenSplit, ParseError> {
+ let (low, high, hoisted) = Self::parse_between_body_arm(self, start_bp)?;
+ if hoisted.iter().any(|h| hoist_min_bp(h) <= outer_min_bp) {
+ return Err(
+ self.err("WIDE body hoist conflicts with outer precedence; falling through")
+ );
+ }
+ Ok((low, high, hoisted))
+ }
+
+ /// Shared body of `parse_between_body`'s two `try_alt` arms,
+ /// parameterized by the starting binding power. See
+ /// `parse_between_body` for the narrow/wide rationale.
+ fn parse_between_body_arm(&mut self, start_bp: u8) -> Result<BetweenSplit, ParseError> {
+ let chain = self.parse_expr_bp(start_bp)?;
+ if let Some((low, high, hoisted)) = split_at_rightmost_and(&chain) {
+ return Ok((low, high, hoisted));
+ }
+ // The body had no AND that the split could find — consume the
+ // mandatory literal AND and parse `high` directly. Reached for
+ // shapes like `a BETWEEN b AND c` parsed with the narrow alt
+ // where the body parse stopped at the AND (BP_AND=50 vs
+ // start_bp=31, both alts admit AND, so this branch is mostly a
+ // safety net for inputs where the rightmost-AND descent fails).
+ self.expect_kw(Kw::And, "AND")?;
+ let high = self.parse_expr_bp(BP_BETWEEN + 1)?;
+ Ok((chain, high, Vec::new()))
+ }
+}
+
+/// Can `tok` plausibly begin a CASE body? CASE accepts an optional
+/// scrutinee expression then `WHEN`. So a body-starter is either an
+/// expression starter or the WHEN keyword itself.
+fn can_start_case_body(tok: TokenKind) -> bool {
+ if tok == TokenKind::Keyword(Kw::When) {
+ return true;
+ }
+ peek_can_start_clause_body(tok) && !is_pure_infix_op(tok)
+}
+
+/// Can `tok` plausibly begin an INTERVAL value? Either an expression
+/// starter (Number, Ident, etc.) or a string literal (the combined
+/// `INTERVAL '5 day'` form).
+fn can_start_interval_value(tok: TokenKind) -> bool {
+ matches!(tok, TokenKind::String) || (peek_can_start_clause_body(tok) && !is_pure_infix_op(tok))
+}
+
+/// Is `tok` a pure infix operator that can never start an expression?
+/// Used to disambiguate keyword-as-Field from special-form-keyword:
+/// `interval := 5` should fall back to the named-argument identifier
+/// path because `:=` can't open an INTERVAL value, and similar for
+/// comparison / equality operators.
+fn is_pure_infix_op(tok: TokenKind) -> bool {
+ matches!(
+ tok,
+ TokenKind::ColonEquals
+ | TokenKind::EqDouble
+ | TokenKind::EqSingle
+ | TokenKind::NotEq
+ | TokenKind::Lt
+ | TokenKind::LtEq
+ | TokenKind::Gt
+ | TokenKind::GtEq
+ | TokenKind::Slash
+ | TokenKind::Percent
+ | TokenKind::RegexSingle
+ | TokenKind::RegexDouble
+ | TokenKind::IRegexSingle
+ | TokenKind::IRegexDouble
+ | TokenKind::NotRegex
+ | TokenKind::NotIRegex
+ | TokenKind::Concat
+ | TokenKind::Nullish
+ | TokenKind::Arrow
+ | TokenKind::DoubleColon
+ | TokenKind::Dot
+ | TokenKind::NullProperty
+ )
+}
+
+/// Can `tok` legitimately continue a FROM table reference — as an
+/// alias (Ident / QuotedIdent / alias-permitted keyword), an explicit
+/// `AS` keyword, table-function args (`(`), JOIN-chain prefix, or a
+/// FINAL / SAMPLE decoration? Used to detect when a FROM table cannot
+/// take its next token as a continuation, in which case cpp's ANTLR
+/// backtracks and treats the FROM as a Field identifier (so the
+/// following clause keyword introduces the actual clause).
+fn can_be_table_continuation(tok: TokenKind) -> bool {
+ match tok {
+ TokenKind::Ident
+ | TokenKind::QuotedIdent
+ | TokenKind::LParen
+ | TokenKind::Comma
+ | TokenKind::Keyword(Kw::As)
+ | TokenKind::Keyword(Kw::Final)
+ | TokenKind::Keyword(Kw::Sample)
+ | TokenKind::Keyword(Kw::Join)
+ | TokenKind::Keyword(Kw::Inner)
+ | TokenKind::Keyword(Kw::Outer)
+ | TokenKind::Keyword(Kw::Left)
+ | TokenKind::Keyword(Kw::Right)
+ | TokenKind::Keyword(Kw::Full)
+ | TokenKind::Keyword(Kw::Cross)
+ | TokenKind::Keyword(Kw::Anti)
+ | TokenKind::Keyword(Kw::Semi)
+ | TokenKind::Keyword(Kw::Asof)
+ | TokenKind::Keyword(Kw::Natural)
+ | TokenKind::Keyword(Kw::On)
+ | TokenKind::Keyword(Kw::Using)
+ | TokenKind::Keyword(Kw::Pivot)
+ | TokenKind::Keyword(Kw::Unpivot) => true,
+ // Alias-permitted keywords per kw_allowed_as_implicit_alias.
+ TokenKind::Keyword(
+ Kw::Ascending
+ | Kw::Cohort
+ | Kw::Date
+ | Kw::Descending
+ | Kw::Id
+ | Kw::Return
+ | Kw::Top
+ | Kw::Totals,
+ ) => true,
+ _ => false,
+ }
+}
+
+/// Is `tok` a keyword that, in clause position, normally introduces
+/// a SELECT clause? Used to gate the FROM+LIMIT/OFFSET disambiguation:
+/// `FROM limit prewhere x` keeps FROM as the clause (PREWHERE is a
+/// clause-introducer that wouldn't be a LIMIT-expression body), but
+/// `FROM limit 5` flips FROM to a Field because `5` clearly fills the
+/// LIMIT body.
+fn is_clause_introducer_kw(tok: TokenKind) -> bool {
+ matches!(
+ tok,
+ TokenKind::Keyword(Kw::From)
+ | TokenKind::Keyword(Kw::Where)
+ | TokenKind::Keyword(Kw::Prewhere)
+ | TokenKind::Keyword(Kw::Having)
+ | TokenKind::Keyword(Kw::Qualify)
+ | TokenKind::Keyword(Kw::Group)
+ | TokenKind::Keyword(Kw::Order)
+ | TokenKind::Keyword(Kw::Window)
+ | TokenKind::Keyword(Kw::Limit)
+ | TokenKind::Keyword(Kw::Offset)
+ | TokenKind::Keyword(Kw::Sample)
+ | TokenKind::Keyword(Kw::Settings)
+ | TokenKind::Keyword(Kw::Union)
+ | TokenKind::Keyword(Kw::Intersect)
+ | TokenKind::Keyword(Kw::Except)
+ | TokenKind::Keyword(Kw::Using)
+ | TokenKind::Keyword(Kw::On)
+ | TokenKind::Keyword(Kw::Join)
+ | TokenKind::Keyword(Kw::Inner)
+ | TokenKind::Keyword(Kw::Outer)
+ | TokenKind::Keyword(Kw::Left)
+ | TokenKind::Keyword(Kw::Right)
+ | TokenKind::Keyword(Kw::Full)
+ | TokenKind::Keyword(Kw::Cross)
+ | TokenKind::Keyword(Kw::Anti)
+ | TokenKind::Keyword(Kw::Semi)
+ | TokenKind::Keyword(Kw::Asof)
+ | TokenKind::Keyword(Kw::Natural)
+ | TokenKind::Keyword(Kw::Rollup)
+ | TokenKind::Keyword(Kw::Cube)
+ | TokenKind::Keyword(Kw::Grouping)
+ | TokenKind::Keyword(Kw::Sets)
+ | TokenKind::Keyword(Kw::Final)
+ )
+}
+
+/// Could `tok` plausibly begin the body of a clause that the preceding
+/// clause keyword introduces? Conservative — returns `true` for any
+/// expression-starter / table-reference-starter, and `false` for hard
+/// list-terminators and other clause keywords. Used to distinguish
+/// "real clause start" from "this clause keyword is acting as a
+/// Field identifier" in column-position lookahead.
+fn peek_can_start_clause_body(tok: TokenKind) -> bool {
+ match tok {
+ // Hard list-terminators — never a clause body.
+ TokenKind::Eof
+ | TokenKind::RParen
+ | TokenKind::RBracket
+ | TokenKind::RBrace
+ | TokenKind::Comma
+ | TokenKind::Semicolon => false,
+ // Another clause keyword can't start the previous clause's
+ // body — the previous keyword must be a Field. (`BY` is
+ // whitelisted because some clause keywords legitimately have
+ // it as their second token, e.g. `LIMIT a BY b` body.)
+ TokenKind::Keyword(kw) => {
+ matches!(
+ kw,
+ // Expression-starter keywords — fine as clause body.
+ Kw::Case
+ | Kw::Cast
+ | Kw::TryCast
+ | Kw::Lambda
+ | Kw::Interval
+ | Kw::Columns
+ | Kw::Not
+ | Kw::True
+ | Kw::False
+ | Kw::Null
+ | Kw::Inf
+ | Kw::Nan
+ | Kw::Distinct
+ | Kw::Array
+ | Kw::Trim
+ | Kw::Select
+ | Kw::With
+ | Kw::By
+ | Kw::Recursive
+ ) || crate::parse::kw_acts_as_ident_in_primary(kw)
+ }
+ // A pure infix / postfix operator token (`?.`, `::`, `%`,
+ // `=`, `->`, `.`, …) can never *start* a clause body — it
+ // needs a left operand. (`+` / `-` / `*` are excluded from
+ // `is_pure_infix_op` since they double as prefix / spread, so
+ // they stay valid starters.)
+ _ if is_pure_infix_op(tok) => false,
+ // Everything else (Number, String, Ident, LParen, LBracket,
+ // LBrace, +/-, * (asterisk-spread), `#` placeholder, …) is a
+ // fine starter.
+ _ => true,
+ }
+}
+
+/// One outer wrapper that the caller of `parse_between_body` should
+/// apply around the built BetweenExpr, in order (innermost first).
+/// Used to reassemble cpp's shape when Pratt's greedy body parse
+/// absorbed something that cpp's left-recursive grammar would have
+/// folded OUTSIDE the BETWEEN.
+///
+/// - `Alias(name)` — `BETWEEN body AND high AS alias` puts the alias
+/// on the BetweenExpr (BETWEEN binds tighter than alias-postfix).
+/// - `Between { low, high, negated }` — chained `<X> BETWEEN body1
+/// AND high1 BETWEEN body2 AND high2` builds left-recursively, so
+/// the SECOND BETWEEN wraps the FIRST. When the FIRST's body parse
+/// greedily consumed the second BETWEEN, we hoist the second out
+/// to be applied to the outer BetweenExpr the caller will build.
+/// - `Ternary { then_branch, else_branch }` — `(BETWEEN body AND
+/// high) ? then : else` parses with BETWEEN binding tighter than
+/// ternary, so the ternary wraps the BetweenExpr. When the body
+/// parse absorbed the AND inside an if-call's cond (`if(And(low,
+/// high), then, else)`), we hoist the ternary's then/else out to
+/// wrap the BetweenExpr the caller builds.
+#[derive(Debug, Clone)]
+pub(crate) enum BetweenHoist {
+ Alias(String),
+ Between {
+ low: Value,
+ high: Value,
+ negated: bool,
+ },
+ Ternary {
+ then_branch: Value,
+ else_branch: Value,
+ },
+ /// `Or(left_siblings ... , <expr>, right_siblings ...)` — the
+ /// greedy body parse absorbed an OR whose AND-carrying child sits
+ /// inside a looser wrapper (Alias / Lambda / NamedArg / Ternary).
+ /// cpp's left-recursive grammar treats the wrapper as terminating
+ /// BETWEEN's high body, so the OR (and its siblings) become an
+ /// outer wrapper around the alias-wrapped BetweenExpr.
+ Or {
+ left_siblings: Vec<Value>,
+ right_siblings: Vec<Value>,
+ },
+ /// `IsDistinctFrom(<expr>, right, negated?)` — `BETWEEN body AND
+ /// high AS al IS [NOT] DISTINCT FROM rhs` parses with the IS
+ /// DISTINCT FROM as the OUTERMOST node when an AS-alias sits
+ /// between BETWEEN's high and the IS DISTINCT FROM (the alias
+ /// terminates BETWEEN's high body, and IS DISTINCT FROM applies
+ /// to the alias-wrapped BetweenExpr).
+ IsDistinctFrom {
+ right: Value,
+ negated: bool,
+ },
+ /// `IsNull(<expr>, negated?)` — `BETWEEN body AND high AS al IS
+ /// [NOT] NULL` has the same shape: alias terminates body, IS NULL
+ /// applies to the alias-wrapped BetweenExpr.
+ IsNull {
+ negated: bool,
+ },
+ /// `ArrayAccess(<expr>, property, nullish?)` — postfix `[…]`,
+ /// `.<ident>` (when re-rooted), or `?.<ident>` on top of an
+ /// alias-wrapped BetweenExpr. cpp's `ColumnExprArrayAccess` /
+ /// nullish-property forms apply at higher precedence than the
+ /// alias-wrap; when the body parse absorbed the access along
+ /// with the alias, we hoist it OUTSIDE the alias around the
+ /// BetweenExpr.
+ ArrayAccess {
+ property: Value,
+ nullish: bool,
+ },
+ /// `ExprCall(<expr>, args)` — postfix `(<args>)` on top of the
+ /// alias-wrapped BetweenExpr. cpp's `ColumnExprCall` at
+ /// BP_POSTFIX=130 wraps OUTSIDE BetweenExpr (BP_BETWEEN=30);
+ /// when the WIDE body parse absorbed the call along with an
+ /// inner Alias / Lambda layer carrying the BETWEEN-separator AND,
+ /// the ExprCall hoists out alongside the alias to wrap the
+ /// final BetweenExpr.
+ ExprCall {
+ args: Vec<Value>,
+ },
+ /// `TypeCast(<expr>, "<type-ident>")` — postfix `:: <type>` at
+ /// BP_POSTFIX=130. Same hoisting rationale as ExprCall: the
+ /// type-cast attaches OUTSIDE the BetweenExpr after the inner
+ /// AND-bearing wrapper chain is peeled.
+ TypeCast {
+ type_name: Value,
+ },
+ /// `TupleAccess(<tuple>, index, nullish?)` — postfix `.<NUMBER>`
+ /// / `?.<NUMBER>` at BP_POSTFIX=130. Same hoisting rationale as
+ /// ArrayAccess (which carries the `.<ident>` / `?.<ident>` /
+ /// `[<expr>]` cases). cpp lowers the two postfix families to
+ /// different nodes (`TupleAccess` vs `ArrayAccess`) so we keep
+ /// them as separate hoist variants rather than collapsing.
+ TupleAccess {
+ index: i64,
+ nullish: bool,
+ },
+ /// `ArithmeticOperation(<expr>, op, right)` — a binary arith op
+ /// whose AND was buried in its LEFT side (typically via an
+ /// alias-around-And chain inside the .left). The arith op
+ /// attaches OUTSIDE the BetweenExpr after the alias-wrapped
+ /// And-chain is peeled. (The MIRRORED case of arith with AND in
+ /// its RIGHT — `between c and ({}) * lambda q : ... and 999999`
+ /// — is handled by the `.right`-descent branch in
+ /// `split_at_rightmost_and` which keeps the arith node in place
+ /// rather than hoisting.)
+ ArithmeticOperation {
+ op: String,
+ right: Value,
+ },
+}
+
+/// Result of finding the BETWEEN separator AND inside a greedy body
+/// parse. `hoisted` wrappers are applied around the BetweenExpr by
+/// the caller of `parse_between_body`, innermost first.
+type BetweenSplit = (Value, Value, Vec<BetweenHoist>);
+
+/// The lowest binding power at which this hoist's outer wrapper can
+/// fire. Used by `parse_between_body_arm_wide` to detect when an
+/// outer Pratt context (the parent caller of `parse_between_body`)
+/// would itself claim the wrapper — in which case the WIDE arm must
+/// reject so the wrapper attaches at the outer level instead of
+/// being applied INSIDE the BETWEEN.
+fn hoist_min_bp(hoist: &BetweenHoist) -> u8 {
+ match hoist {
+ BetweenHoist::Alias(_) => BP_ALIAS,
+ BetweenHoist::Ternary { .. } => BP_TERNARY,
+ BetweenHoist::Between { .. } => BP_BETWEEN,
+ BetweenHoist::Or { .. } => BP_OR,
+ BetweenHoist::IsDistinctFrom { .. } => BP_IS_DISTINCT_FROM,
+ BetweenHoist::IsNull { .. } => BP_IS_NULL,
+ BetweenHoist::ArrayAccess { .. } => BP_POSTFIX,
+ BetweenHoist::ExprCall { .. } => BP_POSTFIX,
+ BetweenHoist::TypeCast { .. } => BP_POSTFIX,
+ BetweenHoist::TupleAccess { .. } => BP_POSTFIX,
+ // Arith hoists conservatively assume MULT (the tightest of
+ // the binary arith family). If the WIDE arm absorbed a /+
+ // -/concat/mod with the AND inside its left, we'd still want
+ // to hoist — using the lowest member (additive at 100) would
+ // still be above BP_BETWEEN so the gating check rarely
+ // affects this hoist either way.
+ BetweenHoist::ArithmeticOperation { .. } => BP_ADDITIVE,
+ }
+}
+
+/// Apply one outer wrapper around an in-progress BetweenExpr.
+fn apply_between_hoist(expr: Value, hoist: BetweenHoist) -> Value {
+ match hoist {
+ BetweenHoist::Alias(name) => emit::alias(expr, &name),
+ BetweenHoist::Between { low, high, negated } => emit::between(expr, low, high, negated),
+ BetweenHoist::Ternary {
+ then_branch,
+ else_branch,
+ } => emit::call("if", vec![expr, then_branch, else_branch]),
+ BetweenHoist::Or {
+ left_siblings,
+ right_siblings,
+ } => {
+ let mut all: Vec<Value> = left_siblings;
+ all.push(expr);
+ all.extend(right_siblings);
+ emit::or_(all)
+ }
+ BetweenHoist::IsDistinctFrom { right, negated } => {
+ serde_json::json!({
+ "node": "IsDistinctFrom",
+ "left": expr,
+ "right": right,
+ "negated": negated,
+ })
+ }
+ BetweenHoist::IsNull { negated } => emit::compare_is_null(expr, negated),
+ BetweenHoist::ArrayAccess { property, nullish } => {
+ let mut obj = serde_json::Map::new();
+ obj.insert("node".into(), Value::String("ArrayAccess".into()));
+ obj.insert("array".into(), expr);
+ obj.insert("property".into(), property);
+ if nullish {
+ obj.insert("nullish".into(), Value::Bool(true));
+ }
+ Value::Object(obj)
+ }
+ BetweenHoist::ExprCall { args } => {
+ let mut obj = serde_json::Map::new();
+ obj.insert("node".into(), Value::String("ExprCall".into()));
+ obj.insert("expr".into(), expr);
+ obj.insert("args".into(), Value::Array(args));
+ Value::Object(obj)
+ }
+ BetweenHoist::TypeCast { type_name } => {
+ // Reconstruct the TypeCast node the WIDE parse produced.
+ // Inner field is `expr`; the type identifier is on
+ // `type_name` (per cpp's `VISIT(ColumnTypeExprSimple)` —
+ // it deserialises to the Python dataclass field of the
+ // same name).
+ serde_json::json!({
+ "node": "TypeCast",
+ "expr": expr,
+ "type_name": type_name,
+ })
+ }
+ BetweenHoist::TupleAccess { index, nullish } => {
+ // cpp's `VISIT(ColumnExprTupleAccess)` emits the inner
+ // expression on the `tuple` field, and the dot-number
+ // index on `index`. Mirror that.
+ let mut obj = serde_json::Map::new();
+ obj.insert("node".into(), Value::String("TupleAccess".into()));
+ obj.insert("tuple".into(), expr);
+ obj.insert("index".into(), serde_json::Value::from(index));
+ if nullish {
+ obj.insert("nullish".into(), Value::Bool(true));
+ }
+ Value::Object(obj)
+ }
+ BetweenHoist::ArithmeticOperation { op, right } => {
+ serde_json::json!({
+ "node": "ArithmeticOperation",
+ "left": expr,
+ "right": right,
+ "op": op,
+ })
+ }
+ }
+}
+
+/// Stamp `start` / `end` on a synthetic And/Or built by
+/// `split_at_rightmost_and` from a slice of pre-positioned children.
+/// `emit::and_` / `emit::or_` produce position-less JSON; an outer
+/// `wrap_pos` would catch the BETWEEN-level wrap but not the inner
+/// synthetic And/Or that lives inside BetweenExpr's `low` or `high`,
+/// because BetweenExpr's `low` / `high` are direct fields (not nested
+/// expressions that the pratt loop wraps). Derive the span from the
+/// first child's `start` and the last child's `end` so the inner
+/// synthetic node carries a non-null span.
+fn stamp_span_from_children(mut node: Value, children: &[Value]) -> Value {
+ if children.is_empty() {
+ return node;
+ }
+ let start = children[0].get("start").cloned();
+ let end = children[children.len() - 1].get("end").cloned();
+ if let Some(obj) = node.as_object_mut() {
+ if let Some(s) = start {
+ obj.insert("start".into(), s);
+ }
+ if let Some(e) = end {
+ obj.insert("end".into(), e);
+ }
+ }
+ node
+}
+
+/// Walk an already-parsed boolean tree to find the rightmost AND in
+/// source order and split there. Returns `(left_of_and, right_of_and)`.
+/// Used by `parse_between_body` to apply ANTLR's "rightmost AND is the
+/// separator" resolution to a tree we built greedily.
+///
+/// Walking semantics:
+/// - An `And` node IS the AND. Peel the last operand: `low =
+/// And(exprs[:-1])` (collapsed when length 2), `high = exprs[-1]`.
+/// - An `Or` node defers — walk children right-to-left so we find the
+/// *latest* AND-bearing child. Reconstruct the Or above the split.
+/// - Anything else has no AND in it; return None.
+fn split_at_rightmost_and(node: &Value) -> Option<BetweenSplit> {
+ let node_name = node.get("node").and_then(Value::as_str);
+ if node_name == Some("And") {
+ let exprs = node.get("exprs").and_then(Value::as_array).cloned()?;
+ if exprs.len() < 2 {
+ return None;
+ }
+ // Try descending the LAST element first — it may itself contain
+ // a deeper AND that's the rightmost in source order. e.g.
+ // `(a) * b AND c := d AND e` parses as
+ // `And(Arith, NamedArg(c, And(d, e)))`; the rightmost source
+ // AND is between `d` and `e` (inside NamedArg.value). cpp
+ // splits there, leaving NamedArg.value=d and using `e` as the
+ // outer high. Without this descent we'd just pop the last
+ // element (NamedArg) wholesale and lose that AND.
+ if let Some((deep_left, deep_right, hoisted)) =
+ split_at_rightmost_and(&exprs[exprs.len() - 1])
+ {
+ let mut new_exprs = exprs.clone();
+ let last_idx = new_exprs.len() - 1;
+ new_exprs[last_idx] = deep_left;
+ let new_left = if new_exprs.len() == 1 {
+ new_exprs.into_iter().next().unwrap()
+ } else {
+ let synthetic = emit::and_(new_exprs.clone());
+ stamp_span_from_children(synthetic, &new_exprs)
+ };
+ return Some((new_left, deep_right, hoisted));
+ }
+ // No deeper AND in the last element — pop it as the split.
+ let mut exprs = exprs;
+ let right = exprs.pop().unwrap();
+ let left = if exprs.len() == 1 {
+ exprs.pop().unwrap()
+ } else {
+ let synthetic = emit::and_(exprs.clone());
+ stamp_span_from_children(synthetic, &exprs)
+ };
+ return Some((left, right, Vec::new()));
+ }
+ if node_name == Some("Or") {
+ let exprs = node.get("exprs").and_then(Value::as_array).cloned()?;
+ for i in (0..exprs.len()).rev() {
+ if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(&exprs[i]) {
+ if hoisted.is_empty() {
+ // AND was found directly inside the Or's child (no
+ // looser-wrapper between them). cpp's grammar lets
+ // BETWEEN's high absorb the OR, so left/right
+ // children flow into the high alongside the descent
+ // result. `x BETWEEN low AND high OR rest` →
+ // BETWEEN(x, low, Or(high, rest)).
+ let mut left_children: Vec<Value> = exprs[..i].to_vec();
+ left_children.push(left_in);
+ let left = if left_children.len() == 1 {
+ left_children.pop().unwrap()
+ } else {
+ let synthetic = emit::or_(left_children.clone());
+ stamp_span_from_children(synthetic, &left_children)
+ };
+ let mut right_children: Vec<Value> = Vec::with_capacity(exprs.len() - i);
+ right_children.push(right_in);
+ right_children.extend_from_slice(&exprs[i + 1..]);
+ let right = if right_children.len() == 1 {
+ right_children.pop().unwrap()
+ } else {
+ let synthetic = emit::or_(right_children.clone());
+ stamp_span_from_children(synthetic, &right_children)
+ };
+ return Some((left, right, hoisted));
+ }
+ // The descent passed THROUGH a looser wrapper (Alias /
+ // Lambda / NamedArg / Ternary). cpp treats the wrapper
+ // as terminating BETWEEN's high body, so the OR (and
+ // its siblings) hoist OUTSIDE the wrapper rather than
+ // being absorbed into the high. Pushing the Or hoist
+ // AFTER `hoisted` puts it OUTSIDE the wrappers the
+ // descent has accumulated.
+ let left_siblings: Vec<Value> = exprs[..i].to_vec();
+ let right_siblings: Vec<Value> = exprs[i + 1..].to_vec();
+ if !left_siblings.is_empty() || !right_siblings.is_empty() {
+ hoisted.push(BetweenHoist::Or {
+ left_siblings,
+ right_siblings,
+ });
+ }
+ return Some((left_in, right_in, hoisted));
+ }
+ }
+ }
+ // Wrappers whose rightmost expression slot can contain the AND
+ // that ALL(*) treats as BETWEEN's separator. Recurse, then
+ // reconstruct the wrapper around the left side; the right side
+ // surfaces as BETWEEN's high.
+ //
+ // - Lambda.expr — bare-list / parens / colon lambda bodies.
+ // - NamedArgument.value — `name := body AND high`.
+ // - Call(name='if').args[2] — `cond ? then : else AND high` (the
+ // ternary lowers to an `if` call with else in args[2]).
+ // - Alias.expr — `body AND high AS outer` (greedy parse wraps the
+ // AND in an Alias). cpp's grammar has BETWEEN at higher
+ // precedence than alias-postfix, so the alias goes OUTSIDE the
+ // BetweenExpr. Descend through the Alias and HOIST its name to
+ // the caller's outer-wrap list.
+ if node_name == Some("Lambda") {
+ if let Some(inner) = node.get("expr") {
+ if let Some((left_in, right_in, hoisted)) = split_at_rightmost_and(inner) {
+ let mut new_node = node.as_object()?.clone();
+ new_node.insert("expr".into(), left_in);
+ return Some((Value::Object(new_node), right_in, hoisted));
+ }
+ }
+ }
+ // `Not(expr)` — same shape as Lambda. The AND-reservation context
+ // for BETWEEN's body must pass *through* a NOT prefix into the
+ // wrapped expression. `a BETWEEN NOT lambda x : b AND c` parses
+ // as `Not(Lambda(x, And(b, c)))` greedily; descending into
+ // `Not.expr` peels the AND off so the outer BETWEEN sees its own
+ // `low = Not(Lambda(x, b))`, `high = c` split.
+ if node_name == Some("Not") {
+ if let Some(inner) = node.get("expr") {
+ if let Some((left_in, right_in, hoisted)) = split_at_rightmost_and(inner) {
+ let mut new_node = node.as_object()?.clone();
+ new_node.insert("expr".into(), left_in);
+ return Some((Value::Object(new_node), right_in, hoisted));
+ }
+ }
+ }
+ // ArithmeticOperation has two slots that can carry the BETWEEN-
+ // separator AND, and the two shapes need DIFFERENT handling:
+ //
+ // 1. AND in `.right` (typically buried under a BP-resetting
+ // wrapper like Lambda.expr or NamedArgument.value): the arith
+ // op STAYS in place wrapping a piece of the BETWEEN LOW.
+ // Example: `BETWEEN columns(*) AND {} * lambda q : ... AND
+ // 999999` — the deepest source AND is inside Lambda's body
+ // under Mul.right; the Mul itself belongs to the LOW.
+ //
+ // 2. AND in `.left` (typically via an Alias-around-And chain
+ // inside the arith's left operand): the arith op HOISTS
+ // outside the BetweenExpr. Example: `BETWEEN (1) AS p AND 2
+ // AS al * y` — the rightmost AND is between `(1) as p` and
+ // `2 as al`; the trailing `* y` wraps the BetweenExpr after
+ // the inner alias's hoist applies.
+ //
+ // Try `.right` first (keep in place); on failure try `.left`
+ // (hoist via BetweenHoist::ArithmeticOperation). The order
+ // matters: when both slots could contain the AND (rare but
+ // possible), cpp prefers the rightmost-in-source which lives in
+ // `.right`.
+ if node_name == Some("ArithmeticOperation") {
+ if let Some(inner) = node.get("right") {
+ if let Some((left_in, right_in, hoisted)) = split_at_rightmost_and(inner) {
+ let mut new_node = node.as_object()?.clone();
+ new_node.insert("right".into(), left_in);
+ return Some((Value::Object(new_node), right_in, hoisted));
+ }
+ }
+ if let Some(inner) = node.get("left") {
+ if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(inner) {
+ let op = node
+ .get("op")
+ .and_then(Value::as_str)
+ .unwrap_or("")
+ .to_string();
+ let right = node.get("right").cloned().unwrap_or(Value::Null);
+ hoisted.push(BetweenHoist::ArithmeticOperation { op, right });
+ return Some((left_in, right_in, hoisted));
+ }
+ }
+ }
+ if node_name == Some("NamedArgument") {
+ if let Some(inner) = node.get("value") {
+ if let Some((left_in, right_in, hoisted)) = split_at_rightmost_and(inner) {
+ let mut new_node = node.as_object()?.clone();
+ new_node.insert("value".into(), left_in);
+ return Some((Value::Object(new_node), right_in, hoisted));
+ }
+ }
+ }
+ if node_name == Some("Call") && node.get("name").and_then(Value::as_str) == Some("if") {
+ if let Some(args) = node.get("args").and_then(Value::as_array) {
+ if args.len() == 3 {
+ // Try the else-branch (args[2]) first: `cond ? then :
+ // else AND high` parses with else absorbing the AND;
+ // we peel and rewrap the if-call.
+ if let Some((left_in, right_in, hoisted)) = split_at_rightmost_and(&args[2]) {
+ let mut new_args = args.clone();
+ new_args[2] = left_in;
+ let mut new_node = node.as_object()?.clone();
+ new_node.insert("args".into(), Value::Array(new_args));
+ return Some((Value::Object(new_node), right_in, hoisted));
+ }
+ // Try the cond (args[0]): `(BETWEEN body AND high) ?
+ // then : else` parses with the AND inside the cond of
+ // an outer ternary. Hoist the ternary's then/else
+ // OUTSIDE the BETWEEN — cpp puts ternary at lower
+ // precedence than BETWEEN, so the if-call wraps the
+ // BetweenExpr the caller builds. The if-call node
+ // itself dissolves: its then/else go to the hoist, its
+ // cond's split becomes BETWEEN's low/high.
+ if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(&args[0]) {
+ hoisted.push(BetweenHoist::Ternary {
+ then_branch: args[1].clone(),
+ else_branch: args[2].clone(),
+ });
+ return Some((left_in, right_in, hoisted));
+ }
+ }
+ }
+ }
+ if node_name == Some("Alias") {
+ if let Some(inner) = node.get("expr") {
+ if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(inner) {
+ // Hoist *this* alias name. Caller wraps BetweenExpr
+ // with each hoisted item in order (innermost first),
+ // which matches cpp's `Alias(BetweenExpr(...),
+ // outer_name)` shape.
+ let name = node
+ .get("alias")
+ .and_then(Value::as_str)
+ .unwrap_or("")
+ .to_string();
+ hoisted.push(BetweenHoist::Alias(name));
+ return Some((left_in, right_in, hoisted));
+ }
+ }
+ }
+ // `IsDistinctFrom(left, right, negated)` and `CompareOperation`
+ // with `is_null_comparison_style=true` (the IS NULL postfix
+ // representation) are TIGHTER than BETWEEN in cpp's grammar, BUT
+ // when their `left` contains an alias-wrapped And-chain, the
+ // alias terminates BETWEEN's body and the IS DISTINCT FROM / IS
+ // NULL applies OUTSIDE the alias-wrapped BetweenExpr. Recurse
+ // into `left`; on a successful descent (which will hoist the
+ // intermediate Alias), hoist the IS-postfix itself AFTER the
+ // accumulated wrappers so it ends up OUTERMOST around the
+ // alias-wrapped BetweenExpr the caller will build.
+ if node_name == Some("IsDistinctFrom") {
+ if let Some(inner) = node.get("left") {
+ if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(inner) {
+ let right = node.get("right").cloned().unwrap_or(Value::Null);
+ let negated = node
+ .get("negated")
+ .and_then(Value::as_bool)
+ .unwrap_or(false);
+ hoisted.push(BetweenHoist::IsDistinctFrom { right, negated });
+ return Some((left_in, right_in, hoisted));
+ }
+ }
+ }
+ if node_name == Some("CompareOperation")
+ && node
+ .get("is_null_comparison_style")
+ .and_then(Value::as_bool)
+ == Some(true)
+ {
+ if let Some(inner) = node.get("left") {
+ if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(inner) {
+ // `op` is "==" for IS NULL, "!=" for IS NOT NULL.
+ let negated = node.get("op").and_then(Value::as_str) == Some("!=");
+ hoisted.push(BetweenHoist::IsNull { negated });
+ return Some((left_in, right_in, hoisted));
+ }
+ }
+ }
+ // `ArrayAccess(<expr>, property, nullish?)` — postfix `[…]` /
+ // `.<ident>` / `?.<ident>` over an alias-wrapped And-chain.
+ // Descend through `array`; on success, hoist the access OUTSIDE
+ // the alias so it wraps the BetweenExpr the caller builds.
+ if node_name == Some("ArrayAccess") {
+ if let Some(inner) = node.get("array") {
+ if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(inner) {
+ let property = node.get("property").cloned().unwrap_or(Value::Null);
+ let nullish = node
+ .get("nullish")
+ .and_then(Value::as_bool)
+ .unwrap_or(false);
+ hoisted.push(BetweenHoist::ArrayAccess { property, nullish });
+ return Some((left_in, right_in, hoisted));
+ }
+ }
+ }
+ // `ExprCall(<expr>, args)` — postfix `(<args>)` at BP_POSTFIX=130
+ // on top of an alias-wrapped And-chain. Same hoisting pattern as
+ // ArrayAccess: descend through `.expr`, hoist the call OUTSIDE.
+ // Reaches cases like `x BETWEEN lambda k : 1 AND ((2)) AS 'a'
+ // (1)` where the WIDE body parse absorbs `(1)` as a postfix call
+ // on `Alias(And(1, (2)), 'a')`, burying the BETWEEN-separator
+ // AND inside the call's `.expr`.
+ if node_name == Some("ExprCall") {
+ if let Some(inner) = node.get("expr") {
+ if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(inner) {
+ let args = node
+ .get("args")
+ .and_then(Value::as_array)
+ .cloned()
+ .unwrap_or_default();
+ hoisted.push(BetweenHoist::ExprCall { args });
+ return Some((left_in, right_in, hoisted));
+ }
+ }
+ }
+ // `TypeCast(<expr>, type_name)` — postfix `:: <type>` at
+ // BP_POSTFIX=130. Same hoisting pattern as ExprCall.
+ if node_name == Some("TypeCast") {
+ if let Some(inner) = node.get("expr") {
+ if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(inner) {
+ let type_name = node.get("type_name").cloned().unwrap_or(Value::Null);
+ hoisted.push(BetweenHoist::TypeCast { type_name });
+ return Some((left_in, right_in, hoisted));
+ }
+ }
+ }
+ // `TupleAccess(<tuple>, index, nullish?)` — postfix `.<NUMBER>` /
+ // `?.<NUMBER>` at BP_POSTFIX=130. Same hoisting pattern as
+ // ArrayAccess but on a different node type with a different
+ // field name (`tuple` vs `array`, `index` vs `property`).
+ if node_name == Some("TupleAccess") {
+ if let Some(inner) = node.get("tuple") {
+ if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(inner) {
+ let index = node.get("index").and_then(Value::as_i64).unwrap_or(0);
+ let nullish = node
+ .get("nullish")
+ .and_then(Value::as_bool)
+ .unwrap_or(false);
+ hoisted.push(BetweenHoist::TupleAccess { index, nullish });
+ return Some((left_in, right_in, hoisted));
+ }
+ }
+ }
+ // BetweenExpr has TWO slots that can contain the AND we need.
+ // ORDER MATTERS — cpp prefers nested-via-low when both options
+ // are valid (e.g. `a BETWEEN b AND c BETWEEN d AND e AND f` →
+ // outer(a, inner(And(b,c), d, e), f) NOT chained):
+ //
+ // 1. `low` first: classic nested-via-low case (`x BETWEEN y
+ // BETWEEN z AND w AND v` → outer.low = BETWEEN(y, z, w),
+ // outer.high = v; or 3-AND case where the inner BETWEEN's
+ // low absorbs the extra AND). Peel one AND from inner.low:
+ // the peeled-off right operand becomes the new inner.high;
+ // the OLD inner.high surfaces as the outer's high. Recursion
+ // peels N-1 ANDs across N levels.
+ //
+ // 2. `expr` fallback: when inner.low has no AND, the greedy body
+ // parse must have consumed a later sibling BETWEEN with the
+ // AND-chain ending up in the embedded BetweenExpr's `expr`
+ // field. cpp parses that pattern LEFT-RECURSIVELY: the second
+ // (rightmost-source) BETWEEN wraps the first. Hoist the whole
+ // BetweenExpr's low / high / negated out so the caller wraps
+ // with a second BETWEEN. Example:
+ //
+ // `a NOT BETWEEN b ? c : d AND e NOT BETWEEN f AND g`
+ //
+ // Pratt builds body = if(b, c, BetweenExpr(expr=And(d,e),
+ // low=f, high=g, neg=true)). inner.low=f is a single field
+ // (no AND), so the `low` peel above fails. Fall through to
+ // `expr`: split And(d,e), hoist (f, g, neg=true).
+ if node_name == Some("BetweenExpr") {
+ if let (Some(inner_low), Some(inner_high)) = (node.get("low"), node.get("high")) {
+ if let Some((new_low, new_high, hoisted)) = split_at_rightmost_and(inner_low) {
+ let mut new_inner = node.as_object()?.clone();
+ new_inner.insert("low".into(), new_low);
+ new_inner.insert("high".into(), new_high);
+ return Some((Value::Object(new_inner), inner_high.clone(), hoisted));
+ }
+ }
+ if let Some(inner_expr) = node.get("expr") {
+ if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(inner_expr) {
+ let low = node.get("low").cloned().unwrap_or(Value::Null);
+ let high = node.get("high").cloned().unwrap_or(Value::Null);
+ let negated = node
+ .get("negated")
+ .and_then(Value::as_bool)
+ .unwrap_or(false);
+ hoisted.push(BetweenHoist::Between { low, high, negated });
+ return Some((left_in, right_in, hoisted));
+ }
+ }
+ }
+ None
+}
+
+/// True when `v` is a `Field` node with a single-element identifier
+/// chain. Used by `parse_expr_list_until_terminators` to detect
+/// speculatively-parsed clause keywords (e.g. `qualify`, `having`,
+/// `offset`) that resolved to a bare identifier and should NOT extend
+/// the column list — cpp backs off the comma and dispatches them as
+/// the next clause introducer.
+pub(crate) fn is_bare_field(v: &Value) -> bool {
+ let Some(obj) = v.as_object() else {
+ return false;
+ };
+ if obj.get("node").and_then(Value::as_str) != Some("Field") {
+ return false;
+ }
+ let Some(chain) = obj.get("chain").and_then(Value::as_array) else {
+ return false;
+ };
+ chain.len() == 1
+}
+
+/// Detect a ColumnsExpr produced by the bare-paren grammar alts
+/// `LPAREN ASTERISK [EXCLUDE(...)]? REPLACE(...) RPAREN`, whose ctx
+/// span includes the outer parens. Exclude-only `(* EXCLUDE(...))` is
+/// a regular `ColumnExprAsterisk` inside `ColumnExprParens` (paren
+/// pass-through), so we key off `replace` presence to identify the
+/// bare-paren form. The COLUMNS-prefixed `COLUMNS(* REPLACE(...))`
+/// variant takes a different parse path (it doesn't go through
+/// `parse_paren_or_tuple`), so this check is safe.
+fn is_paren_form_columns_replace(v: &Value) -> bool {
+ let Some(obj) = v.as_object() else {
+ return false;
+ };
+ if obj.get("node").and_then(Value::as_str) != Some("ColumnsExpr") {
+ return false;
+ }
+ if obj.get("all_columns").and_then(Value::as_bool) != Some(true) {
+ return false;
+ }
+ obj.get("replace").map(|v| !v.is_null()).unwrap_or(false)
+}
diff --git a/rust/hogql/parser/src/parse/hogqlx.rs b/rust/hogql/parser/src/parse/hogqlx.rs
new file mode 100644
index 000000000000..dff444a0e33e
--- /dev/null
+++ b/rust/hogql/parser/src/parse/hogqlx.rs
@@ -0,0 +1,328 @@
+//! HogQLX tag-element parsing — JSX-like `<Tag attr='v' >children</Tag>`
+//! and self-closing `<Tag />` syntax (grammar rules `hogqlxTagElement` /
+//! `hogqlxTagAttribute` / `hogqlxChildElement` / `hogqlxText`).
+//!
+//! Three contexts admit a tag:
+//! - top of a SELECT (`select: hogqlxTagElement`)
+//! - FROM table position (`tableExpr: hogqlxTagElement`)
+//! - column position (`columnExpr: hogqlxTagElement`)
+//!
+//! All three route to `parse_hogqlx_tag_element` after detecting
+//! `<Ident` at peek. Text content between tag bracket-`>` and the next
+//! `<` / `{` is scanned at the byte level (the lexer's whitespace skip
+//! would otherwise eat significant inter-token spaces in things like
+//! `<span>Hello World</span>`).
+//!
+//! cpp's emit:
+//! - `<Tag a='v' />` → HogQLXTag(kind="Tag", attributes=[Attr(a, Constant("v"))])
+//! - `<Tag a={e} />` → HogQLXTag(kind="Tag", attributes=[Attr(a, e)])
+//! - `<Tag a />` → HogQLXTag(kind="Tag", attributes=[Attr(a, Constant(true))])
+//! - `<Tag>x</Tag>` → HogQLXTag(..., attributes=[Attr("children", [Constant("x")])])
+//! - `<Tag></Tag>` → HogQLXTag(..., attributes=[]) (no children attr when empty)
+//!
+//! Ported verbatim from `parser_backtrack/src/parse/hogqlx.rs`; the
+//! Parser API is identical across the two backends so no rewrites are
+//! needed here.
+
+use serde_json::{json, Value};
+
+use super::{identifier_text, unquote_single_string, Parser};
+use crate::emit;
+use crate::error::ParseError;
+use crate::lex::TokenKind;
+
+impl<'a> Parser<'a> {
+ /// True when peek/peek_next look like the start of a HogQLX tag —
+ /// `<` followed by an identifier-or-keyword-acting-as-identifier.
+ /// `<` followed by anything else (most commonly an expression for
+ /// the `<` comparison operator) is NOT a tag.
+ pub(crate) fn peek_starts_hogqlx_tag(&self) -> bool {
+ if self.peek() != TokenKind::Lt {
+ return false;
+ }
+ matches!(
+ self.peek_next(),
+ TokenKind::Ident | TokenKind::QuotedIdent | TokenKind::Keyword(_)
+ )
+ }
+
+ /// Parse a HogQLX tag element starting at `<`.
+ ///
+ /// Handles both `<Tag attr* />` (self-closing) and
+ /// `<Tag attr*>children</Tag>` (nested). For nested form, validates
+ /// that opening and closing tag names match (cpp emits an
+ /// "Opening and closing HogQLX tags must match" error otherwise)
+ /// and auto-injects the `children` attribute from any parsed child
+ /// elements.
+ ///
+ /// Tolerate peek1 lex errors while parsing the tag (and any nested
+ /// tags): cpp's `HOGQLX_TEXT` lexer mode admits any byte except
+ /// `<` / `{` inside the body, but rust's mode-less lexer rejects
+ /// punctuation like `&` / `!` / `@` when pre-loading peek1 across
+ /// a `>` / `/>` / `</…>` boundary. `parse_hogqlx_children`
+ /// byte-walks the body directly and re-seeks the lexer via
+ /// `consume_hogqlx_text`, so peek1's transient invalid state is
+ /// recoverable.
+ pub(crate) fn parse_hogqlx_tag_element(&mut self) -> Result<Value, ParseError> {
+ self.hogqlx_text_lookahead_depth += 1;
+ let result = self.parse_hogqlx_tag_element_inner();
+ self.hogqlx_text_lookahead_depth -= 1;
+ result
+ }
+
+ fn parse_hogqlx_tag_element_inner(&mut self) -> Result<Value, ParseError> {
+ let tag_start = self.peek0.start;
+ self.expect(TokenKind::Lt, "<")?;
+ let kind = self.parse_hogqlx_identifier("tag name")?;
+ let mut attributes: Vec<Value> = Vec::new();
+ loop {
+ match self.peek() {
+ TokenKind::SlashGt => {
+ self.bump()?;
+ return Ok(self.wrap_pos(
+ json!({
+ "node": "HogQLXTag",
+ "kind": kind,
+ "attributes": attributes,
+ }),
+ tag_start,
+ ));
+ }
+ TokenKind::Gt => {
+ self.bump()?;
+ let children = self.parse_hogqlx_children()?;
+ self.expect(TokenKind::LtSlash, "</")?;
+ let close = self.parse_hogqlx_identifier("closing tag name")?;
+ if close != kind {
+ return Err(self.err(format!(
+ "Opening and closing HogQLX tags must match. Got {} and {}",
+ kind, close
+ )));
+ }
+ self.expect(TokenKind::Gt, ">")?;
+ if !children.is_empty() {
+ if attributes.iter().any(|a| {
+ a.as_object()
+ .and_then(|o| o.get("name").and_then(Value::as_str))
+ == Some("children")
+ }) {
+ return Err(self.err(
+ "Can't have a HogQLX tag with both children and a 'children' attribute",
+ ));
+ }
+ attributes.push(json!({
+ "node": "HogQLXAttribute",
+ "name": "children",
+ "value": children,
+ }));
+ }
+ return Ok(self.wrap_pos(
+ json!({
+ "node": "HogQLXTag",
+ "kind": kind,
+ "attributes": attributes,
+ }),
+ tag_start,
+ ));
+ }
+ TokenKind::Ident | TokenKind::QuotedIdent | TokenKind::Keyword(_) => {
+ attributes.push(self.parse_hogqlx_attribute()?);
+ }
+ TokenKind::Eof => {
+ return Err(self.err("unexpected end of input inside HogQLX tag"));
+ }
+ _ => {
+ return Err(self.err(format!(
+ "expected attribute name, `>`, or `/>` inside HogQLX tag, got {:?}",
+ self.peek()
+ )));
+ }
+ }
+ }
+ }
+
+ /// Parse one of:
+ /// - `name = 'string'` → HogQLXAttribute(name, Constant(string))
+ /// - `name = { expr }` → HogQLXAttribute(name, expr)
+ /// - `name` → HogQLXAttribute(name, Constant(true))
+ fn parse_hogqlx_attribute(&mut self) -> Result<Value, ParseError> {
+ let name = self.parse_hogqlx_identifier("attribute name")?;
+ // No `=` → bare attribute, value is Constant(true).
+ if self.peek() != TokenKind::EqDouble {
+ return Ok(json!({
+ "node": "HogQLXAttribute",
+ "name": name,
+ "value": emit::constant(Value::Bool(true)),
+ }));
+ }
+ self.bump()?; // `=`
+ let value = match self.peek() {
+ TokenKind::String => {
+ let t = self.bump()?;
+ emit::constant(Value::String(unquote_single_string(self.text(t))))
+ }
+ TokenKind::LBrace => {
+ self.bump()?;
+ let expr = self.parse_expr_bp(0)?;
+ self.expect(TokenKind::RBrace, "}")?;
+ expr
+ }
+ _ => {
+ return Err(self.err(format!(
+ "expected string literal or `{{expr}}` for attribute value, got {:?}",
+ self.peek()
+ )));
+ }
+ };
+ Ok(json!({
+ "node": "HogQLXAttribute",
+ "name": name,
+ "value": value,
+ }))
+ }
+
+ /// Read tag-body children until the closing `</`. Children are:
+ /// - nested tag elements (`<Inner ... >...</Inner>` / `<Inner />`)
+ /// - `{ expr }` blocks
+ /// - raw text — everything between tag-end-`>` (or the previous
+ /// child boundary) and the next `<` or `{`, byte-for-byte
+ ///
+ /// Text scanning uses the source's byte stream directly because the
+ /// lexer's whitespace skip would otherwise destroy significant
+ /// inter-token spacing (e.g. `Hello World`).
+ fn parse_hogqlx_children(&mut self) -> Result<Vec<Value>, ParseError> {
+ let mut children: Vec<Value> = Vec::new();
+ loop {
+ let text = self.consume_hogqlx_text()?;
+ // cpp's `VISIT(HogqlxTagElementNested)` drops child text
+ // runs that contain a newline AND are entirely whitespace —
+ // any pretty-printed multi-line HOGQLX literal lands here.
+ // Pure-space / pure-tab runs (no newline) are kept. Mixed
+ // whitespace-with-content runs are also kept verbatim.
+ let drop_for_newline_ws = !text.is_empty()
+ && text.bytes().all(|b| b.is_ascii_whitespace())
+ && text.bytes().any(|b| b == b'\n' || b == b'\r');
+ if !text.is_empty() && !drop_for_newline_ws {
+ children.push(emit::constant(Value::String(text)));
+ }
+ match self.peek() {
+ TokenKind::LtSlash => return Ok(children),
+ TokenKind::Lt => {
+ if !matches!(
+ self.peek_next(),
+ TokenKind::Ident | TokenKind::QuotedIdent | TokenKind::Keyword(_)
+ ) {
+ return Err(self.err(format!(
+ "expected nested tag name or `</` after `<`, got {:?}",
+ self.peek_next()
+ )));
+ }
+ let nested = self.parse_hogqlx_tag_element()?;
+ children.push(nested);
+ }
+ TokenKind::LBrace => {
+ self.bump()?;
+ let expr = self.parse_expr_bp(0)?;
+ self.expect(TokenKind::RBrace, "}")?;
+ children.push(expr);
+ }
+ TokenKind::Eof => {
+ return Err(self.err("unexpected end of input inside HogQLX tag children"));
+ }
+ _ => {
+ // Should be unreachable — text consumption advances
+ // past anything except `<` / `{` / Eof.
+ return Err(self.err(format!(
+ "unexpected token in HogQLX tag children: {:?}",
+ self.peek()
+ )));
+ }
+ }
+ }
+ }
+
+ /// Scan source bytes from the position immediately after the last
+ /// consumed token up to the next `<` or `{` (or EOF). Returns the
+ /// raw text — empty when peek is already at `<` / `{`. Re-seeks the
+ /// lexer to the boundary position so subsequent token-based parsing
+ /// continues from there.
+ fn consume_hogqlx_text(&mut self) -> Result<String, ParseError> {
+ let start = self.last_consumed_end;
+ let bytes = self.src.as_bytes();
+ // Truth-of-the-bytes check: are we already at a real
+ // tag-body boundary? Don't trust peek0 alone — when
+ // `hogqlx_text_lookahead_depth > 0` the parser may carry a
+ // synthetic `Eof` token in peek0/peek1 because the default-mode
+ // lexer choked on a text-only byte. Look at the actual source
+ // byte at `start`.
+ if start >= bytes.len() {
+ return Ok(String::new());
+ }
+ let head_byte = bytes[start];
+ if head_byte == b'<' || head_byte == b'{' {
+ return Ok(String::new());
+ }
+ let mut i = start;
+ while i < bytes.len() {
+ let c = bytes[i];
+ if c == b'<' || c == b'{' {
+ break;
+ }
+ i += 1;
+ }
+ let text = self.src[start..i].to_string();
+ self.set_lexer_pos(i)?;
+ Ok(text)
+ }
+
+ /// Read a single tag-name / attribute-name token. cpp's
+ /// `HOGQLX_TAG_OPEN` / `HOGQLX_TAG_CLOSE` lexer modes
+ /// (`HogQLLexer.common.g4:315 + 326`) admit
+ /// `[a-zA-Z_][a-zA-Z0-9_-]*` — hyphens are part of the identifier
+ /// inside tag-open / tag-close modes. Rust's lexer doesn't have
+ /// modes, so `a-b` lexes as `Ident a`, `Dash`, `Ident b`; stitch
+ /// them back together here when the dash is followed immediately
+ /// by an ident-like token with no intervening whitespace.
+ fn parse_hogqlx_identifier(&mut self, what: &str) -> Result<String, ParseError> {
+ let head = self.bump()?;
+ let mut name = match head.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent | TokenKind::Keyword(_) => {
+ identifier_text(self.text(head), head.kind)
+ }
+ _ => {
+ return Err(self.err(format!(
+ "expected {} (identifier or keyword), got {:?}",
+ what, head.kind
+ )));
+ }
+ };
+ let mut last_end = head.end;
+ // Greedy hyphen-stitch loop. Per the grammar, hyphens may
+ // appear anywhere AFTER the leading char and must be
+ // immediately followed by another `[a-zA-Z0-9_]` character.
+ // Require a zero-byte gap on either side of the dash so we
+ // don't paper over actual whitespace-separated tokens.
+ while self.peek() == TokenKind::Dash && self.peek0.start == last_end {
+ let cont_start = self.peek_next_start();
+ if self.peek0.end != cont_start {
+ break;
+ }
+ if !matches!(
+ self.peek_next(),
+ TokenKind::Ident | TokenKind::Keyword(_) | TokenKind::Number,
+ ) {
+ break;
+ }
+ self.bump()?; // dash
+ let next = self.bump()?;
+ name.push('-');
+ name.push_str(self.text(next));
+ last_end = next.end;
+ }
+ Ok(name)
+ }
+
+ fn peek_next_start(&self) -> usize {
+ self.peek1.start
+ }
+}
diff --git a/rust/hogql/parser/src/parse/join.rs b/rust/hogql/parser/src/parse/join.rs
new file mode 100644
index 000000000000..59c46f574f9a
--- /dev/null
+++ b/rust/hogql/parser/src/parse/join.rs
@@ -0,0 +1,1627 @@
+//! `FROM` clause + JOIN chain parsing.
+//!
+//! Covers everything from the `tableExpr` leaf up through the
+//! left-recursive `joinExpr` chain, including the table-function
+//! sentinel, PIVOT/UNPIVOT decoration, and the `SAMPLE … OFFSET …`
+//! qualifier. ARRAY JOIN is *not* here — it belongs to the SELECT
+//! statement (see `parse_select_stmt_body` in `select.rs`).
+
+use serde_json::{json, Value};
+
+use super::{
+ chain_join, check_alias_not_reserved, identifier_text, kw_valid_as_identifier, Parser,
+};
+use crate::emit;
+use crate::error::ParseError;
+use crate::lex::{Kw, Lexer, TokenKind};
+
+impl<'a> Parser<'a> {
+ pub(crate) fn parse_join_expr(&mut self) -> Result<Value, ParseError> {
+ // Left-recursive in the grammar; iterate, chaining each new
+ // right-side table into the previous JoinExpr's `next_join` field.
+ let chain_start = self.peek0.start;
+ let mut left = self.parse_table_atom_with_pivot()?;
+ // Record the lead's chain depth: a parens-wrapped joinExpr arrives
+ // pre-built (e.g. `(a JOIN b)` is two JoinExprs deep). The peel-extras
+ // loop below must NOT attach constraints into pre-existing joins —
+ // those slots belong to the inner scope. Scope-local additions made
+ // by THIS loop sit at depth > lead_depth.
+ let lead_depth = chain_depth(&left);
+ let mut joined_any = false;
+ loop {
+ // ARRAY JOIN belongs to the outer SELECT statement, not the
+ // JoinExpr chain — exit the loop when we see one (in any of
+ // its prefix forms: bare `ARRAY JOIN`, `LEFT ARRAY JOIN`,
+ // `INNER ARRAY JOIN`) so parse_select_stmt can take over.
+ if matches!(self.peek(), TokenKind::Keyword(Kw::Array))
+ && self.peek_next() == TokenKind::Keyword(Kw::Join)
+ {
+ break;
+ }
+ if matches!(
+ self.peek(),
+ TokenKind::Keyword(Kw::Left) | TokenKind::Keyword(Kw::Inner)
+ ) && self.peek_next() == TokenKind::Keyword(Kw::Array)
+ {
+ break;
+ }
+ // `,` cross join. cpp's ANTLR ALL(*) tolerates a trailing
+ // comma after a constrained JOIN chain (`a JOIN b ON 1,`)
+ // when nothing parseable follows — the comma is recovery-
+ // discarded. Mirror that: if peek_next isn't a token that
+ // can start a table atom, consume + discard the trailing
+ // comma so the outer SELECT parser keeps walking.
+ if self.peek() == TokenKind::Comma {
+ if !self.peek_next_starts_table_atom() {
+ if joined_any {
+ // Trailing comma after at least one join — discard.
+ self.bump()?;
+ }
+ break;
+ }
+ self.bump()?;
+ let right = self.parse_table_atom_with_pivot()?;
+ left = chain_join(left, right, "CROSS JOIN", None);
+ joined_any = true;
+ continue;
+ }
+ // CROSS JOIN explicit.
+ if matches!(self.peek(), TokenKind::Keyword(Kw::Cross))
+ && self.peek_next() == TokenKind::Keyword(Kw::Join)
+ {
+ self.bump()?;
+ self.bump()?;
+ let right = self.parse_table_atom_with_pivot()?;
+ left = chain_join(left, right, "CROSS JOIN", None);
+ joined_any = true;
+ continue;
+ }
+ // POSITIONAL JOIN.
+ if matches!(self.peek(), TokenKind::Keyword(Kw::Positional))
+ && self.peek_next() == TokenKind::Keyword(Kw::Join)
+ {
+ self.bump()?;
+ self.bump()?;
+ let right = self.parse_table_atom_with_pivot()?;
+ let constraint = self.parse_join_constraint_opt()?;
+ left = chain_join(left, right, "POSITIONAL JOIN", constraint);
+ joined_any = true;
+ continue;
+ }
+ // [NATURAL]? [SEMI|ANTI|ALL|ANY|ASOF]? [INNER|LEFT|RIGHT|FULL [OUTER]?]? JOIN target.
+ let _natural = self.eat_kw(Kw::Natural)?;
+ let join_op = self.try_consume_join_op()?;
+ if join_op.is_none() && !matches!(self.peek(), TokenKind::Keyword(Kw::Join)) {
+ // No JOIN — but PIVOT / UNPIVOT also extend the
+ // joinExpr chain, and the result can still take an
+ // alias / FINAL / SAMPLE or a further JOIN / PIVOT.
+ if matches!(
+ self.peek(),
+ TokenKind::Keyword(Kw::Pivot) | TokenKind::Keyword(Kw::Unpivot)
+ ) {
+ left = self.wrap_pivot_chain(left, joined_any, chain_start)?;
+ continue;
+ }
+ break;
+ }
+ let op_text = join_op.unwrap_or_default();
+ self.expect_kw(Kw::Join, "JOIN")?;
+ let right = self.parse_table_atom_with_pivot()?;
+ let constraint = self.parse_join_constraint_opt()?;
+ let join_type = if op_text.is_empty() {
+ "JOIN".to_string()
+ } else {
+ format!("{op_text} JOIN")
+ };
+ left = chain_join(left, right, &join_type, constraint);
+ joined_any = true;
+ }
+
+ // cpp's left-recursive `joinExpr JOIN joinExpr joinConstraintClause?`
+ // attaches a stacked `ON1 ON2 ON3` run right-associatively (ON1 → innermost
+ // JOIN, ON3 → outermost). Our loop above is left-to-right and grabs only
+ // one constraint per JOIN; peel the rest off here, inward-to-outward. If
+ // no attachment site exists — bare FROM, all-CROSS chain, or every slot
+ // already filled — raise a syntax error at the stray keyword.
+ //
+ // Guard against the SELECT-statement-level `USING sampleClause` form
+ // (grammar `(USING? sampleClause)?`): `USING SAMPLE 0.5` belongs to the
+ // outer selectStmt, not the JOIN — leave it for the SELECT parser.
+ while matches!(
+ self.peek(),
+ TokenKind::Keyword(Kw::On) | TokenKind::Keyword(Kw::Using)
+ ) {
+ if self.peek() == TokenKind::Keyword(Kw::Using)
+ && self.peek_next() == TokenKind::Keyword(Kw::Sample)
+ {
+ break;
+ }
+ let kw_kind = self.peek();
+ let Some(constraint) = self.parse_join_constraint_opt()? else {
+ break;
+ };
+ if !attach_constraint_to_outermost_unconstrained_join(
+ &mut left,
+ constraint,
+ lead_depth + 1,
+ 1,
+ ) {
+ let kw = if matches!(kw_kind, TokenKind::Keyword(Kw::On)) {
+ "ON"
+ } else {
+ "USING"
+ };
+ return Err(self.err(format!(
+ "stray {kw} — no preceding JOIN can take a constraint clause"
+ )));
+ }
+ }
+
+ // wrap_pos is idempotent. parse_table_atom and wrap_pivot_chain
+ // both wrap their results with positions, so `left` always has
+ // a span by this point — keeping wrap_pos here matches cpp's
+ // JoinExprParens semantics (unwrap parens, keep the inner's
+ // positions) and cpp's JoinExprOp / JoinExprCrossOp semantics
+ // (chain joins, keep the head's positions; do not extend to the
+ // joined-in tables).
+ Ok(self.wrap_pos(left, chain_start))
+ }
+
+ /// `parse_table_atom` followed by an optional immediately-adjacent
+ /// `PIVOT` / `UNPIVOT`. The grammar's `joinExpr PIVOT` is
+ /// left-recursive on the *immediately preceding* joinExpr, so
+ /// `a JOIN b PIVOT (…)` pivots `b` alone — the PIVOT binds to the
+ /// freshly-parsed atom, not the whole JOIN chain. A PIVOT that
+ /// instead follows a join *constraint* (`a JOIN b ON x PIVOT (…)`)
+ /// applies to the whole chain; that case is left for the caller's
+ /// loop, which calls `wrap_pivot_chain` with `joined_any`.
+ fn parse_table_atom_with_pivot(&mut self) -> Result<Value, ParseError> {
+ let atom_start = self.peek0.start;
+ let atom = self.parse_table_atom()?;
+ if matches!(
+ self.peek(),
+ TokenKind::Keyword(Kw::Pivot) | TokenKind::Keyword(Kw::Unpivot)
+ ) {
+ return self.wrap_pivot_chain(atom, false, atom_start);
+ }
+ Ok(atom)
+ }
+
+ /// Consume a `PIVOT (...)` / `UNPIVOT (...)` run that decorates the
+ /// current join chain, then any `JoinExprTable`/`TableExprAlias`
+ /// decoration the result can still take. `tableExpr PIVOT (...)` is
+ /// itself a `tableExpr`, so an alias (`TableExprAlias`) and a
+ /// trailing `FINAL? sampleClause?` (`JoinExprTable`) all still apply
+ /// — `FROM (t PIVOT (...) AS x FINAL)`. The caller loops, so a
+ /// following JOIN or further PIVOT is picked up too.
+ fn wrap_pivot_chain(
+ &mut self,
+ left: Value,
+ joined_any: bool,
+ table_start: usize,
+ ) -> Result<Value, ParseError> {
+ // For the single-atom case (no JOIN happened) the chain is a
+ // JoinExpr that only wraps a bare Field — unwrap to match cpp's
+ // shape (PivotExpr's `table` is the bare Field). When the
+ // JoinExpr carries an alias / final / sample / column_aliases,
+ // keep it as is since that decoration belongs *inside* the PIVOT.
+ // `start` / `end` are position metadata, not grammar decoration —
+ // exclude from the decoration probe.
+ let pivot_input = if joined_any {
+ left
+ } else if let Some(obj) = left.as_object() {
+ let has_decorations = obj
+ .keys()
+ .any(|k| !matches!(k.as_str(), "node" | "table" | "start" | "end"));
+ if has_decorations {
+ left
+ } else {
+ obj.get("table").cloned().unwrap_or(left)
+ }
+ } else {
+ left
+ };
+ let wrapped = self.try_consume_pivot_unpivot(pivot_input, table_start)?;
+ // Wrap the PivotExpr/UnpivotExpr in an outer JoinExpr (the C++
+ // visitor's JoinExprPivot does the same).
+ let mut outer = serde_json::Map::new();
+ outer.insert("node".into(), Value::String("JoinExpr".into()));
+ outer.insert("table".into(), wrapped);
+ // Grammar order: `TableExprAlias` (alias + columnAliases) binds
+ // inside `tableExpr`, then `JoinExprTable` adds `FINAL?
+ // sampleClause?`.
+ let (alias, column_aliases) = self.consume_table_alias_chain()?;
+ if let Some(a) = alias {
+ outer.insert("alias".into(), Value::String(a));
+ }
+ if let Some(ca) = column_aliases {
+ outer.insert(
+ "column_aliases".into(),
+ Value::Array(ca.into_iter().map(Value::String).collect()),
+ );
+ }
+ if self.eat_kw(Kw::Final)? {
+ outer.insert("table_final".into(), Value::Bool(true));
+ }
+ if let Some(s) = self.try_consume_sample()? {
+ outer.insert("sample".into(), s);
+ }
+ // Wrap before returning so the JoinExpr carries positions even
+ // when a later wrap_pivot_chain stacks it as the inner table of
+ // a fresh outer PivotExpr / UnpivotExpr. The outer parse_join_expr
+ // wrap_pos at line ~160 is idempotent and only reaches the
+ // *outermost* node — the inner one needs its own wrap here.
+ Ok(self.wrap_pos(Value::Object(outer), table_start))
+ }
+
+ fn try_consume_join_op(&mut self) -> Result<Option<String>, ParseError> {
+ // Mirror the C++ visitor's canonical ordering — the AST validates
+ // join_type against a fixed allow-list and source-order
+ // concatenation would produce variants outside it.
+ let candidates: &[Kw] = &[
+ Kw::All,
+ Kw::Any,
+ Kw::Asof,
+ Kw::Inner,
+ Kw::Left,
+ Kw::Right,
+ Kw::Full,
+ Kw::Outer,
+ Kw::Semi,
+ Kw::Anti,
+ ];
+ let mut all = false;
+ let mut any = false;
+ let mut asof = false;
+ let mut inner = false;
+ let mut left = false;
+ let mut right = false;
+ let mut full = false;
+ let mut outer = false;
+ let mut semi = false;
+ let mut anti = false;
+ let mut seen_any_kw = false;
+ // Track source order of relevant keywords for ordering-sensitive
+ // grammar checks below (e.g. `ASOF (ANTI|SEMI)` must come in
+ // that order, never `ANTI ASOF`).
+ let mut order: Vec<Kw> = Vec::new();
+ loop {
+ let TokenKind::Keyword(kw) = self.peek() else {
+ break;
+ };
+ if !candidates.contains(&kw) {
+ break;
+ }
+ self.bump()?;
+ seen_any_kw = true;
+ // Each modifier keyword may appear at most once. cpp's
+ // ANTLR alts (`HogQLParser.g4:127–134`) each reference each
+ // keyword at most once; rust was silently OR-ing duplicates
+ // into the boolean state, so `INNER INNER JOIN` /
+ // `LEFT OUTER LEFT JOIN` slipped through.
+ let already_set = match kw {
+ Kw::All => all,
+ Kw::Any => any,
+ Kw::Asof => asof,
+ Kw::Inner => inner,
+ Kw::Left => left,
+ Kw::Right => right,
+ Kw::Full => full,
+ Kw::Outer => outer,
+ Kw::Semi => semi,
+ Kw::Anti => anti,
+ _ => false,
+ };
+ if already_set {
+ return Err(self.err(format!("duplicate {:?} in JOIN op", kw)));
+ }
+ match kw {
+ Kw::All => all = true,
+ Kw::Any => any = true,
+ Kw::Asof => asof = true,
+ Kw::Inner => inner = true,
+ Kw::Left => left = true,
+ Kw::Right => right = true,
+ Kw::Full => full = true,
+ Kw::Outer => outer = true,
+ Kw::Semi => semi = true,
+ Kw::Anti => anti = true,
+ _ => {}
+ }
+ order.push(kw);
+ }
+ if !seen_any_kw {
+ return Ok(None);
+ }
+
+ // Grammar validation. The three `joinOp` alts (see
+ // `HogQLParser.g4:127–134`) partition the keyword set:
+ // JoinOpInner ⇒ INNER + at most one of ALL/ANY/ASOF; or
+ // ANTI; or SEMI; or ASOF (ANTI|SEMI). No
+ // LEFT/RIGHT/FULL/OUTER.
+ // JoinOpLeftRight ⇒ exactly one of LEFT/RIGHT; optional
+ // OUTER; optional one of SEMI/ALL/ANTI/ANY/ASOF
+ // on either side. No INNER/FULL.
+ // JoinOpFull ⇒ FULL; optional OUTER; optional one of
+ // ALL/ANY/ASOF. No INNER/LEFT/RIGHT/ANTI/SEMI.
+ // Rust's source-order loop happily accepted any subset, then
+ // emitted a canonical-order token list — letting `INNER LEFT
+ // JOIN` through as the synthetic `LEFT INNER`. Validate the
+ // boolean state against the grammar before composing tokens.
+ let lr_count = (left as u8) + (right as u8);
+ if lr_count > 1 {
+ return Err(self.err("LEFT and RIGHT cannot both appear in a JOIN op"));
+ }
+ if full && (inner || left || right || anti || semi) {
+ return Err(self.err("FULL cannot combine with INNER/LEFT/RIGHT/ANTI/SEMI"));
+ }
+ if inner && (left || right || full || anti || semi) {
+ return Err(self.err("INNER cannot combine with LEFT/RIGHT/FULL/ANTI/SEMI"));
+ }
+ if outer && !(left || right || full) {
+ return Err(self.err("OUTER requires LEFT/RIGHT/FULL"));
+ }
+ // Within-category arity per `HogQLParser.g4:127–134`:
+ // - At most one of ALL/ANY/ASOF in any alt (the grammar
+ // references the group as `(ALL|ANY|ASOF)?`, never twice).
+ // - ANTI and SEMI never together — inner-style admits `ANTI`,
+ // `SEMI`, or `ASOF (ANTI|SEMI)` (one or the other, not both).
+ // - For the inner-style alt, ANTI / SEMI only combine with
+ // ASOF (never ALL or ANY).
+ let modifier_count = (all as u8) + (any as u8) + (asof as u8);
+ if modifier_count > 1 {
+ return Err(self.err("JOIN op accepts at most one of ALL / ANY / ASOF"));
+ }
+ if anti && semi {
+ return Err(self.err("ANTI and SEMI cannot both appear in a JOIN op"));
+ }
+ if !full && !left && !right {
+ // Inner-style. ANTI / SEMI combine only with ASOF (never
+ // ALL / ANY): `ASOF (ANTI | SEMI)`. And in that order —
+ // `ANTI ASOF` / `SEMI ASOF` is the reverse and invalid.
+ if (anti || semi) && (all || any) {
+ return Err(
+ self.err("inner-style JOIN op: ANTI / SEMI cannot combine with ALL / ANY")
+ );
+ }
+ if asof && (anti || semi) {
+ let asof_pos = order.iter().position(|&k| k == Kw::Asof);
+ let antisemi_pos = order.iter().position(|&k| matches!(k, Kw::Anti | Kw::Semi));
+ if matches!((asof_pos, antisemi_pos), (Some(a), Some(b)) if a > b) {
+ return Err(self.err("JOIN op: ANTI / SEMI must follow ASOF, not precede it"));
+ }
+ }
+ }
+
+ let mut tokens: Vec<&str> = Vec::new();
+ if left || right {
+ if left {
+ tokens.push("LEFT");
+ }
+ if right {
+ tokens.push("RIGHT");
+ }
+ if outer {
+ tokens.push("OUTER");
+ }
+ if semi {
+ tokens.push("SEMI");
+ }
+ if all {
+ tokens.push("ALL");
+ }
+ if anti {
+ tokens.push("ANTI");
+ }
+ if any {
+ tokens.push("ANY");
+ }
+ if asof {
+ tokens.push("ASOF");
+ }
+ } else if full {
+ tokens.push("FULL");
+ if outer {
+ tokens.push("OUTER");
+ }
+ if all {
+ tokens.push("ALL");
+ }
+ if any {
+ tokens.push("ANY");
+ }
+ if asof {
+ tokens.push("ASOF");
+ }
+ } else {
+ // Inner-style.
+ if all {
+ tokens.push("ALL");
+ }
+ if any {
+ tokens.push("ANY");
+ }
+ if asof {
+ tokens.push("ASOF");
+ }
+ if anti {
+ tokens.push("ANTI");
+ }
+ if semi {
+ tokens.push("SEMI");
+ }
+ if inner || (!anti && !semi) {
+ tokens.push("INNER");
+ }
+ }
+ Ok(Some(tokens.join(" ")))
+ }
+
+ fn parse_join_constraint_opt(&mut self) -> Result<Option<Value>, ParseError> {
+ let cons_start = self.peek0.start;
+ if self.eat_kw(Kw::On)? {
+ let expr = self.parse_expr_bp(0)?;
+ // cpp's `joinConstraintClause: ON columnExprList` greedily
+ // consumes the comma-separated list, then the cpp visitor
+ // raises `NotImplementedError` for any list with more than
+ // one expression. Mirror that here: a comma followed by
+ // anything that could continue the list belongs to the ON
+ // list, not the outer JOIN's CROSS-JOIN comma. Rust used
+ // to fall out and let the outer chain consume it as
+ // cross-join, silently emitting a divergent JoinExpr.
+ //
+ // A *trailing* comma (`FROM a JOIN b ON 1,` with nothing
+ // parseable after) is tolerated — cpp's ANTLR recovery
+ // discards it. Leave the outer JOIN loop to handle that.
+ if self.peek() == TokenKind::Comma
+ && !matches!(
+ self.peek_next(),
+ TokenKind::Eof | TokenKind::Semicolon | TokenKind::RParen
+ )
+ {
+ let start = self.peek0.start;
+ let end = self.peek0.end;
+ return Err(ParseError::not_implemented(
+ "Unsupported: JOIN ... ON with multiple expressions",
+ start,
+ end,
+ ));
+ }
+ return Ok(Some(self.wrap_pos(
+ json!({"node": "JoinConstraint", "expr": expr, "constraint_type": "ON"}),
+ cons_start,
+ )));
+ }
+ if self.eat_kw(Kw::Using)? {
+ // The grammar `joinConstraintClause` admits two USING shapes:
+ // `USING LPAREN columnExprList RPAREN`
+ // `USING columnExprList`
+ // — both require a non-empty columnExprList. cpp rejects
+ // `USING ()`; rust was silently producing an empty list.
+ let exprs = if self.eat(TokenKind::LParen)? {
+ if self.peek() == TokenKind::RParen {
+ return Err(self.err("USING (…) must have at least one expression"));
+ }
+ let list = self.parse_expr_list_until_paren()?;
+ self.expect(TokenKind::RParen, ")")?;
+ list
+ } else {
+ self.parse_expr_list_until_terminators()?
+ };
+ let expr = if exprs.len() == 1 {
+ exprs.into_iter().next().unwrap()
+ } else {
+ emit::tuple_(exprs)
+ };
+ return Ok(Some(self.wrap_pos(
+ json!({"node": "JoinConstraint", "expr": expr, "constraint_type": "USING"}),
+ cons_start,
+ )));
+ }
+ Ok(None)
+ }
+
+ /// Probe: does `peek_next` look like the start of a `tableExpr`?
+ /// Used by the JOIN loop to decide whether a top-level `,` is the
+ /// start of a CROSS JOIN (table atom follows) or a stray trailing
+ /// comma that the SELECT-level parser will handle.
+ fn peek_next_starts_table_atom(&self) -> bool {
+ matches!(
+ self.peek_next(),
+ TokenKind::Ident
+ | TokenKind::QuotedIdent
+ | TokenKind::LParen
+ | TokenKind::LBrace
+ | TokenKind::Lt
+ | TokenKind::Keyword(Kw::Values)
+ ) || matches!(
+ self.peek_next(),
+ TokenKind::Keyword(kw) if super::kw_valid_as_identifier(kw)
+ )
+ }
+
+ fn parse_table_atom(&mut self) -> Result<Value, ParseError> {
+ let atom_start = self.peek0.start;
+ let mut table_expr = self.parse_table_expr()?;
+ // Snapshot the end of `tableExpr` before alias / FINAL / SAMPLE
+ // are consumed. For the table-function case (cpp's
+ // `TableFunctionExpr`), cpp's emitted JoinExpr's ctx covers
+ // ONLY `name(args)` — the alias is injected by the parent
+ // `TableExprAlias` without changing the JoinExpr's span. Capture
+ // here so the table-function branch below can clamp `end` to
+ // the args-close position rather than letting it run through
+ // the alias / FINAL / SAMPLE decorations.
+ let table_expr_end = self.last_consumed_end;
+ // `(joinExpr)` per the grammar's `JoinExprParens` returns an
+ // already-wrapped JoinExpr (or chain). The grammar:
+ // joinExpr: ... | LPAREN joinExpr RPAREN # JoinExprParens
+ // tableExpr: ... | tableExpr (alias | AS identifier) columnAliases?
+ // # TableExprAlias
+ // `TableExprAlias` requires a `tableExpr` head — `LPAREN
+ // joinExpr RPAREN` is a `joinExpr`, NOT a `tableExpr`, so an
+ // alias / FINAL / SAMPLE / columnAliases CANNOT bind after the
+ // closing paren. cpp rejects `(t) AS x`, `(t JOIN b ON x) AS y`,
+ // `(t) FINAL`, etc. Return the JoinExpr unchanged and let the
+ // caller surface any post-paren tokens as trailing-input errors.
+ let already_join_expr = table_expr.get("node").and_then(Value::as_str) == Some("JoinExpr");
+ if already_join_expr {
+ return Ok(table_expr);
+ }
+ // parse_table_expr signals table-function args via a sentinel key
+ // on the returned Field — extract them into `table_args` so the
+ // JoinExpr wrapper gets the C++-shape Field + table_args split.
+ let table_args = table_expr
+ .as_object_mut()
+ .and_then(|m| m.remove("__rust_table_args"));
+ let is_table_function = table_args.is_some();
+ // Grammar order: `TableExprAlias` is `tableExpr (alias | AS
+ // identifier) columnAliases?` — the alias and column-aliases
+ // bind *inside* `tableExpr` — and `JoinExprTable` then
+ // decorates it with `FINAL? sampleClause?`. So the alias comes
+ // first, FINAL and SAMPLE after. Parsing SAMPLE before the
+ // alias (as this did) silently dropped the sample on an
+ // aliased table — `t AS e SAMPLE 1` lost its `SampleExpr`.
+ let (alias, column_aliases) = self.consume_table_alias_chain()?;
+ let had_alias = alias.is_some() || column_aliases.is_some();
+ // Snapshot end after alias / column_aliases — cpp's
+ // `TableExprAlias` ctx covers `tableExpr alias columnAliases?` and
+ // its JoinExpr wrap stops there. The subsequent FINAL / SAMPLE
+ // sit in the parent `JoinExprTable` rule, which adds them as
+ // fields on the existing JoinExpr WITHOUT widening its span.
+ let after_alias_end = self.last_consumed_end;
+ // `JoinExprTable: tableExpr FINAL? sampleClause?` — FINAL and
+ // SAMPLE decorate the (possibly aliased) table.
+ let final_ = self.eat_kw(Kw::Final)?;
+ let sample = self.try_consume_sample()?;
+
+ // PIVOT/UNPIVOT detection is done at the parse_join_expr level so
+ // that the wrapping applies to a whole JOIN chain rather than to
+ // each individual atom — `FROM a JOIN b PIVOT (...)` wraps the
+ // entire `a JOIN b`, not just `b`. parse_table_atom only handles
+ // the immediate table + its alias / sample / final decoration.
+ let mut obj = serde_json::Map::new();
+ obj.insert("node".into(), Value::String("JoinExpr".into()));
+ obj.insert("table".into(), table_expr);
+ if let Some(ta) = table_args {
+ obj.insert("table_args".into(), ta);
+ }
+ if let Some(a) = alias {
+ obj.insert("alias".into(), Value::String(a));
+ }
+ if final_ {
+ obj.insert("table_final".into(), Value::Bool(true));
+ }
+ if let Some(s) = sample {
+ obj.insert("sample".into(), s);
+ }
+ if let Some(ca) = column_aliases {
+ obj.insert(
+ "column_aliases".into(),
+ Value::Array(ca.into_iter().map(Value::String).collect()),
+ );
+ }
+ // Three position-end regimes match cpp's three wrapping points:
+ // - `TableFunctionExpr` (cpp lines 2797-2817): ctx covers
+ // `name(args)` only; alias / FINAL / SAMPLE never widen it.
+ // - `TableExprAlias` (cpp lines 2754-2790): ctx covers
+ // `tableExpr alias columnAliases?`; FINAL / SAMPLE applied
+ // by the parent JoinExprTable don't widen.
+ // - `JoinExprTable` (cpp lines 1056-1080): wraps a non-
+ // JoinExpr tableExpr with ctx = `tableExpr FINAL? SAMPLE?`;
+ // this is the only path where FINAL / SAMPLE contribute to
+ // the span.
+ let wrap_end = if is_table_function {
+ table_expr_end
+ } else if had_alias {
+ after_alias_end
+ } else {
+ self.last_consumed_end
+ };
+ Ok(self.wrap_pos_to(Value::Object(obj), atom_start, wrap_end))
+ }
+
+ /// Consume a chain of table aliases. The grammar's `TableExprAlias`
+ /// — `tableExpr (alias | AS identifier) columnAliases?` — is
+ /// left-recursive, so a table may carry several stacked aliases
+ /// (`t a b c`). cpp's `visitTableExprAlias` overwrites `alias` and
+ /// `column_aliases` on every wrap, so the LAST alias wins and its
+ /// column-aliases win with it (a final alias with no `columnAliases`
+ /// clears any that an inner alias set). Returns `(alias,
+ /// column_aliases)` for the outermost — last — alias, or
+ /// `(None, None)` when the table carries no alias at all.
+ fn consume_table_alias_chain(
+ &mut self,
+ ) -> Result<(Option<String>, Option<Vec<String>>), ParseError> {
+ let mut alias: Option<String> = None;
+ let mut column_aliases: Option<Vec<String>> = None;
+ while let Some(a) = self.try_consume_table_alias()? {
+ alias = Some(a);
+ // `columnAliases` belongs to *this* alias's `TableExprAlias`;
+ // re-read each iteration so the last alias's value (present
+ // or absent) is the one that survives.
+ column_aliases = self.try_consume_column_aliases()?;
+ }
+ Ok((alias, column_aliases))
+ }
+
+ /// Optional `columnAliases` — `LPAREN identifier (COMMA identifier)*
+ /// RPAREN` — renaming a table's output columns. The grammar only
+ /// admits it directly after a table alias, so the caller consumes it
+ /// inside the alias chain, never on its own.
+ fn try_consume_column_aliases(&mut self) -> Result<Option<Vec<String>>, ParseError> {
+ if self.peek() != TokenKind::LParen {
+ return Ok(None);
+ }
+ self.bump()?;
+ // `columnAliases: LPAREN identifier (COMMA identifier)* RPAREN` —
+ // the grammar requires at least one identifier. Empty `()` is a
+ // parse error in cpp.
+ if self.peek() == TokenKind::RParen {
+ return Err(self.err("column-alias list must have at least one identifier"));
+ }
+ let mut cols = Vec::new();
+ loop {
+ let t = self.bump()?;
+ // `columnAliases` elements are `identifier` per the grammar
+ // (`IDENTIFIER | QUOTED_IDENTIFIER | interval | keyword`);
+ // exclude the same reserved keywords as elsewhere.
+ let name = match t.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent => identifier_text(self.text(t), t.kind),
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
+ identifier_text(self.text(t), t.kind)
+ }
+ _ => {
+ return Err(self.err(format!(
+ "expected identifier in column-alias list, got {:?}",
+ t.kind
+ )));
+ }
+ };
+ cols.push(name);
+ if !self.eat(TokenKind::Comma)? {
+ break;
+ }
+ if self.peek() == TokenKind::RParen {
+ break;
+ }
+ }
+ self.expect(TokenKind::RParen, ")")?;
+ Ok(Some(cols))
+ }
+
+ fn try_consume_table_alias(&mut self) -> Result<Option<String>, ParseError> {
+ if self.eat_kw(Kw::As)? {
+ // `tableExpr (alias | AS identifier)` — the explicit-`AS`
+ // branch is `AS identifier`, and the grammar's `identifier`
+ // rule admits any keyword bar the literals / hard set-ops
+ // (`kw_valid_as_identifier`). This is much wider than the
+ // bare-alias `keywordForAlias` set below: cpp accepts e.g.
+ // `FROM t AS hour`, `AS select`, `AS interval`.
+ let t = self.bump()?;
+ let name = match t.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent => identifier_text(self.text(t), t.kind),
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
+ identifier_text(self.text(t), t.kind)
+ }
+ _ => return Err(self.err(format!("expected alias after AS, got {:?}", t.kind))),
+ };
+ if !matches!(t.kind, TokenKind::QuotedIdent) {
+ check_alias_not_reserved(&name, t.start, t.end)?;
+ }
+ return Ok(Some(name));
+ }
+ // Bare (no `AS`) alias — the grammar's `alias` rule:
+ // `IDENTIFIER | QUOTED_IDENTIFIER | keywordForAlias`, where
+ // `keywordForAlias` is the small DATE / FIRST / ID / KEY set
+ // (none of which is a JOIN op or clause keyword, so consuming
+ // one here is unambiguous).
+ match self.peek() {
+ TokenKind::Ident => {
+ let t = self.bump()?;
+ let name = identifier_text(self.text(t), t.kind);
+ check_alias_not_reserved(&name, t.start, t.end)?;
+ Ok(Some(name))
+ }
+ TokenKind::QuotedIdent => {
+ let t = self.bump()?;
+ Ok(Some(identifier_text(self.text(t), t.kind)))
+ }
+ TokenKind::Keyword(Kw::Date | Kw::First | Kw::Id | Kw::Key) => {
+ let t = self.bump()?;
+ Ok(Some(identifier_text(self.text(t), t.kind)))
+ }
+ _ => Ok(None),
+ }
+ }
+
+ fn parse_table_expr(&mut self) -> Result<Value, ParseError> {
+ // `(selectSet)`, table identifier (with optional function-arg
+ // syntax), `{placeholder}`, `VALUES (...)`, `(joinExpr)`
+ // (per the grammar's `JoinExprParens` rule — e.g. `FROM (t FINAL)`),
+ // or HogQLX (`<Tag ...>`).
+ let tab_start = self.peek0.start;
+ if self.peek_starts_hogqlx_tag() {
+ return self.parse_hogqlx_tag_element();
+ }
+ if self.peek() == TokenKind::LParen {
+ // `(<Tag/>)` is `LPAREN joinExpr RPAREN` per the grammar,
+ // where the inner `joinExpr → tableExpr → hogqlxTagElement`.
+ // Don't shortcut — fall through to the JoinExprParens path
+ // below so the tag gets wrapped in a JoinExpr (which the
+ // outer table-atom code refuses to alias) and the inner
+ // alias / FINAL / SAMPLE / JOIN decorations on the tag work.
+ // Three competing grammar arms when the next token is `(`:
+ //
+ // tableExpr: LPAREN selectSetStmt RPAREN # TableExprSubquery
+ // tableExpr: LPAREN valuesClause RPAREN # TableExprValues
+ // joinExpr: LPAREN joinExpr RPAREN # JoinExprParens
+ //
+ // ANTLR's ALL(*) tries them in grammar declaration order:
+ // tableExpr alternatives first (Subquery before Values),
+ // then joinExpr-parens as the fallback. We mirror that
+ // with `try_alt` — first parse to a matching close paren
+ // wins; failed alts roll back via the parser checkpoint.
+ //
+ // The previous Pratt-era code used a `peek_paren_wraps_select_stmt`
+ // heuristic to commit early; that probe walked balanced parens
+ // looking for SELECT/WITH/placeholder markers and could get the
+ // call wrong on shapes like `from (a final) sample {x}` (cpp
+ // drops the trailing sample as JoinExprParens; the probe would
+ // have steered toward TableExprSubquery).
+ return self.try_alt(&[
+ &Self::parse_table_expr_subquery_arm,
+ &Self::parse_table_expr_values_arm,
+ &Self::parse_join_expr_parens_arm,
+ ]);
+ }
+ // `{name}` — placeholder table reference.
+ if self.peek() == TokenKind::LBrace {
+ return self.parse_brace_dict_or_placeholder();
+ }
+ // Identifier-led: either a Field chain (plain table reference) or
+ // a tableFunction (`name(args)`). Grammar's `tableIdentifier` →
+ // `nestedIdentifier` admits `identifier` (`IDENTIFIER |
+ // QUOTED_IDENTIFIER | interval | keyword`); the `keyword` rule
+ // excludes the same set as `kw_valid_as_identifier`.
+ let head = self.bump()?;
+ let name = match head.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent => {
+ identifier_text(self.text(head), head.kind)
+ }
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
+ identifier_text(self.text(head), head.kind)
+ }
+ TokenKind::Eof => {
+ // FROM consumed but no table — surface as a reserved-
+ // keyword issue so the Python side raises SyntaxError.
+ return Err(ParseError::syntax(
+ "expected table reference after FROM (a reserved keyword cannot be a table name here)",
+ head.start, head.end,
+ ));
+ }
+ _ => return Err(self.err(format!(
+ "expected table reference, got {:?} (a reserved keyword cannot be used in this position)",
+ head.kind,
+ ))),
+ };
+ // Table function call form `name(args)`. The C++ visitor emits
+ // this as a Field with `table_args` populated at the wrapping
+ // JoinExpr level — NOT as a Call expression. parse_table_atom
+ // picks up the args list off the returned Field.
+ if self.peek() == TokenKind::LParen {
+ self.bump()?;
+ let args = self.parse_arg_list(TokenKind::RParen)?;
+ self.expect(TokenKind::RParen, ")")?;
+ // Encode as a Field with a sibling "table_args" object so the
+ // wrapping JoinExpr in parse_table_atom can pull it out.
+ // cpp's `VISIT(TableFunctionExpr)` (parser_json.cpp lines
+ // 2797-2817) builds the inner Field WITHOUT calling
+ // `addPositionInfo` — only the wrapping JoinExpr carries the
+ // span. Emit position-less here too so the deserialised
+ // Field's `start` / `end` stay `None`, matching cpp.
+ return Ok(emit::no_pos(json!({
+ "node": "Field",
+ "chain": [name],
+ "__rust_table_args": args,
+ })));
+ }
+ // Field chain.
+ let mut chain: Vec<Value> = vec![Value::String(name)];
+ while self.peek() == TokenKind::Dot {
+ self.bump()?;
+ let part = self.bump()?;
+ match part.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent => {
+ chain.push(Value::String(identifier_text(self.text(part), part.kind)));
+ }
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
+ chain.push(Value::String(identifier_text(self.text(part), part.kind)));
+ }
+ _ => {
+ return Err(self.err(format!(
+ "expected identifier after '.', got {:?}",
+ part.kind
+ )))
+ }
+ }
+ }
+ Ok(self.wrap_pos(emit::field(chain), tab_start))
+ }
+
+ /// `parse_table_expr` arm: TableExprSubquery, `LPAREN selectSetStmt RPAREN`.
+ /// The inner is anything `selectSetStmt` admits — SELECT statements,
+ /// WITH-CTE selects, paren-wrapped set-stmts, or a bare placeholder
+ /// `{x}` (placeholders are first-class `selectStmtWithParens` arms).
+ fn parse_table_expr_subquery_arm(&mut self) -> Result<Value, ParseError> {
+ self.expect(TokenKind::LParen, "(")?;
+ let inner = self.parse_select_set_stmt()?;
+ self.expect(TokenKind::RParen, ")")?;
+ Ok(inner)
+ }
+
+ /// `parse_table_expr` arm: TableExprValues, `LPAREN valuesClause RPAREN`.
+ /// `VALUES` is the first inner token and uniquely identifies this arm,
+ /// but we still parse it inside the try_alt so a malformed valuesClause
+ /// (e.g. `(VALUES, x)`) rolls back cleanly to the joinExpr fallback.
+ fn parse_table_expr_values_arm(&mut self) -> Result<Value, ParseError> {
+ self.expect(TokenKind::LParen, "(")?;
+ if self.peek() != TokenKind::Keyword(Kw::Values) {
+ return Err(self.err("not a VALUES clause"));
+ }
+ let values = self.parse_values_query()?;
+ self.expect(TokenKind::RParen, ")")?;
+ Ok(values)
+ }
+
+ /// `parse_table_expr` arm: JoinExprParens, `LPAREN joinExpr RPAREN`.
+ /// Anything else admissible as a joinExpr — tableIdentifier, FINAL/
+ /// sample-decorated tables, JOIN chains. cpp's `JoinExprParens` doesn't
+ /// allow trailing FINAL / SAMPLE at the outer level; `parse_table_atom`
+ /// distinguishes this case via the returned node's `"JoinExpr"` shape.
+ fn parse_join_expr_parens_arm(&mut self) -> Result<Value, ParseError> {
+ self.expect(TokenKind::LParen, "(")?;
+ let inner = self.parse_join_expr()?;
+ self.expect(TokenKind::RParen, ")")?;
+ Ok(inner)
+ }
+
+ /// `VALUES (...), (...)` — a literal-row query usable wherever a table
+ /// reference is expected. The caller has already consumed the leading
+ /// `(` if any; we consume the `VALUES` keyword and emit a ValuesQuery.
+ fn parse_values_query(&mut self) -> Result<Value, ParseError> {
+ self.expect_kw(Kw::Values, "VALUES")?;
+ let mut rows: Vec<Value> = Vec::new();
+ loop {
+ self.expect(TokenKind::LParen, "(")?;
+ let row = self.parse_expr_list_until_paren()?;
+ self.expect(TokenKind::RParen, ")")?;
+ rows.push(Value::Array(row));
+ if !self.eat(TokenKind::Comma)? {
+ break;
+ }
+ }
+ Ok(json!({"node": "ValuesQuery", "rows": rows}))
+ }
+
+ /// `SAMPLE ratioExpr PERCENT? (OFFSET ratioExpr)? (LPAREN ident RPAREN)?`
+ /// — attached to a table reference inside a JoinExpr. Returns None
+ /// when no SAMPLE clause is present.
+ pub(crate) fn try_consume_sample(&mut self) -> Result<Option<Value>, ParseError> {
+ if !matches!(self.peek(), TokenKind::Keyword(Kw::Sample)) {
+ return Ok(None);
+ }
+ let sample_start = self.peek0.start;
+ self.bump()?;
+ let sample_value = self.parse_ratio_expr()?;
+ // `PERCENT` would be the `%` token; tolerate but ignore its
+ // presence — there's no AST slot for the percent flag.
+ let _ = self.eat(TokenKind::Percent)?;
+ // OFFSET only belongs to the SAMPLE clause when the following
+ // token can start a ratioExpr (`placeholder | numberLiteral`).
+ // Otherwise the OFFSET stays for the outer parser — at SELECT
+ // level it's the offsetOnlyClause that lands on SelectQuery.offset.
+ // ANTLR ALL(*) makes the same split via grammar alternative
+ // preference. Note: an `LBrace` only counts as a ratio starter
+ // when it's actually a placeholder (`{name}`) — `{}` (empty
+ // dict) and `{k: v}` (dict) aren't ratios, so the OFFSET goes
+ // to the outer.
+ let offset_is_ratio = matches!(self.peek(), TokenKind::Keyword(Kw::Offset))
+ && match self.peek_next() {
+ TokenKind::Number
+ | TokenKind::Plus
+ | TokenKind::Dash
+ | TokenKind::Dot
+ | TokenKind::Keyword(Kw::Inf)
+ | TokenKind::Keyword(Kw::Nan) => true,
+ TokenKind::LBrace => self.brace_after_offset_is_placeholder(),
+ _ => false,
+ };
+ let offset_value = if offset_is_ratio {
+ self.bump()?;
+ Some(self.parse_ratio_expr()?)
+ } else {
+ None
+ };
+ // `( identifier )` qualifier — also no AST slot, swallow if present.
+ if self.peek() == TokenKind::LParen {
+ self.bump()?;
+ let _ = self.bump()?;
+ self.expect(TokenKind::RParen, ")")?;
+ }
+ let mut obj = serde_json::Map::new();
+ obj.insert("node".into(), Value::String("SampleExpr".into()));
+ obj.insert("sample_value".into(), sample_value);
+ if let Some(o) = offset_value {
+ obj.insert("offset_value".into(), o);
+ }
+ Ok(Some(self.wrap_pos(Value::Object(obj), sample_start)))
+ }
+
+ /// After a SAMPLE clause has consumed its value and (optional)
+ /// PERCENT, decide whether `OFFSET {...}` is the SAMPLE's own
+ /// offset (placeholder ratioExpr) or a separate outer
+ /// offsetOnlyClause (Dict literal). cpp's ANTLR backtracks based
+ /// on whether the `{...}` parses as a placeholder vs Dict; we
+ /// peek inside the brace via a shadow lexer.
+ fn brace_after_offset_is_placeholder(&self) -> bool {
+ // Two tokens after OFFSET (the `{` is at peek1 here). Lex
+ // forward from peek1.end to walk the contents of the brace.
+ // cpp's `placeholder: LBRACE columnExpr RBRACE` admits any
+ // columnExpr inside, but the *Dict* literal `{key: value, ...}`
+ // is distinguished by the `:` separator at depth 0 inside the
+ // outer brace, and an empty `{}` is the empty Dict. Walk
+ // forward tracking paren depth (the outer `{` already counted
+ // as depth 1) and decide based on what we see first.
+ let mut lex = Lexer::with_pos(self.src, self.peek1.end);
+ let mut depth: i32 = 1;
+ let mut first = true;
+ loop {
+ let tok = match lex.next_token() {
+ Ok(t) => t,
+ Err(_) => return false,
+ };
+ // Immediate `{}` — empty Dict, not a placeholder.
+ if first && tok.kind == TokenKind::RBrace {
+ return false;
+ }
+ first = false;
+ match tok.kind {
+ TokenKind::LBrace | TokenKind::LParen | TokenKind::LBracket => depth += 1,
+ TokenKind::RBrace | TokenKind::RParen | TokenKind::RBracket => {
+ depth -= 1;
+ if depth == 0 {
+ // Closed the outer brace without seeing a
+ // top-level `:` — placeholder.
+ return true;
+ }
+ }
+ // A `:` at the outer brace's depth marks a Dict
+ // key/value separator.
+ TokenKind::Colon if depth == 1 => return false,
+ TokenKind::Eof => return false,
+ _ => {}
+ }
+ }
+ }
+
+ /// Consume a single number-literal value for a `ratioExpr` slot,
+ /// handling the trailing-dot float (`5.`) form. parse_prefix's
+ /// number path leaves the dot for the Pratt postfix loop, but
+ /// ratio context never runs the postfix loop — so a bare `5.`
+ /// would leave the `.` stranded. Detect Number-then-bare-Dot and
+ /// upgrade to a float Constant in-place.
+ fn consume_ratio_value(&mut self) -> Result<Value, ParseError> {
+ let val_start = self.peek0.start;
+ // cpp grammar: `ratioExpr: placeholder | numberLiteral
+ // (SLASH numberLiteral)?`. The numerator/denominator side is
+ // strictly a `numberLiteral` — not a generic columnExpr. The
+ // prior implementation called `parse_prefix()`, which let
+ // Fields (`SAMPLE a`), TupleAccess (`SAMPLE x.y`), and
+ // placeholder-as-RHS (`1 / {p}`) into the ratio slot.
+ //
+ // `numberLiteral` is `(PLUS | DASH)? (NULL | NAN | INF |
+ // FLOATING_LITERAL | DECIMAL_LITERAL | HEXADECIMAL_LITERAL
+ // | OCTAL_PREFIX_LITERAL)`. The parser already collapses signs
+ // and special literals into single Number / Constant tokens via
+ // `parse_number_literal` (called when the prefix is Number, or
+ // an explicit sign + Number combo). Accept those shapes only.
+ // numberLiteral: `(PLUS|DASH)? (floatingLiteral|BINARY|OCTAL|
+ // OCTAL_PREFIX|DECIMAL|HEXADECIMAL|INF|NAN_SQL)`. INF / NAN are
+ // keyword tokens; numeric literals surface as `Number`. The
+ // leading-dot float (`.04`) lexes as `Dot` + `Number`, so admit
+ // `Dot` when the following token is a Number. NULL is *not* in
+ // numberLiteral. Anything else (Field, Call, placeholder-as-RHS,
+ // etc.) is a grammar violation.
+ match self.peek() {
+ TokenKind::Number
+ | TokenKind::Plus
+ | TokenKind::Dash
+ | TokenKind::Keyword(Kw::Nan)
+ | TokenKind::Keyword(Kw::Inf) => {}
+ TokenKind::Dot if self.peek_next() == TokenKind::Number => {}
+ _ => return Err(self.err("SAMPLE ratio value must be a number literal")),
+ }
+ let mut val = self.parse_prefix()?;
+ // Reject non-numeric prefixes (a placeholder masquerading as
+ // a `{x}` ratio side, a sign followed by a non-number, etc.).
+ let is_numeric_constant = val
+ .as_object()
+ .is_some_and(|o| o.get("node").and_then(Value::as_str) == Some("Constant"));
+ if !is_numeric_constant {
+ return Err(self.err("SAMPLE ratio value must be a number literal"));
+ }
+ // Trailing dot with no field-chain extender after — turn the
+ // integer Constant into a float and consume the dot.
+ if self.peek() == TokenKind::Dot
+ && !matches!(
+ self.peek_next(),
+ TokenKind::Number | TokenKind::Ident | TokenKind::QuotedIdent,
+ )
+ {
+ self.bump()?;
+ if let Some(obj) = val.as_object_mut() {
+ if obj.get("node").and_then(Value::as_str) == Some("Constant") {
+ if let Some(n) = obj.get("value").and_then(Value::as_i64) {
+ obj.insert("value".into(), serde_json::json!(n as f64));
+ }
+ }
+ }
+ }
+ Ok(self.wrap_pos(val, val_start))
+ }
+
+ fn parse_ratio_expr(&mut self) -> Result<Value, ParseError> {
+ // cpp grammar: `ratioExpr: placeholder | numberLiteral
+ // (SLASH numberLiteral)?`. We mirror it narrowly so the
+ // trailing `(identifier)` sample qualifier — and an unrelated
+ // `OFFSET` ratio — don't get absorbed as a function call on
+ // the placeholder. The placeholder branch returns the
+ // Placeholder directly (cpp's `VISIT(RatioExpr)` short-circuits
+ // and skips the RatioExpr wrapper); the numberLiteral branch
+ // wraps in RatioExpr.
+ let ratio_start = self.peek0.start;
+ if self.peek() == TokenKind::LBrace {
+ return self.parse_brace_dict_or_placeholder();
+ }
+ let left = self.consume_ratio_value()?;
+ let right = if self.eat(TokenKind::Slash)? {
+ Some(self.consume_ratio_value()?)
+ } else {
+ None
+ };
+ let mut obj = serde_json::Map::new();
+ obj.insert("node".into(), Value::String("RatioExpr".into()));
+ obj.insert("left".into(), left);
+ if let Some(r) = right {
+ obj.insert("right".into(), r);
+ }
+ Ok(self.wrap_pos(Value::Object(obj), ratio_start))
+ }
+
+ /// `<table> PIVOT (aggregates pivotColumnList (GROUP BY exprList)?)`
+ /// or `<table> UNPIVOT (INCLUDE NULLS)? (unpivotColumnList)`. Both
+ /// decorate the table reference. `tableExpr` is left-recursive
+ /// (`tableExpr PIVOT …`), so decorators chain — `t PIVOT (…) UNPIVOT
+ /// (…)` nests each decorator's result directly as the next one's
+ /// `table` (no per-level `JoinExpr` wrapper; the caller wraps the
+ /// whole chain once). Loops until neither keyword follows.
+ /// `table_start` is the byte offset where the table expression
+ /// preceding the PIVOT / UNPIVOT begins; cpp's `JoinExprPivot` /
+ /// `JoinExprUnpivot` ctx covers `tableExpr PIVOT/UNPIVOT (...)`
+ /// — span includes that leading table.
+ fn try_consume_pivot_unpivot(
+ &mut self,
+ mut table: Value,
+ table_start: usize,
+ ) -> Result<Value, ParseError> {
+ loop {
+ if matches!(self.peek(), TokenKind::Keyword(Kw::Pivot)) {
+ let pivot_start = table_start;
+ self.bump()?;
+ self.expect(TokenKind::LParen, "(")?;
+ let aggregates = self.parse_expr_list_until_terminators_at_for_or_rparen()?;
+ // Parse pivotColumnList: `FOR pivotColumn+` where each
+ // pivotColumn is `<expr|tuple> IN (cols)`.
+ self.expect_kw(Kw::For, "FOR")?;
+ let mut columns: Vec<Value> = Vec::new();
+ loop {
+ let col_expr = self.parse_expr_tuple_or_single(true)?;
+ self.expect_kw(Kw::In, "IN")?;
+ self.expect(TokenKind::LParen, "(")?;
+ // Grammar: `pivotColumn: columnExprTupleOrSingle IN
+ // LPAREN columnExprList RPAREN` — the IN list is
+ // non-empty (`columnExprList: columnExpr (COMMA
+ // columnExpr)* COMMA?`). cpp rejects empty `IN ()`.
+ if self.peek() == TokenKind::RParen {
+ return Err(self.err("PIVOT `IN (…)` list must be non-empty"));
+ }
+ let values = self.parse_expr_list_until_paren()?;
+ self.expect(TokenKind::RParen, ")")?;
+ columns.push(json!({
+ "node": "PivotColumn",
+ "column": col_expr,
+ "values": values,
+ }));
+ // `pivotColumn+`: keep collecting columns until the
+ // list terminator — the closing `)` or an optional
+ // `GROUP BY`. Anything else begins the next
+ // `columnExprTupleOrSingle`, so it cannot be enumerated
+ // as a fixed token set (a pivotColumn may open with a
+ // number, string, `{placeholder}`, `*`, `(`, …). cpp's
+ // ALL(*) `+` prediction distinguishes a `GROUP BY`
+ // clause from a `group`-keyword Field by the `BY`.
+ if self.peek() == TokenKind::RParen {
+ break;
+ }
+ if matches!(self.peek(), TokenKind::Keyword(Kw::Group))
+ && self.peek_next() == TokenKind::Keyword(Kw::By)
+ {
+ break;
+ }
+ }
+ // Optional GROUP BY for additional grouping columns.
+ // cpp's `(GROUP BY columnExprList)?` requires the list
+ // to be non-empty when GROUP BY is present — a bare
+ // `GROUP BY)` errors at the trailing paren. Rust's
+ // `parse_expr_list_until_paren` returns an empty Vec on
+ // `)` immediately, silently accepting; reject explicitly
+ // to match cpp.
+ let mut group_by: Option<Vec<Value>> = None;
+ if matches!(self.peek(), TokenKind::Keyword(Kw::Group))
+ && self.peek_next() == TokenKind::Keyword(Kw::By)
+ {
+ self.bump()?;
+ self.bump()?;
+ if self.peek() == TokenKind::RParen {
+ return Err(self.err("PIVOT GROUP BY must have at least one expression"));
+ }
+ group_by = Some(self.parse_expr_list_until_paren()?);
+ }
+ self.expect(TokenKind::RParen, ")")?;
+ let mut obj = serde_json::Map::new();
+ obj.insert("node".into(), Value::String("PivotExpr".into()));
+ obj.insert("table".into(), table);
+ obj.insert("aggregates".into(), Value::Array(aggregates));
+ obj.insert("columns".into(), Value::Array(columns));
+ if let Some(g) = group_by {
+ obj.insert("group_by".into(), Value::Array(g));
+ }
+ table = self.wrap_pos(Value::Object(obj), pivot_start);
+ continue;
+ }
+ if matches!(self.peek(), TokenKind::Keyword(Kw::Unpivot)) {
+ let unpivot_start = table_start;
+ self.bump()?;
+ let include_nulls = matches!(self.peek(), TokenKind::Keyword(Kw::Include))
+ && self.peek_next() == TokenKind::Keyword(Kw::Nulls);
+ if include_nulls {
+ self.bump()?;
+ self.bump()?;
+ }
+ self.expect(TokenKind::LParen, "(")?;
+ // `unpivotColumnList: unpivotColumn (COMMA unpivotColumn)* COMMA?`
+ // where each `unpivotColumn` is
+ // `tos FOR tos IN ( list ) (tos IN ( list ))*`.
+ // The trailing `(tos IN ( list ))*` groups are parsed but
+ // dropped — cpp's visitor keeps only the first IN list.
+ let mut columns: Vec<Value> = Vec::new();
+ loop {
+ // value-columns slot is bounded by `FOR`, not a
+ // structural `IN` — no `pivot_in_stop` needed.
+ let value_columns = self.parse_expr_tuple_or_single(false)?;
+ self.expect_kw(Kw::For, "FOR")?;
+ let name_columns = self.parse_expr_tuple_or_single(true)?;
+ self.expect_kw(Kw::In, "IN")?;
+ self.expect(TokenKind::LParen, "(")?;
+ let unpivot_values = self.parse_expr_list_until_paren()?;
+ self.expect(TokenKind::RParen, ")")?;
+ columns.push(json!({
+ "node": "UnpivotColumn",
+ "value_columns": value_columns,
+ "name_columns": name_columns,
+ "unpivot_values": unpivot_values,
+ }));
+ // Additional `tos IN ( list )` groups (no FOR, no
+ // comma) extend the SAME unpivotColumn; they are
+ // discarded to match cpp.
+ while !matches!(self.peek(), TokenKind::RParen | TokenKind::Comma) {
+ self.parse_expr_tuple_or_single(true)?;
+ self.expect_kw(Kw::In, "IN")?;
+ self.expect(TokenKind::LParen, "(")?;
+ self.parse_expr_list_until_paren()?;
+ self.expect(TokenKind::RParen, ")")?;
+ }
+ if !self.eat(TokenKind::Comma)? {
+ break;
+ }
+ if self.peek() == TokenKind::RParen {
+ break; // trailing `COMMA?`
+ }
+ }
+ self.expect(TokenKind::RParen, ")")?;
+ let mut obj = serde_json::Map::new();
+ obj.insert("node".into(), Value::String("UnpivotExpr".into()));
+ obj.insert("table".into(), table);
+ obj.insert("columns".into(), Value::Array(columns));
+ // cpp's `VISIT(JoinExprUnpivot)` always emits the
+ // `include_nulls` field — default `false` when the
+ // `INCLUDE NULLS` modifier isn't present. Rust used to
+ // omit the field entirely. Emit unconditionally to
+ // match the JSON shape.
+ obj.insert("include_nulls".into(), Value::Bool(include_nulls));
+ table = self.wrap_pos(Value::Object(obj), unpivot_start);
+ continue;
+ }
+ return Ok(table);
+ }
+ }
+
+ /// `( exprList ) | columnExpr` — the `columnExprTupleOrSingle`
+ /// operand used in PIVOT/UNPIVOT column slots.
+ ///
+ /// `columnExprTupleOrSingle: LPAREN columnExprList RPAREN |
+ /// columnExpr`. The parenthesised alternative is always a `Tuple`
+ /// (even a single element — `(x)` → Tuple([x])), but only when the
+ /// matching `)` is the end of the operand, i.e. it is followed by
+ /// the `FOR` / `IN` that bounds it. When a postfix instead follows
+ /// (`(n)()`), cpp's ALL(*) takes the `columnExpr` alternative — a
+ /// parenthesised expression extended by the postfix — so we defer
+ /// to the expression parser there.
+ ///
+ /// The `columnExpr` alternative is parsed at full binding power so
+ /// an operand that itself contains infix operators (`x in y`,
+ /// `a = b`, `m as x`, …) is captured whole. For a slot bounded by a
+ /// structural `IN ( values )` (`in_separated`),
+ /// `find_pivot_in_separator` locates that `IN` and `pivot_in_stop`
+ /// makes the Pratt `in` handler yield it back instead of consuming
+ /// it as an operator. The value-columns slot of an `unpivotColumn`
+ /// is bounded by `FOR` instead — never an infix operator — so it
+ /// needs no stop.
+ fn parse_expr_tuple_or_single(&mut self, in_separated: bool) -> Result<Value, ParseError> {
+ let op_start = self.peek0.start;
+ if self.peek() == TokenKind::LParen && self.paren_group_followed_by_for_or_in() {
+ self.bump()?;
+ let exprs = self.parse_expr_list_until_paren()?;
+ self.expect(TokenKind::RParen, ")")?;
+ // cpp's UnpivotColumn / PivotColumn visitors construct a
+ // synthetic Tuple (`{node: Tuple, exprs: …}`) without calling
+ // `addPositionInfo` (lines 1141-1148 and 1100-1116 of
+ // `parser_json.cpp`). The grammar's
+ // `columnExprTupleOrSingle: LPAREN columnExprList RPAREN`
+ // exists only inside PIVOT/UNPIVOT, so every call to this
+ // function lands in one of those slots and the Tuple
+ // emission must be position-less to match.
+ return Ok(emit::tuple_(exprs));
+ }
+ let stop = if in_separated {
+ self.find_pivot_in_separator()
+ } else {
+ None
+ };
+ // Single-token operand fallback: when the structural IN is at
+ // position peek1 (i.e. directly after the current token), the
+ // entire operand is just this one token as a Field. cpp's
+ // ANTLR resolves the ambiguous `NOT IN (…)` → `Field([NOT]) IN
+ // (…)` here — NOT cannot start a unary expression because the
+ // following IN isn't an expression atom, so ANTLR falls back
+ // to the bare-identifier alt. Any keyword that's a valid
+ // `identifier` (e.g. NOT / SELECT / IF / NULLS / …) lands
+ // here; plain Ident / QuotedIdent already parse single-token
+ // via parse_ident_lead and don't need the early return.
+ if let Some(stop_pos) = stop {
+ if stop_pos == self.peek1.start
+ && matches!(self.peek(), TokenKind::Keyword(kw) if kw_valid_as_identifier(kw))
+ {
+ let t = self.bump()?;
+ let name = identifier_text(self.text(t), t.kind);
+ return Ok(self.wrap_pos(emit::field(vec![Value::String(name)]), op_start));
+ }
+ }
+ let prev = std::mem::replace(&mut self.pivot_in_stop, stop);
+ let result = self.parse_expr_bp(0);
+ self.pivot_in_stop = prev;
+ result
+ }
+
+ /// Scan the upcoming `columnExprTupleOrSingle` operand and return
+ /// the byte offset of the structural `IN` that separates it from
+ /// its `( values )` list: the *first* depth-0 `IN` immediately
+ /// followed by `(`, before the operand's `FOR` / `)` / `,`
+ /// terminator. `None` when no such `IN` exists (a malformed slot;
+ /// the caller's `expect_kw(In)` then reports it).
+ ///
+ /// "First `IN (`" is the structural one because the `pivotColumn`
+ /// rule (`columnExprTupleOrSingle IN LPAREN … RPAREN`) ends right
+ /// after that list — a following `colN IN ( … )` is the *next*
+ /// `pivotColumn`. An operand-internal `x IN y` (with `y` not a
+ /// `(`) is skipped, so `n IN p IN (r)` still splits as operand
+ /// `n IN p` + separator `IN (r)`. The one shape this mis-splits is
+ /// an operand whose own value is an `IN ( list )` *operator*
+ /// expression (`x IN (1,2) IN (r)`) — vanishingly rare, and
+ /// already rejected before this fix.
+ fn find_pivot_in_separator(&self) -> Option<usize> {
+ // Find the structural `IN` of this pivotColumn.
+ //
+ // cpp's ANTLR ALL(*) greedy-consumes the LHS
+ // `columnExprTupleOrSingle` (a full `columnExpr`, which admits
+ // nested `... IN (...)` operator expressions AND postfix
+ // `(...)` calls on whatever it's already built). The structural
+ // `IN` is the LAST depth-0 `IN (` whose closing `)` is NOT
+ // followed by another token that could extend the LHS via an
+ // infix operator OR a postfix decoration. Any such token means
+ // the columnExpr keeps growing past this `IN ( … )` group.
+ //
+ // Extension tokens: postfix `(` / `[` / `.` / `?.`,
+ // arithmetic / comparison / regex infix tokens, And / Or / In
+ // / Is / Like / Ilike / Between / As keywords, `??`, `::`.
+ // `Not` is intentionally NOT in the set: it's a prefix
+ // operator, so a leading `NOT` starts a new operand. Bare
+ // identifiers / literals / placeholders / `*`-as-spread also
+ // start a new operand (commit the IN as structural).
+ //
+ // `y IN (1) (2) IN (3)` is one pivotColumn:
+ // IN1 = `IN (1)` followed by `(2)` (postfix call); LHS extends.
+ // IN2 = `IN (3)` followed by `)` (end); structural. ✓
+ //
+ // `a IN (1) IN (2)` is one pivotColumn:
+ // IN1 = `IN (1)` followed by `IN` (Compare infix); LHS extends.
+ // IN2 = `IN (2)` followed by `)`; structural. ✓
+ //
+ // `a IN (1) b IN (2)` is two pivotColumns:
+ // IN1 = `IN (1)` followed by `b` (new LHS); structural. ✓
+ //
+ // `a IN (1) NOT IN (2)` is two pivotColumns:
+ // IN1 = `IN (1)` followed by `NOT` (prefix); structural. ✓
+ // IN2 = `IN (2)` is the second column's separator. ✓
+ let mut probe = Lexer::with_pos(self.src, self.peek0.start);
+ let mut depth: i32 = 0;
+ let mut pending_in: Option<usize> = None;
+ // After an `IN ( ... )` group closes, this state holds the
+ // start-pos of the candidate IN until we see the *next* token
+ // and decide whether it's a postfix `(` (extends LHS) or
+ // anything else (commits the IN as structural).
+ let mut candidate_after_close: Option<usize> = None;
+ while let Ok(tok) = probe.next_token() {
+ if let Some(in_pos) = candidate_after_close.take() {
+ if !token_extends_pivot_column_lhs(tok.kind) {
+ return Some(in_pos);
+ }
+ // The IN ( … ) group is followed by something that
+ // extends the LHS (postfix call / array / dot, or
+ // any infix operator / keyword that takes a LHS).
+ // Keep scanning for a later structural IN. Fall
+ // through to the normal token handling so we keep
+ // tracking depth via `LParen` / `LBracket` / `LBrace`.
+ }
+ if let Some(in_pos) = pending_in.take() {
+ if tok.kind == TokenKind::LParen {
+ // Found `IN (`; we'll commit it as structural when
+ // the matching `)` closes AND the following token
+ // isn't another `(`.
+ depth += 1;
+ // Scan to matching close.
+ while depth > 0 {
+ let inner = match probe.next_token() {
+ Ok(t) => t,
+ Err(_) => return None,
+ };
+ match inner.kind {
+ TokenKind::LParen | TokenKind::LBracket | TokenKind::LBrace => {
+ depth += 1
+ }
+ TokenKind::RParen | TokenKind::RBracket | TokenKind::RBrace => {
+ depth -= 1
+ }
+ TokenKind::Eof => return None,
+ _ => {}
+ }
+ }
+ candidate_after_close = Some(in_pos);
+ continue;
+ }
+ }
+ match tok.kind {
+ TokenKind::LParen | TokenKind::LBracket | TokenKind::LBrace => depth += 1,
+ TokenKind::RParen | TokenKind::RBracket | TokenKind::RBrace => {
+ if depth == 0 {
+ break;
+ }
+ depth -= 1;
+ }
+ TokenKind::Comma if depth == 0 => break,
+ TokenKind::Keyword(Kw::For) if depth == 0 => break,
+ TokenKind::Keyword(Kw::In) if depth == 0 => pending_in = Some(tok.start),
+ TokenKind::Eof => break,
+ _ => {}
+ }
+ }
+ // Reached end of pivotColumn body. If the most-recent IN-(...)
+ // group has no follow-on `(`, commit it.
+ candidate_after_close
+ }
+
+ /// `self.peek()` is `(` — scan to its matching `)` and report
+ /// whether a `FOR` / `IN` keyword immediately follows it.
+ fn paren_group_followed_by_for_or_in(&self) -> bool {
+ let mut probe = Lexer::with_pos(self.src, self.peek0.end);
+ let mut depth: i32 = 1;
+ loop {
+ let tok = match probe.next_token() {
+ Ok(t) => t,
+ Err(_) => return false,
+ };
+ match tok.kind {
+ TokenKind::LParen | TokenKind::LBracket | TokenKind::LBrace => depth += 1,
+ TokenKind::RParen | TokenKind::RBracket | TokenKind::RBrace => {
+ depth -= 1;
+ if depth == 0 {
+ let after = probe.next_token().map(|t| t.kind).unwrap_or(TokenKind::Eof);
+ return matches!(
+ after,
+ TokenKind::Keyword(Kw::For) | TokenKind::Keyword(Kw::In)
+ );
+ }
+ }
+ TokenKind::Eof => return false,
+ _ => {}
+ }
+ }
+ }
+
+ /// Like parse_expr_list_until_terminators, but also stops at `FOR`
+ /// (used inside PIVOT to separate aggregate list from the column
+ /// spec). Comma-separated.
+ fn parse_expr_list_until_terminators_at_for_or_rparen(
+ &mut self,
+ ) -> Result<Vec<Value>, ParseError> {
+ let mut out = Vec::new();
+ loop {
+ out.push(self.parse_expr_bp(0)?);
+ if !self.eat(TokenKind::Comma)? {
+ break;
+ }
+ if matches!(self.peek(), TokenKind::Keyword(Kw::For))
+ || self.peek() == TokenKind::RParen
+ {
+ break;
+ }
+ }
+ Ok(out)
+ }
+}
+
+/// `true` when `kind` can extend the LHS columnExpr of a pivotColumn
+/// past a preceding `IN ( … )` group — either a postfix decoration
+/// (`(...)`, `[...]`, `.x`, `?.x`) or an infix operator that takes a
+/// LHS. cpp's ANTLR ALL(*) keeps eating tokens into the LHS as long
+/// as one of these follows; the structural `IN` of the pivotColumn is
+/// the LAST one whose closing `)` is NOT followed by an extender. A
+/// `NOT` (prefix), bare identifier, literal, placeholder, top-level
+/// `*` (spread asterisk), or `,` / `)` / `FOR` / `GROUP BY` instead
+/// commits the IN as structural.
+fn token_extends_pivot_column_lhs(kind: TokenKind) -> bool {
+ matches!(
+ kind,
+ TokenKind::LParen
+ | TokenKind::LBracket
+ | TokenKind::Dot
+ | TokenKind::NullProperty
+ | TokenKind::DoubleColon
+ | TokenKind::Asterisk
+ | TokenKind::Slash
+ | TokenKind::Percent
+ | TokenKind::Plus
+ | TokenKind::Dash
+ | TokenKind::Concat
+ | TokenKind::Nullish
+ | TokenKind::EqDouble
+ | TokenKind::EqSingle
+ | TokenKind::NotEq
+ | TokenKind::Lt
+ | TokenKind::LtEq
+ | TokenKind::Gt
+ | TokenKind::GtEq
+ | TokenKind::RegexSingle
+ | TokenKind::RegexDouble
+ | TokenKind::IRegexSingle
+ | TokenKind::IRegexDouble
+ | TokenKind::NotRegex
+ | TokenKind::NotIRegex
+ | TokenKind::Keyword(
+ Kw::And | Kw::Or | Kw::In | Kw::Is | Kw::Like | Kw::Ilike | Kw::Between | Kw::As,
+ )
+ )
+}
+
+/// Walk a JOIN chain (the outermost `JoinExpr`'s `next_join` linked
+/// list) inward-to-outward, looking for the FIRST `JoinExpr` along
+/// the way whose `constraint` is missing / null, and attach the given
+/// constraint there. Returns `true` on success, `false` when every
+/// level already has a constraint.
+///
+/// "Inward-to-outward" because cpp's right-associative join parse for
+/// `a JOIN b JOIN c ON1 ON2` puts ON1 on the innermost (`c`) and ON2
+/// on the next outer (`b`). The first stranded ON attaches inward
+/// (after the loop's left-to-right pass already placed one on the
+/// deepest JoinExpr); the second moves outward; etc.
+/// `min_attachable_depth` is the chain depth at which scope-local joins begin
+/// (one past the lead's pre-existing chain). Nodes shallower than that
+/// belong to a parens-wrapped inner scope and are opaque — we recurse
+/// through them but never attach.
+fn attach_constraint_to_outermost_unconstrained_join(
+ node: &mut Value,
+ constraint: Value,
+ min_attachable_depth: usize,
+ current_depth: usize,
+) -> bool {
+ let Some(obj) = node.as_object_mut() else {
+ return false;
+ };
+ if obj.get("node").and_then(Value::as_str) != Some("JoinExpr") {
+ return false;
+ }
+ if let Some(nj) = obj.get_mut("next_join") {
+ if nj.is_object()
+ && attach_constraint_to_outermost_unconstrained_join(
+ nj,
+ constraint.clone(),
+ min_attachable_depth,
+ current_depth + 1,
+ )
+ {
+ return true;
+ }
+ }
+ if current_depth < min_attachable_depth {
+ return false;
+ }
+ // Per the grammar, only `JoinExprOp` and `JoinExprPositional` take a
+ // `joinConstraintClause`. The lead `JoinExprTable` carries no `join_type`,
+ // and `JoinExprCrossOp` is explicitly CROSS — refuse both.
+ let accepts_constraint = matches!(
+ obj.get("join_type").and_then(Value::as_str),
+ Some(jt) if jt != "CROSS JOIN"
+ );
+ if !accepts_constraint {
+ return false;
+ }
+ if matches!(obj.get("constraint"), None | Some(Value::Null)) {
+ obj.insert("constraint".into(), constraint);
+ return true;
+ }
+ false
+}
+
+/// Count JoinExprs linked via `next_join`. Lead is depth 1.
+fn chain_depth(node: &Value) -> usize {
+ let mut depth = 1;
+ let mut cursor = node;
+ while let Some(nj) = cursor.as_object().and_then(|o| o.get("next_join")) {
+ if !nj.is_object() {
+ break;
+ }
+ depth += 1;
+ cursor = nj;
+ }
+ depth
+}
diff --git a/rust/hogql/parser/src/parse/program.rs b/rust/hogql/parser/src/parse/program.rs
new file mode 100644
index 000000000000..bff5e9eb0156
--- /dev/null
+++ b/rust/hogql/parser/src/parse/program.rs
@@ -0,0 +1,943 @@
+//! Hog program-statement parsing — the imperative-language layer
+//! built on top of the HogQL expression grammar.
+//!
+//! Grammar (HogQLParser.g4):
+//!
+//! program : declaration* EOF
+//! declaration : varDecl | statement
+//! varDecl : LET ident (':=' expression)?
+//! statement : returnStmt | throwStmt | tryCatchStmt | ifStmt
+//! | whileStmt | forInStmt | forStmt | funcStmt
+//! | varAssignment | block | exprStmt | emptyStmt
+//! block : '{' declaration* '}'
+//!
+//! AST shapes (cpp parity, dropping start/end / null defaults):
+//! - VariableDeclaration { name, expr }
+//! - VariableAssignment { left, right }
+//! - ExprStatement { expr }
+//! - IfStatement { expr, then, else_ }
+//! - WhileStatement { expr, body }
+//! - ForStatement { initializer, condition, increment, body }
+//! - ForInStatement { keyVar, valueVar, expr, body }
+//! - Function { name, params: [str], body: Block }
+//! - ReturnStatement { expr }
+//! - ThrowStatement { expr }
+//! - TryCatchStatement { try_stmt, catches: [[var, type|null, block], ...], finally_stmt }
+//! - Block { declarations: [decl, ...] }
+//! - Program { declarations: [decl, ...] }
+
+use serde_json::{json, Value};
+
+use super::{identifier_text, kw_valid_as_identifier, Parser};
+use crate::emit;
+use crate::error::ParseError;
+use crate::lex::{Kw, Lexer, TokenKind};
+
+impl<'a> Parser<'a> {
+ pub(crate) fn parse_program(&mut self) -> Result<Value, ParseError> {
+ let prog_start = self.peek0.start;
+ let mut declarations: Vec<Value> = Vec::new();
+ while !matches!(self.peek(), TokenKind::Eof) {
+ // Empty statement (a stray `;`) is a no-op — skip it
+ // without producing a declaration so the AST stays clean.
+ if self.peek() == TokenKind::Semicolon {
+ self.bump()?;
+ continue;
+ }
+ declarations.push(self.parse_declaration()?);
+ }
+ // cpp's `VISIT(Program)` calls `addPositionInfo(json, ctx)`, and
+ // ANTLR's Program ctx ends at the EOF token — i.e. the source
+ // length, NOT the end of the last meaningful token. Any trailing
+ // whitespace / `;` / newline is included in the span. Use the
+ // source length explicitly rather than `last_consumed_end` so
+ // `let x := 1\n` ends at 11 (matching cpp) not 10 (the `1`).
+ let prog_end = self.src.len();
+ Ok(self.wrap_pos_to(
+ json!({
+ "node": "Program",
+ "declarations": declarations,
+ }),
+ prog_start,
+ prog_end,
+ ))
+ }
+
+ fn parse_declaration(&mut self) -> Result<Value, ParseError> {
+ let decl_start = self.peek0.start;
+ let result = if self.peek() == TokenKind::Keyword(Kw::Let) {
+ self.parse_var_decl()?
+ } else {
+ self.parse_statement()?
+ };
+ Ok(self.wrap_pos(result, decl_start))
+ }
+
+ /// Parse a statement-level expression — a `varAssignment` target
+ /// or RHS, a `varDecl` / `return` / `throw` value, or a bare
+ /// `exprStmt` — with the `stop_postfix_call_before_colon_equals`
+ /// guard active, so a trailing `(…) :=` opens the NEXT statement
+ /// instead of folding into this expression as a postfix call.
+ fn parse_stmt_rhs_expr(&mut self) -> Result<Value, ParseError> {
+ let prev_postfix = self.stop_postfix_call_before_colon_equals;
+ self.stop_postfix_call_before_colon_equals = true;
+ let prev_recover = self.stmt_rhs_recover_on_pratt_rhs_failure;
+ self.stmt_rhs_recover_on_pratt_rhs_failure = true;
+ let result = self.parse_expr_bp(0);
+ self.stop_postfix_call_before_colon_equals = prev_postfix;
+ self.stmt_rhs_recover_on_pratt_rhs_failure = prev_recover;
+ result
+ }
+
+ /// `LET ident (':=' expression)?` (no required trailing `;` —
+ /// cpp's `varDecl` doesn't include it). The optional trailing `;`
+ /// is consumed at the statement level via the `emptyStmt` skip in
+ /// `parse_program` / `parse_block`. We do NOT consume it here:
+ /// cpp's `VarDecl` ctx span ends at the expression token, not at
+ /// the trailing `;`, so wrapping with `last_consumed_end` after a
+ /// local `eat(Semicolon)` would over-extend the span by 1 byte
+ /// vs cpp's `addPositionInfo(json, ctx)`.
+ fn parse_var_decl(&mut self) -> Result<Value, ParseError> {
+ self.expect_kw(Kw::Let, "let")?;
+ let name_tok = self.bump()?;
+ let name = match name_tok.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent => {
+ identifier_text(self.text(name_tok), name_tok.kind)
+ }
+ // cpp's `varDecl: LET identifier …` routes through the
+ // grammar's `identifier` rule, which omits NULL / INF / NAN
+ // and the Hog-statement keywords. `kw_valid_as_identifier`
+ // is exactly that filter.
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
+ identifier_text(self.text(name_tok), name_tok.kind)
+ }
+ _ => {
+ return Err(self.err(format!(
+ "expected variable name after `let`, got {:?}",
+ name_tok.kind
+ )));
+ }
+ };
+ let mut obj = serde_json::Map::new();
+ obj.insert("node".into(), Value::String("VariableDeclaration".into()));
+ obj.insert("name".into(), Value::String(name));
+ if self.eat(TokenKind::ColonEquals)? {
+ let cp = self.checkpoint();
+ let expr = self.parse_stmt_rhs_expr()?;
+ // cpp's varDecl grammar (`LET ident (':=' expression)?`)
+ // has no place for a trailing `:=` after the expression.
+ // When one follows, cpp's ANTLR ALL(*) shortens the
+ // expression to the shortest prefix (the leading single
+ // token) that leaves the trailing `:=` as the START of a
+ // *new* statement's varAssignment lvalue. `let x := y *
+ // (z) := 3` → `let x := y` + `*(z) := 3`. Rust used to
+ // greedy-parse the full `y * (z)` and then choke on the
+ // dangling `:=`.
+ if self.peek() == TokenKind::ColonEquals {
+ // Shorten to the leading primary form. cpp's ALL(*)
+ // does the equivalent: take the shortest columnExpr
+ // prefix (typically just one primary — a single token
+ // for ident/number/string/`*`, or a paren-wrapped
+ // group unwrapped to its inner) that leaves the
+ // trailing `:=` and its rhs as a separate statement.
+ // `parse_prefix` handles all primary shapes cleanly.
+ self.restore(cp)?;
+ match self.parse_prefix() {
+ Ok(primary) => {
+ obj.insert("expr".into(), primary);
+ }
+ Err(_) => {
+ // Re-parse and accept the full greedy result —
+ // we'll error at the next statement boundary
+ // the same way the original code did.
+ self.restore(cp)?;
+ obj.insert("expr".into(), self.parse_stmt_rhs_expr()?);
+ }
+ }
+ } else {
+ obj.insert("expr".into(), expr);
+ }
+ }
+ Ok(Value::Object(obj))
+ }
+
+ fn parse_statement(&mut self) -> Result<Value, ParseError> {
+ let stmt_start = self.peek0.start;
+ let result = self.parse_statement_inner()?;
+ Ok(self.wrap_pos(result, stmt_start))
+ }
+
+ fn parse_statement_inner(&mut self) -> Result<Value, ParseError> {
+ match self.peek() {
+ TokenKind::Keyword(Kw::Return) => self.parse_return_stmt(),
+ TokenKind::Keyword(Kw::Throw) => self.parse_throw_stmt(),
+ TokenKind::Keyword(Kw::Try) => self.parse_try_catch_stmt(),
+ // `ifStmt` / `forStmt` / `forInStmt` open with `IF` / `FOR`
+ // then a mandatory `(` — but `IF` and `FOR` are also
+ // `keyword`-rule identifiers, so an `if` / `for` that is
+ // NOT opening its statement form (`if cond {…}` with no
+ // parens, a bare `for` lvalue) is just a Field. cpp's
+ // ALL(*) takes `statement`'s `ifStmt` / `forStmt` alt only
+ // when the whole statement parses; otherwise it falls to
+ // `exprStmt`. `try_alt` mirrors that: the statement form is
+ // tried first, and a failure rolls back to the expression
+ // statement (`while` / `fn` / `fun` are NOT in the
+ // `keyword` rule, so they have no such fallback).
+ TokenKind::Keyword(Kw::If) => {
+ self.try_alt(&[&Self::parse_if_stmt, &Self::parse_expr_or_assignment_stmt])
+ }
+ TokenKind::Keyword(Kw::While) => self.parse_while_stmt(),
+ TokenKind::Keyword(Kw::For) => self.try_alt(&[
+ &Self::parse_for_or_for_in_stmt,
+ &Self::parse_expr_or_assignment_stmt,
+ ]),
+ TokenKind::Keyword(Kw::Fn) | TokenKind::Keyword(Kw::Fun) => self.parse_func_stmt(),
+ // A leading `{` is a three-way ambiguity — cpp's
+ // `statement` rule lists `varAssignment | block | exprStmt`
+ // and ANTLR's ALL(*) picks the first that consumes the
+ // whole statement:
+ // - `{…} := …` → varAssignment (`{…}` is a Dict/
+ // Placeholder *expression* used as the lvalue)
+ // - `{}` / `{ <decls> }` → Block
+ // - `{1: 2}` / `{x}`-as-Dict → exprStmt
+ // Mirror the precedence with `try_alt`: the var-assignment
+ // arm rejects unless it actually found `:=`, so `{}` falls
+ // through to the Block arm, and `{1: 2}` (whose body isn't
+ // a valid `declaration*`) falls through to the exprStmt arm.
+ TokenKind::LBrace => {
+ // cpp's ANTLR ALL(*) prefers the exprStmt alt when a
+ // postfix `(` or `.` follows the matching `}` — `{1}()`
+ // and `{1}.x` are `Placeholder(1)` extended by a
+ // postfix call / property access, not a Block followed
+ // by stray tokens. Other postfixes (`[…]`, `+`, …) keep
+ // the Block interpretation, matching cpp. Probe the
+ // matching `}` to decide.
+ if self.brace_followed_by_postfix_call_or_dot() {
+ self.parse_expr_or_assignment_stmt()
+ } else {
+ self.try_alt(&[
+ &Self::parse_brace_lvalue_assignment,
+ &Self::parse_block,
+ &Self::parse_expr_or_assignment_stmt,
+ ])
+ }
+ }
+ // `emptyStmt: SEMICOLON` — a bare `;` as a statement.
+ // cpp's `VISIT(EmptyStmt)` emits `ExprStatement(expr=null)`.
+ // Reached when a statement *slot* holds `;` — e.g. a
+ // `while (…) ;` / `for (…;…;…) ;` body or an `if` branch.
+ // (At the program / block level a stray `;` is skipped
+ // outright in `parse_program` / `parse_block`.)
+ TokenKind::Semicolon => {
+ self.bump()?;
+ Ok(json!({"node": "ExprStatement", "expr": Value::Null}))
+ }
+ _ => self.parse_expr_or_assignment_stmt(),
+ }
+ }
+
+ fn parse_return_stmt(&mut self) -> Result<Value, ParseError> {
+ self.expect_kw(Kw::Return, "return")?;
+ let mut obj = serde_json::Map::new();
+ obj.insert("node".into(), Value::String("ReturnStatement".into()));
+ // `returnStmt: RETURN expression? SEMICOLON?` — the expression
+ // is optional. cpp's ANTLR takes the `?` only when an
+ // `expression` actually parses. Two filters mirror that:
+ //
+ // 1. A token that begins the NEXT declaration instead — `let`
+ // (varDecl), a Hog-statement keyword, or a statement/block
+ // terminator — is never an expression start (`return let x`
+ // is a bare return + varDecl; `{ return }` is a Block with
+ // a bare return).
+ // 2. For the remaining tokens the expression CAN start but may
+ // not parse to completion — `return { return {} }` (the
+ // `{…}` is a Block statement, not a Dict) or `return for (…)`
+ // (`for` is a keyword-ident but `(… ; …)` can't be its
+ // call-args). cpp's ALL(*) backtracks here; we mirror with
+ // a checkpoint — if `parse_expr_bp` fails, roll back and
+ // emit a bare return so the stranded tokens become the
+ // next declaration.
+ if peek_starts_return_expr(self.peek()) {
+ let cp = self.checkpoint();
+ match self.parse_stmt_rhs_expr() {
+ Ok(_) if self.peek() == TokenKind::ColonEquals => {
+ // `return <expr> := …` — taking the full expression
+ // would strand the `:=`. cpp's ALL(*) backtracks to
+ // the shortest expr PREFIX that leaves the rest
+ // parseable as a statement. The common shortenings:
+ //
+ // - `return * columns(…) := …` → expr is just `*`
+ // (Field(['*'])); the `columns(…) := …` becomes
+ // a varAssignment whose lvalue is the `columns`
+ // call.
+ // - `return columns(…) := …` → expr is `columns`
+ // (Field(['columns'])); the `(…) := …` becomes
+ // a varAssignment whose lvalue is the
+ // parenthesised inner.
+ // - `return return * ('e') := {}` → expr is the
+ // head Keyword as a Field; the rest forms a
+ // `* ('e') := {}` varAssignment. cpp consistently
+ // shortens to the FIRST single-token Field,
+ // regardless of what immediately follows.
+ // - Otherwise (e.g. `return a.b := c` where the
+ // first token would chain) no valid shortening
+ // exists; fall back to bare return so `a.b := c`
+ // opens the next stmt.
+ self.restore(cp)?;
+ if self.peek() == TokenKind::Asterisk {
+ self.bump()?;
+ obj.insert("expr".into(), emit::field(vec![Value::String("*".into())]));
+ } else if matches!(
+ self.peek(),
+ TokenKind::Ident | TokenKind::QuotedIdent | TokenKind::Keyword(_)
+ ) && !matches!(
+ self.peek_next(),
+ TokenKind::Dot | TokenKind::NullProperty
+ ) {
+ // First single token as Field — cpp shortens to
+ // a one-element chain regardless of what comes
+ // after (call, infix, or another statement
+ // keyword). The Dot / `?.` exclusion stops a
+ // multi-token chain `a.b := c` from being
+ // split (cpp's ANTLR backtracks past chained
+ // shortening to the bare-return path in that
+ // shape).
+ let t = self.bump()?;
+ let name = identifier_text(self.text(t), t.kind);
+ obj.insert("expr".into(), emit::field(vec![Value::String(name)]));
+ } else {
+ obj.insert("expr".into(), Value::Null);
+ }
+ }
+ Ok(expr) => {
+ obj.insert("expr".into(), expr);
+ }
+ Err(_) => {
+ self.restore(cp)?;
+ obj.insert("expr".into(), Value::Null);
+ }
+ }
+ } else {
+ obj.insert("expr".into(), Value::Null);
+ }
+ let _ = self.eat(TokenKind::Semicolon)?;
+ Ok(Value::Object(obj))
+ }
+
+ fn parse_throw_stmt(&mut self) -> Result<Value, ParseError> {
+ self.expect_kw(Kw::Throw, "throw")?;
+ let mut obj = serde_json::Map::new();
+ obj.insert("node".into(), Value::String("ThrowStatement".into()));
+ // `throwStmt: THROW expression SEMICOLON?` — the expression is
+ // MANDATORY (unlike `returnStmt`'s `expression?`). A bare
+ // `throw` / `throw;` is rejected. `parse_expr_bp` raises on a
+ // missing expression, so no explicit empty-check is needed.
+ obj.insert("expr".into(), self.parse_stmt_rhs_expr()?);
+ let _ = self.eat(TokenKind::Semicolon)?;
+ Ok(Value::Object(obj))
+ }
+
+ fn parse_if_stmt(&mut self) -> Result<Value, ParseError> {
+ self.expect_kw(Kw::If, "if")?;
+ self.expect(TokenKind::LParen, "(")?;
+ let cond = self.parse_expr_bp(0)?;
+ self.expect(TokenKind::RParen, ")")?;
+ let then = self.parse_statement()?;
+ let else_ = if self.eat_kw(Kw::Else)? {
+ Some(self.parse_statement()?)
+ } else {
+ None
+ };
+ Ok(json!({
+ "node": "IfStatement",
+ "expr": cond,
+ "then": then,
+ "else_": else_.unwrap_or(Value::Null),
+ }))
+ }
+
+ fn parse_while_stmt(&mut self) -> Result<Value, ParseError> {
+ self.expect_kw(Kw::While, "while")?;
+ self.expect(TokenKind::LParen, "(")?;
+ let cond = self.parse_expr_bp(0)?;
+ self.expect(TokenKind::RParen, ")")?;
+ let body = self.parse_statement()?;
+ let _ = self.eat(TokenKind::Semicolon)?;
+ Ok(json!({
+ "node": "WhileStatement",
+ "expr": cond,
+ "body": body,
+ }))
+ }
+
+ /// `for (...)` dispatches between the C-style triple-clause form
+ /// and the `for (let ident (, ident)? in expr) body` for-in form
+ /// by probing past the `LET`.
+ fn parse_for_or_for_in_stmt(&mut self) -> Result<Value, ParseError> {
+ self.expect_kw(Kw::For, "for")?;
+ self.expect(TokenKind::LParen, "(")?;
+ // Detect for-in by probing: `LET ident (, ident)? IN`.
+ if self.peek() == TokenKind::Keyword(Kw::Let) && self.is_for_in_shape() {
+ self.bump()?; // LET
+ let first_tok = self.bump()?;
+ let first = match first_tok.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent => {
+ identifier_text(self.text(first_tok), first_tok.kind)
+ }
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
+ identifier_text(self.text(first_tok), first_tok.kind)
+ }
+ _ => {
+ return Err(self.err(format!(
+ "expected loop variable after `let`, got {:?}",
+ first_tok.kind
+ )));
+ }
+ };
+ // Single-var `for (let v in ...)` → keyVar=None,
+ // valueVar=v. Two-var `for (let k, v in ...)` →
+ // keyVar=k, valueVar=v. cpp's emitter follows the same
+ // convention: in the single-binding form the binding
+ // names the *value*, not the key.
+ let (key_var, value_var) = if self.eat(TokenKind::Comma)? {
+ let v_tok = self.bump()?;
+ let v = match v_tok.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent => {
+ identifier_text(self.text(v_tok), v_tok.kind)
+ }
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
+ identifier_text(self.text(v_tok), v_tok.kind)
+ }
+ _ => {
+ return Err(
+ self.err(format!("expected value variable, got {:?}", v_tok.kind))
+ );
+ }
+ };
+ (Some(first), v)
+ } else {
+ (None, first)
+ };
+ self.expect_kw(Kw::In, "in")?;
+ let iter_expr = self.parse_expr_bp(0)?;
+ self.expect(TokenKind::RParen, ")")?;
+ let body = self.parse_statement()?;
+ let _ = self.eat(TokenKind::Semicolon)?;
+ return Ok(json!({
+ "node": "ForInStatement",
+ "keyVar": key_var.map(Value::String).unwrap_or(Value::Null),
+ "valueVar": value_var,
+ "expr": iter_expr,
+ "body": body,
+ }));
+ }
+ // C-style: (init?; cond?; incr?) body
+ let initializer = if self.peek() != TokenKind::Semicolon {
+ Some(self.parse_for_clause()?)
+ } else {
+ None
+ };
+ self.expect(TokenKind::Semicolon, ";")?;
+ let condition = if self.peek() != TokenKind::Semicolon {
+ Some(self.parse_expr_bp(0)?)
+ } else {
+ None
+ };
+ self.expect(TokenKind::Semicolon, ";")?;
+ let increment = if self.peek() != TokenKind::RParen {
+ Some(self.parse_for_clause()?)
+ } else {
+ None
+ };
+ self.expect(TokenKind::RParen, ")")?;
+ let body = self.parse_statement()?;
+ let _ = self.eat(TokenKind::Semicolon)?;
+ Ok(json!({
+ "node": "ForStatement",
+ "initializer": initializer.unwrap_or(Value::Null),
+ "condition": condition.unwrap_or(Value::Null),
+ "increment": increment.unwrap_or(Value::Null),
+ "body": body,
+ }))
+ }
+
+ /// `for`'s initializer / increment slot accepts `varDecl`,
+ /// `varAssignment` (expr := expr), or a bare expression. The
+ /// varDecl shape is unambiguous (`LET` prefix); the other two
+ /// share the expression prefix and disambiguate by the trailing
+ /// `:=` token after the expression.
+ fn parse_for_clause(&mut self) -> Result<Value, ParseError> {
+ // cpp positions the for-clause initializer / increment in the
+ // outer `ForStmt` ctx, so each shape needs a `start` / `end`
+ // matching cpp's per-node visit. Capture the slot's start and
+ // wrap the emitted VariableDeclaration / VariableAssignment /
+ // expression node before returning.
+ let clause_start = self.peek0.start;
+ if self.peek() == TokenKind::Keyword(Kw::Let) {
+ let decl = self.parse_var_decl_no_semicolon()?;
+ return Ok(self.wrap_pos(decl, clause_start));
+ }
+ // Bare `IDENT := …` — same special-case as
+ // `parse_expr_or_assignment_stmt`: a leading identifier
+ // (including a keyword-named place) followed by `:=` would
+ // otherwise be absorbed by `parse_ident_lead` into a
+ // `NamedArgument` rather than a `VariableAssignment`.
+ if self.peek_is_bare_assignment_lead() {
+ let id_start = self.peek0.start;
+ let id_end = self.peek0.end;
+ let id = self.bump()?;
+ let name = identifier_text(self.text(id), id.kind);
+ self.bump()?; // `:=`
+ let right = self.parse_stmt_rhs_expr()?;
+ let left =
+ self.wrap_pos_to(json!({"node": "Field", "chain": [name]}), id_start, id_end);
+ return Ok(self.wrap_pos(
+ json!({
+ "node": "VariableAssignment",
+ "left": left,
+ "right": right,
+ }),
+ clause_start,
+ ));
+ }
+ // Leading expression — parsed without the
+ // `stop_postfix_call_before_colon_equals` guard (see
+ // `parse_expr_or_assignment_stmt`): a `(…)` here folds as this
+ // clause's own call.
+ let expr = self.parse_expr_bp(0)?;
+ if self.eat(TokenKind::ColonEquals)? {
+ let right = self.parse_stmt_rhs_expr()?;
+ return Ok(self.wrap_pos(
+ json!({
+ "node": "VariableAssignment",
+ "left": expr,
+ "right": right,
+ }),
+ clause_start,
+ ));
+ }
+ Ok(expr)
+ }
+
+ /// `LET ident (:= expression)?` without the trailing-`;` consume —
+ /// used inside `for (...)` where the `;` is the for-loop
+ /// separator, not a statement terminator.
+ fn parse_var_decl_no_semicolon(&mut self) -> Result<Value, ParseError> {
+ self.expect_kw(Kw::Let, "let")?;
+ let name_tok = self.bump()?;
+ let name = match name_tok.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent => {
+ identifier_text(self.text(name_tok), name_tok.kind)
+ }
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
+ identifier_text(self.text(name_tok), name_tok.kind)
+ }
+ _ => {
+ return Err(self.err(format!(
+ "expected variable name after `let`, got {:?}",
+ name_tok.kind
+ )));
+ }
+ };
+ let mut obj = serde_json::Map::new();
+ obj.insert("node".into(), Value::String("VariableDeclaration".into()));
+ obj.insert("name".into(), Value::String(name));
+ if self.eat(TokenKind::ColonEquals)? {
+ obj.insert("expr".into(), self.parse_stmt_rhs_expr()?);
+ }
+ Ok(Value::Object(obj))
+ }
+
+ /// Probe: starting at the `LET` token after `for (`, look ahead for
+ /// `LET ident (, ident)? IN` — that's the for-in shape. Anything
+ /// else (`LET ident := …`) is a C-style initializer.
+ fn is_for_in_shape(&self) -> bool {
+ let mut probe = Lexer::with_pos(self.src, self.peek0.start);
+ let lt = probe.next_token().ok();
+ if !matches!(
+ lt.as_ref().map(|t| t.kind),
+ Some(TokenKind::Keyword(Kw::Let))
+ ) {
+ return false;
+ }
+ // Loop-var positions route through `identifier`, so a Keyword
+ // is only valid here when `kw_valid_as_identifier` admits it
+ // (excludes Null/Inf/Nan and the Hog-statement keywords).
+ let id = probe.next_token().ok();
+ if !is_hog_identifier_kind(id.as_ref().map(|t| t.kind)) {
+ return false;
+ }
+ let next = probe.next_token().ok();
+ match next.as_ref().map(|t| t.kind) {
+ Some(TokenKind::Keyword(Kw::In)) => true,
+ Some(TokenKind::Comma) => {
+ let id2 = probe.next_token().ok();
+ if !is_hog_identifier_kind(id2.as_ref().map(|t| t.kind)) {
+ return false;
+ }
+ matches!(
+ probe.next_token().ok().map(|t| t.kind),
+ Some(TokenKind::Keyword(Kw::In))
+ )
+ }
+ _ => false,
+ }
+ }
+
+ fn parse_func_stmt(&mut self) -> Result<Value, ParseError> {
+ // FN or FUN — both accepted, both emit the same Function node.
+ self.bump()?;
+ let name_tok = self.bump()?;
+ let name = match name_tok.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent => {
+ identifier_text(self.text(name_tok), name_tok.kind)
+ }
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
+ identifier_text(self.text(name_tok), name_tok.kind)
+ }
+ _ => {
+ return Err(self.err(format!("expected function name, got {:?}", name_tok.kind)));
+ }
+ };
+ self.expect(TokenKind::LParen, "(")?;
+ // `funcStmt … LPAREN identifierList? RPAREN` and
+ // `identifierList: nestedIdentifier (COMMA nestedIdentifier)*
+ // COMMA?` — each parameter is a *nestedIdentifier* (a dotted
+ // chain `a.b.c`, not a single name), and a trailing comma is
+ // allowed. cpp's visitor joins the chain with `.` into one
+ // param string (`a.b.c`).
+ let mut params: Vec<Value> = Vec::new();
+ if self.peek() != TokenKind::RParen {
+ loop {
+ params.push(Value::String(
+ self.parse_nested_identifier_text("parameter name")?,
+ ));
+ if !self.eat(TokenKind::Comma)? {
+ break;
+ }
+ if self.peek() == TokenKind::RParen {
+ break;
+ }
+ }
+ }
+ self.expect(TokenKind::RParen, ")")?;
+ let body = self.parse_block()?;
+ Ok(json!({
+ "node": "Function",
+ "name": name,
+ "params": params,
+ "body": body,
+ }))
+ }
+
+ /// `try block (catch (var (: type)?)? block)* (finally block)?`
+ fn parse_try_catch_stmt(&mut self) -> Result<Value, ParseError> {
+ self.expect_kw(Kw::Try, "try")?;
+ let try_stmt = self.parse_block()?;
+ let mut catches: Vec<Value> = Vec::new();
+ while self.peek() == TokenKind::Keyword(Kw::Catch) {
+ self.bump()?; // catch
+ let (var, ty) = if self.eat(TokenKind::LParen)? {
+ let v_tok = self.bump()?;
+ let v = match v_tok.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent => {
+ identifier_text(self.text(v_tok), v_tok.kind)
+ }
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
+ identifier_text(self.text(v_tok), v_tok.kind)
+ }
+ _ => {
+ return Err(self.err(format!(
+ "expected catch variable name, got {:?}",
+ v_tok.kind
+ )));
+ }
+ };
+ let ty = if self.eat(TokenKind::Colon)? {
+ let t_tok = self.bump()?;
+ let t = match t_tok.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent => {
+ identifier_text(self.text(t_tok), t_tok.kind)
+ }
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
+ identifier_text(self.text(t_tok), t_tok.kind)
+ }
+ _ => {
+ return Err(
+ self.err(format!("expected catch type name, got {:?}", t_tok.kind))
+ );
+ }
+ };
+ Some(t)
+ } else {
+ None
+ };
+ self.expect(TokenKind::RParen, ")")?;
+ (Some(v), ty)
+ } else {
+ (None, None)
+ };
+ let catch_block = self.parse_block()?;
+ catches.push(json!([
+ var.map(Value::String).unwrap_or(Value::Null),
+ ty.map(Value::String).unwrap_or(Value::Null),
+ catch_block,
+ ]));
+ }
+ let finally_stmt = if self.eat_kw(Kw::Finally)? {
+ Some(self.parse_block()?)
+ } else {
+ None
+ };
+ Ok(json!({
+ "node": "TryCatchStatement",
+ "try_stmt": try_stmt,
+ "catches": catches,
+ "finally_stmt": finally_stmt.unwrap_or(Value::Null),
+ }))
+ }
+
+ /// `self.peek()` is `{` — scan to its matching `}` and report
+ /// whether the next token is `(` or `.`. Used at statement start
+ /// to choose between the Block alt (`{ decls }`) and the exprStmt
+ /// alt (`{expr} <postfix>`) — cpp's ANTLR prefers exprStmt for the
+ /// two postfixes that can extend a placeholder expression but
+ /// keeps Block for everything else.
+ fn brace_followed_by_postfix_call_or_dot(&self) -> bool {
+ let mut probe = Lexer::with_pos(self.src, self.peek0.end);
+ let mut depth: i32 = 1;
+ while depth > 0 {
+ let tok = match probe.next_token() {
+ Ok(t) => t,
+ Err(_) => return false,
+ };
+ match tok.kind {
+ TokenKind::LParen | TokenKind::LBracket | TokenKind::LBrace => depth += 1,
+ TokenKind::RParen | TokenKind::RBracket | TokenKind::RBrace => depth -= 1,
+ TokenKind::Eof => return false,
+ _ => {}
+ }
+ }
+ matches!(
+ probe.next_token().map(|t| t.kind),
+ Ok(TokenKind::LParen | TokenKind::Dot)
+ )
+ }
+
+ pub(crate) fn parse_block(&mut self) -> Result<Value, ParseError> {
+ let block_start = self.peek0.start;
+ self.expect(TokenKind::LBrace, "{")?;
+ let mut declarations: Vec<Value> = Vec::new();
+ while !matches!(self.peek(), TokenKind::RBrace | TokenKind::Eof) {
+ if self.peek() == TokenKind::Semicolon {
+ self.bump()?;
+ continue;
+ }
+ declarations.push(self.parse_declaration()?);
+ }
+ self.expect(TokenKind::RBrace, "}")?;
+ Ok(self.wrap_pos(
+ json!({
+ "node": "Block",
+ "declarations": declarations,
+ }),
+ block_start,
+ ))
+ }
+
+ /// Does the cursor sit on a bare `<ident> :=` — a single
+ /// identifier-shaped token immediately followed by `:=`? The token
+ /// is identifier-shaped if it is a plain identifier, a quoted
+ /// identifier, or a keyword admissible wherever the grammar's
+ /// `identifier` rule applies (the `keyword` rule — every keyword
+ /// bar the literal keywords and the hard set-op introducers, see
+ /// `kw_valid_as_identifier`). This is the `varAssignment` whose
+ /// `assignmentTarget` is a lone `columnIdentifier`; it must be
+ /// caught before `parse_ident_lead` folds the `:=` into a
+ /// `NamedArgument`. Keyword-named places — `current := …`,
+ /// `timestamp := …` — are the reason the keyword arm is here:
+ /// without it they slip past the fast path and mis-parse as a
+ /// `NamedArgument` ExprStatement instead of a `VariableAssignment`.
+ fn peek_is_bare_assignment_lead(&self) -> bool {
+ let head_ok = match self.peek() {
+ TokenKind::Ident | TokenKind::QuotedIdent => true,
+ TokenKind::Keyword(kw) => kw_valid_as_identifier(kw),
+ _ => false,
+ };
+ head_ok && self.peek_next() == TokenKind::ColonEquals
+ }
+
+ /// `expr := expr` (VariableAssignment) or `expr` (ExprStatement).
+ /// Disambiguate after parsing the leading expression.
+ ///
+ /// Special-case `IDENT := expr` up front: `parse_expr_bps`
+ /// `parse_ident_lead` would otherwise route the leading ident
+ /// through the NamedArgument branch and absorb the `:=` itself,
+ /// giving us `NamedArgument(ident, expr)` instead of the
+ /// statement-level `VariableAssignment`. Compound lvalues like
+ /// `obj.prop := value` go through the fallback — the Field chain
+ /// completes before `:=` is reached, so parse_ident_lead doesn't
+ /// see the ColonEquals.
+ fn parse_expr_or_assignment_stmt(&mut self) -> Result<Value, ParseError> {
+ if self.peek_is_bare_assignment_lead() {
+ let id_start = self.peek0.start;
+ let id_end = self.peek0.end;
+ let id = self.bump()?;
+ let name = identifier_text(self.text(id), id.kind);
+ self.bump()?; // `:=`
+ let right = self.parse_stmt_rhs_expr()?;
+ // A *second* `:=` after the rhs means cpp's varAssignment
+ // separator is the second one, not the first — the leading
+ // `IDENT := <rhs>` becomes a NamedArgument as the lvalue of
+ // the outer varAssignment. `a := 1 := 2` →
+ // `VariableAssignment(NamedArgument(a, 1), 2)`. cpp arrives
+ // here via the columnExpr alt of varAssignment when the
+ // rhs of the first `:=` is a non-ident-led expression that
+ // stops at the next `:=`.
+ if self.eat(TokenKind::ColonEquals)? {
+ let outer_right = self.parse_stmt_rhs_expr()?;
+ let _ = self.eat(TokenKind::Semicolon)?;
+ return Ok(json!({
+ "node": "VariableAssignment",
+ "left": emit::named_argument(&name, right),
+ "right": outer_right,
+ }));
+ }
+ // The `:=` form is an `exprStmt` (`expression (COLONEQUALS
+ // expression)? SEMICOLON?`) — consume the optional trailing
+ // `;` so `if (c) a := b ; else d` sees the `else`.
+ let _ = self.eat(TokenKind::Semicolon)?;
+ let left =
+ self.wrap_pos_to(json!({"node": "Field", "chain": [name]}), id_start, id_end);
+ return Ok(json!({
+ "node": "VariableAssignment",
+ "left": left,
+ "right": right,
+ }));
+ }
+ // The leading expression is parsed WITHOUT the
+ // `stop_postfix_call_before_colon_equals` guard: a `(…)` here
+ // is this statement's own call (`if(x) := y` is
+ // `Call(if,[x]) := y`, `f() := 1` is `Call(f) := 1`). The
+ // guard is only for a *RHS* parse, where a trailing `(…) :=`
+ // would be the next statement's target.
+ //
+ // We *do* enable the Pratt-RHS-failure recovery flag: cpp's
+ // ALL(*) splits `x *= 2` into `x` + `* = 2` (the `*= 2` lexes
+ // as `*` `=` `2`, and `* = 2` is a valid Compare(Field(*), =,
+ // 2) statement on its own). Rust used to hard-error on the
+ // failed RHS of `*`. Wrap the leading parse in checkpoint +
+ // recovery so a failed infix RHS at the top level yields the
+ // LHS so far and the operator becomes the next statement's
+ // leading token.
+ let prev_recover = self.stmt_rhs_recover_on_pratt_rhs_failure;
+ self.stmt_rhs_recover_on_pratt_rhs_failure = true;
+ let expr_result = self.parse_expr_bp(0);
+ self.stmt_rhs_recover_on_pratt_rhs_failure = prev_recover;
+ let expr = expr_result?;
+ if self.eat(TokenKind::ColonEquals)? {
+ let right = self.parse_stmt_rhs_expr()?;
+ // `exprStmt: expression (COLONEQUALS expression)? SEMICOLON?`
+ // — the `:=` form is an `exprStmt`, so it consumes an
+ // optional trailing `;`. Without it `if (c) a := b ; else
+ // d` would not see the `else` (the `;` would strand).
+ let _ = self.eat(TokenKind::Semicolon)?;
+ return Ok(json!({
+ "node": "VariableAssignment",
+ "left": expr,
+ "right": right,
+ }));
+ }
+ let _ = self.eat(TokenKind::Semicolon)?;
+ Ok(json!({
+ "node": "ExprStatement",
+ "expr": expr,
+ }))
+ }
+
+ /// Read a `nestedIdentifier` — `identifier (DOT identifier)*` —
+ /// and return its parts joined with `.` (cpp's visitor emits the
+ /// dotted chain as one string, with quoted-identifier quotes
+ /// stripped). Used for `funcStmt` parameter names.
+ fn parse_nested_identifier_text(&mut self, what: &str) -> Result<String, ParseError> {
+ let mut parts: Vec<String> = Vec::new();
+ loop {
+ let t = self.bump()?;
+ let part = match t.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent => identifier_text(self.text(t), t.kind),
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
+ identifier_text(self.text(t), t.kind)
+ }
+ _ => {
+ return Err(self.err(format!("expected {what}, got {:?}", t.kind)));
+ }
+ };
+ parts.push(part);
+ if self.peek() != TokenKind::Dot {
+ break;
+ }
+ self.bump()?; // consume `.`
+ }
+ Ok(parts.join("."))
+ }
+
+ /// `try_alt` arm for a `{`-led statement: parse it as a statement
+ /// and accept ONLY if it turned out to be a `VariableAssignment`
+ /// (i.e. a `{…} := …` whose `{…}` lvalue is a `Placeholder`, the
+ /// only `{…}`-shaped `assignmentTarget`). Anything else — a bare
+ /// `{}` Block, a `{1: 2}` Dict exprStmt — is rejected so `try_alt`
+ /// falls through to the Block / exprStmt arms. Mirrors ANTLR
+ /// trying `varAssignment` before `block` / `exprStmt`.
+ fn parse_brace_lvalue_assignment(&mut self) -> Result<Value, ParseError> {
+ let stmt = self.parse_expr_or_assignment_stmt()?;
+ if stmt.get("node").and_then(Value::as_str) == Some("VariableAssignment") {
+ Ok(stmt)
+ } else {
+ Err(self.err("`{…}`-led statement is not a varAssignment"))
+ }
+ }
+}
+
+/// Can `tok` begin the optional `expression` of a `returnStmt`?
+/// `false` for statement/block terminators (`;` `}` `)` `]` `,` EOF)
+/// and for the eight Hog-statement keywords that are NOT in the
+/// grammar's `keyword` rule — `LET` / `WHILE` / `FN` / `FUN` /
+/// `THROW` / `TRY` / `CATCH` / `FINALLY`. Every other keyword
+/// (including `IF` / `FOR` / `RETURN` / `ELSE`) IS in `keyword`, so
+/// it can be a Field identifier and therefore start an expression:
+/// `return return` is `ReturnStatement(expr=Field('return'))`, while
+/// `return while` is a bare return followed by a `whileStmt`.
+fn peek_starts_return_expr(tok: TokenKind) -> bool {
+ !matches!(
+ tok,
+ TokenKind::Semicolon
+ | TokenKind::RBrace
+ | TokenKind::RParen
+ | TokenKind::RBracket
+ | TokenKind::Comma
+ | TokenKind::Eof
+ | TokenKind::Keyword(
+ Kw::Let
+ | Kw::While
+ | Kw::Fn
+ | Kw::Fun
+ | Kw::Throw
+ | Kw::Try
+ | Kw::Catch
+ | Kw::Finally
+ )
+ )
+}
+
+/// `true` when `kind` can stand in for the grammar's `identifier`
+/// rule — Ident / QuotedIdent / any keyword admitted by
+/// `kw_valid_as_identifier` (the `keyword` rule omits NULL / INF / NAN
+/// and the Hog-statement keywords). Used by probe sites that look
+/// ahead for an identifier shape (for-in, lambda heads).
+pub(crate) fn is_hog_identifier_kind(kind: Option<TokenKind>) -> bool {
+ match kind {
+ Some(TokenKind::Ident) | Some(TokenKind::QuotedIdent) => true,
+ Some(TokenKind::Keyword(kw)) => kw_valid_as_identifier(kw),
+ _ => false,
+ }
+}
diff --git a/rust/hogql/parser/src/parse/select.rs b/rust/hogql/parser/src/parse/select.rs
new file mode 100644
index 000000000000..4cf764aa3a8b
--- /dev/null
+++ b/rust/hogql/parser/src/parse/select.rs
@@ -0,0 +1,1739 @@
+//! `SELECT` statement parsing, including the set-operator chain wrapper
+//! and all per-clause helpers: columns, WHERE, GROUP BY (and its CUBE /
+//! ROLLUP / GROUPING SETS variants), HAVING, QUALIFY, WINDOW, ORDER BY +
+//! INTERPOLATE, LIMIT (regular + BY) and OFFSET, plus the trailing
+//! set-level decorators that decorate a `selectSetStmt` rather than the
+//! inner `selectStmt`.
+//!
+//! ARRAY JOIN is handled here (not in `join.rs`) because the grammar
+//! attaches it to the SELECT, not to the join chain.
+
+use serde_json::{json, Value};
+
+use super::expr::is_bare_field;
+use super::{
+ check_alias_not_reserved, format_set_op, identifier_text, inject_ctes_into_select,
+ kw_allowed_as_implicit_alias, merge_select_decorators, Parser, BP_MULT,
+};
+use crate::emit;
+use crate::error::ParseError;
+use crate::lex::{Kw, Lexer, TokenKind};
+
+impl<'a> Parser<'a> {
+ pub(crate) fn parse_select_set_stmt(&mut self) -> Result<Value, ParseError> {
+ let stmt_start = self.peek0.start;
+ let first = self.parse_select_stmt_with_parens()?;
+ let mut subsequent: Vec<Value> = Vec::new();
+ while let Some(op) = self.try_consume_set_op()? {
+ let next = self.parse_select_stmt_with_parens()?;
+ subsequent.push(json!({
+ "node": "SelectSetNode",
+ "select_query": next,
+ "set_operator": op,
+ }));
+ }
+
+ // Optional trailing ORDER BY / LIMIT / OFFSET at the
+ // selectSetStmt level — these decorate the whole set rather than a
+ // single SELECT. The C++ visitor pushes them onto the SelectSetQuery
+ // wrapper (or, if no UNION, onto the single inner SelectQuery).
+ //
+ // Snapshot whether ANY set-level trailing decorator is about
+ // to be consumed; ORDER BY gets consumed-and-dropped (cpp's
+ // VISIT(SelectSetStmt) ignores it) so it wouldn't show up in
+ // the resulting `trailing` vec, but its presence still blocks
+ // the OFFSET-lift below — cpp lifts only when the set-stmt
+ // has NO trailing decorators of any kind.
+ let has_set_level_trailing = matches!(
+ self.peek(),
+ TokenKind::Keyword(Kw::Order)
+ | TokenKind::Keyword(Kw::Limit)
+ | TokenKind::Keyword(Kw::Offset)
+ );
+ let trailing = self.parse_trailing_set_decorators()?;
+
+ if subsequent.is_empty() {
+ // cpp's `VISIT(SelectSetStmt)` only writes `limit_percent`
+ // and `limit_with_ties` in the multi-set branch (lines
+ // 716-721 of parser_json.cpp). The single-select branch
+ // (lines 633-651) writes only `limit` and `offset`. Mirror
+ // that: drop those two fields when collapsing to a single
+ // SelectQuery.
+ let filtered: Vec<(String, Value)> = trailing
+ .into_iter()
+ .filter(|(k, _)| k != "limit_percent" && k != "limit_with_ties")
+ .collect();
+ // Clear the lift sentinel on the inner — it's only meaningful
+ // when wrapping in a SelectSetQuery.
+ let mut first = first;
+ if let Some(obj) = first.as_object_mut() {
+ obj.remove("__rust_offset_liftable");
+ }
+ // A set-level LIMIT / OFFSET clause has nowhere to attach on a
+ // bare `{placeholder}` select body — only `SelectQuery` /
+ // `SelectSetQuery` carry those fields — so it is dropped, the
+ // same way cpp does (`#58885`). Without this the clause would
+ // be written onto the `Placeholder` node and crash AST
+ // deserialization.
+ let body_takes_decorators = matches!(
+ first.get("node").and_then(Value::as_str),
+ Some("SelectQuery") | Some("SelectSetQuery")
+ );
+ if !body_takes_decorators {
+ return Ok(first);
+ }
+ // Do NOT extend the inner SelectQuery / SelectSetQuery's
+ // `end` to cover trailing set-level decorators. cpp's
+ // `VISIT(SelectStmt)` positions the SelectQuery from its own
+ // ctx (which spans whatever the selectStmt rule itself
+ // matched), and the outer `VISIT(SelectSetStmt)` adds
+ // limit / offset / limit_with_ties / limit_percent fields
+ // without re-stamping positions — so the end stays at the
+ // last body-level clause cpp consumed. Mirror that exactly.
+ let merged = merge_select_decorators(first, filtered);
+ // `has_set_level_trailing` is unused here (we keep it
+ // declared above for parity with the set-stmt branch's
+ // OFFSET-lift heuristic, which it still feeds).
+ let _ = has_set_level_trailing;
+ return Ok(merged);
+ }
+ // cpp's `VISIT(SelectSetStmt)` lifts the inner SelectQuery's
+ // OFFSET to the outer SelectSetQuery — but ONLY for the
+ // verbose `LIMIT n OFFSET m` form (after an explicit LIMIT).
+ // The compact `LIMIT n, m`, bare `OFFSET m` (no LIMIT), and
+ // limit-by's trailing bare OFFSET all stay on the inner.
+ // LIMIT, PERCENT, WITH TIES always stay on the inner.
+ //
+ // Examples:
+ // `... except select 1 limit 5 OFFSET 10` → lift (outer.offset=10)
+ // `... except select 1 limit 5, 10` → keep (inner.offset=10)
+ // `... except select 1 offset 10` → keep (inner.offset=10)
+ // `... except select 1 limit 5 by a offset 10` → keep (inner.offset=10)
+ //
+ // The discriminator is the `__rust_offset_liftable` sentinel
+ // that `parse_trailing_limit_and_offset` and the regular
+ // limit-and-offset branch of `parse_limit_clauses` mark when
+ // they consume the verbose form.
+ let mut first = first;
+ // Clean the lift sentinel off the initial SELECT — cpp's lift
+ // only ever applies to the LAST inner SELECT, never the first.
+ if let Some(obj) = first.as_object_mut() {
+ obj.remove("__rust_offset_liftable");
+ }
+ // …and off every non-last subsequent SELECT (the lift only
+ // applies to the trailing inner).
+ let last_idx = subsequent.len().saturating_sub(1);
+ for (i, node) in subsequent.iter_mut().enumerate() {
+ if i == last_idx {
+ continue;
+ }
+ if let Some(sq) = node
+ .as_object_mut()
+ .and_then(|n| n.get_mut("select_query"))
+ .and_then(Value::as_object_mut)
+ {
+ sq.remove("__rust_offset_liftable");
+ }
+ }
+ // Lift the inner's verbose OFFSET to the outer SelectSetQuery
+ // only when the set-stmt has NO trailing decorators of any
+ // kind. Any of:
+ //
+ // - LIMIT / OFFSET at the set level — would overwrite the
+ // lifted slot or claim it directly.
+ // - ORDER BY at the set level — cpp's `VISIT(SelectSetStmt)`
+ // drops it but its presence still tells cpp's adaptive
+ // parser that the inner's OFFSET is "complete" at the
+ // inner level and shouldn't surface upward.
+ //
+ // Examples:
+ // ... UNION ... LIMIT 5 OFFSET 10 → lift (no trailing)
+ // ... UNION ... LIMIT X OFFSET Y LIMIT Z, V → no lift
+ // ... UNION ... LIMIT 5 % WITH TIES OFFSET m ORDER BY 1 → no lift
+ //
+ // `has_set_level_trailing` captures the ORDER-BY case (the
+ // trailing decorator is consumed-and-dropped, so an
+ // after-the-fact `trailing.iter()` check misses it).
+ let inner_offset = subsequent
+ .last_mut()
+ .and_then(Value::as_object_mut)
+ .and_then(|n| n.get_mut("select_query"))
+ .and_then(Value::as_object_mut)
+ .and_then(|sq| {
+ let liftable = sq
+ .remove("__rust_offset_liftable")
+ .and_then(|v| v.as_bool())
+ == Some(true);
+ if liftable && !has_set_level_trailing {
+ sq.remove("offset")
+ } else {
+ None
+ }
+ });
+ let mut wrap = serde_json::Map::new();
+ wrap.insert("node".into(), Value::String("SelectSetQuery".into()));
+ wrap.insert("initial_select_query".into(), first);
+ wrap.insert("subsequent_select_queries".into(), Value::Array(subsequent));
+ if let Some(off) = inner_offset {
+ wrap.insert("offset".into(), off);
+ }
+ // Trailing decorators are applied last so they can override
+ // the lifted inner offset when present.
+ for (k, v) in trailing {
+ wrap.insert(k, v);
+ }
+ Ok(self.wrap_pos(Value::Object(wrap), stmt_start))
+ }
+
+ fn try_consume_set_op(&mut self) -> Result<Option<String>, ParseError> {
+ let base = match self.peek() {
+ TokenKind::Keyword(Kw::Union) => "UNION",
+ TokenKind::Keyword(Kw::Intersect) => "INTERSECT",
+ TokenKind::Keyword(Kw::Except) => "EXCEPT",
+ _ => return Ok(None),
+ };
+ self.bump()?;
+ let modifier = if self.eat_kw(Kw::All)? {
+ Some("ALL")
+ } else if self.eat_kw(Kw::Distinct)? {
+ Some("DISTINCT")
+ } else {
+ None
+ };
+ let by_name = matches!(self.peek(), TokenKind::Keyword(Kw::By))
+ && self.peek_next() == TokenKind::Keyword(Kw::Name);
+ if by_name {
+ self.bump()?;
+ self.bump()?;
+ }
+ let op = format_set_op(base, modifier, by_name).ok_or_else(|| {
+ self.err(format!(
+ "invalid set operator {base} with modifier {modifier:?}"
+ ))
+ })?;
+ Ok(Some(op))
+ }
+
+ fn parse_trailing_set_decorators(&mut self) -> Result<Vec<(String, Value)>, ParseError> {
+ let mut out: Vec<(String, Value)> = Vec::new();
+ // `selectSetStmt`'s `orderByClause?` slot at this level is
+ // parsed by ANTLR but cpp's `VISIT(SelectSetStmt)` never emits
+ // it — `(SELECT 1) ORDER BY 2` drops the ORDER BY entirely.
+ // Consume-and-discard so the grammar still accepts the input
+ // without leaking an `order_by` onto a SelectSetQuery /
+ // Placeholder / standalone SelectQuery target.
+ //
+ // EXCEPTION: when `suppress_setstmt_trailing_order_by` is set,
+ // we leave the ORDER BY untouched so the outer caller can
+ // absorb it. This is set by `parse_call_argument_select` for
+ // inputs like `f((select 1) order by 1)` — cpp prefers
+ // ColumnExprFunction here, which means the ORDER BY belongs
+ // to the function-call's `orderByClause`, not the inner set
+ // statement.
+ if !self.suppress_setstmt_trailing_order_by
+ && matches!(self.peek(), TokenKind::Keyword(Kw::Order))
+ && self.peek_next() == TokenKind::Keyword(Kw::By)
+ {
+ self.bump()?;
+ self.bump()?;
+ self.parse_order_expr_list()?;
+ // Optional trailing `INTERPOLATE [(...)]` is part of the
+ // orderByClause grammar; consume-and-drop alongside the
+ // order_by we're discarding here.
+ if self.eat_kw(Kw::Interpolate)? && self.eat(TokenKind::LParen)? {
+ let mut depth: i32 = 1;
+ while depth > 0 {
+ match self.peek() {
+ TokenKind::LParen => depth += 1,
+ TokenKind::RParen => depth -= 1,
+ TokenKind::Eof => break,
+ _ => {}
+ }
+ self.bump()?;
+ }
+ }
+ }
+ // Trailing LIMIT/OFFSET on the set. Mirrors
+ // `limitAndOffsetClauseOptional` in the grammar:
+ // `LIMIT columnExpr PERCENT? (COMMA columnExpr)? (WITH TIES)?`
+ // `LIMIT columnExpr PERCENT? (WITH TIES)? OFFSET columnExpr`
+ // `OFFSET columnExpr`
+ if self.eat_kw(Kw::Limit)? {
+ // The initial parse stops at BP_MULT+1 so `limit_resolve_percent`
+ // sees `%` undigested and can decide PERCENT-marker vs modulo.
+ // When `%` resolves to the PERCENT marker the body is done; in
+ // any other case (no `%`, or `%` resolved as modulo) the body
+ // may still extend with lower-precedence operators (additive,
+ // comparison, AND, OR), so continue the Pratt loop at BP=0.
+ // See `parse_limit_clauses` for why `limit_body_depth`
+ // wraps the whole body parse.
+ self.limit_body_depth += 1;
+ let body = self.parse_limit_body();
+ self.limit_body_depth -= 1;
+ let (first, percent) = body?;
+ let mut with_ties = self.peek_kw2(Kw::With, Kw::Ties);
+ if with_ties {
+ self.bump()?;
+ self.bump()?;
+ }
+ let (limit, offset) = if self.eat(TokenKind::Comma)? {
+ // `LIMIT a, b` — cpp emits limit=a, offset=b (no
+ // swap). The visitor reads the slots in source order
+ // for the SelectSetStmt's trailing clause.
+ let second = self.parse_expr_bp(0)?;
+ (first, Some(second))
+ } else if self.eat_kw(Kw::Offset)? {
+ let off = self.parse_expr_bp(0)?;
+ (first, Some(off))
+ } else {
+ (first, None)
+ };
+ // Trailing `WITH TIES` after the compact comma form.
+ if !with_ties && self.peek_kw2(Kw::With, Kw::Ties) {
+ self.bump()?;
+ self.bump()?;
+ with_ties = true;
+ }
+ // cpp's visitor overwrites `limit` (always — the outer
+ // clause has one) but only writes the optional
+ // accompanying fields when they're present in the outer
+ // clause itself: a bare `LIMIT n` outer preserves the
+ // inner's `offset`, `limit_percent`, and `limit_with_ties`.
+ out.push(("limit".into(), limit));
+ if let Some(off) = offset {
+ out.push(("offset".into(), off));
+ }
+ if percent {
+ out.push(("limit_percent".into(), Value::Bool(true)));
+ }
+ if with_ties {
+ out.push(("limit_with_ties".into(), Value::Bool(true)));
+ }
+ } else if self.eat_kw(Kw::Offset)? {
+ // `offsetOnlyClause: OFFSET columnExpr` — a full
+ // `columnExpr`, so parse at BP=0; a `BP_MULT+1` bound
+ // stranded any lower-precedence tail (`offset (x) or y`,
+ // `offset (x) ignore nulls`).
+ let off = self.parse_expr_bp(0)?;
+ out.push(("offset".into(), off));
+ }
+ Ok(out)
+ }
+
+ fn parse_select_stmt_with_parens(&mut self) -> Result<Value, ParseError> {
+ // `WITH … (selectSet)` — paren'd set wrapper form with CTEs.
+ // Consume the WITH clause and its CTEs, then peek the next token
+ // to decide between the two valid continuations:
+ // - `(` → paren-wrapped selectSet that inherits the CTEs
+ // - `SELECT` → bare WITH-SELECT; thread CTEs into parse_select_stmt
+ if matches!(self.peek(), TokenKind::Keyword(Kw::With)) {
+ // Capture WITH's start so the resulting SelectQuery /
+ // SelectSetQuery has a span starting at WITH rather than at
+ // the inner SELECT — cpp's selectStmt ctx covers the whole
+ // WITH-led statement.
+ let with_start = self.peek0.start;
+ self.bump()?; // WITH
+ let recursive = self.eat_kw(Kw::Recursive)?;
+ let mut ctes = self.parse_with_expr_list()?;
+ if recursive {
+ for cte in ctes.iter_mut() {
+ if let Some(o) = cte.as_object_mut() {
+ o.insert("recursive".into(), Value::Bool(true));
+ }
+ }
+ }
+ if matches!(self.peek(), TokenKind::LParen) {
+ self.bump()?;
+ let mut inner = self.parse_select_set_stmt()?;
+ self.expect(TokenKind::RParen, ")")?;
+ inject_ctes_into_select(&mut inner, ctes);
+ // cpp's `WITH ctes (selectSet)` ctx for the outer
+ // SelectSetQuery starts at the `(`, NOT at WITH. The
+ // CTEs are injected into the inner set's SelectQuery,
+ // but the outer span doesn't widen to cover WITH.
+ // Keep `inner`'s existing positions untouched.
+ return Ok(inner);
+ }
+ return self.parse_select_stmt_body(Some(ctes), Some(with_start));
+ }
+ if self.eat(TokenKind::LParen)? {
+ let inner = self.parse_select_set_stmt()?;
+ self.expect(TokenKind::RParen, ")")?;
+ return Ok(inner);
+ }
+ // `selectStmtWithParens` grammar admits a bare `placeholder` as
+ // its fourth alternative — `{name}` standing in for a whole
+ // select. Defer to the expression parser, which already knows
+ // how to emit a Placeholder node for `{…}`. cpp's
+ // `VISIT(Placeholder)` covers the whole `{ … }` span — wrap so
+ // the bare-placeholder select body carries that position.
+ if self.peek() == TokenKind::LBrace {
+ let placeholder_start = self.peek0.start;
+ let placeholder = self.parse_brace_dict_or_placeholder()?;
+ return Ok(self.wrap_pos(placeholder, placeholder_start));
+ }
+ self.parse_select_stmt()
+ }
+
+ /// Single `SELECT` statement with all its clauses.
+ fn parse_select_stmt(&mut self) -> Result<Value, ParseError> {
+ // WITH at the start; consume CTEs here then delegate to the body
+ // helper. This lets parse_select_stmt_with_parens hand us
+ // already-parsed CTEs when it disambiguated WITH+`(`.
+ // Capture the WITH start before consuming so the body wraps the
+ // resulting SelectQuery with a span beginning at WITH (cpp's
+ // selectStmt ctx covers the whole WITH-led statement).
+ let with_start = if matches!(self.peek(), TokenKind::Keyword(Kw::With)) {
+ Some(self.peek0.start)
+ } else {
+ None
+ };
+ let mut ctes: Option<Vec<Value>> = None;
+ if self.eat_kw(Kw::With)? {
+ let recursive = self.eat_kw(Kw::Recursive)?;
+ let mut parsed = self.parse_with_expr_list()?;
+ if recursive {
+ for cte in parsed.iter_mut() {
+ if let Some(o) = cte.as_object_mut() {
+ o.insert("recursive".into(), Value::Bool(true));
+ }
+ }
+ }
+ ctes = Some(parsed);
+ }
+ self.parse_select_stmt_body(ctes, with_start)
+ }
+
+ /// SELECT statement body, starting at the `SELECT` keyword (after
+ /// any WITH clause has been consumed). `pre_parsed_ctes` carries
+ /// CTEs that the caller already consumed; `override_start` carries
+ /// the caller-snapshotted position of the WITH keyword so the
+ /// resulting SelectQuery's span starts at WITH rather than at the
+ /// inner SELECT — cpp's selectStmt ctx covers the whole
+ /// WITH-led statement.
+ fn parse_select_stmt_body(
+ &mut self,
+ pre_parsed_ctes: Option<Vec<Value>>,
+ override_start: Option<usize>,
+ ) -> Result<Value, ParseError> {
+ let stmt_start = override_start.unwrap_or(self.peek0.start);
+ let mut obj = serde_json::Map::new();
+ obj.insert("node".into(), Value::String("SelectQuery".into()));
+ if let Some(ctes) = pre_parsed_ctes {
+ obj.insert("ctes".into(), Value::Array(ctes));
+ }
+
+ // Catch typo'd SELECT keyword (e.g. `SELEC`) with a message close
+ // enough to the ANTLR-style "mismatched input" that the existing
+ // `test_malformed_sql` substring-match passes. End position spans
+ // through the rest of the source (matching C++ which highlights
+ // the whole malformed region, not just the first token).
+ if !matches!(self.peek(), TokenKind::Keyword(Kw::Select)) {
+ let raw = if self.peek0.kind == TokenKind::Eof {
+ "<eof>"
+ } else {
+ self.text(self.peek0)
+ };
+ return Err(ParseError::syntax(
+ format!("mismatched input '{raw}' expecting {{SELECT, WITH, '{{', '(', '<'}} (reserved keyword expected)"),
+ self.peek0.start, self.src.len(),
+ ));
+ }
+ self.bump()?;
+ let distinct = self.eat_kw(Kw::Distinct)?;
+ if distinct {
+ obj.insert("distinct".into(), Value::Bool(true));
+ }
+ // `topClause: TOP DECIMAL_LITERAL (WITH TIES)?` — accepted by
+ // the grammar, rejected by the cpp visitor as unsupported. A
+ // bare `top` (not followed by a number) is still a valid Field
+ // / column name, so only treat `TOP <number>` as the clause.
+ if matches!(self.peek(), TokenKind::Keyword(Kw::Top))
+ && matches!(self.peek_next(), TokenKind::Number)
+ {
+ return Err(ParseError::not_implemented(
+ "Unsupported: SelectStmt.topClause()",
+ self.peek0.start,
+ self.src.len(),
+ ));
+ }
+ let columns = self.parse_select_columns()?;
+ if columns.is_empty() {
+ // `SELECT FROM …` / `SELECT WHERE …` — no expression in the
+ // column slot. The C++ parser rejects this; surface as a
+ // syntax error including "reserved keyword" so the Python
+ // side raises HogQLSyntaxError.
+ return Err(ParseError::syntax(
+ "SELECT must list at least one expression (a reserved keyword cannot stand in for a column)",
+ self.peek0.start, self.peek0.end,
+ ));
+ }
+ obj.insert("select".into(), Value::Array(columns));
+
+ if self.eat_kw(Kw::From)? {
+ let join = self.parse_join_expr()?;
+ obj.insert("select_from".into(), join);
+ }
+ // ARRAY JOIN: `(LEFT|INNER)? ARRAY JOIN <expr_list>`.
+ let array_join_op_kw = if matches!(self.peek(), TokenKind::Keyword(Kw::Left))
+ && self.peek_next() == TokenKind::Keyword(Kw::Array)
+ {
+ self.bump()?;
+ Some("LEFT")
+ } else if matches!(self.peek(), TokenKind::Keyword(Kw::Inner))
+ && self.peek_next() == TokenKind::Keyword(Kw::Array)
+ {
+ self.bump()?;
+ Some("INNER")
+ } else {
+ None
+ };
+ if matches!(self.peek(), TokenKind::Keyword(Kw::Array))
+ && self.peek_next() == TokenKind::Keyword(Kw::Join)
+ {
+ // Two semantic errors the C++ visitor raises on ARRAY JOIN:
+ // - No FROM: "Using ARRAY JOIN without a FROM clause is not permitted"
+ // - Unaliased array expr: "ARRAY JOIN arrays must have an alias"
+ // Both are SelectStmt-VISITOR checks, not grammar checks —
+ // `suppress_array_join_checks` skips them when this SELECT
+ // is a subquery inside a discarded `FILTER (WHERE …)` body
+ // (see `parse_optional_filter`).
+ if !self.suppress_array_join_checks && !obj.contains_key("select_from") {
+ return Err(ParseError::syntax(
+ "Using ARRAY JOIN without a FROM clause is not permitted",
+ 0,
+ self.src.len(),
+ ));
+ }
+ self.bump()?;
+ self.bump()?;
+ let op = match array_join_op_kw {
+ Some("LEFT") => "LEFT ARRAY JOIN",
+ Some("INNER") => "INNER ARRAY JOIN",
+ _ => "ARRAY JOIN",
+ };
+ obj.insert("array_join_op".into(), Value::String(op.into()));
+ // Inline expr-list parsing so we can capture each item's span
+ // for the alias-required error.
+ let mut exprs: Vec<Value> = Vec::new();
+ loop {
+ let item_start = self.peek0.start;
+ let expr = self.parse_expr_bp(0)?;
+ // Use the token *just consumed* as the item's end. After
+ // parse_expr_bp the cursor sits on the next token; the
+ // previous token's end is the most accurate item-end.
+ let item_end = self.last_consumed_end;
+ // Implicit alias: `[…] alias` without AS.
+ let aliased = if let Some(name) = self.try_consume_implicit_alias()? {
+ emit::alias(expr, &name)
+ } else {
+ expr
+ };
+ if !self.suppress_array_join_checks
+ && aliased.get("node").and_then(|v| v.as_str()) != Some("Alias")
+ {
+ return Err(ParseError::syntax(
+ "ARRAY JOIN arrays must have an alias",
+ item_start,
+ item_end,
+ ));
+ }
+ exprs.push(aliased);
+ if !self.eat(TokenKind::Comma)? {
+ break;
+ }
+ if self.peek_is_clause_terminator()
+ || matches!(
+ self.peek(),
+ TokenKind::Eof | TokenKind::RParen | TokenKind::Semicolon
+ )
+ {
+ break;
+ }
+ }
+ obj.insert("array_join_list".into(), Value::Array(exprs));
+ }
+ if self.eat_kw(Kw::Prewhere)? {
+ obj.insert("prewhere".into(), self.parse_expr_bp(0)?);
+ }
+ if self.eat_kw(Kw::Where)? {
+ obj.insert("where".into(), self.parse_expr_bp(0)?);
+ }
+ // `(USING? SAMPLE …)?` — the grammar allows a SAMPLE clause at
+ // SELECT level (before GROUP BY *and* after QUALIFY). Both
+ // positions attach to the FROM table's existing JoinExpr.sample
+ // slot. The leading USING is optional in the first position
+ // and required in the second; we just accept either.
+ self.try_attach_select_level_sample(&mut obj)?;
+ if matches!(self.peek(), TokenKind::Keyword(Kw::Group))
+ && self.peek_next() == TokenKind::Keyword(Kw::By)
+ {
+ self.bump()?;
+ self.bump()?;
+ if matches!(self.peek(), TokenKind::Keyword(Kw::All))
+ && self.peek_next_can_terminate_group_by_all()
+ {
+ // `GROUP BY ALL` — all-mode. Bare ALL or followed by a
+ // clause-end token only. Anything postfix-shaped (`.x`,
+ // `[1]`, `()`, `+1`, `::Int`, `,`, …) means cpp's
+ // ALL(*) falls back to `columnExprList` with ALL as a
+ // plain Field.
+ self.bump()?;
+ obj.insert("group_by_mode".into(), Value::String("all".into()));
+ } else if matches!(self.peek(), TokenKind::Keyword(Kw::Cube | Kw::Rollup))
+ && self.peek_next() == TokenKind::LParen
+ && !self.peek_lparen_is_empty()
+ && !self.cube_rollup_followed_by_more_keys()
+ {
+ let kw = if matches!(self.peek(), TokenKind::Keyword(Kw::Cube)) {
+ "cube"
+ } else {
+ "rollup"
+ };
+ self.bump()?;
+ self.expect(TokenKind::LParen, "(")?;
+ let exprs = self.parse_expr_list_until_paren()?;
+ self.expect(TokenKind::RParen, ")")?;
+ obj.insert("group_by".into(), Value::Array(exprs));
+ obj.insert("group_by_mode".into(), Value::String(kw.into()));
+ } else if matches!(self.peek(), TokenKind::Keyword(Kw::Grouping))
+ && self.peek_next() == TokenKind::Keyword(Kw::Sets)
+ {
+ self.bump()?;
+ self.bump()?;
+ self.expect(TokenKind::LParen, "(")?;
+ // grouping sets: list of `GroupingSet` nodes — cpp's
+ // visitor wraps each paren'd column list in a node so
+ // the Python AST can hold them in `group_by: list[Expr]`.
+ // The cpp ctx for `groupingSet` is `LPAREN columnExprList? RPAREN`
+ // so the position spans the parens themselves.
+ let mut sets: Vec<Value> = Vec::new();
+ loop {
+ let set_start = self.peek0.start;
+ self.expect(TokenKind::LParen, "(")?;
+ let exprs = if self.peek() == TokenKind::RParen {
+ self.bump()?;
+ Vec::new()
+ } else {
+ let exprs = self.parse_expr_list_until_paren()?;
+ self.expect(TokenKind::RParen, ")")?;
+ exprs
+ };
+ sets.push(self.wrap_pos(
+ serde_json::json!({
+ "node": "GroupingSet",
+ "exprs": exprs,
+ }),
+ set_start,
+ ));
+ if !self.eat(TokenKind::Comma)? {
+ break;
+ }
+ }
+ self.expect(TokenKind::RParen, ")")?;
+ obj.insert("group_by".into(), Value::Array(sets));
+ obj.insert(
+ "group_by_mode".into(),
+ Value::String("grouping_sets".into()),
+ );
+ } else {
+ let exprs = self.parse_expr_list_until_terminators()?;
+ obj.insert("group_by".into(), Value::Array(exprs));
+ }
+ }
+ // `WITH (CUBE | ROLLUP | TOTALS)` after the GROUP BY position —
+ // the grammar admits them as independent optionals. The cpp
+ // visitor parses but doesn't persist any AST bit here (mode is
+ // only set on the GROUP-BY-led form like `GROUP BY CUBE(...)`).
+ // We silently consume to match. cpp grammar:
+ // `… (WITH (CUBE | ROLLUP))? (WITH TOTALS)?`
+ // — at most one of CUBE / ROLLUP, then optionally TOTALS, in
+ // that order. Track which slots we've filled so a second
+ // `WITH CUBE` / `WITH ROLLUP` / `WITH TOTALS` errors out.
+ let mut saw_cube_or_rollup = false;
+ let mut saw_totals = false;
+ loop {
+ if !matches!(self.peek(), TokenKind::Keyword(Kw::With)) {
+ break;
+ }
+ match self.peek_next() {
+ TokenKind::Keyword(Kw::Cube) | TokenKind::Keyword(Kw::Rollup) => {
+ if saw_cube_or_rollup || saw_totals {
+ return Err(self.err(
+ "GROUP BY admits at most one of WITH CUBE / WITH ROLLUP, before WITH TOTALS",
+ ));
+ }
+ saw_cube_or_rollup = true;
+ self.bump()?;
+ self.bump()?;
+ }
+ TokenKind::Keyword(Kw::Totals) => {
+ if saw_totals {
+ return Err(self.err("duplicate WITH TOTALS"));
+ }
+ saw_totals = true;
+ self.bump()?;
+ self.bump()?;
+ }
+ _ => break,
+ }
+ }
+ if self.eat_kw(Kw::Having)? {
+ obj.insert("having".into(), self.parse_expr_bp(0)?);
+ }
+ if self.eat_kw(Kw::Qualify)? {
+ obj.insert("qualify".into(), self.parse_expr_bp(0)?);
+ }
+ // Second `USING SAMPLE` opportunity per the grammar (after
+ // QUALIFY, before WINDOW). Same attach-to-FROM-table logic.
+ self.try_attach_select_level_sample(&mut obj)?;
+ // WINDOW clause — minimal: WINDOW name AS (...) [, ...].
+ if self.eat_kw(Kw::Window)? {
+ let mut windows = serde_json::Map::new();
+ loop {
+ let name_tok = self.bump()?;
+ let name = match name_tok.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent | TokenKind::Keyword(_) => {
+ identifier_text(self.text(name_tok), name_tok.kind)
+ }
+ _ => {
+ return Err(
+ self.err(format!("expected window name, got {:?}", name_tok.kind))
+ )
+ }
+ };
+ self.expect_kw(Kw::As, "AS")?;
+ self.expect(TokenKind::LParen, "(")?;
+ let we = self.parse_window_expr()?;
+ self.expect(TokenKind::RParen, ")")?;
+ windows.insert(name, we);
+ if !self.eat(TokenKind::Comma)? {
+ break;
+ }
+ }
+ obj.insert("window_exprs".into(), Value::Object(windows));
+ }
+ if matches!(self.peek(), TokenKind::Keyword(Kw::Order))
+ && self.peek_next() == TokenKind::Keyword(Kw::By)
+ {
+ self.bump()?;
+ self.bump()?;
+ obj.insert(
+ "order_by".into(),
+ Value::Array(self.parse_order_expr_list()?),
+ );
+ // Optional `INTERPOLATE [(expr [AS expr], …)]` after ORDER BY.
+ if self.eat_kw(Kw::Interpolate)? {
+ let items = if self.eat(TokenKind::LParen)? {
+ let mut items: Vec<Value> = Vec::new();
+ // `interpolateClause: INTERPOLATE (LPAREN interpolateExpr
+ // (COMMA interpolateExpr)* RPAREN)?` — when parens are
+ // present, at least one interpolateExpr is required.
+ if self.peek() == TokenKind::RParen {
+ return Err(self.err("INTERPOLATE (...) must have at least one item"));
+ }
+ loop {
+ // Parse expr greedily so AS-alias gets
+ // absorbed when its right operand is a
+ // valid alias target — matches cpp's
+ // ALL(*) which prefers the inner
+ // columnExpr's AS-alias over the outer
+ // `(AS columnExpr)?` separator.
+ // `interpolate(a AS 5)` keeps AS for the
+ // outer because `5` isn't an alias target.
+ let expr = self.parse_expr_bp(0)?;
+ let value = if self.eat_kw(Kw::As)? {
+ Some(self.parse_expr_bp(0)?)
+ } else {
+ None
+ };
+ let mut interp = serde_json::Map::new();
+ interp.insert("node".into(), Value::String("InterpolateExpr".into()));
+ interp.insert("expr".into(), expr);
+ if let Some(v) = value {
+ interp.insert("value".into(), v);
+ }
+ items.push(Value::Object(interp));
+ if !self.eat(TokenKind::Comma)? {
+ break;
+ }
+ // `interpolateClause: INTERPOLATE LPAREN
+ // interpolateExpr (COMMA interpolateExpr)*
+ // RPAREN` — no trailing comma. cpp rejects
+ // `INTERPOLATE (y,)`.
+ if self.peek() == TokenKind::RParen {
+ return Err(self.err("trailing comma in INTERPOLATE clause"));
+ }
+ }
+ self.expect(TokenKind::RParen, ")")?;
+ items
+ } else {
+ Vec::new()
+ };
+ obj.insert("interpolate".into(), Value::Array(items));
+ }
+ }
+ // LIMIT / LIMIT BY / OFFSET handling. The grammar allows both
+ // limitByClause and limitAndOffsetClause; when both are present,
+ // limitBy comes first. We deferred the choice of "which form" until
+ // the prefix is fully parsed — see parse_limit_clauses for the
+ // disambiguation strategy (no bounded probe).
+ self.parse_limit_clauses(&mut obj)?;
+ // SETTINGS — accepted by the grammar, rejected by the cpp
+ // visitor as unsupported. Raise the same `NotImplementedError`
+ // class rather than letting the stray `SETTINGS` token fall
+ // through to a generic trailing-token `SyntaxError`.
+ if matches!(self.peek(), TokenKind::Keyword(Kw::Settings)) {
+ return Err(ParseError::not_implemented(
+ "Unsupported: SelectStmt.settingsClause()",
+ self.peek0.start,
+ self.src.len(),
+ ));
+ }
+
+ Ok(self.wrap_pos(Value::Object(obj), stmt_start))
+ }
+
+ /// Probe: at the GROUP BY position, peek is `ALL`. The peek_next
+ /// token decides whether `ALL` is the all-mode marker (cpp's
+ /// `groupByClause: GROUP BY ALL` alt) or the head of a
+ /// `columnExprList` whose first element is the keyword-as-Field
+ /// `ALL` (`GROUP BY ALL, b`, `GROUP BY ALL.x`, `GROUP BY ALL()`,
+ /// `GROUP BY ALL::Int`, etc.). Return true if peek_next is a
+ /// terminator that closes the GROUP BY (i.e. all-mode wins).
+ fn peek_next_can_terminate_group_by_all(&self) -> bool {
+ matches!(
+ self.peek_next(),
+ TokenKind::Eof
+ | TokenKind::Semicolon
+ | TokenKind::RParen
+ | TokenKind::Keyword(Kw::With)
+ | TokenKind::Keyword(Kw::Having)
+ | TokenKind::Keyword(Kw::Qualify)
+ | TokenKind::Keyword(Kw::Window)
+ | TokenKind::Keyword(Kw::Order)
+ | TokenKind::Keyword(Kw::Limit)
+ | TokenKind::Keyword(Kw::Offset)
+ | TokenKind::Keyword(Kw::Settings)
+ | TokenKind::Keyword(Kw::Union)
+ | TokenKind::Keyword(Kw::Intersect)
+ | TokenKind::Keyword(Kw::Except)
+ )
+ }
+
+ /// Probe: at the GROUP BY position, peek is `CUBE` or `ROLLUP` and
+ /// peek_next is `(`. Look past the matching close `)` to see if a
+ /// `,` follows — that signals the caller's specialised
+ /// `CUBE(...)` / `ROLLUP(...)` mode is wrong and cpp's ANTLR ALL(*)
+ /// would fall back to the `columnExprList` alternative with the
+ /// CUBE/ROLLUP as an ordinary function call.
+ fn cube_rollup_followed_by_more_keys(&self) -> bool {
+ let mut probe = Lexer::with_pos(self.src, self.peek1.end);
+ let mut depth: i32 = 1;
+ while depth > 0 {
+ let tok = match probe.next_token() {
+ Ok(t) => t,
+ Err(_) => return false,
+ };
+ match tok.kind {
+ TokenKind::LParen | TokenKind::LBracket | TokenKind::LBrace => depth += 1,
+ TokenKind::RParen | TokenKind::RBracket | TokenKind::RBrace => depth -= 1,
+ TokenKind::Eof => return false,
+ _ => {}
+ }
+ }
+ // After the matching close, is the next token a list separator?
+ matches!(probe.next_token().map(|t| t.kind), Ok(TokenKind::Comma))
+ }
+
+ /// Parse a `LIMIT` clause's first operand — a `columnExpr`
+ /// optionally followed by the `%` PERCENT marker — and return
+ /// `(body, percent)`. Callers raise `limit_body_depth` around this
+ /// so the Pratt `%` handler can resolve modulo vs the PERCENT
+ /// marker at any depth.
+ fn parse_limit_body(&mut self) -> Result<(Value, bool), ParseError> {
+ // BP_MULT+1 stops the initial parse before a top-level `%` so
+ // `limit_resolve_percent` sees it undigested; a compound body
+ // (additive / comparison / AND / OR) is then extended at BP=0.
+ let body_start = self.peek0.start;
+ let first_raw = self.parse_expr_bp(BP_MULT + 1)?;
+ let (mut first, mut percent) = self.limit_resolve_percent(first_raw, body_start)?;
+ if !percent {
+ // Use the body's start (snapshotted before parse_expr_bp) for
+ // the continuation's wrap so the resulting infix span starts
+ // at the first operand, not at the operator that pratt_continue
+ // reads from peek0. cpp's limitExpr ctx covers the whole body
+ // from the first token.
+ first = self.pratt_continue_with_lhs(first, 0, body_start)?;
+ // The continuation's `%` handler leaves a `LIMIT … PERCENT`
+ // marker unconsumed (it isn't modulo); pick it up here.
+ if self.peek() == TokenKind::Percent {
+ self.bump()?;
+ percent = true;
+ }
+ }
+ Ok((first, percent))
+ }
+
+ /// Parse the optional `limitByClause? (limitAndOffsetClause | offsetOnlyClause)?`
+ /// trailer of a SELECT, without using bounded token lookahead.
+ ///
+ /// The two forms share a prefix (`LIMIT <expr> [, <expr> | OFFSET <expr>]`),
+ /// and only the trailing token disambiguates: `BY` means limit-by,
+ /// anything else means regular limit-and-offset. `%` (PERCENT) and
+ /// `WITH TIES` rule out limit-by mid-parse — they are only valid in the
+ /// limit-and-offset form.
+ fn parse_limit_clauses(
+ &mut self,
+ obj: &mut serde_json::Map<String, Value>,
+ ) -> Result<(), ParseError> {
+ // Capture the LIMIT keyword's start so the eventual LimitByExpr
+ // (cpp's `limitByClause` ctx, `LIMIT limitExpr BY columnExprList`)
+ // gets a span starting at LIMIT, not at the first BY-expr.
+ let limit_start = self.peek0.start;
+ if !self.eat_kw(Kw::Limit)? {
+ // No LIMIT — accept a standalone OFFSET clause (offsetOnlyClause).
+ if self.eat_kw(Kw::Offset)? {
+ obj.insert("offset".into(), self.parse_expr_bp(0)?);
+ }
+ return Ok(());
+ }
+
+ // Common prefix: LIMIT <expr>. BP_MULT+1 prevents the trailing `%`
+ // from being consumed as a modulo on the limit expression itself;
+ // limit_resolve_percent then disambiguates `%` between PERCENT and
+ // modulo (the latter when the modulo path is the only one that
+ // succeeds end-to-end). When `%` resolves to PERCENT marker the
+ // body is done; otherwise continue Pratt at BP=0 to consume any
+ // lower-precedence operators (additive, comparison, AND, OR).
+ // `limit_body_depth` stays raised across the whole body parse
+ // so the Pratt `%` handler (and `limit_resolve_percent`'s own
+ // speculation) resolve modulo vs the PERCENT marker uniformly,
+ // at any depth — `LIMIT a%b % WITH TIES` keeps `a%b` as modulo
+ // and the second `%` as the marker.
+ self.limit_body_depth += 1;
+ let body = self.parse_limit_body();
+ self.limit_body_depth -= 1;
+ let (first, percent) = body?;
+ let mut with_ties = false;
+ if self.peek_kw2(Kw::With, Kw::Ties) {
+ self.bump()?;
+ self.bump()?;
+ with_ties = true;
+ }
+
+ // Parse the optional second operand: `, b` (compact) or `OFFSET b`
+ // (verbose). The compact form's role flips between limit-by and
+ // limit-and-offset; we capture which separator was used and decide
+ // later. Both operands parse at full bp (no `%` ambiguity here —
+ // PERCENT only attaches to the first LIMIT operand).
+ enum Tail {
+ None,
+ Comma(Value),
+ Offset(Value),
+ }
+ let tail = if self.eat(TokenKind::Comma)? {
+ Tail::Comma(self.parse_expr_bp(0)?)
+ } else if matches!(self.peek(), TokenKind::Keyword(Kw::Offset)) {
+ // cpp's grammar allows OFFSET at the body level in two places:
+ // - `limitByClause: LIMIT limitExpr BY ...` where
+ // `limitExpr: columnExpr ((COMMA | OFFSET) columnExpr)?`
+ // — i.e. `LIMIT a OFFSET b BY c` is limit-by with offset_value=b.
+ // - `limitAndOffsetClause` verbose alt: `LIMIT n PERCENT?
+ // (WITH TIES)? OFFSET m`.
+ // For the verbose limit-and-offset alt, cpp's ANTLR ALL(*)
+ // prefers the COMPACT alt (`LIMIT n` only) when both can
+ // match, leaving `OFFSET m` to be absorbed by selectSetStmt's
+ // trailing `limitAndOffsetClauseOptional`. So consume OFFSET
+ // here ONLY when BY follows — otherwise leave it for the
+ // outer set-stmt trailing-decorators pass.
+ let cp = self.checkpoint();
+ self.bump()?; // OFFSET
+ let off = self.parse_expr_bp(0)?;
+ if matches!(self.peek(), TokenKind::Keyword(Kw::By)) {
+ Tail::Offset(off)
+ } else {
+ self.restore(cp)?;
+ Tail::None
+ }
+ } else {
+ Tail::None
+ };
+
+ // Trailing `WITH TIES` after the compact comma form. The
+ // verbose form (`LIMIT n WITH TIES OFFSET m`) puts WITH TIES
+ // BEFORE OFFSET, so a trailing WITH TIES is only valid after
+ // the compact form (Tail::Comma). `LIMIT n OFFSET m WITH TIES`
+ // doesn't match either grammar alt — cpp rejects.
+ if !with_ties
+ && matches!(tail, Tail::None | Tail::Comma(_))
+ && self.peek_kw2(Kw::With, Kw::Ties)
+ {
+ self.bump()?;
+ self.bump()?;
+ with_ties = true;
+ }
+
+ // Disambiguator: `BY` makes this a limit-by clause.
+ if self.eat_kw(Kw::By)? {
+ if percent || with_ties {
+ return Err(self.err("PERCENT and WITH TIES are not valid in a LIMIT BY clause"));
+ }
+ let cols = self.parse_limit_by_exprs()?;
+ let (n, offset_value) = match tail {
+ Tail::None => (first, None),
+ // `LIMIT a, b BY ...` → n=b, offset_value=a (compact swaps)
+ Tail::Comma(s) => (s, Some(first)),
+ // `LIMIT a OFFSET b BY ...` → n=a, offset_value=b
+ Tail::Offset(s) => (first, Some(s)),
+ };
+ let mut lb = serde_json::Map::new();
+ lb.insert("node".into(), Value::String("LimitByExpr".into()));
+ lb.insert("n".into(), n);
+ lb.insert("exprs".into(), Value::Array(cols));
+ if let Some(o) = offset_value {
+ lb.insert("offset_value".into(), o);
+ }
+ obj.insert(
+ "limit_by".into(),
+ self.wrap_pos(Value::Object(lb), limit_start),
+ );
+
+ // After the limit-by clause, an optional outer
+ // limit-and-offset (or bare OFFSET) may follow.
+ self.parse_trailing_limit_and_offset(obj)?;
+ return Ok(());
+ }
+
+ // Otherwise: regular limit-and-offset. The verbose `OFFSET m`
+ // form (Tail::Offset) is liftable to the outer SelectSetQuery
+ // when wrapped in a set-stmt; the compact `, m` form is not.
+ // See `parse_select_set_stmt` for the lift logic.
+ obj.insert("limit".into(), first);
+ if percent {
+ obj.insert("limit_percent".into(), Value::Bool(true));
+ }
+ match tail {
+ Tail::Comma(s) => {
+ obj.insert("offset".into(), s);
+ }
+ Tail::Offset(s) => {
+ obj.insert("offset".into(), s);
+ obj.insert("__rust_offset_liftable".into(), Value::Bool(true));
+ }
+ Tail::None => {}
+ }
+ if with_ties {
+ obj.insert("limit_with_ties".into(), Value::Bool(true));
+ }
+ Ok(())
+ }
+
+ /// Outer limit/offset that may follow a `LIMIT BY` clause. Same
+ /// grammar as `limitAndOffsetClause | offsetOnlyClause`, but `BY` is
+ /// not legal here.
+ fn parse_trailing_limit_and_offset(
+ &mut self,
+ obj: &mut serde_json::Map<String, Value>,
+ ) -> Result<(), ParseError> {
+ if self.eat_kw(Kw::Limit)? {
+ // Full `columnExpr` body — `parse_limit_body` covers the
+ // compound case (`limit (x) ?? y`) and the `%`/PERCENT
+ // resolution; a bare `BP_MULT+1` parse stranded any
+ // lower-precedence tail.
+ self.limit_body_depth += 1;
+ let body = self.parse_limit_body();
+ self.limit_body_depth -= 1;
+ let (limit, percent) = body?;
+ obj.insert("limit".into(), limit);
+ if percent {
+ obj.insert("limit_percent".into(), Value::Bool(true));
+ }
+ // Grammar (line 107–110): limitAndOffsetClause has two
+ // alternatives that differ in where WITH TIES sits relative
+ // to the second value:
+ //
+ // compact: LIMIT n PERCENT? (COMMA n)? (WITH TIES)?
+ // verbose: LIMIT n PERCENT? (WITH TIES)? OFFSET n
+ //
+ // After consuming `LIMIT n PERCENT?`, the next token
+ // disambiguates: COMMA → compact, WITH/OFFSET → verbose.
+ // The compact form puts WITH TIES *after* the comma's
+ // second operand; verbose puts WITH TIES *before* OFFSET.
+ // The previous flat eat-comma-or-offset-then-check-WITH-TIES
+ // missed `LIMIT n % WITH TIES OFFSET m` because the WITH
+ // TIES check happened only after the (skipped) comma /
+ // OFFSET branch.
+ if self.eat(TokenKind::Comma)? {
+ // Compact form.
+ obj.insert("offset".into(), self.parse_expr_bp(0)?);
+ if self.peek_kw2(Kw::With, Kw::Ties) {
+ self.bump()?;
+ self.bump()?;
+ obj.insert("limit_with_ties".into(), Value::Bool(true));
+ }
+ } else {
+ // Verbose form (or no second operand).
+ if self.peek_kw2(Kw::With, Kw::Ties) {
+ self.bump()?;
+ self.bump()?;
+ obj.insert("limit_with_ties".into(), Value::Bool(true));
+ }
+ if self.eat_kw(Kw::Offset)? {
+ obj.insert("offset".into(), self.parse_expr_bp(0)?);
+ // Sentinel for the SelectSetStmt wrapper's
+ // conditional lift logic — only the verbose form
+ // is liftable.
+ obj.insert("__rust_offset_liftable".into(), Value::Bool(true));
+ }
+ }
+ } else if self.eat_kw(Kw::Offset)? {
+ // Bare `OFFSET m` (no preceding LIMIT). cpp keeps this on
+ // the inner SELECT — don't mark liftable.
+ obj.insert("offset".into(), self.parse_expr_bp(0)?);
+ }
+ Ok(())
+ }
+
+ /// Peek two consecutive keyword tokens without consuming.
+ fn peek_kw2(&self, a: Kw, b: Kw) -> bool {
+ matches!(self.peek(), TokenKind::Keyword(kw) if kw == a)
+ && self.peek_next() == TokenKind::Keyword(b)
+ }
+
+ /// After parsing a LIMIT expression, decide whether a following `%` is
+ /// the PERCENT marker or modulo, and return the (possibly extended)
+ /// expression along with whether PERCENT was consumed.
+ ///
+ /// Mirrors ANTLR ALL(*) on `LIMIT columnExpr PERCENT?`: cpp picks
+ /// modulo whenever the modulo path can succeed end-to-end (the
+ /// whole `columnExpr` parses and the rest forms a valid limit
+ /// continuation), otherwise `%` is the PERCENT marker.
+ fn limit_resolve_percent(
+ &mut self,
+ expr: Value,
+ expr_start: usize,
+ ) -> Result<(Value, bool), ParseError> {
+ if self.peek0.kind != TokenKind::Percent {
+ return Ok((expr, false));
+ }
+ match self.try_limit_modulo_extension(expr.clone(), expr_start)? {
+ Some(extended) => Ok((extended, false)),
+ None => {
+ self.bump()?; // % (PERCENT marker)
+ Ok((expr, true))
+ }
+ }
+ }
+
+ /// Caller has confirmed peek is `%`. Speculatively parse it as the
+ /// modulo operator: `% rhs` (RHS bounded at BP_MULT+1 so the inner
+ /// Pratt doesn't re-engage `%`) followed by the rest of the
+ /// `columnExpr` at BP=0. Returns `Some(extended)` — cursor advanced
+ /// past the whole modulo expression — when it lands at a clean
+ /// LIMIT-body boundary;
+ /// cpp's ANTLR ALL(*) takes the modulo alt only then. Returns
+ /// `None` with the cursor restored to the `%` otherwise: there the
+ /// `%` is the `LIMIT … PERCENT` marker, not modulo.
+ ///
+ /// `%` is genuinely ambiguous — `ColumnExprPrecedence1` modulo and
+ /// the `LIMIT columnExpr PERCENT?` marker — and which one applies
+ /// depends on whether the modulo RHS exists and the whole thing
+ /// lands cleanly, so a token-level heuristic is not enough. The
+ /// Pratt `%` handler calls this for every `%` it meets inside a
+ /// LIMIT body (`limit_body_depth > 0`).
+ pub(crate) fn try_limit_modulo_extension(
+ &mut self,
+ lhs: Value,
+ lhs_start: usize,
+ ) -> Result<Option<Value>, ParseError> {
+ let cp = self.checkpoint();
+ let trial = (|p: &mut Self| -> Result<Option<Value>, ParseError> {
+ p.bump()?; // %
+ let rhs = p.parse_expr_bp(BP_MULT + 1)?;
+ let combined = emit::arith(lhs.clone(), "%", rhs);
+ // Extend the whole columnExpr (BP=0) — cpp parses the
+ // LIMIT body greedily, so a lower-precedence tail
+ // (`% 2 + 3`, `% 2 AND 3`) stays part of the modulo body.
+ // `lhs_start` is the original LHS's start, not the `%` —
+ // cpp's `columnExprPrecedence2` ctx covers the whole modulo
+ // expression from the LHS's first token.
+ let extended = p.pratt_continue_with_lhs(combined, 0, lhs_start)?;
+ if p.peek_is_limit_body_done() {
+ return Ok(Some(extended));
+ }
+ // Second-level speculation: when the modulo extension
+ // lands on `BY`, try parsing the BY-exprs clause. cpp's
+ // `LIMIT {} % order by 2` parses as LIMIT BY where
+ // n=Mod(Dict, Field(order)) and exprs=[2]. Without this
+ // check the modulo extension rolls back to PERCENT and
+ // the trailing `order by 2` ends up consumed-and-dropped
+ // by the outer set-stmt's trailing decorators — losing
+ // the cpp interpretation. The BY-exprs check rolls back
+ // to just AFTER the modulo so the outer
+ // `parse_limit_clauses` BY handler picks up cleanly.
+ if p.peek() == TokenKind::Keyword(Kw::By) {
+ let after_modulo = p.checkpoint();
+ let by_trial = (|p: &mut Self| -> Result<bool, ParseError> {
+ p.bump()?; // BY
+ p.parse_limit_by_exprs()?;
+ // Post-BY-exprs state must be a valid LIMIT-BY
+ // tail per the grammar: optional outer
+ // limit/offset trailer, SETTINGS, or end-of-stmt
+ // (incl. set operators). Notably excludes WITH
+ // (cpp's `WITH FILL TO …` order-by suffix is
+ // invalid here) and ORDER (we're past ORDER BY
+ // position in selectStmt).
+ Ok(matches!(
+ p.peek(),
+ TokenKind::Eof
+ | TokenKind::RParen
+ | TokenKind::RBracket
+ | TokenKind::RBrace
+ | TokenKind::Comma
+ | TokenKind::Semicolon
+ | TokenKind::Keyword(Kw::Limit)
+ | TokenKind::Keyword(Kw::Offset)
+ | TokenKind::Keyword(Kw::Settings)
+ | TokenKind::Keyword(Kw::Union)
+ | TokenKind::Keyword(Kw::Intersect)
+ | TokenKind::Keyword(Kw::Except)
+ ))
+ })(p);
+ p.restore(after_modulo)?;
+ if let Ok(true) = by_trial {
+ return Ok(Some(extended));
+ }
+ }
+ Ok(None)
+ })(self);
+ match trial {
+ Ok(Some(v)) => Ok(Some(v)),
+ _ => {
+ self.restore(cp)?;
+ Ok(None)
+ }
+ }
+ }
+
+ /// True when peek is a valid LIMIT-clause boundary token: a
+ /// structural terminator (paren/bracket/brace/comma/semicolon/eof),
+ /// the LIMIT clause's own trailing modifiers (`WITH TIES`,
+ /// `OFFSET`), or the start of a sibling clause / set operator.
+ /// Used by `limit_resolve_percent` to decide whether a speculative
+ /// modulo extension lands cleanly.
+ fn peek_is_limit_body_done(&self) -> bool {
+ matches!(
+ self.peek(),
+ TokenKind::Eof
+ | TokenKind::RParen
+ | TokenKind::RBracket
+ | TokenKind::RBrace
+ | TokenKind::Comma
+ | TokenKind::Semicolon
+ // A `%` directly after a modulo extension is the
+ // `LIMIT … PERCENT` marker — the extension ends here.
+ | TokenKind::Percent
+ | TokenKind::Keyword(Kw::With)
+ | TokenKind::Keyword(Kw::Offset)
+ | TokenKind::Keyword(Kw::Settings)
+ | TokenKind::Keyword(Kw::Union)
+ | TokenKind::Keyword(Kw::Intersect)
+ | TokenKind::Keyword(Kw::Except)
+ // `ORDER BY` can appear AFTER the LIMIT body at the
+ // selectSetStmt level (cpp's grammar admits the slot
+ // there; cpp drops the parsed AST but still consumes
+ // the tokens cleanly). Treat ORDER as a clean
+ // LIMIT-body boundary so the modulo speculation
+ // commits when the extended chain is followed by a
+ // top-level ORDER BY clause. Bare `BY` (without
+ // ORDER preceding) is NOT in the list — that would
+ // imply a malformed `... LIMIT % BY ...` shape that
+ // cpp's recovery handles but ours can't.
+ | TokenKind::Keyword(Kw::Order)
+ )
+ }
+
+ /// True when peek is a valid boundary AFTER a LIMIT-BY-exprs
+ /// item: another item (Comma), end-of-statement structural,
+ /// the outer LIMIT-and-offset trailer (Limit/Offset), ORDER BY
+ /// at selectSetStmt level, set operators, or SETTINGS. cpp's
+ /// adaptive prediction bails out of the iteration when the
+ /// post-parse state doesn't fit one of these — most notably for
+ /// `WITH TIES` which is part of the outer LIMIT-body, NOT a
+ /// LIMIT-BY-exprs continuation.
+ fn peek_is_limit_by_exprs_boundary(&self) -> bool {
+ matches!(
+ self.peek(),
+ TokenKind::Eof
+ | TokenKind::RParen
+ | TokenKind::RBracket
+ | TokenKind::RBrace
+ | TokenKind::Comma
+ | TokenKind::Semicolon
+ | TokenKind::Keyword(Kw::Limit)
+ | TokenKind::Keyword(Kw::Offset)
+ | TokenKind::Keyword(Kw::Settings)
+ | TokenKind::Keyword(Kw::Union)
+ | TokenKind::Keyword(Kw::Intersect)
+ | TokenKind::Keyword(Kw::Except)
+ | TokenKind::Keyword(Kw::Order)
+ )
+ }
+
+ /// Consume an optional `[USING] SAMPLE …` clause at SELECT level
+ /// and discard it — the grammar's `selectStmt` rule allows this
+ /// clause in two positions, but the cpp visitor's `VISIT(SelectStmt)`
+ /// doesn't read the `sampleClause` from either slot. Only the
+ /// table-level form (consumed inside `parse_table_atom` while
+ /// building the JoinExpr) ends up on `JoinExpr.sample`. We mirror
+ /// the silent-drop behaviour here so the parser accepts the syntax
+ /// without diverging from cpp.
+ fn try_attach_select_level_sample(
+ &mut self,
+ _obj: &mut serde_json::Map<String, Value>,
+ ) -> Result<(), ParseError> {
+ let saw_sample = if self.peek_kw2(Kw::Using, Kw::Sample) {
+ self.bump()?; // USING
+ true
+ } else {
+ matches!(self.peek(), TokenKind::Keyword(Kw::Sample))
+ };
+ if !saw_sample {
+ return Ok(());
+ }
+ drop(self.try_consume_sample()?);
+ Ok(())
+ }
+
+ /// LIMIT BY columnExprList: comma-separated columnExprs. Two
+ /// disambiguations cpp's ALL(*) handles by looking past the
+ /// comma:
+ ///
+ /// `LIMIT a BY b, offset * c`
+ /// → second item is `offset_field * c` — OFFSET is a Field,
+ /// the list continues, no offsetOnlyClause.
+ /// `LIMIT X, Y BY Z, offset W`
+ /// → list ends after `Z`; `OFFSET W` is the separate
+ /// offsetOnlyClause that lands on `SelectQuery.offset`.
+ ///
+ /// cpp's choice across `<comma> offset <X>`: parse `offset <X>` as
+ /// a continuing columnExpr when feasible, otherwise end the list
+ /// and start the OFFSET clause. The disambiguator is whether `<X>`
+ /// can extend `offset` as a Field — postfix chaining (`.`, `[`,
+ /// `(`), infix operators (`*`, `/`, `=`, …), or infix keywords
+ /// (`AND`, `IS`, `BETWEEN`, `LIKE`, `AS`, …) all keep `offset` as
+ /// a Field. Standalone primary-starters (Ident, Number, String,
+ /// `{…}`, primary keywords) terminate.
+ ///
+ /// `peek_is_clause_terminator` is tuned for column-list context
+ /// and treats `OFFSET <primary>` as a clause introducer — that
+ /// matches when `<primary>` doesn't extend `offset`. Its
+ /// `asterisk_after_offset_continues_arith` probe is too narrow
+ /// here though: for `LIMIT … BY b, offset * columns(…)` cpp
+ /// continues the list, but the probe returns false (treating
+ /// COLUMNS-with-paren as the body of `OFFSET *`). Override OFFSET
+ /// specifically with a more permissive infix-or-postfix check.
+ fn parse_limit_by_exprs(&mut self) -> Result<Vec<Value>, ParseError> {
+ let mut out = Vec::new();
+ out.push(self.parse_expr_bp(0)?);
+ while self.eat(TokenKind::Comma)? {
+ if matches!(
+ self.peek(),
+ TokenKind::Eof | TokenKind::RParen | TokenKind::Semicolon
+ ) {
+ break;
+ }
+ if self.peek() == TokenKind::Keyword(Kw::Offset) {
+ if !offset_next_terminates_limit_by(self.peek_next()) {
+ // OFFSET extends as a Field — continue the list.
+ out.push(self.parse_expr_bp(0)?);
+ continue;
+ }
+ // OFFSET starts a new clause — end the list so the
+ // outer parser picks up `OFFSET <body>`.
+ break;
+ }
+ if self.peek_is_clause_terminator() {
+ // Same speculative-parse trick as
+ // `parse_expr_list_until_terminators`: cpp's columnExpr
+ // greedily extends through keyword-as-Field forms (`,
+ // limit * columns('ok')` → `Mul(Field('limit'),
+ // ColumnsExpr)` as another LIMIT-BY item). Commit only
+ // when the result engaged structure beyond a bare
+ // single-chain Field AND the post-parse cursor lands
+ // at a clean LIMIT-BY-exprs boundary. Otherwise back
+ // off the comma and let the outer dispatcher pick up
+ // the keyword as a clause introducer. The post-parse
+ // boundary check rejects shapes like `, limit (1)
+ // WITH TIES` — cpp's adaptive prediction sees the
+ // trailing `WITH TIES` doesn't fit the BY-exprs
+ // grammar and bails out of the iteration, letting
+ // `LIMIT (1) WITH TIES` parse as the outer LIMIT
+ // clause instead.
+ let cp = self.checkpoint();
+ let speculated = match self.parse_expr_bp(0) {
+ Ok(expr) if is_bare_field(&expr) => {
+ self.restore(cp)?;
+ None
+ }
+ Ok(_expr) if !self.peek_is_limit_by_exprs_boundary() => {
+ self.restore(cp)?;
+ None
+ }
+ Ok(expr) => Some(expr),
+ Err(_) => {
+ self.restore(cp)?;
+ None
+ }
+ };
+ match speculated {
+ Some(expr) => out.push(expr),
+ None => break,
+ }
+ } else {
+ out.push(self.parse_expr_bp(0)?);
+ }
+ }
+ Ok(out)
+ }
+
+ /// PARTITION BY exprs inside a windowExpr: a comma-separated
+ /// columnExprList that terminates when the next sibling clause
+ /// (ORDER BY, ROWS-frame, RANGE-frame) or the closing paren
+ /// appears. Without this RANGE/ROWS would be consumed as Field
+ /// identifiers (per the keyword rule) and BETWEEN that follows
+ /// them would over-greedily eat the window frame body.
+ fn parse_window_partition_by_exprs(&mut self) -> Result<Vec<Value>, ParseError> {
+ let mut out = Vec::new();
+ loop {
+ out.push(self.parse_expr_bp(0)?);
+ if !self.eat(TokenKind::Comma)? {
+ break;
+ }
+ // Window-specific terminators in addition to the standard set.
+ if matches!(
+ self.peek(),
+ TokenKind::Eof
+ | TokenKind::RParen
+ | TokenKind::Semicolon
+ | TokenKind::Keyword(Kw::Range)
+ | TokenKind::Keyword(Kw::Rows)
+ | TokenKind::Keyword(Kw::Order)
+ ) || self.peek_is_clause_terminator()
+ {
+ break;
+ }
+ }
+ Ok(out)
+ }
+
+ pub(crate) fn parse_window_expr(&mut self) -> Result<Value, ParseError> {
+ let we_start = self.peek0.start;
+ let mut obj = serde_json::Map::new();
+ obj.insert("node".into(), Value::String("WindowExpr".into()));
+ if matches!(self.peek(), TokenKind::Keyword(Kw::Partition))
+ && self.peek_next() == TokenKind::Keyword(Kw::By)
+ {
+ self.bump()?;
+ self.bump()?;
+ // Window-context partition_by exprs terminate on the
+ // following frame/order keywords (RANGE / ROWS / ORDER) or
+ // the closing paren of the windowExpr.
+ let exprs = self.parse_window_partition_by_exprs()?;
+ obj.insert("partition_by".into(), Value::Array(exprs));
+ }
+ if matches!(self.peek(), TokenKind::Keyword(Kw::Order))
+ && self.peek_next() == TokenKind::Keyword(Kw::By)
+ {
+ self.bump()?;
+ self.bump()?;
+ obj.insert(
+ "order_by".into(),
+ Value::Array(self.parse_order_expr_list()?),
+ );
+ }
+ // Frame clause: ROWS|RANGE bound [BETWEEN bound AND bound].
+ let frame_method = if self.eat_kw(Kw::Rows)? {
+ Some("ROWS")
+ } else if self.eat_kw(Kw::Range)? {
+ Some("RANGE")
+ } else {
+ None
+ };
+ if let Some(m) = frame_method {
+ obj.insert("frame_method".into(), Value::String(m.into()));
+ // `BETWEEN` after ROWS / RANGE is ambiguous: the
+ // `frameBetween` alt (`BETWEEN bound AND bound`) or a
+ // `frameStart` bound whose `columnExpr` is the `between`
+ // keyword used as a Field (`RANGE BETWEEN PRECEDING` is
+ // the frame expr `Field(between)` PRECEDING). cpp's ALL(*)
+ // takes `frameBetween` only when it parses end-to-end;
+ // speculate, and on failure rewind so the `between` is
+ // re-read as the Field of a `frameStart` bound.
+ let cp = self.checkpoint();
+ let between_frame = if self.eat_kw(Kw::Between)? {
+ (|p: &mut Self| -> Result<(Value, Value), ParseError> {
+ let start = p.parse_window_frame_bound()?;
+ p.expect_kw(Kw::And, "AND")?;
+ let end = p.parse_window_frame_bound()?;
+ Ok((start, end))
+ })(self)
+ .ok()
+ } else {
+ None
+ };
+ if let Some((start, end)) = between_frame {
+ obj.insert("frame_start".into(), start);
+ obj.insert("frame_end".into(), end);
+ } else {
+ self.restore(cp)?;
+ let start = self.parse_window_frame_bound()?;
+ obj.insert("frame_start".into(), start);
+ }
+ }
+ // cpp's `VISIT(WindowExpr)` calls `addPositionInfo(json, ctx)`,
+ // so the JSON has `start` / `end` spanning the window-expr body
+ // (between the parens — `OVER ( PARTITION BY ... ROWS ... )`).
+ Ok(self.wrap_pos(Value::Object(obj), we_start))
+ }
+
+ fn parse_window_frame_bound(&mut self) -> Result<Value, ParseError> {
+ let bound_start = self.peek0.start;
+ if self.eat_kw(Kw::Current)? {
+ self.expect_kw(Kw::Row, "ROW")?;
+ return Ok(self.wrap_pos(
+ json!({"node": "WindowFrameExpr", "frame_type": "CURRENT ROW", "frame_value": Value::Null}),
+ bound_start,
+ ));
+ }
+ if self.eat_kw(Kw::Unbounded)? {
+ let ty = if self.eat_kw(Kw::Preceding)? {
+ "PRECEDING"
+ } else if self.eat_kw(Kw::Following)? {
+ "FOLLOWING"
+ } else {
+ return Err(self.err("expected PRECEDING or FOLLOWING after UNBOUNDED"));
+ };
+ return Ok(self.wrap_pos(
+ json!({"node": "WindowFrameExpr", "frame_type": ty, "frame_value": Value::Null}),
+ bound_start,
+ ));
+ }
+ // `winFrameBound: columnExpr PRECEDING | columnExpr FOLLOWING`
+ // — the value is a full `columnExpr`, so parse it at binding
+ // power 0. `PRECEDING` / `FOLLOWING` are keywords (never infix
+ // operators), so they always terminate the value parse; the
+ // `AND` separating two bounds of a `BETWEEN` frame sits after
+ // that keyword and is never swallowed.
+ let val = self.parse_expr_bp(0)?;
+ let ty = if self.eat_kw(Kw::Preceding)? {
+ "PRECEDING"
+ } else if self.eat_kw(Kw::Following)? {
+ "FOLLOWING"
+ } else {
+ return Err(self.err("expected PRECEDING or FOLLOWING after frame bound expression"));
+ };
+ // cpp's `VISIT(WinFrameBound)` unwraps a frame-bound `Constant`
+ // to a bare number only when the value `isInt()`; a float or
+ // string Constant keeps its full object form. Mirror that —
+ // unwrap only an integer-valued Constant.
+ let frame_value = match val.as_object() {
+ Some(obj)
+ if obj.get("node").and_then(Value::as_str) == Some("Constant")
+ && obj.get("value").is_some_and(Value::is_i64) =>
+ {
+ obj.get("value").cloned().unwrap_or(Value::Null)
+ }
+ _ => val,
+ };
+ Ok(self.wrap_pos(
+ json!({"node": "WindowFrameExpr", "frame_type": ty, "frame_value": frame_value}),
+ bound_start,
+ ))
+ }
+
+ fn parse_select_columns(&mut self) -> Result<Vec<Value>, ParseError> {
+ // `selectColumnExprList` with optional trailing comma. Each item is
+ // either `IDENT COLON expr` (alias-before), `expr [implicitAlias]`,
+ // or `expr AS alias` (`AS` already handled by Pratt as an infix).
+ let mut cols: Vec<Value> = Vec::new();
+ loop {
+ if matches!(
+ self.peek(),
+ TokenKind::Eof | TokenKind::RParen | TokenKind::Semicolon
+ ) {
+ break;
+ }
+ // `selectColumnExprList: selectColumnExpr (COMMA selectColumnExpr)*
+ // COMMA?` — after a comma the list continues with another
+ // column for any clause keyword that can also be a Field
+ // (`select 1, window from t` keeps `window` as the second
+ // column). Whether the comma was trailing is decided
+ // entirely by `peek_is_clause_terminator` below (it folds
+ // in `peek_is_two_token_clause_terminator` and the `FROM`
+ // table-reference carve-out).
+ //
+ // A clause keyword after the trailing comma starts its
+ // clause — not another column — whenever a valid clause
+ // body follows: cpp's ALL(*) prefers the clause when both
+ // the column and the clause interpretations parse (`select
+ // a, where * columns('x')` is one column plus a WHERE
+ // clause, even though `where * columns('x')` is also a
+ // valid multiplication column). With no body the keyword
+ // stays a column (`select a, where` → two columns);
+ // `peek_is_clause_terminator` encodes that split, incl. the
+ // `WINDOW <name> AS (` and arith-`*` carve-outs. The `:`
+ // guard keeps the alias-before form (`select a, where : 1`)
+ // out of this path.
+ if !cols.is_empty()
+ && self.peek_next() != TokenKind::Colon
+ && self.peek_is_clause_terminator()
+ {
+ break;
+ }
+ let col_start = self.peek0.start;
+ // Alias-before: `IDENT : expr` or `"IDENT" : expr` or
+ // `<keyword> : expr`. The grammar's `identifier` rule admits
+ // any keyword (per the `keyword` production), so e.g.
+ // `select asc : 1` is valid and aliases `1` as `asc`.
+ if matches!(
+ self.peek(),
+ TokenKind::Ident | TokenKind::QuotedIdent | TokenKind::Keyword(_)
+ ) && self.peek_next() == TokenKind::Colon
+ {
+ let name_tok = self.bump()?;
+ let name = identifier_text(self.text(name_tok), name_tok.kind);
+ if !matches!(name_tok.kind, TokenKind::QuotedIdent) {
+ check_alias_not_reserved(&name, name_tok.start, name_tok.end)?;
+ }
+ self.bump()?; // consume `:`
+ let expr = self.parse_expr_bp(0)?;
+ // cpp's `ColumnExprAlias` ctx for the alias-before form
+ // (`IDENT COLON columnExpr`) spans from the alias ident
+ // through the value expression. Wrap so the column's
+ // `start` / `end` match cpp's `addPositionInfo`.
+ cols.push(self.wrap_pos(emit::alias(expr, &name), col_start));
+ } else {
+ let expr = self.parse_expr_bp(0)?;
+ // Implicit alias: a trailing identifier (or one of the
+ // `keywordForImplicitAlias` set) directly after the
+ // expression. Plain `AS alias` is already folded into the
+ // expression by the Pratt loop.
+ let aliased = if let Some(name) = self.try_consume_implicit_alias()? {
+ // Grammar alt `FROM implicitAlias #
+ // ColumnExprInvalidFromImplicitAlias`: a bare `from`
+ // Field carrying an *implicit* (no-`AS`) alias is a
+ // deliberate footgun-catcher — cpp's visitor rejects
+ // it. (`from AS x` is fine; the `AS` form folds into
+ // the expr above and never reaches here.)
+ if is_bare_from_field(&expr) {
+ return Err(self.err("Cannot use \"from\" before an implicit alias"));
+ }
+ // cpp's `ColumnExprAlias` ctx for the implicit-alias
+ // form (`columnExpr IDENT`) spans from the value
+ // expression through the alias identifier — wrap
+ // with the column's running start so the Alias
+ // carries the cpp span.
+ self.wrap_pos(emit::alias(expr, &name), col_start)
+ } else {
+ expr
+ };
+ cols.push(aliased);
+ }
+ if !self.eat(TokenKind::Comma)? {
+ break;
+ }
+ }
+ Ok(cols)
+ }
+
+ fn try_consume_implicit_alias(&mut self) -> Result<Option<String>, ParseError> {
+ match self.peek() {
+ TokenKind::Ident => {
+ let t = self.bump()?;
+ let name = identifier_text(self.text(t), t.kind);
+ check_alias_not_reserved(&name, t.start, t.end)?;
+ Ok(Some(name))
+ }
+ TokenKind::QuotedIdent => {
+ let t = self.bump()?;
+ Ok(Some(identifier_text(self.text(t), t.kind)))
+ }
+ TokenKind::Keyword(kw) if kw_allowed_as_implicit_alias(kw) => {
+ let t = self.bump()?;
+ let name = self.text(t).to_string();
+ check_alias_not_reserved(&name, t.start, t.end)?;
+ Ok(Some(name))
+ }
+ _ => Ok(None),
+ }
+ }
+}
+
+/// True when `expr` is a bare `from` Field — a `Field` whose chain is
+/// the single element `from` (any case). Used to flag the grammar's
+/// `ColumnExprInvalidFromImplicitAlias` footgun (`select from x`).
+fn is_bare_from_field(expr: &Value) -> bool {
+ let Some(obj) = expr.as_object() else {
+ return false;
+ };
+ if obj.get("node").and_then(Value::as_str) != Some("Field") {
+ return false;
+ }
+ match obj.get("chain").and_then(Value::as_array) {
+ Some(chain) => {
+ chain.len() == 1
+ && chain[0]
+ .as_str()
+ .is_some_and(|s| s.eq_ignore_ascii_case("from"))
+ }
+ None => false,
+ }
+}
+
+/// Inside a `LIMIT … BY <list>`, given that the previous token was a
+/// comma and `peek` is OFFSET, does `peek_next` terminate the list? cpp
+/// continues whenever `offset <peek_next>` could be parsed as a columnExpr
+/// (postfix chain `. [ (`, infix operator, infix keyword, `AS` alias),
+/// and only terminates when `peek_next` is a standalone primary-expression
+/// starter that doesn't combine with the preceding `offset` Field.
+fn offset_next_terminates_limit_by(tok: TokenKind) -> bool {
+ match tok {
+ // Primary-only starters: a fresh expression begins, so `offset`
+ // ends the previous list item AND the OFFSET clause body starts.
+ TokenKind::Ident
+ | TokenKind::QuotedIdent
+ | TokenKind::Number
+ | TokenKind::String
+ | TokenKind::LBrace
+ // `#N` (HASH DECIMAL_LITERAL) is the ColumnExprPositional form
+ // — a primary-only expression that doesn't combine with a
+ // preceding `offset` Field.
+ | TokenKind::Hash
+ // Primary-only keywords (kw_acts_as_ident_in_primary style):
+ // these start fresh expressions and never act as infix
+ // continuation of a Field.
+ | TokenKind::Keyword(
+ Kw::Case
+ | Kw::Cast
+ | Kw::TryCast
+ | Kw::Lambda
+ | Kw::Interval
+ | Kw::Columns
+ | Kw::True
+ | Kw::False
+ | Kw::Null
+ | Kw::Inf
+ | Kw::Nan
+ | Kw::Distinct
+ | Kw::Array
+ | Kw::Trim
+ | Kw::Select
+ | Kw::With,
+ ) => true,
+ // Everything else (operators, postfix chaining, infix keywords,
+ // commas, parens) keeps `offset` as a Field — the list continues.
+ _ => false,
+ }
+}
diff --git a/rust/hogql/parser/src/parse/template.rs b/rust/hogql/parser/src/parse/template.rs
new file mode 100644
index 000000000000..c47a23d02b75
--- /dev/null
+++ b/rust/hogql/parser/src/parse/template.rs
@@ -0,0 +1,242 @@
+//! Template-string body splitter for `f'…'` literals and the standalone
+//! `parse_full_template_string` entry point.
+//!
+//! The body is a sequence of literal chunks separated by `{ expr }`
+//! blocks. We sub-parse each block by spawning a fresh [`Parser`] seeked
+//! to the byte after `{`, then advance past the closing `}` it stopped
+//! on.
+
+use serde_json::Value;
+
+use super::Parser;
+use crate::emit;
+use crate::error::ParseError;
+use crate::lex::{Lexer, TokenKind};
+
+/// Split a template-string body into literal chunks and embedded
+/// expression blocks, then wrap as either a bare `Constant` (no
+/// `{ … }` blocks) or a `Call("concat", chunks)`.
+///
+/// `full_src` is the source the outer parser sees; `body_offset` is the
+/// byte offset where the template body begins (just past `f'`) and
+/// `body_end` is the byte offset of the closing `'`. Positions emitted
+/// on literal Constants are absolute in `full_src`, matching cpp's
+/// `STRING_TEXT` ctx spans. Sub-parsed `{ … }` expression chunks already
+/// get absolute positions because their sub-parser sees the full source
+/// up to the closing brace.
+///
+/// Escapes follow cpp's f-string `STRING_TEXT` lexer rule and the
+/// `parse_string_text_ctx` visitor: `\{`, `\'`, `\\`, `\n`, `\t`, `\r`,
+/// `\b`, `\f`, `\a`, `\v` decode in place, `\0` contributes nothing,
+/// and `\xHH` is kept verbatim. Any other `\X` is one the lexer rule
+/// cannot span — cpp ends the `STRING_TEXT` token there, drops the
+/// `\X`, and starts a fresh token, so the body splitter does the same:
+/// it closes the current literal chunk and opens a new one (an extra
+/// `concat` argument).
+pub(super) fn parse_template_body(
+ full_src: &str,
+ body_offset: usize,
+ body_end: usize,
+) -> Result<Value, ParseError> {
+ let body = &full_src[body_offset..body_end];
+ let bytes = body.as_bytes();
+ // (start_in_body, end_in_body, value) — absolute positions wrap on
+ // each push so callers receive cpp-shaped `start` / `end` spans.
+ let mut chunks: Vec<Value> = Vec::new();
+ let mut literal = String::new();
+ let mut literal_start = 0; // byte offset within `body` where the current literal began
+ let mut i = 0;
+ while i < bytes.len() {
+ let c = bytes[i];
+ if c == b'\\' && i + 1 < bytes.len() {
+ let next = bytes[i + 1];
+ // Escapes the f-string `STRING_TEXT` lexer rule admits
+ // (`BACKSLASH LBRACE` / `BACKSLASH QUOTE_SINGLE` /
+ // `ESCAPE_CHAR_COMMON`) stay inside the current literal
+ // chunk; their decoded value follows the cpp
+ // `parse_string_text_ctx` + `replace_common_escape_characters`
+ // pair — note `\0` is dropped (NUL ignored) and `\xHH` is
+ // left verbatim (the cpp escape map has no `\x` case).
+ match next {
+ b'{' => literal.push('{'),
+ b'\'' => literal.push('\''),
+ b'\\' => literal.push('\\'),
+ b'n' => literal.push('\n'),
+ b't' => literal.push('\t'),
+ b'r' => literal.push('\r'),
+ b'b' => literal.push('\u{08}'),
+ b'f' => literal.push('\u{0C}'),
+ b'a' => literal.push('\u{07}'),
+ b'v' => literal.push('\u{0B}'),
+ b'0' => { /* NUL is ignored, contributing nothing */ }
+ b'x' if i + 4 <= bytes.len()
+ && bytes[i + 2].is_ascii_hexdigit()
+ && bytes[i + 3].is_ascii_hexdigit() =>
+ {
+ literal.push_str(&body[i..i + 4]);
+ i += 4;
+ continue;
+ }
+ _ => {
+ // An escape the lexer rule cannot span: cpp's
+ // `STRING_TEXT` token ends here, the offending
+ // `\X` is dropped by lexer error recovery, and a
+ // fresh `STRING_TEXT` (a new concat chunk) begins.
+ if !literal.is_empty() {
+ chunks.push(wrap_literal_chunk(
+ full_src,
+ std::mem::take(&mut literal),
+ body_offset + literal_start,
+ body_offset + i,
+ ));
+ }
+ i += 2;
+ literal_start = i;
+ continue;
+ }
+ }
+ i += 2;
+ continue;
+ }
+ if c == b'{' {
+ if !literal.is_empty() {
+ chunks.push(wrap_literal_chunk(
+ full_src,
+ std::mem::take(&mut literal),
+ body_offset + literal_start,
+ body_offset + i,
+ ));
+ }
+ // Locate the matching `}` with a raw-lexer brace scan
+ // before sub-parsing. The Lexer consumes string / quoted-
+ // identifier / nested-template tokens whole, so a `}`
+ // inside a literal is never miscounted. The expression is
+ // then sub-parsed from a slice that *ends at* the `}` —
+ // this is what keeps the sub-parser's two-token lookahead
+ // from lexing on into the literal template text that
+ // follows the block. That trailing text is not a valid
+ // default-mode token stream (a bare `\` escape, for one),
+ // so letting the lookahead reach it spuriously fails the
+ // whole template.
+ //
+ // Scan via the FULL source so the lexer's positions are
+ // absolute (`scan.next_token()?.start` is a `full_src`
+ // offset), then sub-parse from the same full source so the
+ // emitted positions stay absolute too.
+ let abs_brace_start = body_offset + i;
+ let mut scan = Lexer::with_pos(full_src, abs_brace_start + 1);
+ let mut depth: i32 = 1;
+ let close_brace_start = loop {
+ let t = scan.next_token()?;
+ match t.kind {
+ TokenKind::LBrace => depth += 1,
+ TokenKind::RBrace => {
+ depth -= 1;
+ if depth == 0 {
+ break t.start;
+ }
+ }
+ TokenKind::Eof => {
+ return Err(ParseError::syntax(
+ "expected `}` to close template expression",
+ abs_brace_start,
+ body_end,
+ ));
+ }
+ _ => {}
+ }
+ };
+ // Sub-parse the brace-internal expression. The slice stops
+ // at the `}`, so the sub-parser sees EOF where the block
+ // ends instead of the surrounding literal text. Slicing
+ // `full_src` keeps the absolute offsets up to that point —
+ // a Parser::with_pos started at `abs_brace_start + 1`
+ // emits absolute positions in `full_src`.
+ let mut sub = Parser::with_pos(&full_src[..close_brace_start], abs_brace_start + 1)?;
+ let expr = sub.parse_expr_bp(0)?;
+ if !matches!(sub.peek(), TokenKind::Eof) {
+ return Err(ParseError::syntax(
+ format!(
+ "expected `}}` to close template expression, got {:?}",
+ sub.peek()
+ ),
+ sub.peek0.start,
+ sub.peek0.end,
+ ));
+ }
+ // Convert absolute close-brace offset back to body-relative
+ // for the byte-level scan loop.
+ i = close_brace_start - body_offset + 1;
+ literal_start = i;
+ chunks.push(expr);
+ continue;
+ }
+ // Generic char: decode the next UTF-8 scalar so we copy whole
+ // codepoints, not stray bytes.
+ let rest = &body[i..];
+ let ch = rest.chars().next().expect("non-empty rest");
+ literal.push(ch);
+ i += ch.len_utf8();
+ }
+ if !literal.is_empty() {
+ chunks.push(wrap_literal_chunk(
+ full_src,
+ literal,
+ body_offset + literal_start,
+ body_offset + i,
+ ));
+ }
+ if chunks.is_empty() {
+ // Empty body — cpp emits an empty-string Constant spanning the
+ // body (between the quotes). Position it accordingly.
+ return Ok(wrap_literal_chunk(
+ full_src,
+ String::new(),
+ body_offset,
+ body_end,
+ ));
+ }
+ // A single-chunk template IS that chunk — whether a literal
+ // `Constant` or one `{ … }` substitution (`f'{x}'` is just `x`).
+ // cpp only wraps in `concat` when there are two or more pieces.
+ if chunks.len() == 1 {
+ return Ok(chunks.remove(0));
+ }
+ // The outer concat Call wraps the chunks. Its position spans the
+ // whole template body — the caller adds the outer wrap based on
+ // the `f'…'` token bounds via the standard pratt-loop wrap.
+ Ok(emit::call("concat", chunks))
+}
+
+/// Wrap a literal-chunk Constant with the cpp `STRING_TEXT` ctx span.
+/// Positions are absolute byte offsets in the full source. The
+/// helper directly assembles the cpp-shape `{line, column, offset}`
+/// envelope without spinning up a fresh `Parser` (which would try to
+/// lex the rest of the source starting from `start`, and inside an
+/// `f'…'` body that lex would fail on the trailing unclosed `'`).
+fn wrap_literal_chunk(full_src: &str, value: String, start: usize, end: usize) -> Value {
+ let constant = emit::constant(Value::String(value));
+ let start_pos = pos_in_source(full_src, start);
+ let end_pos = pos_in_source(full_src, end);
+ emit::with_pos(constant, start_pos, end_pos)
+}
+
+/// Compute the cpp-shape `{line, column, offset}` envelope for an
+/// absolute byte offset in `src`. `offset` is the character index
+/// (Unicode code points), matching cpp's ANTLR `getStartIndex()`
+/// semantics; `column` is character-position-in-line.
+fn pos_in_source(src: &str, byte_offset: usize) -> Value {
+ // Line: count `\n` bytes before `byte_offset`.
+ let preceding = &src[..byte_offset.min(src.len())];
+ let line_breaks = preceding.bytes().filter(|&b| b == b'\n').count();
+ let line = (line_breaks + 1) as u32;
+ // Column + char offset: count chars in the preceding-source slice.
+ let line_start = preceding.rfind('\n').map(|i| i + 1).unwrap_or(0);
+ let column = src[line_start..byte_offset.min(src.len())].chars().count() as u32;
+ let char_offset = if src.is_ascii() {
+ byte_offset
+ } else {
+ preceding.chars().count()
+ };
+ emit::position(line, column, char_offset)
+}
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 8a3c73439924..9d5698bc0891 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -1460,6 +1460,16 @@ export namespace Schemas {
Optimized: 'optimized',
} as const;
+ export type ParserMode = typeof ParserMode[keyof typeof ParserMode];
+
+
+ export const ParserMode = {
+ CppOnly: 'cpp_only',
+ CppWithRustShadow: 'cpp_with_rust_shadow',
+ RustWithCppShadow: 'rust_with_cpp_shadow',
+ RustOnly: 'rust_only',
+ } as const;
+
export type PersonsArgMaxVersion = typeof PersonsArgMaxVersion[keyof typeof PersonsArgMaxVersion];
@@ -1530,6 +1540,8 @@ export namespace Schemas {
materializedColumnsOptimizationMode?: MaterializedColumnsOptimizationMode | null;
optimizeJoinedFilters?: boolean | null;
optimizeProjections?: boolean | null;
+ /** HogQL parser backend; absent → `cpp_only`. `*_shadow` modes return the primary result and sample-compare against the other parser, reporting divergences without failing the request. */
+ parserMode?: ParserMode | null;
personsArgMaxVersion?: PersonsArgMaxVersion | null;
personsJoinMode?: PersonsJoinMode | null;
personsOnEventsMode?: PersonsOnEventsMode | null;
diff --git a/uv.lock b/uv.lock
index 98ca6aa4ada7..61c2e38c531a 100644
--- a/uv.lock
+++ b/uv.lock
@@ -11,13 +11,15 @@ resolution-markers = [
]
[options]
-exclude-newer = "2026-05-12T12:28:26.957458Z"
+exclude-newer = "2026-05-14T17:05:01.112803428Z"
exclude-newer-span = "P7D"
[options.exclude-newer-package]
pixelhog = false
hogql-parser = false
posthoganalytics = false
+django = false
+hogql-parser-rs = false
[manifest]
members = [
@@ -1715,7 +1717,7 @@ dependencies = [
{ name = "sqlparse" },
{ name = "tzdata", marker = "sys_platform == 'win32'" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/65/95/95f7faa0950867afaa0bef2460c6263afd6a2c78cc9434046ed28160b015/django-5.2.14.tar.gz", hash = "sha256:58a63ba841662e5c686b57ba1fec52ddd68c0b93bd96ac3029d55728f00bf8a2", size = 10895118, upload-time = "2026-05-05T13:57:25.795Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/65/95/95f7faa0950867afaa0bef2460c6263afd6a2c78cc9434046ed28160b015/django-5.2.14.tar.gz", hash = "sha256:58a63ba841662e5c686b57ba1fec52ddd68c0b93bd96ac3029d55728f00bf8a2", size = 10895118, upload-time = "2026-05-05T13:57:31.104Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/14/44/f172870cf87aa25afef48fb72adba89ee8b77fcab6f3b23d240b923f1528/django-5.2.14-py3-none-any.whl", hash = "sha256:6f712143bd3064310d1f50fac859c3e9a274bdcfc9595339853be7779297fc76", size = 8311320, upload-time = "2026-05-05T13:57:25.795Z" },
]
@@ -3013,14 +3015,28 @@ provides-extras = ["dev"]
[[package]]
name = "hogql-parser"
-version = "1.3.53"
+version = "1.3.65"
source = { registry = "https://pypi.org/simple" }
-sdist = { url = "https://files.pythonhosted.org/packages/03/14/0d8ab2055da4cd31610a7b9b51a73b04440e8f98ba4b825f4131109a96dd/hogql_parser-1.3.53.tar.gz", hash = "sha256:76ddea6db61d97000db86690840be7febc1d5a4999ccbe5f04189ea6530cf4a7", size = 91395, upload-time = "2026-05-18T21:18:58.638Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/72/a7/0c83fb3fc6e9f7d707576939b2bffdf4dccfe946d8aff3c8aaa944c994d9/hogql_parser-1.3.65.tar.gz", hash = "sha256:db69056bc9ebe5cfd340c4f832f6858ea69248ff3157ebcf6cd17c1e1338fa15", size = 92054, upload-time = "2026-05-21T12:28:42.025Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/de/6a/d0e465eac4d401c4a304cc9eed0a30716ce513ca8c7b9dc51653cb39ed2a/hogql_parser-1.3.53-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:4d3de975566c18f28350e3af9f2a80ea3cf42d47eea344519bf5dc5c80a3c28c", size = 664671, upload-time = "2026-05-18T21:18:43.648Z" },
- { url = "https://files.pythonhosted.org/packages/e4/ba/48b2c07ab5781024e75b5f1bda8fc29510adf1700a820a835875603bfad5/hogql_parser-1.3.53-cp312-cp312-macosx_15_0_x86_64.whl", hash = "sha256:3eff6ba0dd06c11e7d8a4e039822e2e72310fecbd8202b4e35dac2e3c14fac9f", size = 668525, upload-time = "2026-05-18T21:18:45.775Z" },
- { url = "https://files.pythonhosted.org/packages/1f/8d/ca3be4e8ae245b761cf7ee3223361cd150e7a0b62603eeb02c7b7964f0a0/hogql_parser-1.3.53-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:f954ed210bb644b7efb0bca1e73ec72a78fe3ebc579d7f1d378ddc83511cf58a", size = 5059737, upload-time = "2026-05-18T21:18:47.646Z" },
- { url = "https://files.pythonhosted.org/packages/a3/d8/23c2b3305951cefb51434a172b2483cc4c774c9af7cb0c5fffa16d877516/hogql_parser-1.3.53-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:05b74b75a4b60b1df6104c1149134bee7131fc1b7f0cc620703b5993f565254d", size = 5166900, upload-time = "2026-05-18T21:18:49.222Z" },
+ { url = "https://files.pythonhosted.org/packages/c0/ed/534ee52471e56578c5e3931ef3fe1a416f54c223b933fc1aef2e2873b0af/hogql_parser-1.3.65-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:5cc32eb60460b29d4f488103508bc3dee9c183e960edb6ffeb3aa97e430419e0", size = 665537, upload-time = "2026-05-21T12:28:24.738Z" },
+ { url = "https://files.pythonhosted.org/packages/1b/d7/8ac4cc3d4ad813b650f3364278cc6fcce0857f1cd68783bff668bf6fdbeb/hogql_parser-1.3.65-cp312-cp312-macosx_15_0_x86_64.whl", hash = "sha256:04bec35fbf61ca8c40daaf40cb5c5d3b7cd4cfc99d987660ab87a15ea5da5df5", size = 670454, upload-time = "2026-05-21T12:28:27.294Z" },
+ { url = "https://files.pythonhosted.org/packages/b2/3f/db59ceb34bedda8d73ab88f8320164b8e9593d6ed70d410c3e528fbeff6a/hogql_parser-1.3.65-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:fd37e39d4b64c94c20da24ee4c912409ed38cb190cf666186c9b1da4d4bcc25f", size = 5061473, upload-time = "2026-05-21T12:28:29.248Z" },
+ { url = "https://files.pythonhosted.org/packages/0e/f6/92e91a66f79350d9815ad8c147c7f7b546dbe7ae6120b8ffaacfe89d7788/hogql_parser-1.3.65-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:eae6dc24bb1e715f9257d0ee3b0bb17d28debda760870d3e2a70f81a22e72c24", size = 5167945, upload-time = "2026-05-21T12:28:31.602Z" },
+]
+
+[[package]]
+name = "hogql-parser-rs"
+version = "1.3.69"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/68/b6/5f0d55d2c32de2e2e3476efdaa4799fbd7ad4af42b47965e0287c2ae6c78/hogql_parser_rs-1.3.69.tar.gz", hash = "sha256:8dc68e902bbb115bd910be114f8dc978a1f80e3db0880de4f807a2e70c72ce33", size = 237540, upload-time = "2026-05-21T17:04:30.835Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/c7/ab/9c340d58c66632bd6e521629f673392edb45c6df520c6655536836fe6f16/hogql_parser_rs-1.3.69-cp312-abi3-macosx_10_12_x86_64.whl", hash = "sha256:db160a453cf5c3cc0c69ce03ee2345d3079f077d9f0ee49353e95778a9417ed3", size = 502626, upload-time = "2026-05-21T17:04:20.856Z" },
+ { url = "https://files.pythonhosted.org/packages/0b/71/5c808362e83027e8e39c55f31058384a1dcd061ee41fdaa94a1f61394fae/hogql_parser_rs-1.3.69-cp312-abi3-macosx_11_0_arm64.whl", hash = "sha256:9f6614d531efc5787922404da9c025a394f4e987b3b31b861f7dfeb8b4967fac", size = 477612, upload-time = "2026-05-21T17:04:22.544Z" },
+ { url = "https://files.pythonhosted.org/packages/26/f3/fa5df3157cfbe0289f4cba46db707d3d05e12691062525bf0b0effeeb537/hogql_parser_rs-1.3.69-cp312-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:ac6401570c3945c6c450484aabf5cec73c60993460cf06a5157ff5d27cef8974", size = 1928571, upload-time = "2026-05-21T17:04:23.897Z" },
+ { url = "https://files.pythonhosted.org/packages/ee/d6/89881cbc5f3948d3fe4943cfc34f7a1fe65e6b53d73387bab89fc217eb54/hogql_parser_rs-1.3.69-cp312-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:20c77d302ae9d2e6c3ffaff8a7d6f33234b7eeef00dbf9fc9e8847af3e784536", size = 2169683, upload-time = "2026-05-21T17:04:25.375Z" },
+ { url = "https://files.pythonhosted.org/packages/4d/7a/7f7d54f63e7ac136991f8cd1defe67e0f4088477d4cb65eb6a9922aaf5be/hogql_parser_rs-1.3.69-cp312-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:57ba7655c7efb19638e1dcb77cd32fdf763b1d44cd0816a9a929d5f6485d5e01", size = 2099178, upload-time = "2026-05-21T17:04:27.181Z" },
+ { url = "https://files.pythonhosted.org/packages/8a/10/87c2a2fa981e1a96dddd7d688588d1fe3c8c992a74768421b3f0e32dcce0/hogql_parser_rs-1.3.69-cp312-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:fdf499cee104fa9d1f28b8dd3b525775c530ebc638af138941fb043c80d11b10", size = 2152315, upload-time = "2026-05-21T17:04:28.886Z" },
]
[[package]]
@@ -5285,6 +5301,7 @@ dependencies = [
{ name = "grpcio" },
{ name = "gspread" },
{ name = "hogql-parser" },
+ { name = "hogql-parser-rs" },
{ name = "humanize" },
{ name = "infi-clickhouse-orm" },
{ name = "jsonref" },
@@ -5548,7 +5565,8 @@ requires-dist = [
{ name = "grimp", specifier = "~=3.14" },
{ name = "grpcio", specifier = "~=1.71.0" },
{ name = "gspread", specifier = "==6.2.1" },
- { name = "hogql-parser", specifier = "==1.3.53" },
+ { name = "hogql-parser", specifier = "==1.3.65" },
+ { name = "hogql-parser-rs", specifier = "==1.3.69" },
{ name = "humanize", specifier = "~=4.12.3" },
{ name = "infi-clickhouse-orm", git = "https://github.com/PostHog/infi.clickhouse_orm?rev=4e3996becf66bf5c26580aff12a80425d9d56fe5" },
{ name = "jsonref", specifier = "==1.1.0" },