// unescape_html in Zig with Wasm SIMD: decodes every HTML character reference in UTF-8 text
// the way Python's html.unescape does, and copies all other bytes unchanged.
//
// The design goal is a short path per reference with few unpredictable branches:
// - 64 zero bytes are written after the input, so no load or loop needs a bounds check and
// nothing stale from an earlier input can be mistaken for part of a reference.
// - Two stages per 4 KiB window. Stage 1 turns each 64-byte block into a bitmask of its `&`
// and appends their positions to a list, without branching on what it finds. Stage 2
// walks the list: copy the text since the last reference (32 bytes unconditionally, more
// in a loop), then decode. The next position is known before the current reference is
// decoded, so consecutive references do not wait on each other.
// - Inputs without `&` are returned in place; nothing is copied.
// - A name of up to 7 bytes ending in `;` is looked up without measuring it: the first `;`
// in the next 8 bytes is found with a SWAR zero-byte test, the bytes up to it are the key,
// and one multiply indexes an open-addressed table of 16-byte entries (key, value, length).
// A hit proves the name; legacy and common names sit in their home slot.
// - Longer names go through a second table and one masked 32-byte vector compare.
// - Without `;` only the 106 legacy names match. A filter on the first two bytes gives the
// longest legacy name that could start there, usually none.
// - Numeric references of up to 7 digits, decimal or hexadecimal, share one branch-free
// SWAR path, and the code point is encoded as UTF-8 without branching on its length.
// The lookup tables are built on the first call by parsing an 18 KB serialized entity list
// (see `init`), which costs microseconds, so the size of the list costs nothing per reference.
//
// Build (or just run `zig build` / `zig build submit` in this repo):
// zig build-exe this-file.zig -target wasm32-freestanding
// -mcpu=generic+simd128+bulk_memory -O ReleaseSmall -fno-entry -rdynamic -fstrip
// --stack 8192 --initial-memory=3145728 --max-memory=3145728
// then: wasm-opt -O1 --enable-simd --enable-bulk-memory
const std = @import("std");
const V = @Vector(16, u8);
const INPUT_CAP: usize = 1 << 20;
// The largest growth is `≫⃒` (5 bytes) becoming 6 bytes.
const OUTPUT_CAP: usize = INPUT_CAP / 5 * 6 + 8;
const PAD = 128;
const FAST_BITS = 12;
const FAST_TAIL = 32;
const LEG_BITS = 8;
const LEG_TAIL = 16;
const LONG_BITS = 11;
const LONG_MASK = (1 << LONG_BITS) - 1;
const EMPTY: u64 = ~@as(u64, 0);
// Bytes of input per stage-1 window; a multiple of 64.
const WINDOW = 4096;
const ONES: u64 = 0x0101010101010101;
const HIGH: u64 = 0x8080808080808080;
const FAST_MUL: u64 = 0xa59d054b12f5b905;
const LEG_MUL: u64 = 0xf880d97d1854e551;
const LONG_MUL: u64 = 0xa0c2995f40498cb3;
const ENTITY_COUNT = 2125;
const LONG_COUNT = 506;
const packed_list = [18450]u8{
9,3,84,97,98,1,7,78,101,119,76,105,110,101,23,4,101,120,99,108,1,36,81,85,
79,84,0,36,113,117,111,116,1,3,110,117,109,1,6,100,111,108,108,97,114,1,6,112,
101,114,99,110,116,1,35,65,77,80,0,35,97,109,112,1,4,97,112,111,115,1,4,108,
112,97,114,1,4,114,112,97,114,1,3,97,115,116,0,6,109,105,100,97,115,116,1,4,
112,108,117,115,1,5,99,111,109,109,97,2,6,112,101,114,105,111,100,1,3,115,111,108,
11,5,99,111,108,111,110,1,4,115,101,109,105,1,34,76,84,0,34,108,116,0,68,210,
32,110,118,108,116,1,6,101,113,117,97,108,115,0,67,229,32,98,110,101,1,34,71,84,
0,34,103,116,0,68,210,32,110,118,103,116,1,5,113,117,101,115,116,1,6,99,111,109,
109,97,116,27,6,108,98,114,97,99,107,0,4,108,115,113,98,1,4,98,115,111,108,1,
6,114,98,114,97,99,107,0,4,114,115,113,98,1,3,72,97,116,1,8,85,110,100,101,
114,66,97,114,0,6,108,111,119,98,97,114,1,16,68,105,97,99,114,105,116,105,99,97,
108,71,114,97,118,101,0,5,103,114,97,118,101,6,69,106,0,102,106,108,105,103,21,6,
108,98,114,97,99,101,0,4,108,99,117,98,1,12,86,101,114,116,105,99,97,108,76,105,
110,101,0,6,118,101,114,98,97,114,0,4,118,101,114,116,1,6,114,98,114,97,99,101,
0,4,114,99,117,98,35,16,78,111,110,66,114,101,97,107,105,110,103,83,112,97,99,101,
0,36,110,98,115,112,1,37,105,101,120,99,108,1,36,99,101,110,116,1,37,112,111,117,
110,100,1,38,99,117,114,114,101,110,1,35,121,101,110,1,38,98,114,118,98,97,114,1,
36,115,101,99,116,1,3,68,111,116,0,9,68,111,117,98,108,101,68,111,116,0,3,100,
105,101,0,35,117,109,108,1,36,67,79,80,89,0,36,99,111,112,121,1,36,111,114,100,
102,1,37,108,97,113,117,111,1,35,110,111,116,1,35,115,104,121,1,35,82,69,71,0,
8,99,105,114,99,108,101,100,82,0,35,114,101,103,1,36,109,97,99,114,0,5,115,116,
114,110,115,1,35,100,101,103,1,9,80,108,117,115,77,105,110,117,115,0,38,112,108,117,
115,109,110,0,2,112,109,1,36,115,117,112,50,1,36,115,117,112,51,1,16,68,105,97,
99,114,105,116,105,99,97,108,65,99,117,116,101,0,37,97,99,117,116,101,1,37,109,105,
99,114,111,1,36,112,97,114,97,1,9,67,101,110,116,101,114,68,111,116,0,9,99,101,
110,116,101,114,100,111,116,0,38,109,105,100,100,111,116,1,7,67,101,100,105,108,108,97,
0,37,99,101,100,105,108,1,36,115,117,112,49,1,36,111,114,100,109,1,37,114,97,113,
117,111,1,38,102,114,97,99,49,52,1,38,102,114,97,99,49,50,0,4,104,97,108,102,
1,38,102,114,97,99,51,52,1,38,105,113,117,101,115,116,1,38,65,103,114,97,118,101,
1,38,65,97,99,117,116,101,1,37,65,99,105,114,99,1,38,65,116,105,108,100,101,1,
36,65,117,109,108,1,37,65,114,105,110,103,0,5,97,110,103,115,116,1,37,65,69,108,
105,103,1,38,67,99,101,100,105,108,1,38,69,103,114,97,118,101,1,38,69,97,99,117,
116,101,1,37,69,99,105,114,99,1,36,69,117,109,108,1,38,73,103,114,97,118,101,1,
38,73,97,99,117,116,101,1,37,73,99,105,114,99,1,36,73,117,109,108,1,35,69,84,
72,1,38,78,116,105,108,100,101,1,38,79,103,114,97,118,101,1,38,79,97,99,117,116,
101,1,37,79,99,105,114,99,1,38,79,116,105,108,100,101,1,36,79,117,109,108,1,37,
116,105,109,101,115,1,38,79,115,108,97,115,104,1,38,85,103,114,97,118,101,1,38,85,
97,99,117,116,101,1,37,85,99,105,114,99,1,36,85,117,109,108,1,38,89,97,99,117,
116,101,1,37,84,72,79,82,78,1,37,115,122,108,105,103,1,38,97,103,114,97,118,101,
1,38,97,97,99,117,116,101,1,37,97,99,105,114,99,1,38,97,116,105,108,100,101,1,
36,97,117,109,108,1,37,97,114,105,110,103,1,37,97,101,108,105,103,1,38,99,99,101,
100,105,108,1,38,101,103,114,97,118,101,1,38,101,97,99,117,116,101,1,37,101,99,105,
114,99,1,36,101,117,109,108,1,38,105,103,114,97,118,101,1,38,105,97,99,117,116,101,
1,37,105,99,105,114,99,1,36,105,117,109,108,1,35,101,116,104,1,38,110,116,105,108,
100,101,1,38,111,103,114,97,118,101,1,38,111,97,99,117,116,101,1,37,111,99,105,114,
99,1,38,111,116,105,108,100,101,1,36,111,117,109,108,1,3,100,105,118,0,38,100,105,
118,105,100,101,1,38,111,115,108,97,115,104,1,38,117,103,114,97,118,101,1,38,117,97,
99,117,116,101,1,37,117,99,105,114,99,1,36,117,117,109,108,1,38,121,97,99,117,116,
101,1,37,116,104,111,114,110,1,36,121,117,109,108,1,5,65,109,97,99,114,1,5,97,
109,97,99,114,1,6,65,98,114,101,118,101,1,6,97,98,114,101,118,101,1,5,65,111,
103,111,110,1,5,97,111,103,111,110,1,6,67,97,99,117,116,101,1,6,99,97,99,117,
116,101,1,5,67,99,105,114,99,1,5,99,99,105,114,99,1,4,67,100,111,116,1,4,
99,100,111,116,1,6,67,99,97,114,111,110,1,6,99,99,97,114,111,110,1,6,68,99,
97,114,111,110,1,6,100,99,97,114,111,110,1,6,68,115,116,114,111,107,1,6,100,115,
116,114,111,107,1,5,69,109,97,99,114,1,5,101,109,97,99,114,3,4,69,100,111,116,
1,4,101,100,111,116,1,5,69,111,103,111,110,1,5,101,111,103,111,110,1,6,69,99,
97,114,111,110,1,6,101,99,97,114,111,110,1,5,71,99,105,114,99,1,5,103,99,105,
114,99,1,6,71,98,114,101,118,101,1,6,103,98,114,101,118,101,1,4,71,100,111,116,
1,4,103,100,111,116,1,6,71,99,101,100,105,108,2,5,72,99,105,114,99,1,5,104,
99,105,114,99,1,6,72,115,116,114,111,107,1,6,104,115,116,114,111,107,1,6,73,116,
105,108,100,101,1,6,105,116,105,108,100,101,1,5,73,109,97,99,114,1,5,105,109,97,
99,114,3,5,73,111,103,111,110,1,5,105,111,103,111,110,1,4,73,100,111,116,1,5,
105,109,97,116,104,0,6,105,110,111,100,111,116,1,5,73,74,108,105,103,1,5,105,106,
108,105,103,1,5,74,99,105,114,99,1,5,106,99,105,114,99,1,6,75,99,101,100,105,
108,1,6,107,99,101,100,105,108,1,6,107,103,114,101,101,110,1,6,76,97,99,117,116,
101,1,6,108,97,99,117,116,101,1,6,76,99,101,100,105,108,1,6,108,99,101,100,105,
108,1,6,76,99,97,114,111,110,1,6,108,99,97,114,111,110,1,6,76,109,105,100,111,
116,1,6,108,109,105,100,111,116,1,6,76,115,116,114,111,107,1,6,108,115,116,114,111,
107,1,6,78,97,99,117,116,101,1,6,110,97,99,117,116,101,1,6,78,99,101,100,105,
108,1,6,110,99,101,100,105,108,1,6,78,99,97,114,111,110,1,6,110,99,97,114,111,
110,1,5,110,97,112,111,115,1,3,69,78,71,1,3,101,110,103,1,5,79,109,97,99,
114,1,5,111,109,97,99,114,3,6,79,100,98,108,97,99,1,6,111,100,98,108,97,99,
1,5,79,69,108,105,103,1,5,111,101,108,105,103,1,6,82,97,99,117,116,101,1,6,
114,97,99,117,116,101,1,6,82,99,101,100,105,108,1,6,114,99,101,100,105,108,1,6,
82,99,97,114,111,110,1,6,114,99,97,114,111,110,1,6,83,97,99,117,116,101,1,6,
115,97,99,117,116,101,1,5,83,99,105,114,99,1,5,115,99,105,114,99,1,6,83,99,
101,100,105,108,1,6,115,99,101,100,105,108,1,6,83,99,97,114,111,110,1,6,115,99,
97,114,111,110,1,6,84,99,101,100,105,108,1,6,116,99,101,100,105,108,1,6,84,99,
97,114,111,110,1,6,116,99,97,114,111,110,1,6,84,115,116,114,111,107,1,6,116,115,
116,114,111,107,1,6,85,116,105,108,100,101,1,6,117,116,105,108,100,101,1,5,85,109,
97,99,114,1,5,117,109,97,99,114,1,6,85,98,114,101,118,101,1,6,117,98,114,101,
118,101,1,5,85,114,105,110,103,1,5,117,114,105,110,103,1,6,85,100,98,108,97,99,
1,6,117,100,98,108,97,99,1,5,85,111,103,111,110,1,5,117,111,103,111,110,1,5,
87,99,105,114,99,1,5,119,99,105,114,99,1,5,89,99,105,114,99,1,5,121,99,105,
114,99,1,4,89,117,109,108,1,6,90,97,99,117,116,101,1,6,122,97,99,117,116,101,
1,4,90,100,111,116,1,4,122,100,111,116,1,6,90,99,97,114,111,110,1,6,122,99,
97,114,111,110,20,4,102,110,111,102,35,5,105,109,112,101,100,64,6,103,97,99,117,116,
101,66,5,106,109,97,116,104,143,1,4,99,105,114,99,1,5,72,97,99,101,107,0,5,
99,97,114,111,110,17,5,66,114,101,118,101,0,5,98,114,101,118,101,1,14,68,105,97,
99,114,105,116,105,99,97,108,68,111,116,0,3,100,111,116,1,4,114,105,110,103,1,4,
111,103,111,110,1,16,68,105,97,99,114,105,116,105,99,97,108,84,105,108,100,101,0,5,
116,105,108,100,101,1,22,68,105,97,99,114,105,116,105,99,97,108,68,111,117,98,108,101,
65,99,117,116,101,0,5,100,98,108,97,99,52,9,68,111,119,110,66,114,101,118,101,128,
1,5,65,108,112,104,97,1,4,66,101,116,97,1,5,71,97,109,109,97,1,5,68,101,
108,116,97,1,7,69,112,115,105,108,111,110,1,4,90,101,116,97,1,3,69,116,97,1,
5,84,104,101,116,97,1,4,73,111,116,97,1,5,75,97,112,112,97,1,6,76,97,109,
98,100,97,1,2,77,117,1,2,78,117,1,2,88,105,1,7,79,109,105,99,114,111,110,
1,2,80,105,1,3,82,104,111,2,5,83,105,103,109,97,1,3,84,97,117,1,7,85,
112,115,105,108,111,110,1,3,80,104,105,1,3,67,104,105,1,3,80,115,105,1,5,79,
109,101,103,97,0,3,111,104,109,8,5,97,108,112,104,97,1,4,98,101,116,97,1,5,
103,97,109,109,97,1,5,100,101,108,116,97,1,4,101,112,115,105,0,7,101,112,115,105,
108,111,110,1,4,122,101,116,97,1,3,101,116,97,1,5,116,104,101,116,97,1,4,105,
111,116,97,1,5,107,97,112,112,97,1,6,108,97,109,98,100,97,1,2,109,117,1,2,
110,117,1,2,120,105,1,7,111,109,105,99,114,111,110,1,2,112,105,1,3,114,104,111,
1,6,115,105,103,109,97,102,0,6,115,105,103,109,97,118,0,8,118,97,114,115,105,103,
109,97,1,5,115,105,103,109,97,1,3,116,97,117,1,4,117,112,115,105,0,7,117,112,
115,105,108,111,110,1,3,112,104,105,1,3,99,104,105,1,3,112,115,105,1,5,111,109,
101,103,97,8,8,116,104,101,116,97,115,121,109,0,6,116,104,101,116,97,118,0,8,118,
97,114,116,104,101,116,97,1,4,85,112,115,105,0,5,117,112,115,105,104,3,4,112,104,
105,118,0,11,115,116,114,97,105,103,104,116,112,104,105,0,6,118,97,114,112,104,105,1,
3,112,105,118,0,5,118,97,114,112,105,6,6,71,97,109,109,97,100,1,7,100,105,103,
97,109,109,97,0,6,103,97,109,109,97,100,19,6,107,97,112,112,97,118,0,8,118,97,
114,107,97,112,112,97,1,4,114,104,111,118,0,6,118,97,114,114,104,111,4,5,101,112,
115,105,118,0,15,115,116,114,97,105,103,104,116,101,112,115,105,108,111,110,0,10,118,97,
114,101,112,115,105,108,111,110,1,11,98,97,99,107,101,112,115,105,108,111,110,0,5,98,
101,112,115,105,11,4,73,79,99,121,1,4,68,74,99,121,1,4,71,74,99,121,1,5,
74,117,107,99,121,1,4,68,83,99,121,1,5,73,117,107,99,121,1,4,89,73,99,121,
1,6,74,115,101,114,99,121,1,4,76,74,99,121,1,4,78,74,99,121,1,5,84,83,
72,99,121,1,4,75,74,99,121,2,5,85,98,114,99,121,1,4,68,90,99,121,1,3,
65,99,121,1,3,66,99,121,1,3,86,99,121,1,3,71,99,121,1,3,68,99,121,1,
4,73,69,99,121,1,4,90,72,99,121,1,3,90,99,121,1,3,73,99,121,1,3,74,
99,121,1,3,75,99,121,1,3,76,99,121,1,3,77,99,121,1,3,78,99,121,1,3,
79,99,121,1,3,80,99,121,1,3,82,99,121,1,3,83,99,121,1,3,84,99,121,1,
3,85,99,121,1,3,70,99,121,1,4,75,72,99,121,1,4,84,83,99,121,1,4,67,
72,99,121,1,4,83,72,99,121,1,6,83,72,67,72,99,121,1,6,72,65,82,68,99,
121,1,3,89,99,121,1,6,83,79,70,84,99,121,1,3,69,99,121,1,4,89,85,99,
121,1,4,89,65,99,121,1,3,97,99,121,1,3,98,99,121,1,3,118,99,121,1,3,
103,99,121,1,3,100,99,121,1,4,105,101,99,121,1,4,122,104,99,121,1,3,122,99,
121,1,3,105,99,121,1,3,106,99,121,1,3,107,99,121,1,3,108,99,121,1,3,109,
99,121,1,3,110,99,121,1,3,111,99,121,1,3,112,99,121,1,3,114,99,121,1,3,
115,99,121,1,3,116,99,121,1,3,117,99,121,1,3,102,99,121,1,4,107,104,99,121,
1,4,116,115,99,121,1,4,99,104,99,121,1,4,115,104,99,121,1,6,115,104,99,104,
99,121,1,6,104,97,114,100,99,121,1,3,121,99,121,1,6,115,111,102,116,99,121,1,
3,101,99,121,1,4,121,117,99,121,1,4,121,97,99,121,2,4,105,111,99,121,1,4,
100,106,99,121,1,4,103,106,99,121,1,5,106,117,107,99,121,1,4,100,115,99,121,1,
5,105,117,107,99,121,1,4,121,105,99,121,1,6,106,115,101,114,99,121,1,4,108,106,
99,121,1,4,110,106,99,121,1,5,116,115,104,99,121,1,4,107,106,99,121,2,5,117,
98,114,99,121,1,4,100,122,99,121,163,55,4,101,110,115,112,1,4,101,109,115,112,1,
6,101,109,115,112,49,51,1,6,101,109,115,112,49,52,2,5,110,117,109,115,112,1,6,
112,117,110,99,115,112,1,9,84,104,105,110,83,112,97,99,101,0,6,116,104,105,110,115,
112,1,13,86,101,114,121,84,104,105,110,83,112,97,99,101,0,6,104,97,105,114,115,112,
1,19,78,101,103,97,116,105,118,101,77,101,100,105,117,109,83,112,97,99,101,0,18,78,
101,103,97,116,105,118,101,84,104,105,99,107,83,112,97,99,101,0,17,78,101,103,97,116,
105,118,101,84,104,105,110,83,112,97,99,101,0,21,78,101,103,97,116,105,118,101,86,101,
114,121,84,104,105,110,83,112,97,99,101,0,14,90,101,114,111,87,105,100,116,104,83,112,
97,99,101,1,4,122,119,110,106,1,3,122,119,106,1,3,108,114,109,1,3,114,108,109,
1,4,100,97,115,104,0,6,104,121,112,104,101,110,3,5,110,100,97,115,104,1,5,109,
100,97,115,104,1,6,104,111,114,98,97,114,1,6,86,101,114,98,97,114,0,4,86,101,
114,116,2,14,79,112,101,110,67,117,114,108,121,81,117,111,116,101,0,5,108,115,113,117,
111,1,15,67,108,111,115,101,67,117,114,108,121,81,117,111,116,101,0,5,114,115,113,117,
111,0,6,114,115,113,117,111,114,1,6,108,115,113,117,111,114,0,5,115,98,113,117,111,
2,20,79,112,101,110,67,117,114,108,121,68,111,117,98,108,101,81,117,111,116,101,0,5,
108,100,113,117,111,1,21,67,108,111,115,101,67,117,114,108,121,68,111,117,98,108,101,81,
117,111,116,101,0,5,114,100,113,117,111,0,6,114,100,113,117,111,114,1,5,98,100,113,
117,111,0,6,108,100,113,117,111,114,2,6,100,97,103,103,101,114,1,6,68,97,103,103,
101,114,0,7,100,100,97,103,103,101,114,1,4,98,117,108,108,0,6,98,117,108,108,101,
116,3,4,110,108,100,114,1,6,104,101,108,108,105,112,0,4,109,108,100,114,10,6,112,
101,114,109,105,108,1,7,112,101,114,116,101,110,107,1,5,112,114,105,109,101,1,5,80,
114,105,109,101,1,6,116,112,114,105,109,101,1,9,98,97,99,107,112,114,105,109,101,0,
6,98,112,114,105,109,101,4,6,108,115,97,113,117,111,1,6,114,115,97,113,117,111,4,
7,79,118,101,114,66,97,114,0,5,111,108,105,110,101,3,5,99,97,114,101,116,2,6,
104,121,98,117,108,108,1,5,102,114,97,115,108,11,5,98,115,101,109,105,8,6,113,112,
114,105,109,101,8,11,77,101,100,105,117,109,83,112,97,99,101,0,74,10,32,84,104,105,
99,107,83,112,97,99,101,1,7,78,111,66,114,101,97,107,1,13,65,112,112,108,121,70,
117,110,99,116,105,111,110,0,2,97,102,1,14,73,110,118,105,115,105,98,108,101,84,105,
109,101,115,0,2,105,116,1,14,73,110,118,105,115,105,98,108,101,67,111,109,109,97,0,
2,105,99,73,4,101,117,114,111,47,9,84,114,105,112,108,101,68,111,116,0,4,116,100,
111,116,1,6,68,111,116,68,111,116,38,4,67,111,112,102,0,9,99,111,109,112,108,101,
120,101,115,3,6,105,110,99,97,114,101,5,4,103,115,99,114,1,12,72,105,108,98,101,
114,116,83,112,97,99,101,0,4,72,115,99,114,0,6,104,97,109,105,108,116,1,3,72,
102,114,0,13,80,111,105,110,99,97,114,101,112,108,97,110,101,1,4,72,111,112,102,0,
11,113,117,97,116,101,114,110,105,111,110,115,1,7,112,108,97,110,99,107,104,1,4,104,
98,97,114,0,6,104,115,108,97,115,104,0,6,112,108,97,110,99,107,0,6,112,108,97,
110,107,118,1,4,73,115,99,114,0,8,105,109,97,103,108,105,110,101,1,3,73,102,114,
0,2,73,109,0,5,105,109,97,103,101,0,8,105,109,97,103,112,97,114,116,1,10,76,
97,112,108,97,99,101,116,114,102,0,4,76,115,99,114,0,6,108,97,103,114,97,110,1,
3,101,108,108,2,4,78,111,112,102,0,8,110,97,116,117,114,97,108,115,1,6,110,117,
109,101,114,111,1,6,99,111,112,121,115,114,1,6,119,101,105,101,114,112,0,2,119,112,
1,4,80,111,112,102,0,6,112,114,105,109,101,115,1,4,81,111,112,102,0,9,114,97,
116,105,111,110,97,108,115,1,4,82,115,99,114,0,7,114,101,97,108,105,110,101,1,2,
82,101,0,3,82,102,114,0,4,114,101,97,108,0,8,114,101,97,108,112,97,114,116,1,
4,82,111,112,102,0,5,114,101,97,108,115,1,2,114,120,4,5,84,82,65,68,69,0,
5,116,114,97,100,101,2,4,90,111,112,102,0,8,105,110,116,101,103,101,114,115,3,3,
109,104,111,1,3,90,102,114,0,6,122,101,101,116,114,102,1,5,105,105,111,116,97,3,
10,66,101,114,110,111,117,108,108,105,115,0,4,66,115,99,114,0,6,98,101,114,110,111,
117,1,7,67,97,121,108,101,121,115,0,3,67,102,114,2,4,101,115,99,114,1,4,69,
115,99,114,0,11,101,120,112,101,99,116,97,116,105,111,110,1,10,70,111,117,114,105,101,
114,116,114,102,0,4,70,115,99,114,2,9,77,101,108,108,105,110,116,114,102,0,4,77,
115,99,114,0,6,112,104,109,109,97,116,1,5,111,114,100,101,114,0,7,111,114,100,101,
114,111,102,0,4,111,115,99,114,1,7,97,108,101,102,115,121,109,0,5,97,108,101,112,
104,1,4,98,101,116,104,1,5,103,105,109,101,108,1,6,100,97,108,101,116,104,13,20,
67,97,112,105,116,97,108,68,105,102,102,101,114,101,110,116,105,97,108,68,0,2,68,68,
1,13,68,105,102,102,101,114,101,110,116,105,97,108,68,0,2,100,100,1,12,69,120,112,
111,110,101,110,116,105,97,108,69,0,2,101,101,0,12,101,120,112,111,110,101,110,116,105,
97,108,101,1,10,73,109,97,103,105,110,97,114,121,73,0,2,105,105,11,6,102,114,97,
99,49,51,1,6,102,114,97,99,50,51,1,6,102,114,97,99,49,53,1,6,102,114,97,
99,50,53,1,6,102,114,97,99,51,53,1,6,102,114,97,99,52,53,1,6,102,114,97,
99,49,54,1,6,102,114,97,99,53,54,1,6,102,114,97,99,49,56,1,6,102,114,97,
99,51,56,1,6,102,114,97,99,53,56,1,6,102,114,97,99,55,56,50,9,76,101,102,
116,65,114,114,111,119,0,14,83,104,111,114,116,76,101,102,116,65,114,114,111,119,0,4,
108,97,114,114,0,9,108,101,102,116,97,114,114,111,119,0,5,115,108,97,114,114,1,12,
83,104,111,114,116,85,112,65,114,114,111,119,0,7,85,112,65,114,114,111,119,0,4,117,
97,114,114,0,7,117,112,97,114,114,111,119,1,10,82,105,103,104,116,65,114,114,111,119,
0,15,83,104,111,114,116,82,105,103,104,116,65,114,114,111,119,0,4,114,97,114,114,0,
10,114,105,103,104,116,97,114,114,111,119,0,5,115,114,97,114,114,1,9,68,111,119,110,
65,114,114,111,119,0,14,83,104,111,114,116,68,111,119,110,65,114,114,111,119,0,4,100,
97,114,114,0,9,100,111,119,110,97,114,114,111,119,1,14,76,101,102,116,82,105,103,104,
116,65,114,114,111,119,0,4,104,97,114,114,0,14,108,101,102,116,114,105,103,104,116,97,
114,114,111,119,1,11,85,112,68,111,119,110,65,114,114,111,119,0,11,117,112,100,111,119,
110,97,114,114,111,119,0,4,118,97,114,114,1,14,85,112,112,101,114,76,101,102,116,65,
114,114,111,119,0,5,110,119,97,114,114,0,7,110,119,97,114,114,111,119,1,15,85,112,
112,101,114,82,105,103,104,116,65,114,114,111,119,0,5,110,101,97,114,114,0,7,110,101,
97,114,114,111,119,1,15,76,111,119,101,114,82,105,103,104,116,65,114,114,111,119,0,5,
115,101,97,114,114,0,7,115,101,97,114,114,111,119,1,14,76,111,119,101,114,76,101,102,
116,65,114,114,111,119,0,5,115,119,97,114,114,0,7,115,119,97,114,114,111,119,1,5,
110,108,97,114,114,0,10,110,108,101,102,116,97,114,114,111,119,1,5,110,114,97,114,114,
0,11,110,114,105,103,104,116,97,114,114,111,119,2,5,114,97,114,114,119,0,15,114,105,
103,104,116,115,113,117,105,103,97,114,114,111,119,0,70,56,3,110,114,97,114,114,119,1,
4,76,97,114,114,0,16,116,119,111,104,101,97,100,108,101,102,116,97,114,114,111,119,1,
4,85,97,114,114,1,4,82,97,114,114,0,17,116,119,111,104,101,97,100,114,105,103,104,
116,97,114,114,111,119,1,4,68,97,114,114,1,6,108,97,114,114,116,108,0,13,108,101,
102,116,97,114,114,111,119,116,97,105,108,1,6,114,97,114,114,116,108,0,14,114,105,103,
104,116,97,114,114,111,119,116,97,105,108,1,12,76,101,102,116,84,101,101,65,114,114,111,
119,0,10,109,97,112,115,116,111,108,101,102,116,1,10,85,112,84,101,101,65,114,114,111,
119,0,8,109,97,112,115,116,111,117,112,1,13,82,105,103,104,116,84,101,101,65,114,114,
111,119,0,3,109,97,112,0,6,109,97,112,115,116,111,1,12,68,111,119,110,84,101,101,
65,114,114,111,119,0,10,109,97,112,115,116,111,100,111,119,110,2,13,104,111,111,107,108,
101,102,116,97,114,114,111,119,0,6,108,97,114,114,104,107,1,14,104,111,111,107,114,105,
103,104,116,97,114,114,111,119,0,6,114,97,114,114,104,107,1,6,108,97,114,114,108,112,
0,13,108,111,111,112,97,114,114,111,119,108,101,102,116,1,14,108,111,111,112,97,114,114,
111,119,114,105,103,104,116,0,6,114,97,114,114,108,112,1,5,104,97,114,114,119,0,19,
108,101,102,116,114,105,103,104,116,115,113,117,105,103,97,114,114,111,119,1,5,110,104,97,
114,114,0,15,110,108,101,102,116,114,105,103,104,116,97,114,114,111,119,2,3,76,115,104,
0,3,108,115,104,1,3,82,115,104,0,3,114,115,104,1,4,108,100,115,104,1,4,114,
100,115,104,2,5,99,114,97,114,114,1,6,99,117,108,97,114,114,0,14,99,117,114,118,
101,97,114,114,111,119,108,101,102,116,1,6,99,117,114,97,114,114,0,15,99,117,114,118,
101,97,114,114,111,119,114,105,103,104,116,3,15,99,105,114,99,108,101,97,114,114,111,119,
108,101,102,116,0,5,111,108,97,114,114,1,16,99,105,114,99,108,101,97,114,114,111,119,
114,105,103,104,116,0,5,111,114,97,114,114,1,10,76,101,102,116,86,101,99,116,111,114,
0,13,108,101,102,116,104,97,114,112,111,111,110,117,112,0,5,108,104,97,114,117,1,14,
68,111,119,110,76,101,102,116,86,101,99,116,111,114,0,15,108,101,102,116,104,97,114,112,
111,111,110,100,111,119,110,0,5,108,104,97,114,100,1,13,82,105,103,104,116,85,112,86,
101,99,116,111,114,0,5,117,104,97,114,114,0,14,117,112,104,97,114,112,111,111,110,114,
105,103,104,116,1,12,76,101,102,116,85,112,86,101,99,116,111,114,0,5,117,104,97,114,
108,0,13,117,112,104,97,114,112,111,111,110,108,101,102,116,1,11,82,105,103,104,116,86,
101,99,116,111,114,0,5,114,104,97,114,117,0,14,114,105,103,104,116,104,97,114,112,111,
111,110,117,112,1,15,68,111,119,110,82,105,103,104,116,86,101,99,116,111,114,0,5,114,
104,97,114,100,0,16,114,105,103,104,116,104,97,114,112,111,111,110,100,111,119,110,1,15,
82,105,103,104,116,68,111,119,110,86,101,99,116,111,114,0,5,100,104,97,114,114,0,16,
100,111,119,110,104,97,114,112,111,111,110,114,105,103,104,116,1,14,76,101,102,116,68,111,
119,110,86,101,99,116,111,114,0,5,100,104,97,114,108,0,15,100,111,119,110,104,97,114,
112,111,111,110,108,101,102,116,1,19,82,105,103,104,116,65,114,114,111,119,76,101,102,116,
65,114,114,111,119,0,15,114,105,103,104,116,108,101,102,116,97,114,114,111,119,115,0,5,
114,108,97,114,114,1,16,85,112,65,114,114,111,119,68,111,119,110,65,114,114,111,119,0,
5,117,100,97,114,114,1,19,76,101,102,116,65,114,114,111,119,82,105,103,104,116,65,114,
114,111,119,0,15,108,101,102,116,114,105,103,104,116,97,114,114,111,119,115,0,5,108,114,
97,114,114,1,14,108,101,102,116,108,101,102,116,97,114,114,111,119,115,0,5,108,108,97,
114,114,1,10,117,112,117,112,97,114,114,111,119,115,0,5,117,117,97,114,114,1,16,114,
105,103,104,116,114,105,103,104,116,97,114,114,111,119,115,0,5,114,114,97,114,114,1,5,
100,100,97,114,114,0,14,100,111,119,110,100,111,119,110,97,114,114,111,119,115,1,18,82,
101,118,101,114,115,101,69,113,117,105,108,105,98,114,105,117,109,0,17,108,101,102,116,114,
105,103,104,116,104,97,114,112,111,111,110,115,0,5,108,114,104,97,114,1,11,69,113,117,
105,108,105,98,114,105,117,109,0,17,114,105,103,104,116,108,101,102,116,104,97,114,112,111,
111,110,115,0,5,114,108,104,97,114,1,10,110,76,101,102,116,97,114,114,111,119,0,5,
110,108,65,114,114,1,15,110,76,101,102,116,114,105,103,104,116,97,114,114,111,119,0,5,
110,104,65,114,114,1,11,110,82,105,103,104,116,97,114,114,111,119,0,5,110,114,65,114,
114,1,15,68,111,117,98,108,101,76,101,102,116,65,114,114,111,119,0,9,76,101,102,116,
97,114,114,111,119,0,4,108,65,114,114,1,13,68,111,117,98,108,101,85,112,65,114,114,
111,119,0,7,85,112,97,114,114,111,119,0,4,117,65,114,114,1,16,68,111,117,98,108,
101,82,105,103,104,116,65,114,114,111,119,0,7,73,109,112,108,105,101,115,0,10,82,105,
103,104,116,97,114,114,111,119,0,4,114,65,114,114,1,15,68,111,117,98,108,101,68,111,
119,110,65,114,114,111,119,0,9,68,111,119,110,97,114,114,111,119,0,4,100,65,114,114,
1,20,68,111,117,98,108,101,76,101,102,116,82,105,103,104,116,65,114,114,111,119,0,14,
76,101,102,116,114,105,103,104,116,97,114,114,111,119,0,4,104,65,114,114,0,3,105,102,
102,1,17,68,111,117,98,108,101,85,112,68,111,119,110,65,114,114,111,119,0,11,85,112,
100,111,119,110,97,114,114,111,119,0,4,118,65,114,114,1,5,110,119,65,114,114,1,5,
110,101,65,114,114,1,5,115,101,65,114,114,1,5,115,119,65,114,114,1,10,76,108,101,
102,116,97,114,114,111,119,0,5,108,65,97,114,114,1,11,82,114,105,103,104,116,97,114,
114,111,119,0,5,114,65,97,114,114,2,7,122,105,103,114,97,114,114,7,12,76,101,102,
116,65,114,114,111,119,66,97,114,0,5,108,97,114,114,98,1,13,82,105,103,104,116,65,
114,114,111,119,66,97,114,0,5,114,97,114,114,98,16,16,68,111,119,110,65,114,114,111,
119,85,112,65,114,114,111,119,0,5,100,117,97,114,114,8,5,108,111,97,114,114,1,5,
114,111,97,114,114,1,5,104,111,97,114,114,1,6,70,111,114,65,108,108,0,6,102,111,
114,97,108,108,1,4,99,111,109,112,0,10,99,111,109,112,108,101,109,101,110,116,1,8,
80,97,114,116,105,97,108,68,0,4,112,97,114,116,0,69,56,3,110,112,97,114,116,1,
6,69,120,105,115,116,115,0,5,101,120,105,115,116,1,9,78,111,116,69,120,105,115,116,
115,0,6,110,101,120,105,115,116,0,7,110,101,120,105,115,116,115,1,5,101,109,112,116,
121,0,8,101,109,112,116,121,115,101,116,0,6,101,109,112,116,121,118,0,10,118,97,114,
110,111,116,104,105,110,103,2,3,68,101,108,0,5,110,97,98,108,97,1,7,69,108,101,
109,101,110,116,0,2,105,110,0,4,105,115,105,110,0,5,105,115,105,110,118,1,10,78,
111,116,69,108,101,109,101,110,116,0,5,110,111,116,105,110,0,7,110,111,116,105,110,118,
97,2,14,82,101,118,101,114,115,101,69,108,101,109,101,110,116,0,8,83,117,99,104,84,
104,97,116,0,2,110,105,0,3,110,105,118,1,17,78,111,116,82,101,118,101,114,115,101,
69,108,101,109,101,110,116,0,5,110,111,116,110,105,0,7,110,111,116,110,105,118,97,3,
7,80,114,111,100,117,99,116,0,4,112,114,111,100,1,9,67,111,112,114,111,100,117,99,
116,0,6,99,111,112,114,111,100,1,3,83,117,109,0,3,115,117,109,1,5,109,105,110,
117,115,1,9,77,105,110,117,115,80,108,117,115,0,6,109,110,112,108,117,115,0,2,109,
112,1,7,100,111,116,112,108,117,115,0,6,112,108,117,115,100,111,2,9,66,97,99,107,
115,108,97,115,104,0,8,115,101,116,109,105,110,117,115,0,5,115,101,116,109,110,0,13,
115,109,97,108,108,115,101,116,109,105,110,117,115,0,6,115,115,101,116,109,110,1,6,108,
111,119,97,115,116,1,11,83,109,97,108,108,67,105,114,99,108,101,0,6,99,111,109,112,
102,110,2,4,83,113,114,116,0,5,114,97,100,105,99,3,12,80,114,111,112,111,114,116,
105,111,110,97,108,0,4,112,114,111,112,0,6,112,114,111,112,116,111,0,9,118,97,114,
112,114,111,112,116,111,0,5,118,112,114,111,112,1,5,105,110,102,105,110,1,5,97,110,
103,114,116,1,3,97,110,103,0,5,97,110,103,108,101,0,68,210,32,110,97,110,103,1,
6,97,110,103,109,115,100,0,13,109,101,97,115,117,114,101,100,97,110,103,108,101,1,6,
97,110,103,115,112,104,1,11,86,101,114,116,105,99,97,108,66,97,114,0,3,109,105,100,
0,8,115,104,111,114,116,109,105,100,0,4,115,109,105,100,1,14,78,111,116,86,101,114,
116,105,99,97,108,66,97,114,0,4,110,109,105,100,0,9,110,115,104,111,114,116,109,105,
100,0,5,110,115,109,105,100,1,17,68,111,117,98,108,101,86,101,114,116,105,99,97,108,
66,97,114,0,3,112,97,114,0,8,112,97,114,97,108,108,101,108,0,13,115,104,111,114,
116,112,97,114,97,108,108,101,108,0,4,115,112,97,114,1,20,78,111,116,68,111,117,98,
108,101,86,101,114,116,105,99,97,108,66,97,114,0,4,110,112,97,114,0,9,110,112,97,
114,97,108,108,101,108,0,14,110,115,104,111,114,116,112,97,114,97,108,108,101,108,0,5,
110,115,112,97,114,1,3,97,110,100,0,5,119,101,100,103,101,1,2,111,114,0,3,118,
101,101,1,3,99,97,112,0,68,0,254,99,97,112,115,1,3,99,117,112,0,68,0,254,
99,117,112,115,1,8,73,110,116,101,103,114,97,108,0,3,105,110,116,1,3,73,110,116,
1,5,105,105,105,110,116,0,4,116,105,110,116,1,15,67,111,110,116,111,117,114,73,110,
116,101,103,114,97,108,0,6,99,111,110,105,110,116,0,4,111,105,110,116,1,6,67,111,
110,105,110,116,0,21,68,111,117,98,108,101,67,111,110,116,111,117,114,73,110,116,101,103,
114,97,108,1,7,67,99,111,110,105,110,116,1,5,99,119,105,110,116,1,24,67,108,111,
99,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,0,8,99,
119,99,111,110,105,110,116,1,31,67,111,117,110,116,101,114,67,108,111,99,107,119,105,115,
101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,0,8,97,119,99,111,110,105,
110,116,1,9,84,104,101,114,101,102,111,114,101,0,6,116,104,101,114,101,52,0,9,116,
104,101,114,101,102,111,114,101,1,7,66,101,99,97,117,115,101,0,6,98,101,99,97,117,
115,0,7,98,101,99,97,117,115,101,1,5,114,97,116,105,111,1,5,67,111,108,111,110,
0,10,80,114,111,112,111,114,116,105,111,110,1,8,100,111,116,109,105,110,117,115,0,6,
109,105,110,117,115,100,2,5,109,68,68,111,116,1,6,104,111,109,116,104,116,1,5,84,
105,108,100,101,0,3,115,105,109,0,8,116,104,105,99,107,115,105,109,0,6,116,104,107,
115,105,109,0,69,210,32,110,118,115,105,109,1,7,98,97,99,107,115,105,109,0,4,98,
115,105,109,0,68,49,3,114,97,99,101,1,2,97,99,0,6,109,115,116,112,111,115,0,
67,51,3,97,99,69,1,3,97,99,100,1,13,86,101,114,116,105,99,97,108,84,105,108,
100,101,0,2,119,114,0,6,119,114,101,97,116,104,1,8,78,111,116,84,105,108,100,101,
0,4,110,115,105,109,1,10,69,113,117,97,108,84,105,108,100,101,0,5,101,113,115,105,
109,0,4,101,115,105,109,0,77,56,3,78,111,116,69,113,117,97,108,84,105,108,100,101,
0,69,56,3,110,101,115,105,109,1,10,84,105,108,100,101,69,113,117,97,108,0,4,115,
105,109,101,0,5,115,105,109,101,113,1,13,78,111,116,84,105,108,100,101,69,113,117,97,
108,0,5,110,115,105,109,101,0,6,110,115,105,109,101,113,1,14,84,105,108,100,101,70,
117,108,108,69,113,117,97,108,0,4,99,111,110,103,1,5,115,105,109,110,101,1,17,78,
111,116,84,105,108,100,101,70,117,108,108,69,113,117,97,108,0,5,110,99,111,110,103,1,
10,84,105,108,100,101,84,105,108,100,101,0,2,97,112,0,6,97,112,112,114,111,120,0,
5,97,115,121,109,112,0,11,116,104,105,99,107,97,112,112,114,111,120,0,5,116,104,107,
97,112,1,13,78,111,116,84,105,108,100,101,84,105,108,100,101,0,3,110,97,112,0,7,
110,97,112,112,114,111,120,1,3,97,112,101,0,8,97,112,112,114,111,120,101,113,1,4,
97,112,105,100,0,69,56,3,110,97,112,105,100,1,8,98,97,99,107,99,111,110,103,0,
5,98,99,111,110,103,1,6,67,117,112,67,97,112,0,7,97,115,121,109,112,101,113,0,
68,210,32,110,118,97,112,1,6,66,117,109,112,101,113,0,12,72,117,109,112,68,111,119,
110,72,117,109,112,0,4,98,117,109,112,0,79,56,3,78,111,116,72,117,109,112,68,111,
119,110,72,117,109,112,0,69,56,3,110,98,117,109,112,1,9,72,117,109,112,69,113,117,
97,108,0,5,98,117,109,112,101,0,6,98,117,109,112,101,113,0,76,56,3,78,111,116,
72,117,109,112,69,113,117,97,108,0,70,56,3,110,98,117,109,112,101,1,8,68,111,116,
69,113,117,97,108,0,5,100,111,116,101,113,0,5,101,115,100,111,116,0,69,56,3,110,
101,100,111,116,1,8,100,111,116,101,113,100,111,116,0,4,101,68,111,116,1,5,101,102,
68,111,116,0,13,102,97,108,108,105,110,103,100,111,116,115,101,113,1,5,101,114,68,111,
116,0,12,114,105,115,105,110,103,100,111,116,115,101,113,1,6,65,115,115,105,103,110,0,
6,99,111,108,111,110,101,0,7,99,111,108,111,110,101,113,1,6,101,99,111,108,111,110,
0,7,101,113,99,111,108,111,110,1,4,101,99,105,114,0,6,101,113,99,105,114,99,1,
6,99,105,114,99,101,113,0,4,99,105,114,101,2,6,119,101,100,103,101,113,1,5,118,
101,101,101,113,2,9,116,114,105,97,110,103,108,101,113,0,4,116,114,105,101,3,6,101,
113,117,101,115,116,0,7,113,117,101,115,116,101,113,1,8,78,111,116,69,113,117,97,108,
0,2,110,101,1,9,67,111,110,103,114,117,101,110,116,0,5,101,113,117,105,118,0,71,
229,32,98,110,101,113,117,105,118,1,12,78,111,116,67,111,110,103,114,117,101,110,116,0,
6,110,101,113,117,105,118,2,2,108,101,0,3,108,101,113,0,68,210,32,110,118,108,101,
1,12,71,114,101,97,116,101,114,69,113,117,97,108,0,2,103,101,0,3,103,101,113,0,
68,210,32,110,118,103,101,1,13,76,101,115,115,70,117,108,108,69,113,117,97,108,0,2,
108,69,0,4,108,101,113,113,0,67,56,3,110,108,69,0,69,56,3,110,108,101,113,113,
1,16,71,114,101,97,116,101,114,70,117,108,108,69,113,117,97,108,0,2,103,69,0,4,
103,101,113,113,0,83,56,3,78,111,116,71,114,101,97,116,101,114,70,117,108,108,69,113,
117,97,108,0,67,56,3,110,103,69,0,69,56,3,110,103,101,113,113,1,3,108,110,69,
0,5,108,110,101,113,113,0,73,0,254,108,118,101,114,116,110,101,113,113,0,68,0,254,
108,118,110,69,1,3,103,110,69,0,5,103,110,101,113,113,0,73,0,254,103,118,101,114,
116,110,101,113,113,0,68,0,254,103,118,110,69,1,2,76,116,0,14,78,101,115,116,101,
100,76,101,115,115,76,101,115,115,0,2,108,108,0,75,56,3,78,111,116,76,101,115,115,
76,101,115,115,0,68,56,3,110,76,116,118,0,67,210,32,110,76,116,1,2,71,116,0,
20,78,101,115,116,101,100,71,114,101,97,116,101,114,71,114,101,97,116,101,114,0,2,103,
103,0,81,56,3,78,111,116,71,114,101,97,116,101,114,71,114,101,97,116,101,114,0,68,
56,3,110,71,116,118,0,67,210,32,110,71,116,1,7,98,101,116,119,101,101,110,0,5,
116,119,105,120,116,1,9,78,111,116,67,117,112,67,97,112,1,7,78,111,116,76,101,115,
115,0,5,110,108,101,115,115,0,3,110,108,116,1,10,78,111,116,71,114,101,97,116,101,
114,0,3,110,103,116,0,4,110,103,116,114,1,12,78,111,116,76,101,115,115,69,113,117,
97,108,0,3,110,108,101,0,4,110,108,101,113,1,15,78,111,116,71,114,101,97,116,101,
114,69,113,117,97,108,0,3,110,103,101,0,4,110,103,101,113,1,9,76,101,115,115,84,
105,108,100,101,0,7,108,101,115,115,115,105,109,0,4,108,115,105,109,1,12,71,114,101,
97,116,101,114,84,105,108,100,101,0,4,103,115,105,109,0,6,103,116,114,115,105,109,1,
12,78,111,116,76,101,115,115,84,105,108,100,101,0,5,110,108,115,105,109,1,15,78,111,
116,71,114,101,97,116,101,114,84,105,108,100,101,0,5,110,103,115,105,109,1,11,76,101,
115,115,71,114,101,97,116,101,114,0,7,108,101,115,115,103,116,114,0,2,108,103,1,11,
71,114,101,97,116,101,114,76,101,115,115,0,2,103,108,0,7,103,116,114,108,101,115,115,
1,14,78,111,116,76,101,115,115,71,114,101,97,116,101,114,0,4,110,116,108,103,1,14,
78,111,116,71,114,101,97,116,101,114,76,101,115,115,0,4,110,116,103,108,1,8,80,114,
101,99,101,100,101,115,0,2,112,114,0,4,112,114,101,99,1,8,83,117,99,99,101,101,
100,115,0,2,115,99,0,4,115,117,99,99,1,18,80,114,101,99,101,100,101,115,83,108,
97,110,116,69,113,117,97,108,0,5,112,114,99,117,101,0,11,112,114,101,99,99,117,114,
108,121,101,113,1,18,83,117,99,99,101,101,100,115,83,108,97,110,116,69,113,117,97,108,
0,5,115,99,99,117,101,0,11,115,117,99,99,99,117,114,108,121,101,113,1,13,80,114,
101,99,101,100,101,115,84,105,108,100,101,0,7,112,114,101,99,115,105,109,0,5,112,114,
115,105,109,1,13,83,117,99,99,101,101,100,115,84,105,108,100,101,0,5,115,99,115,105,
109,0,7,115,117,99,99,115,105,109,0,80,56,3,78,111,116,83,117,99,99,101,101,100,
115,84,105,108,100,101,1,11,78,111,116,80,114,101,99,101,100,101,115,0,3,110,112,114,
0,5,110,112,114,101,99,1,11,78,111,116,83,117,99,99,101,101,100,115,0,3,110,115,
99,0,5,110,115,117,99,99,1,3,115,117,98,0,6,115,117,98,115,101,116,0,73,210,
32,78,111,116,83,117,98,115,101,116,0,71,210,32,110,115,117,98,115,101,116,0,69,210,
32,118,110,115,117,98,1,8,83,117,112,101,114,115,101,116,0,3,115,117,112,0,6,115,
117,112,115,101,116,0,75,210,32,78,111,116,83,117,112,101,114,115,101,116,0,71,210,32,
110,115,117,112,115,101,116,0,69,210,32,118,110,115,117,112,1,4,110,115,117,98,1,4,
110,115,117,112,1,11,83,117,98,115,101,116,69,113,117,97,108,0,4,115,117,98,101,0,
8,115,117,98,115,101,116,101,113,1,13,83,117,112,101,114,115,101,116,69,113,117,97,108,
0,4,115,117,112,101,0,8,115,117,112,115,101,116,101,113,1,14,78,111,116,83,117,98,
115,101,116,69,113,117,97,108,0,5,110,115,117,98,101,0,9,110,115,117,98,115,101,116,
101,113,1,16,78,111,116,83,117,112,101,114,115,101,116,69,113,117,97,108,0,5,110,115,
117,112,101,0,9,110,115,117,112,115,101,116,101,113,1,5,115,117,98,110,101,0,9,115,
117,98,115,101,116,110,101,113,0,76,0,254,118,97,114,115,117,98,115,101,116,110,101,113,
0,70,0,254,118,115,117,98,110,101,1,5,115,117,112,110,101,0,9,115,117,112,115,101,
116,110,101,113,0,76,0,254,118,97,114,115,117,112,115,101,116,110,101,113,0,70,0,254,
118,115,117,112,110,101,2,6,99,117,112,100,111,116,1,9,85,110,105,111,110,80,108,117,
115,0,5,117,112,108,117,115,1,12,83,113,117,97,114,101,83,117,98,115,101,116,0,5,
115,113,115,117,98,0,8,115,113,115,117,98,115,101,116,0,79,56,3,78,111,116,83,113,
117,97,114,101,83,117,98,115,101,116,1,14,83,113,117,97,114,101,83,117,112,101,114,115,
101,116,0,5,115,113,115,117,112,0,8,115,113,115,117,112,115,101,116,0,81,56,3,78,
111,116,83,113,117,97,114,101,83,117,112,101,114,115,101,116,1,17,83,113,117,97,114,101,
83,117,98,115,101,116,69,113,117,97,108,0,6,115,113,115,117,98,101,0,10,115,113,115,
117,98,115,101,116,101,113,1,19,83,113,117,97,114,101,83,117,112,101,114,115,101,116,69,
113,117,97,108,0,6,115,113,115,117,112,101,0,10,115,113,115,117,112,115,101,116,101,113,
1,18,83,113,117,97,114,101,73,110,116,101,114,115,101,99,116,105,111,110,0,5,115,113,
99,97,112,0,70,0,254,115,113,99,97,112,115,1,11,83,113,117,97,114,101,85,110,105,
111,110,0,5,115,113,99,117,112,0,70,0,254,115,113,99,117,112,115,1,10,67,105,114,
99,108,101,80,108,117,115,0,5,111,112,108,117,115,1,11,67,105,114,99,108,101,77,105,
110,117,115,0,6,111,109,105,110,117,115,1,11,67,105,114,99,108,101,84,105,109,101,115,
0,6,111,116,105,109,101,115,1,4,111,115,111,108,1,9,67,105,114,99,108,101,68,111,
116,0,4,111,100,111,116,1,11,99,105,114,99,108,101,100,99,105,114,99,0,4,111,99,
105,114,1,10,99,105,114,99,108,101,100,97,115,116,0,4,111,97,115,116,2,11,99,105,
114,99,108,101,100,100,97,115,104,0,5,111,100,97,115,104,1,7,98,111,120,112,108,117,
115,0,5,112,108,117,115,98,1,8,98,111,120,109,105,110,117,115,0,6,109,105,110,117,
115,98,1,8,98,111,120,116,105,109,101,115,0,6,116,105,109,101,115,98,1,9,100,111,
116,115,113,117,97,114,101,0,5,115,100,111,116,98,1,8,82,105,103,104,116,84,101,101,
0,5,118,100,97,115,104,1,7,76,101,102,116,84,101,101,0,5,100,97,115,104,118,1,
7,68,111,119,110,84,101,101,0,3,116,111,112,1,5,85,112,84,101,101,0,3,98,111,
116,0,6,98,111,116,116,111,109,0,4,112,101,114,112,2,6,109,111,100,101,108,115,1,
14,68,111,117,98,108,101,82,105,103,104,116,84,101,101,0,5,118,68,97,115,104,1,5,
86,100,97,115,104,1,6,86,118,100,97,115,104,1,5,86,68,97,115,104,1,6,110,118,
100,97,115,104,1,6,110,118,68,97,115,104,1,6,110,86,100,97,115,104,1,6,110,86,
68,97,115,104,1,6,112,114,117,114,101,108,2,12,76,101,102,116,84,114,105,97,110,103,
108,101,0,15,118,97,114,116,114,105,97,110,103,108,101,108,101,102,116,0,5,118,108,116,
114,105,1,13,82,105,103,104,116,84,114,105,97,110,103,108,101,0,16,118,97,114,116,114,
105,97,110,103,108,101,114,105,103,104,116,0,5,118,114,116,114,105,1,17,76,101,102,116,
84,114,105,97,110,103,108,101,69,113,117,97,108,0,5,108,116,114,105,101,0,14,116,114,
105,97,110,103,108,101,108,101,102,116,101,113,0,71,210,32,110,118,108,116,114,105,101,1,
18,82,105,103,104,116,84,114,105,97,110,103,108,101,69,113,117,97,108,0,5,114,116,114,
105,101,0,15,116,114,105,97,110,103,108,101,114,105,103,104,116,101,113,0,71,210,32,110,
118,114,116,114,105,101,1,6,111,114,105,103,111,102,1,4,105,109,111,102,1,8,109,117,
108,116,105,109,97,112,0,5,109,117,109,97,112,1,6,104,101,114,99,111,110,1,6,105,
110,116,99,97,108,0,8,105,110,116,101,114,99,97,108,1,6,118,101,101,98,97,114,2,
6,98,97,114,118,101,101,1,7,97,110,103,114,116,118,98,1,5,108,114,116,114,105,1,
5,87,101,100,103,101,0,8,98,105,103,119,101,100,103,101,0,6,120,119,101,100,103,101,
1,3,86,101,101,0,6,98,105,103,118,101,101,0,4,120,118,101,101,1,12,73,110,116,
101,114,115,101,99,116,105,111,110,0,6,98,105,103,99,97,112,0,4,120,99,97,112,1,
5,85,110,105,111,110,0,6,98,105,103,99,117,112,0,4,120,99,117,112,1,7,68,105,
97,109,111,110,100,0,4,100,105,97,109,0,7,100,105,97,109,111,110,100,1,4,115,100,
111,116,1,4,83,116,97,114,0,6,115,115,116,97,114,102,1,13,100,105,118,105,100,101,
111,110,116,105,109,101,115,0,6,100,105,118,111,110,120,1,6,98,111,119,116,105,101,1,
6,108,116,105,109,101,115,1,6,114,116,105,109,101,115,1,14,108,101,102,116,116,104,114,
101,101,116,105,109,101,115,0,6,108,116,104,114,101,101,1,15,114,105,103,104,116,116,104,
114,101,101,116,105,109,101,115,0,6,114,116,104,114,101,101,1,9,98,97,99,107,115,105,
109,101,113,0,5,98,115,105,109,101,1,8,99,117,114,108,121,118,101,101,0,5,99,117,
118,101,101,1,10,99,117,114,108,121,119,101,100,103,101,0,5,99,117,119,101,100,1,3,
83,117,98,0,6,83,117,98,115,101,116,1,3,83,117,112,0,6,83,117,112,115,101,116,
1,3,67,97,112,1,3,67,117,112,1,4,102,111,114,107,0,9,112,105,116,99,104,102,
111,114,107,1,4,101,112,97,114,1,7,108,101,115,115,100,111,116,0,5,108,116,100,111,
116,1,5,103,116,100,111,116,0,6,103,116,114,100,111,116,1,2,76,108,0,67,56,3,
110,76,108,1,2,71,103,0,3,103,103,103,0,67,56,3,110,71,103,1,16,76,101,115,
115,69,113,117,97,108,71,114,101,97,116,101,114,0,3,108,101,103,0,9,108,101,115,115,
101,113,103,116,114,0,68,0,254,108,101,115,103,1,16,71,114,101,97,116,101,114,69,113,
117,97,108,76,101,115,115,0,3,103,101,108,0,9,103,116,114,101,113,108,101,115,115,0,
68,0,254,103,101,115,108,3,5,99,117,101,112,114,0,11,99,117,114,108,121,101,113,112,
114,101,99,1,5,99,117,101,115,99,0,11,99,117,114,108,121,101,113,115,117,99,99,1,
21,78,111,116,80,114,101,99,101,100,101,115,83,108,97,110,116,69,113,117,97,108,0,6,
110,112,114,99,117,101,1,21,78,111,116,83,117,99,99,101,101,100,115,83,108,97,110,116,
69,113,117,97,108,0,6,110,115,99,99,117,101,1,20,78,111,116,83,113,117,97,114,101,
83,117,98,115,101,116,69,113,117,97,108,0,7,110,115,113,115,117,98,101,1,22,78,111,
116,83,113,117,97,114,101,83,117,112,101,114,115,101,116,69,113,117,97,108,0,7,110,115,
113,115,117,112,101,3,5,108,110,115,105,109,1,5,103,110,115,105,109,1,8,112,114,101,
99,110,115,105,109,0,6,112,114,110,115,105,109,1,6,115,99,110,115,105,109,0,8,115,
117,99,99,110,115,105,109,1,15,78,111,116,76,101,102,116,84,114,105,97,110,103,108,101,
0,5,110,108,116,114,105,0,13,110,116,114,105,97,110,103,108,101,108,101,102,116,1,16,
78,111,116,82,105,103,104,116,84,114,105,97,110,103,108,101,0,5,110,114,116,114,105,0,
14,110,116,114,105,97,110,103,108,101,114,105,103,104,116,1,20,78,111,116,76,101,102,116,
84,114,105,97,110,103,108,101,69,113,117,97,108,0,6,110,108,116,114,105,101,0,15,110,
116,114,105,97,110,103,108,101,108,101,102,116,101,113,1,21,78,111,116,82,105,103,104,116,
84,114,105,97,110,103,108,101,69,113,117,97,108,0,6,110,114,116,114,105,101,0,16,110,
116,114,105,97,110,103,108,101,114,105,103,104,116,101,113,1,6,118,101,108,108,105,112,1,
5,99,116,100,111,116,1,5,117,116,100,111,116,1,5,100,116,100,111,116,1,5,100,105,
115,105,110,1,6,105,115,105,110,115,118,1,5,105,115,105,110,115,1,7,105,115,105,110,
100,111,116,0,72,56,3,110,111,116,105,110,100,111,116,1,7,110,111,116,105,110,118,99,
1,7,110,111,116,105,110,118,98,2,5,105,115,105,110,69,0,70,56,3,110,111,116,105,
110,69,1,4,110,105,115,100,1,4,120,110,105,115,1,3,110,105,115,1,7,110,111,116,
110,105,118,99,1,7,110,111,116,110,105,118,98,7,6,98,97,114,119,101,100,0,8,98,
97,114,119,101,100,103,101,1,6,66,97,114,119,101,100,0,14,100,111,117,98,108,101,98,
97,114,119,101,100,103,101,2,11,76,101,102,116,67,101,105,108,105,110,103,0,5,108,99,
101,105,108,1,12,82,105,103,104,116,67,101,105,108,105,110,103,0,5,114,99,101,105,108,
1,9,76,101,102,116,70,108,111,111,114,0,6,108,102,108,111,111,114,1,10,82,105,103,
104,116,70,108,111,111,114,0,6,114,102,108,111,111,114,1,6,100,114,99,114,111,112,1,
6,100,108,99,114,111,112,1,6,117,114,99,114,111,112,1,6,117,108,99,114,111,112,1,
4,98,110,111,116,2,8,112,114,111,102,108,105,110,101,1,8,112,114,111,102,115,117,114,
102,2,6,116,101,108,114,101,99,1,6,116,97,114,103,101,116,6,6,117,108,99,111,114,
110,0,8,117,108,99,111,114,110,101,114,1,6,117,114,99,111,114,110,0,8,117,114,99,
111,114,110,101,114,1,6,100,108,99,111,114,110,0,8,108,108,99,111,114,110,101,114,1,
6,100,114,99,111,114,110,0,8,108,114,99,111,114,110,101,114,3,5,102,114,111,119,110,
0,6,115,102,114,111,119,110,1,5,115,109,105,108,101,0,6,115,115,109,105,108,101,10,
6,99,121,108,99,116,121,1,8,112,114,111,102,97,108,97,114,8,6,116,111,112,98,111,
116,7,5,111,118,98,97,114,2,6,115,111,108,98,97,114,61,7,97,110,103,122,97,114,
114,52,6,108,109,111,117,115,116,0,10,108,109,111,117,115,116,97,99,104,101,1,6,114,
109,111,117,115,116,0,10,114,109,111,117,115,116,97,99,104,101,3,11,79,118,101,114,66,
114,97,99,107,101,116,0,4,116,98,114,107,1,12,85,110,100,101,114,66,114,97,99,107,
101,116,0,4,98,98,114,107,1,8,98,98,114,107,116,98,114,107,38,15,79,118,101,114,
80,97,114,101,110,116,104,101,115,105,115,1,16,85,110,100,101,114,80,97,114,101,110,116,
104,101,115,105,115,1,9,79,118,101,114,66,114,97,99,101,1,10,85,110,100,101,114,66,
114,97,99,101,3,8,116,114,112,101,122,105,117,109,5,8,101,108,105,110,116,101,114,115,
60,5,98,108,97,110,107,165,1,8,99,105,114,99,108,101,100,83,0,2,111,83,56,14,
72,111,114,105,122,111,110,116,97,108,76,105,110,101,0,4,98,111,120,104,2,4,98,111,
120,118,10,5,98,111,120,100,114,4,5,98,111,120,100,108,4,5,98,111,120,117,114,4,
5,98,111,120,117,108,4,5,98,111,120,118,114,8,5,98,111,120,118,108,8,5,98,111,
120,104,100,8,5,98,111,120,104,117,8,5,98,111,120,118,104,20,4,98,111,120,72,1,
4,98,111,120,86,1,5,98,111,120,100,82,1,5,98,111,120,68,114,1,5,98,111,120,
68,82,1,5,98,111,120,100,76,1,5,98,111,120,68,108,1,5,98,111,120,68,76,1,
5,98,111,120,117,82,1,5,98,111,120,85,114,1,5,98,111,120,85,82,1,5,98,111,
120,117,76,1,5,98,111,120,85,108,1,5,98,111,120,85,76,1,5,98,111,120,118,82,
1,5,98,111,120,86,114,1,5,98,111,120,86,82,1,5,98,111,120,118,76,1,5,98,
111,120,86,108,1,5,98,111,120,86,76,1,5,98,111,120,72,100,1,5,98,111,120,104,
68,1,5,98,111,120,72,68,1,5,98,111,120,72,117,1,5,98,111,120,104,85,1,5,
98,111,120,72,85,1,5,98,111,120,118,72,1,5,98,111,120,86,104,1,5,98,111,120,
86,72,20,5,117,104,98,108,107,4,5,108,104,98,108,107,4,5,98,108,111,99,107,9,
5,98,108,107,49,52,1,5,98,108,107,49,50,1,5,98,108,107,51,52,14,6,83,113,
117,97,114,101,0,3,115,113,117,0,6,115,113,117,97,114,101,9,21,70,105,108,108,101,
100,86,101,114,121,83,109,97,108,108,83,113,117,97,114,101,0,11,98,108,97,99,107,115,
113,117,97,114,101,0,6,115,113,117,97,114,102,0,4,115,113,117,102,1,20,69,109,112,
116,121,86,101,114,121,83,109,97,108,108,83,113,117,97,114,101,2,4,114,101,99,116,1,
6,109,97,114,107,101,114,3,5,102,108,116,110,115,2,13,98,105,103,116,114,105,97,110,
103,108,101,117,112,0,5,120,117,116,114,105,1,13,98,108,97,99,107,116,114,105,97,110,
103,108,101,0,5,117,116,114,105,102,1,8,116,114,105,97,110,103,108,101,0,4,117,116,
114,105,3,18,98,108,97,99,107,116,114,105,97,110,103,108,101,114,105,103,104,116,0,5,
114,116,114,105,102,1,4,114,116,114,105,0,13,116,114,105,97,110,103,108,101,114,105,103,
104,116,4,15,98,105,103,116,114,105,97,110,103,108,101,100,111,119,110,0,5,120,100,116,
114,105,1,17,98,108,97,99,107,116,114,105,97,110,103,108,101,100,111,119,110,0,5,100,
116,114,105,102,1,4,100,116,114,105,0,12,116,114,105,97,110,103,108,101,100,111,119,110,
3,17,98,108,97,99,107,116,114,105,97,110,103,108,101,108,101,102,116,0,5,108,116,114,
105,102,1,4,108,116,114,105,0,12,116,114,105,97,110,103,108,101,108,101,102,116,7,3,
108,111,122,0,7,108,111,122,101,110,103,101,1,3,99,105,114,33,6,116,114,105,100,111,
116,3,7,98,105,103,99,105,114,99,0,5,120,99,105,114,99,9,5,117,108,116,114,105,
1,5,117,114,116,114,105,1,5,108,108,116,114,105,1,16,69,109,112,116,121,83,109,97,
108,108,83,113,117,97,114,101,1,17,70,105,108,108,101,100,83,109,97,108,108,83,113,117,
97,114,101,9,7,98,105,103,115,116,97,114,0,5,115,116,97,114,102,1,4,115,116,97,
114,8,5,112,104,111,110,101,50,6,102,101,109,97,108,101,2,4,109,97,108,101,30,6,
115,112,97,100,101,115,0,9,115,112,97,100,101,115,117,105,116,3,5,99,108,117,98,115,
0,8,99,108,117,98,115,117,105,116,2,6,104,101,97,114,116,115,0,9,104,101,97,114,
116,115,117,105,116,1,11,100,105,97,109,111,110,100,115,117,105,116,0,5,100,105,97,109,
115,4,4,115,117,110,103,3,4,102,108,97,116,1,5,110,97,116,117,114,0,7,110,97,
116,117,114,97,108,1,5,115,104,97,114,112,164,1,5,99,104,101,99,107,0,9,99,104,
101,99,107,109,97,114,107,4,5,99,114,111,115,115,9,4,109,97,108,116,0,7,109,97,
108,116,101,115,101,22,4,115,101,120,116,34,17,86,101,114,116,105,99,97,108,83,101,112,
97,114,97,116,111,114,26,5,108,98,98,114,107,1,5,114,98,98,114,107,85,8,98,115,
111,108,104,115,117,98,1,7,115,117,112,104,115,111,108,29,17,76,101,102,116,68,111,117,
98,108,101,66,114,97,99,107,101,116,0,5,108,111,98,114,107,1,18,82,105,103,104,116,
68,111,117,98,108,101,66,114,97,99,107,101,116,0,5,114,111,98,114,107,1,16,76,101,
102,116,65,110,103,108,101,66,114,97,99,107,101,116,0,4,108,97,110,103,0,6,108,97,
110,103,108,101,1,17,82,105,103,104,116,65,110,103,108,101,66,114,97,99,107,101,116,0,
4,114,97,110,103,0,6,114,97,110,103,108,101,1,4,76,97,110,103,1,4,82,97,110,
103,1,5,108,111,97,110,103,1,5,114,111,97,110,103,8,13,76,111,110,103,76,101,102,
116,65,114,114,111,119,0,13,108,111,110,103,108,101,102,116,97,114,114,111,119,0,5,120,
108,97,114,114,1,14,76,111,110,103,82,105,103,104,116,65,114,114,111,119,0,14,108,111,
110,103,114,105,103,104,116,97,114,114,111,119,0,5,120,114,97,114,114,1,18,76,111,110,
103,76,101,102,116,82,105,103,104,116,65,114,114,111,119,0,18,108,111,110,103,108,101,102,
116,114,105,103,104,116,97,114,114,111,119,0,5,120,104,97,114,114,1,19,68,111,117,98,
108,101,76,111,110,103,76,101,102,116,65,114,114,111,119,0,13,76,111,110,103,108,101,102,
116,97,114,114,111,119,0,5,120,108,65,114,114,1,20,68,111,117,98,108,101,76,111,110,
103,82,105,103,104,116,65,114,114,111,119,0,14,76,111,110,103,114,105,103,104,116,97,114,
114,111,119,0,5,120,114,65,114,114,1,24,68,111,117,98,108,101,76,111,110,103,76,101,
102,116,82,105,103,104,116,65,114,114,111,119,0,18,76,111,110,103,108,101,102,116,114,105,
103,104,116,97,114,114,111,119,0,5,120,104,65,114,114,2,10,108,111,110,103,109,97,112,
115,116,111,0,4,120,109,97,112,3,8,100,122,105,103,114,97,114,114,131,2,6,110,118,
108,65,114,114,1,6,110,118,114,65,114,114,1,6,110,118,72,97,114,114,1,3,77,97,
112,7,5,108,98,97,114,114,1,6,98,107,97,114,111,119,0,5,114,98,97,114,114,1,
5,108,66,97,114,114,1,7,100,98,107,97,114,111,119,0,5,114,66,97,114,114,1,5,
82,66,97,114,114,0,8,100,114,98,107,97,114,111,119,1,8,68,68,111,116,114,97,104,
100,1,10,85,112,65,114,114,111,119,66,97,114,1,12,68,111,119,110,65,114,114,111,119,
66,97,114,3,6,82,97,114,114,116,108,3,6,108,97,116,97,105,108,1,6,114,97,116,
97,105,108,1,6,108,65,116,97,105,108,1,6,114,65,116,97,105,108,1,6,108,97,114,
114,102,115,1,6,114,97,114,114,102,115,1,7,108,97,114,114,98,102,115,1,7,114,97,
114,114,98,102,115,3,6,110,119,97,114,104,107,1,6,110,101,97,114,104,107,1,8,104,
107,115,101,97,114,111,119,0,6,115,101,97,114,104,107,1,8,104,107,115,119,97,114,111,
119,0,6,115,119,97,114,104,107,1,6,110,119,110,101,97,114,1,6,110,101,115,101,97,
114,0,4,116,111,101,97,1,6,115,101,115,119,97,114,0,4,116,111,115,97,1,6,115,
119,110,119,97,114,9,5,114,97,114,114,99,0,70,56,3,110,114,97,114,114,99,2,7,
99,117,100,97,114,114,114,1,4,108,100,99,97,1,4,114,100,99,97,1,7,99,117,100,
97,114,114,108,1,6,108,97,114,114,112,108,3,7,99,117,114,97,114,114,109,1,7,99,
117,108,97,114,114,112,8,6,114,97,114,114,112,108,3,7,104,97,114,114,99,105,114,1,
8,85,97,114,114,111,99,105,114,1,8,108,117,114,100,115,104,97,114,1,8,108,100,114,
117,115,104,97,114,3,15,76,101,102,116,82,105,103,104,116,86,101,99,116,111,114,1,17,
82,105,103,104,116,85,112,68,111,119,110,86,101,99,116,111,114,1,19,68,111,119,110,76,
101,102,116,82,105,103,104,116,86,101,99,116,111,114,1,16,76,101,102,116,85,112,68,111,
119,110,86,101,99,116,111,114,1,13,76,101,102,116,86,101,99,116,111,114,66,97,114,1,
14,82,105,103,104,116,86,101,99,116,111,114,66,97,114,1,16,82,105,103,104,116,85,112,
86,101,99,116,111,114,66,97,114,1,18,82,105,103,104,116,68,111,119,110,86,101,99,116,
111,114,66,97,114,1,17,68,111,119,110,76,101,102,116,86,101,99,116,111,114,66,97,114,
1,18,68,111,119,110,82,105,103,104,116,86,101,99,116,111,114,66,97,114,1,15,76,101,
102,116,85,112,86,101,99,116,111,114,66,97,114,1,17,76,101,102,116,68,111,119,110,86,
101,99,116,111,114,66,97,114,1,13,76,101,102,116,84,101,101,86,101,99,116,111,114,1,
14,82,105,103,104,116,84,101,101,86,101,99,116,111,114,1,16,82,105,103,104,116,85,112,
84,101,101,86,101,99,116,111,114,1,18,82,105,103,104,116,68,111,119,110,84,101,101,86,
101,99,116,111,114,1,17,68,111,119,110,76,101,102,116,84,101,101,86,101,99,116,111,114,
1,18,68,111,119,110,82,105,103,104,116,84,101,101,86,101,99,116,111,114,1,15,76,101,
102,116,85,112,84,101,101,86,101,99,116,111,114,1,17,76,101,102,116,68,111,119,110,84,
101,101,86,101,99,116,111,114,1,4,108,72,97,114,1,4,117,72,97,114,1,4,114,72,
97,114,1,4,100,72,97,114,1,7,108,117,114,117,104,97,114,1,7,108,100,114,100,104,
97,114,1,7,114,117,108,117,104,97,114,1,7,114,100,108,100,104,97,114,1,6,108,104,
97,114,117,108,1,6,108,108,104,97,114,100,1,6,114,104,97,114,117,108,1,6,108,114,
104,97,114,100,1,13,85,112,69,113,117,105,108,105,98,114,105,117,109,0,5,117,100,104,
97,114,1,20,82,101,118,101,114,115,101,85,112,69,113,117,105,108,105,98,114,105,117,109,
0,5,100,117,104,97,114,1,12,82,111,117,110,100,73,109,112,108,105,101,115,1,5,101,
114,97,114,114,1,7,115,105,109,114,97,114,114,1,7,108,97,114,114,115,105,109,1,7,
114,97,114,114,115,105,109,1,6,114,97,114,114,97,112,1,6,108,116,108,97,114,114,2,
6,103,116,114,97,114,114,1,7,115,117,98,114,97,114,114,2,7,115,117,112,108,97,114,
114,1,6,108,102,105,115,104,116,1,6,114,102,105,115,104,116,1,6,117,102,105,115,104,
116,1,6,100,102,105,115,104,116,6,5,108,111,112,97,114,1,5,114,111,112,97,114,5,
5,108,98,114,107,101,1,5,114,98,114,107,101,1,7,108,98,114,107,115,108,117,1,7,
114,98,114,107,115,108,100,1,7,108,98,114,107,115,108,100,1,7,114,98,114,107,115,108,
117,1,5,108,97,110,103,100,1,5,114,97,110,103,100,1,6,108,112,97,114,108,116,1,
6,114,112,97,114,103,116,1,6,103,116,108,80,97,114,1,6,108,116,114,80,97,114,4,
7,118,122,105,103,122,97,103,2,6,118,97,110,103,114,116,1,8,97,110,103,114,116,118,
98,100,7,4,97,110,103,101,1,5,114,97,110,103,101,1,7,100,119,97,110,103,108,101,
1,7,117,119,97,110,103,108,101,1,8,97,110,103,109,115,100,97,97,1,8,97,110,103,
109,115,100,97,98,1,8,97,110,103,109,115,100,97,99,1,8,97,110,103,109,115,100,97,
100,1,8,97,110,103,109,115,100,97,101,1,8,97,110,103,109,115,100,97,102,1,8,97,
110,103,109,115,100,97,103,1,8,97,110,103,109,115,100,97,104,1,7,98,101,109,112,116,
121,118,1,7,100,101,109,112,116,121,118,1,7,99,101,109,112,116,121,118,1,8,114,97,
101,109,112,116,121,118,1,8,108,97,101,109,112,116,121,118,1,5,111,104,98,97,114,1,
4,111,109,105,100,1,4,111,112,97,114,2,5,111,112,101,114,112,2,7,111,108,99,114,
111,115,115,1,6,111,100,115,111,108,100,2,5,111,108,99,105,114,1,5,111,102,99,105,
114,1,3,111,108,116,1,3,111,103,116,1,7,99,105,114,115,99,105,114,1,4,99,105,
114,69,1,4,115,111,108,98,1,5,98,115,111,108,98,4,6,98,111,120,98,111,120,4,
5,116,114,105,115,98,1,8,114,116,114,105,108,116,114,105,1,15,76,101,102,116,84,114,
105,97,110,103,108,101,66,97,114,0,82,56,3,78,111,116,76,101,102,116,84,114,105,97,
110,103,108,101,66,97,114,1,16,82,105,103,104,116,84,114,105,97,110,103,108,101,66,97,
114,0,83,56,3,78,111,116,82,105,103,104,116,84,114,105,97,110,103,108,101,66,97,114,
12,6,105,105,110,102,105,110,1,8,105,110,102,105,110,116,105,101,1,7,110,118,105,110,
102,105,110,5,6,101,112,97,114,115,108,1,8,115,109,101,112,97,114,115,108,1,8,101,
113,118,112,97,114,115,108,6,12,98,108,97,99,107,108,111,122,101,110,103,101,0,4,108,
111,122,102,9,11,82,117,108,101,68,101,108,97,121,101,100,2,4,100,115,111,108,10,7,
98,105,103,111,100,111,116,0,5,120,111,100,111,116,1,8,98,105,103,111,112,108,117,115,
0,6,120,111,112,108,117,115,1,9,98,105,103,111,116,105,109,101,115,0,6,120,111,116,
105,109,101,2,8,98,105,103,117,112,108,117,115,0,6,120,117,112,108,117,115,2,8,98,
105,103,115,113,99,117,112,0,6,120,115,113,99,117,112,6,6,105,105,105,105,110,116,0,
4,113,105,110,116,1,8,102,112,97,114,116,105,110,116,3,8,99,105,114,102,110,105,110,
116,1,5,97,119,105,110,116,1,8,114,112,112,111,108,105,110,116,1,8,115,99,112,111,
108,105,110,116,1,7,110,112,111,108,105,110,116,1,8,112,111,105,110,116,105,110,116,1,
7,113,117,97,116,105,110,116,1,8,105,110,116,108,97,114,104,107,11,7,112,108,117,115,
99,105,114,1,8,112,108,117,115,97,99,105,114,1,7,115,105,109,112,108,117,115,1,6,
112,108,117,115,100,117,1,7,112,108,117,115,115,105,109,1,7,112,108,117,115,116,119,111,
2,6,109,99,111,109,109,97,1,7,109,105,110,117,115,100,117,3,6,108,111,112,108,117,
115,1,6,114,111,112,108,117,115,1,5,67,114,111,115,115,1,6,116,105,109,101,115,100,
1,8,116,105,109,101,115,98,97,114,2,6,115,109,97,115,104,112,1,7,108,111,116,105,
109,101,115,1,7,114,111,116,105,109,101,115,1,8,111,116,105,109,101,115,97,115,1,6,
79,116,105,109,101,115,1,4,111,100,105,118,1,7,116,114,105,112,108,117,115,1,8,116,
114,105,109,105,110,117,115,1,7,116,114,105,116,105,109,101,1,7,105,110,116,112,114,111,
100,0,5,105,112,114,111,100,3,5,97,109,97,108,103,1,6,99,97,112,100,111,116,2,
4,110,99,117,112,1,4,110,99,97,112,1,6,99,97,112,97,110,100,1,5,99,117,112,
111,114,1,6,99,117,112,99,97,112,1,6,99,97,112,99,117,112,1,8,99,117,112,98,
114,99,97,112,1,8,99,97,112,98,114,99,117,112,1,6,99,117,112,99,117,112,1,6,
99,97,112,99,97,112,1,5,99,99,117,112,115,1,5,99,99,97,112,115,3,7,99,99,
117,112,115,115,109,3,3,65,110,100,1,2,79,114,1,6,97,110,100,97,110,100,1,4,
111,114,111,114,1,7,111,114,115,108,111,112,101,1,8,97,110,100,115,108,111,112,101,2,
4,97,110,100,118,1,3,111,114,118,1,4,97,110,100,100,1,3,111,114,100,2,6,119,
101,100,98,97,114,7,5,115,100,111,116,101,4,6,115,105,109,100,111,116,3,7,99,111,
110,103,100,111,116,0,72,56,3,110,99,111,110,103,100,111,116,1,6,101,97,115,116,101,
114,1,6,97,112,97,99,105,114,1,3,97,112,69,0,68,56,3,110,97,112,69,1,5,
101,112,108,117,115,1,5,112,108,117,115,101,1,4,69,115,105,109,1,6,67,111,108,111,
110,101,1,5,69,113,117,97,108,2,7,100,100,111,116,115,101,113,0,5,101,68,68,111,
116,1,7,101,113,117,105,118,68,68,1,5,108,116,99,105,114,1,5,103,116,99,105,114,
1,7,108,116,113,117,101,115,116,1,7,103,116,113,117,101,115,116,1,14,76,101,115,115,
83,108,97,110,116,69,113,117,97,108,0,8,108,101,113,115,108,97,110,116,0,3,108,101,
115,0,81,56,3,78,111,116,76,101,115,115,83,108,97,110,116,69,113,117,97,108,0,73,
56,3,110,108,101,113,115,108,97,110,116,0,68,56,3,110,108,101,115,1,17,71,114,101,
97,116,101,114,83,108,97,110,116,69,113,117,97,108,0,8,103,101,113,115,108,97,110,116,
0,3,103,101,115,0,84,56,3,78,111,116,71,114,101,97,116,101,114,83,108,97,110,116,
69,113,117,97,108,0,73,56,3,110,103,101,113,115,108,97,110,116,0,68,56,3,110,103,
101,115,1,6,108,101,115,100,111,116,1,6,103,101,115,100,111,116,1,7,108,101,115,100,
111,116,111,1,7,103,101,115,100,111,116,111,1,8,108,101,115,100,111,116,111,114,1,8,
103,101,115,100,111,116,111,108,1,3,108,97,112,0,10,108,101,115,115,97,112,112,114,111,
120,1,3,103,97,112,0,9,103,116,114,97,112,112,114,111,120,1,3,108,110,101,0,4,
108,110,101,113,1,3,103,110,101,0,4,103,110,101,113,1,4,108,110,97,112,0,8,108,
110,97,112,112,114,111,120,1,4,103,110,97,112,0,8,103,110,97,112,112,114,111,120,1,
3,108,69,103,0,10,108,101,115,115,101,113,113,103,116,114,1,3,103,69,108,0,10,103,
116,114,101,113,113,108,101,115,115,1,5,108,115,105,109,101,1,5,103,115,105,109,101,1,
5,108,115,105,109,103,1,5,103,115,105,109,108,1,3,108,103,69,1,3,103,108,69,1,
6,108,101,115,103,101,115,1,6,103,101,115,108,101,115,1,3,101,108,115,0,11,101,113,
115,108,97,110,116,108,101,115,115,1,3,101,103,115,0,10,101,113,115,108,97,110,116,103,
116,114,1,6,101,108,115,100,111,116,1,6,101,103,115,100,111,116,1,2,101,108,1,2,
101,103,3,4,115,105,109,108,1,4,115,105,109,103,1,5,115,105,109,108,69,1,5,115,
105,109,103,69,1,8,76,101,115,115,76,101,115,115,0,81,56,3,78,111,116,78,101,115,
116,101,100,76,101,115,115,76,101,115,115,1,14,71,114,101,97,116,101,114,71,114,101,97,
116,101,114,0,87,56,3,78,111,116,78,101,115,116,101,100,71,114,101,97,116,101,114,71,
114,101,97,116,101,114,2,3,103,108,106,1,3,103,108,97,1,4,108,116,99,99,1,4,
103,116,99,99,1,5,108,101,115,99,99,1,5,103,101,115,99,99,1,3,115,109,116,1,
3,108,97,116,1,4,115,109,116,101,0,69,0,254,115,109,116,101,115,1,4,108,97,116,
101,0,69,0,254,108,97,116,101,115,1,5,98,117,109,112,69,1,13,80,114,101,99,101,
100,101,115,69,113,117,97,108,0,3,112,114,101,0,6,112,114,101,99,101,113,0,80,56,
3,78,111,116,80,114,101,99,101,100,101,115,69,113,117,97,108,0,68,56,3,110,112,114,
101,0,71,56,3,110,112,114,101,99,101,113,1,13,83,117,99,99,101,101,100,115,69,113,
117,97,108,0,3,115,99,101,0,6,115,117,99,99,101,113,0,80,56,3,78,111,116,83,
117,99,99,101,101,100,115,69,113,117,97,108,0,68,56,3,110,115,99,101,0,71,56,3,
110,115,117,99,99,101,113,3,3,112,114,69,1,3,115,99,69,1,8,112,114,101,99,110,
101,113,113,0,4,112,114,110,69,1,4,115,99,110,69,0,8,115,117,99,99,110,101,113,
113,1,4,112,114,97,112,0,10,112,114,101,99,97,112,112,114,111,120,1,4,115,99,97,
112,0,10,115,117,99,99,97,112,112,114,111,120,1,11,112,114,101,99,110,97,112,112,114,
111,120,0,5,112,114,110,97,112,1,5,115,99,110,97,112,0,11,115,117,99,99,110,97,
112,112,114,111,120,1,2,80,114,1,2,83,99,1,6,115,117,98,100,111,116,1,6,115,
117,112,100,111,116,1,7,115,117,98,112,108,117,115,1,7,115,117,112,112,108,117,115,1,
7,115,117,98,109,117,108,116,1,7,115,117,112,109,117,108,116,1,7,115,117,98,101,100,
111,116,1,7,115,117,112,101,100,111,116,1,4,115,117,98,69,0,9,115,117,98,115,101,
116,101,113,113,0,69,56,3,110,115,117,98,69,0,74,56,3,110,115,117,98,115,101,116,
101,113,113,1,4,115,117,112,69,0,9,115,117,112,115,101,116,101,113,113,0,69,56,3,
110,115,117,112,69,0,74,56,3,110,115,117,112,115,101,116,101,113,113,1,6,115,117,98,
115,105,109,1,6,115,117,112,115,105,109,3,5,115,117,98,110,69,0,10,115,117,98,115,
101,116,110,101,113,113,0,77,0,254,118,97,114,115,117,98,115,101,116,110,101,113,113,0,
70,0,254,118,115,117,98,110,69,1,5,115,117,112,110,69,0,10,115,117,112,115,101,116,
110,101,113,113,0,77,0,254,118,97,114,115,117,112,115,101,116,110,101,113,113,0,70,0,
254,118,115,117,112,110,69,3,4,99,115,117,98,1,4,99,115,117,112,1,5,99,115,117,
98,101,1,5,99,115,117,112,101,1,6,115,117,98,115,117,112,1,6,115,117,112,115,117,
98,1,6,115,117,98,115,117,98,1,6,115,117,112,115,117,112,1,7,115,117,112,104,115,
117,98,1,7,115,117,112,100,115,117,98,1,5,102,111,114,107,118,1,7,116,111,112,102,
111,114,107,1,4,109,108,99,112,9,5,68,97,115,104,118,0,13,68,111,117,98,108,101,
76,101,102,116,84,101,101,2,6,86,100,97,115,104,108,1,4,66,97,114,118,1,4,118,
66,97,114,1,5,118,66,97,114,118,2,4,86,98,97,114,1,3,78,111,116,1,4,98,
78,111,116,1,5,114,110,109,105,100,1,6,99,105,114,109,105,100,1,6,109,105,100,99,
105,114,1,6,116,111,112,99,105,114,1,5,110,104,112,97,114,1,6,112,97,114,115,105,
109,10,5,112,97,114,115,108,0,70,229,32,110,112,97,114,115,108,131,160,3,5,102,102,
108,105,103,1,5,102,105,108,105,103,1,5,102,108,108,105,103,1,6,102,102,105,108,105,
103,1,6,102,102,108,108,105,103,152,179,3,4,65,115,99,114,2,4,67,115,99,114,1,
4,68,115,99,114,3,4,71,115,99,114,3,4,74,115,99,114,1,4,75,115,99,114,3,
4,78,115,99,114,1,4,79,115,99,114,1,4,80,115,99,114,1,4,81,115,99,114,2,
4,83,115,99,114,1,4,84,115,99,114,1,4,85,115,99,114,1,4,86,115,99,114,1,
4,87,115,99,114,1,4,88,115,99,114,1,4,89,115,99,114,1,4,90,115,99,114,1,
4,97,115,99,114,1,4,98,115,99,114,1,4,99,115,99,114,1,4,100,115,99,114,2,
4,102,115,99,114,2,4,104,115,99,114,1,4,105,115,99,114,1,4,106,115,99,114,1,
4,107,115,99,114,1,4,108,115,99,114,1,4,109,115,99,114,1,4,110,115,99,114,2,
4,112,115,99,114,1,4,113,115,99,114,1,4,114,115,99,114,1,4,115,115,99,114,1,
4,116,115,99,114,1,4,117,115,99,114,1,4,118,115,99,114,1,4,119,115,99,114,1,
4,120,115,99,114,1,4,121,115,99,114,1,4,122,115,99,114,53,3,65,102,114,1,3,
66,102,114,2,3,68,102,114,1,3,69,102,114,1,3,70,102,114,1,3,71,102,114,3,
3,74,102,114,1,3,75,102,114,1,3,76,102,114,1,3,77,102,114,1,3,78,102,114,
1,3,79,102,114,1,3,80,102,114,1,3,81,102,114,2,3,83,102,114,1,3,84,102,
114,1,3,85,102,114,1,3,86,102,114,1,3,87,102,114,1,3,88,102,114,1,3,89,
102,114,2,3,97,102,114,1,3,98,102,114,1,3,99,102,114,1,3,100,102,114,1,3,
101,102,114,1,3,102,102,114,1,3,103,102,114,1,3,104,102,114,1,3,105,102,114,1,
3,106,102,114,1,3,107,102,114,1,3,108,102,114,1,3,109,102,114,1,3,110,102,114,
1,3,111,102,114,1,3,112,102,114,1,3,113,102,114,1,3,114,102,114,1,3,115,102,
114,1,3,116,102,114,1,3,117,102,114,1,3,118,102,114,1,3,119,102,114,1,3,120,
102,114,1,3,121,102,114,1,3,122,102,114,1,4,65,111,112,102,1,4,66,111,112,102,
2,4,68,111,112,102,1,4,69,111,112,102,1,4,70,111,112,102,1,4,71,111,112,102,
2,4,73,111,112,102,1,4,74,111,112,102,1,4,75,111,112,102,1,4,76,111,112,102,
1,4,77,111,112,102,2,4,79,111,112,102,4,4,83,111,112,102,1,4,84,111,112,102,
1,4,85,111,112,102,1,4,86,111,112,102,1,4,87,111,112,102,1,4,88,111,112,102,
1,4,89,111,112,102,2,4,97,111,112,102,1,4,98,111,112,102,1,4,99,111,112,102,
1,4,100,111,112,102,1,4,101,111,112,102,1,4,102,111,112,102,1,4,103,111,112,102,
1,4,104,111,112,102,1,4,105,111,112,102,1,4,106,111,112,102,1,4,107,111,112,102,
1,4,108,111,112,102,1,4,109,111,112,102,1,4,110,111,112,102,1,4,111,111,112,102,
1,4,112,111,112,102,1,4,113,111,112,102,1,4,114,111,112,102,1,4,115,111,112,102,
1,4,116,111,112,102,1,4,117,111,112,102,1,4,118,111,112,102,1,4,119,111,112,102,
1,4,120,111,112,102,1,4,121,111,112,102,1,4,122,111,112,102,
};
// The value's UTF-8 bytes in the low bytes and its length in the top byte.
const Entry = extern struct { key: u64, val: u64 };
const Long = extern struct { name: [32]u8, val: u64, len: u32, pad: u32 };
var input: [INPUT_CAP + PAD]u8 align(16) = undefined;
// Zeroed, because the packed list's model is built here on the first call.
var output align(16) = std.mem.zeroes([OUTPUT_CAP + PAD]u8);
var fast: [(1 << FAST_BITS) + FAST_TAIL]Entry = undefined;
var leg: [(1 << LEG_BITS) + LEG_TAIL]Entry = undefined;
var longs: [LONG_COUNT]Long align(16) = std.mem.zeroes([LONG_COUNT]Long);
var long_slots = std.mem.zeroes([1 << LONG_BITS]u16);
// Longest legacy name starting with these two bytes (hashed), or 0.
var leg_max = std.mem.zeroes([4096]u8);
var pos: [WINDOW + 16]u32 = undefined;
var ready: bool = false;
// Windows-1252 remapping for references to 0x80-0x9F.
const c1 = [32]u16{
0x20AC, 0x81, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x8D, 0x017D, 0x8F,
0x90, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x9D, 0x017E, 0x0178,
};
const utf8_marks = [5]u32{ 0, 0, 0x80C0, 0x8080E0, 0x808080F0 };
// Byte j of the 32 loaded at `len_mask + 32 - n` is 0xFF when j < n: 32 bytes of 0xFF, then 32 of 0.
var len_mask align(16) = std.mem.zeroes([64]u8);
inline fn ld(p: [*]const u8) V {
return p[0..16].*;
}
inline fn st(p: [*]u8, v: V) void {
p[0..16].* = v;
}
inline fn ld64(p: [*]const u8) u64 {
return @as(*align(1) const u64, @ptrCast(p)).*;
}
inline fn st64(p: [*]u8, x: u64) void {
@as(*align(1) u64, @ptrCast(p)).* = x;
}
inline fn st32(p: [*]u8, x: u32) void {
@as(*align(1) u32, @ptrCast(p)).* = x;
}
inline fn eqMask(v: V, c: u8) u32 {
return @as(u16, @bitCast(v == @as(V, @splat(c))));
}
inline fn legSlot(w: u64) usize {
return ((@as(u32, @truncate(w)) & 0xFFFF) *% 0x9E3779B1) >> 20;
}
inline fn longHash(head: u64, tail: u64, n: usize) usize {
return @intCast((((head ^ std.math.rotl(u64, tail, 29)) +% n) *% LONG_MUL) >> (64 - LONG_BITS));
}
// The entity list is serialized plainly and parsed once, on the first call: entities in
// code-point order, each a LEB128 code-point delta, a flags-and-length byte (legacy names
// without `;` and values of two code points are flagged), an optional little-endian second
// code point, and the name in ASCII. gen_entities.py, printed at the end of this file, is
// the matching generator. Parsing 18 KB costs microseconds; the tables it fills are the
// same open-addressed hash tables the decoder consults per reference.
// A code point as UTF-8 bytes in a word, low byte first.
noinline fn utf8(v: u32, len: *u32) u32 {
@branchHint(.cold);
const n: u32 = 1 + @as(u32, @intFromBool(v > 0x7F)) + @intFromBool(v > 0x7FF) + @intFromBool(v > 0xFFFF);
const bits = (v >> 18) | (((v >> 12) & 0x3F) << 8) | (((v >> 6) & 0x3F) << 16) | ((v & 0x3F) << 24);
len.* = n;
return if (n == 1) v else (bits >> @intCast(32 - 8 * n)) | utf8_marks[n];
}
noinline fn init() void {
@branchHint(.cold);
@memset(std.mem.asBytes(&fast), 0xFF);
@memset(std.mem.asBytes(&leg), 0xFF);
@memset(len_mask[0..32], 0xFF);
var p: usize = 0;
var cp: u32 = 0;
var nl: usize = 0;
for (0..ENTITY_COUNT) |_| {
// The code point as a LEB128 delta from the previous one.
var d: u32 = 0;
var sh: u5 = 0;
while (true) {
const b = packed_list[p];
p += 1;
d |= @as(u32, b & 0x7F) << sh;
if (b & 0x80 == 0) break;
sh += 7;
}
cp += d;
const fl = packed_list[p];
p += 1;
const n: usize = fl & 0x1F;
const legacy = (fl & 0x20) != 0;
var vn: u32 = 0;
var vn2: u32 = 0;
var val: u64 = utf8(cp, &vn);
if (fl & 0x40 != 0) {
val |= @as(u64, utf8(std.mem.readInt(u16, packed_list[p..][0..2], .little), &vn2)) << @intCast(8 * vn);
p += 2;
}
val |= @as(u64, vn + vn2) << 56;
var name = std.mem.zeroes([40]u8);
@memcpy(name[0..n], packed_list[p..][0..n]);
p += n;
const nm: [*]const u8 = &name;
if (n <= 7) {
var key = ld64(nm) | (@as(u64, ';') << @intCast(8 * n));
var e: [*]Entry = @ptrCast(&fast[@intCast((key *% FAST_MUL) >> (64 - FAST_BITS))]);
while (e[0].key != EMPTY) e += 1;
e[0] = .{ .key = key, .val = val };
if (legacy) {
key = ld64(nm) | (@as(u64, n) << 56);
e = @ptrCast(&leg[@intCast((key *% LEG_MUL) >> (64 - LEG_BITS))]);
while (e[0].key != EMPTY) e += 1;
e[0] = .{ .key = key, .val = val };
const s = legSlot(key); // only the first two bytes matter
if (leg_max[s] < n) leg_max[s] = @intCast(n);
}
} else {
const l = &longs[nl];
nl += 1;
l.name = name[0..32].*;
l.val = val;
l.len = @intCast(n);
var hh = longHash(ld64(nm), ld64(nm + n - 8), n);
while (long_slots[hh] != 0) hh = (hh + 1) & LONG_MASK;
long_slots[hh] = @intCast(nl);
}
}
ready = true;
}
export fn input_ptr() u32 {
return @intCast(@intFromPtr(&input));
}
export fn input_utf8_cap() u32 {
return INPUT_CAP;
}
export fn output_ptr() u32 {
return @intCast(@intFromPtr(&output));
}
export fn output_utf8_cap() u32 {
return OUTPUT_CAP;
}
export fn render(n: u32) u64 {
if (!ready) init();
const size: usize = @min(n, INPUT_CAP);
const src: [*]u8 = &input;
const dst: [*]u8 = &output;
const zero: V = @splat(0);
st(src + size, zero);
st(src + size + 16, zero);
st(src + size + 32, zero);
st(src + size + 48, zero);
// Stage 1 lists the position of every `&` in a window; stage 2 copies the text between
// references and decodes each one.
var e: usize = 0;
var o: usize = 0;
var base: usize = 0;
while (base < size) {
const lim = if (size - base > WINDOW) base + WINDOW else size;
var out: [*]u32 = &pos;
while (true) {
const ma: u64 = eqMask(ld(src + base), '&');
const mb: u64 = eqMask(ld(src + base + 16), '&');
const mc: u64 = eqMask(ld(src + base + 32), '&');
const md: u64 = eqMask(ld(src + base + 48), '&');
var mm: u64 = ma | mb << 16 | mc << 32 | md << 48;
const cnt: usize = @popCount(mm);
const b: u32 = @intCast(base);
// Entries past cnt are garbage and are overwritten or ignored.
inline for (0..4) |k| {
out[k] = b + @ctz(mm);
mm &= mm -% 1;
}
if (cnt > 4) {
@branchHint(.unlikely);
inline for (4..8) |k| {
out[k] = b + @ctz(mm);
mm &= mm -% 1;
}
var k: usize = 8;
while (mm != 0) : (k += 1) {
out[k] = b + @ctz(mm);
mm &= mm -% 1;
}
}
out += cnt;
base += 64;
if (base >= lim) break;
}
var q: [*]const u32 = &pos;
while (@intFromPtr(q) < @intFromPtr(out)) : (q += 1) {
var i: usize = q[0];
// Copy the text since the last reference; src[i] is `&` and i < size.
{
const len = i - e;
st(dst + o, ld(src + e));
st(dst + o + 16, ld(src + e + 16));
if (len > 32) {
var j: usize = 32;
while (true) {
st(dst + o + j, ld(src + e + j));
j += 16;
if (j >= len) break;
}
}
o += len;
}
done: {
const w = ld64(src + i + 1);
if (@as(u8, @truncate(w)) == '#') numeric: {
// Decimal and hexadecimal share one branch-free path: classify 8 bytes,
// take the digits before the first other byte, and fold them pairwise.
const hex = (@as(u8, @truncate(w >> 8)) | 0x20) == 'x';
var p = src + i + 2 + @intFromBool(hex);
const d = ld64(p);
const t = d ^ 0x3030303030303030;
const digit = ~(((t & ~HIGH) +% 0x7676767676767676) | t) & HIGH;
const y = d | 0x2020202020202020;
const ty = y & ~HIGH;
const letter = (ty +% ONES * (0x80 - 'a')) & ~(ty +% ONES * (0x7F - 'f')) & ~y & HIGH;
const stop = ~(digit | (if (hex) letter else 0)) & HIGH;
var v: u32 = 0;
var end: usize = undefined;
if (stop != 0) {
const nb: u32 = @ctz(stop) & 0x38;
if (nb == 0) break :numeric;
var x = ((d & 0x0F0F0F0F0F0F0F0F) +% 9 * (letter >> 7)) << @intCast(64 - nb);
x = (x *% @as(u64, if (hex) 16 else 10) +% (x >> 8)) & 0x00FF00FF00FF00FF;
x = (x *% @as(u64, if (hex) 256 else 100) +% (x >> 16)) & 0x0000FFFF0000FFFF;
v = @truncate(x *% @as(u64, if (hex) 65536 else 10000) +% (x >> 32));
end = @intFromPtr(p) - @intFromPtr(src) + (nb >> 3);
} else {
// Eight or more digits: saturate past U+10FFFF.
@branchHint(.unlikely);
const radix: u32 = if (hex) 16 else 10;
while (true) {
var c: u32 = @as(u32, p[0]) -% '0';
if (c > 9) {
c = (@as(u32, p[0]) | 0x20) -% 'a' +% 10;
if (c < 10) c = 16;
}
if (c >= radix) break;
v = v * radix + c;
if (v > 0x10FFFF) v = 0x110000;
p += 1;
}
end = @intFromPtr(p) - @intFromPtr(src);
}
i = end + @intFromBool(src[end] == ';');
if (v -% 0x80 < 0x20) {
v = c1[v - 0x80];
} else if (v == 0 or v -% 0xD800 < 0x800 or v > 0x10FFFF) {
v = 0xFFFD;
}
// Lay the bits out as four UTF-8 bytes, then drop the unused leading ones.
const len: u32 = 1 + @as(u32, @intFromBool(v > 0x7F)) + @intFromBool(v > 0x7FF) + @intFromBool(v > 0xFFFF);
const bits = v >> 18 | (v >> 12 & 0x3F) << 8 | (v >> 6 & 0x3F) << 16 | (v & 0x3F) << 24;
const word = bits >> @intCast(32 - 8 * len) | utf8_marks[len];
st32(dst + o, if (len == 1) v else word);
o += len;
break :done;
} else {
const t = w ^ (ONES * ';');
const z = (t -% ONES) & ~t & HIGH;
if (z != 0) {
// Bit index of the `;` byte; the key is the name and its `;`.
const kb: u32 = @ctz(z) & 0x38;
const key = w & ((@as(u64, 2) << @intCast(kb + 7)) -% 1);
var en: [*]const Entry = @ptrCast(&fast[@intCast((key *% FAST_MUL) >> (64 - FAST_BITS))]);
while (true) {
const k = en[0].key;
if (k == key) {
const val = en[0].val;
st64(dst + o, val);
o += @intCast(val >> 56);
i += 2 + (kb >> 3);
break :done;
}
if (k == EMPTY) break;
en += 1;
}
} else {
// No `;` in 8 bytes: a name of 8 to 31 bytes needs its `;` in the next 24.
const s0 = ld(src + i + 1);
const s1 = ld(src + i + 17);
const sm: u32 = eqMask(s0, ';') | eqMask(s1, ';') << 16;
if (sm != 0) {
const len: usize = @ctz(sm);
var h = longHash(w, ld64(src + i + 1 + len - 8), len);
const lm: [*]const u8 = &len_mask;
const m0 = ld(lm + 32 - len);
const m1 = ld(lm + 48 - len);
while (true) {
const s = long_slots[h];
if (s == 0) break;
const l = &longs[s - 1];
const nm: [*]const u8 = &l.name;
const diff = ((s0 & m0) ^ ld(nm)) | ((s1 & m1) ^ ld(nm + 16));
if (l.len == len and @reduce(.Or, diff) == 0) {
st64(dst + o, l.val);
o += @intCast(l.val >> 56);
i += 2 + len;
break :done;
}
h = (h + 1) & LONG_MASK;
}
}
}
// Without `;`, the longest legacy name that is a prefix.
var k: usize = leg_max[legSlot(w)];
while (k >= 2) : (k -= 1) {
// The length is part of the key, so a NUL after a shorter name cannot match.
const key = (w & ((@as(u64, 1) << @intCast(8 * k)) - 1)) | @as(u64, k) << 56;
var en: [*]const Entry = @ptrCast(&leg[@intCast((key *% LEG_MUL) >> (64 - LEG_BITS))]);
while (true) {
if (en[0].key == key) {
st64(dst + o, en[0].val);
o += @intCast(en[0].val >> 56);
i += 1 + k;
break :done;
}
if (en[0].key == EMPTY) break;
en += 1;
}
}
}
dst[o] = '&';
o += 1;
i += 1;
}
e = i;
}
}
// Without a reference the input is the output.
if (e == 0) return @as(u64, @intFromPtr(&input)) << 32 | size;
var j = e;
while (j < size) : (j += 16) st(dst + o + (j - e), ld(src + j));
o += size - e;
return @as(u64, @intFromPtr(&output)) << 32 | o;
}
// gen_entities.py, which produced `packed_list`:
//
// #!/usr/bin/env python3
// """Serialize the HTML5 entity list for unescape-small.
//
// Mirrors pack.py's record selection exactly:
// NAMES = html5 keys ending in ';', stripped of the ';'
// LEGACY = html5 keys not ending in ';'
// ORDER = sorted(NAMES, key=(code points of value, name))
// Records are emitted in code-point order so each code point is a small
// delta from the previous one.
//
// Per record:
// delta from previous first code point LEB128 varint
// flags byte: bits 0-4 name length (1..31), bit 5 legacy, bit 6 has second cp
// if has second cp: u16 LE
// name: raw ASCII bytes
// """
// import html.entities
//
// html5 = html.entities.html5
// NAMES = {k[:-1]: v for k, v in html5.items() if k.endswith(';')}
// LEGACY = {k for k in html5 if not k.endswith(';')}
// ORDER = sorted(NAMES, key=lambda n: ([ord(c) for c in NAMES[n]], n))
//
// out = bytearray()
// cp = 0
// nlong = 0
// for n in ORDER:
// cps = [ord(c) for c in NAMES[n]]
// assert len(cps) <= 2 and cps[0] >= cp and (len(cps) == 1 or cps[1] < 0x10000)
// assert 1 <= len(n) <= 31 and n.isascii() and n.isalnum(), n
// d = cps[0] - cp
// cp = cps[0]
// while True: # LEB128
// b = d & 0x7F
// d >>= 7
// if d:
// out.append(b | 0x80)
// else:
// out.append(b)
// break
// fl = len(n) | (0x20 if n in LEGACY else 0) | (0x40 if len(cps) == 2 else 0)
// out.append(fl)
// if len(cps) == 2:
// out += cps[1].to_bytes(2, 'little')
// out += n.encode('ascii')
// if len(n) > 7:
// nlong += 1
//
// blob = bytes(out)
// print('entities:', len(ORDER), 'long:', nlong, 'blob bytes:', len(blob))
//
// with open('entities.zig', 'w') as f:
// f.write('// Serialized HTML5 entity list, see gen_entities.py.\n')
// f.write(f'pub const ENTITY_COUNT = {len(ORDER)};\n')
// f.write(f'pub const LONG_COUNT = {nlong};\n')
// f.write('pub const blob = [{}]u8{{\n'.format(len(blob)))
// for i in range(0, len(blob), 24):
// f.write(' ' + ','.join(str(b) for b in blob[i:i + 24]) + ',\n')
// f.write('};\n')