├── .gitignore
├── LICENSE
├── README.md
├── code49
└── __init__.py
├── main.py
└── test
└── __init__.py
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 | *$py.class
5 |
6 | # C extensions
7 | *.so
8 |
9 | # Distribution / packaging
10 | .Python
11 | build/
12 | develop-eggs/
13 | dist/
14 | downloads/
15 | eggs/
16 | .eggs/
17 | lib/
18 | lib64/
19 | parts/
20 | sdist/
21 | var/
22 | wheels/
23 | share/python-wheels/
24 | *.egg-info/
25 | .installed.cfg
26 | *.egg
27 | MANIFEST
28 |
29 | # PyInstaller
30 | # Usually these files are written by a python script from a template
31 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
32 | *.manifest
33 | *.spec
34 |
35 | # Installer logs
36 | pip-log.txt
37 | pip-delete-this-directory.txt
38 |
39 | # Unit test / coverage reports
40 | htmlcov/
41 | .tox/
42 | .nox/
43 | .coverage
44 | .coverage.*
45 | .cache
46 | nosetests.xml
47 | coverage.xml
48 | *.cover
49 | *.py,cover
50 | .hypothesis/
51 | .pytest_cache/
52 | cover/
53 |
54 | # Translations
55 | *.mo
56 | *.pot
57 |
58 | # Django stuff:
59 | *.log
60 | local_settings.py
61 | db.sqlite3
62 | db.sqlite3-journal
63 |
64 | # Flask stuff:
65 | instance/
66 | .webassets-cache
67 |
68 | # Scrapy stuff:
69 | .scrapy
70 |
71 | # Sphinx documentation
72 | docs/_build/
73 |
74 | # PyBuilder
75 | .pybuilder/
76 | target/
77 |
78 | # Jupyter Notebook
79 | .ipynb_checkpoints
80 |
81 | # IPython
82 | profile_default/
83 | ipython_config.py
84 |
85 | # pyenv
86 | # For a library or package, you might want to ignore these files since the code is
87 | # intended to run in multiple environments; otherwise, check them in:
88 | # .python-version
89 |
90 | # pipenv
91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies
93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not
94 | # install all needed dependencies.
95 | #Pipfile.lock
96 |
97 | # poetry
98 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99 | # This is especially recommended for binary packages to ensure reproducibility, and is more
100 | # commonly ignored for libraries.
101 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102 | #poetry.lock
103 |
104 | # pdm
105 | # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106 | #pdm.lock
107 | # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108 | # in version control.
109 | # https://pdm.fming.dev/#use-with-ide
110 | .pdm.toml
111 |
112 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113 | __pypackages__/
114 |
115 | # Celery stuff
116 | celerybeat-schedule
117 | celerybeat.pid
118 |
119 | # SageMath parsed files
120 | *.sage.py
121 |
122 | # Environments
123 | .env
124 | .venv
125 | env/
126 | venv/
127 | ENV/
128 | env.bak/
129 | venv.bak/
130 |
131 | # Spyder project settings
132 | .spyderproject
133 | .spyproject
134 |
135 | # Rope project settings
136 | .ropeproject
137 |
138 | # mkdocs documentation
139 | /site
140 |
141 | # mypy
142 | .mypy_cache/
143 | .dmypy.json
144 | dmypy.json
145 |
146 | # Pyre type checker
147 | .pyre/
148 |
149 | # pytype static type analyzer
150 | .pytype/
151 |
152 | # Cython debug symbols
153 | cython_debug/
154 |
155 | # PyCharm
156 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158 | # and can be added to the global gitignore or merged into this file. For a more nuclear
159 | # option (not recommended) you can uncomment the following to ignore the entire idea folder.
160 | #.idea/
161 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU AFFERO GENERAL PUBLIC LICENSE
2 | Version 3, 19 November 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU Affero General Public License is a free, copyleft license for
11 | software and other kinds of works, specifically designed to ensure
12 | cooperation with the community in the case of network server software.
13 |
14 | The licenses for most software and other practical works are designed
15 | to take away your freedom to share and change the works. By contrast,
16 | our General Public Licenses are intended to guarantee your freedom to
17 | share and change all versions of a program--to make sure it remains free
18 | software for all its users.
19 |
20 | When we speak of free software, we are referring to freedom, not
21 | price. Our General Public Licenses are designed to make sure that you
22 | have the freedom to distribute copies of free software (and charge for
23 | them if you wish), that you receive source code or can get it if you
24 | want it, that you can change the software or use pieces of it in new
25 | free programs, and that you know you can do these things.
26 |
27 | Developers that use our General Public Licenses protect your rights
28 | with two steps: (1) assert copyright on the software, and (2) offer
29 | you this License which gives you legal permission to copy, distribute
30 | and/or modify the software.
31 |
32 | A secondary benefit of defending all users' freedom is that
33 | improvements made in alternate versions of the program, if they
34 | receive widespread use, become available for other developers to
35 | incorporate. Many developers of free software are heartened and
36 | encouraged by the resulting cooperation. However, in the case of
37 | software used on network servers, this result may fail to come about.
38 | The GNU General Public License permits making a modified version and
39 | letting the public access it on a server without ever releasing its
40 | source code to the public.
41 |
42 | The GNU Affero General Public License is designed specifically to
43 | ensure that, in such cases, the modified source code becomes available
44 | to the community. It requires the operator of a network server to
45 | provide the source code of the modified version running there to the
46 | users of that server. Therefore, public use of a modified version, on
47 | a publicly accessible server, gives the public access to the source
48 | code of the modified version.
49 |
50 | An older license, called the Affero General Public License and
51 | published by Affero, was designed to accomplish similar goals. This is
52 | a different license, not a version of the Affero GPL, but Affero has
53 | released a new version of the Affero GPL which permits relicensing under
54 | this license.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | TERMS AND CONDITIONS
60 |
61 | 0. Definitions.
62 |
63 | "This License" refers to version 3 of the GNU Affero General Public License.
64 |
65 | "Copyright" also means copyright-like laws that apply to other kinds of
66 | works, such as semiconductor masks.
67 |
68 | "The Program" refers to any copyrightable work licensed under this
69 | License. Each licensee is addressed as "you". "Licensees" and
70 | "recipients" may be individuals or organizations.
71 |
72 | To "modify" a work means to copy from or adapt all or part of the work
73 | in a fashion requiring copyright permission, other than the making of an
74 | exact copy. The resulting work is called a "modified version" of the
75 | earlier work or a work "based on" the earlier work.
76 |
77 | A "covered work" means either the unmodified Program or a work based
78 | on the Program.
79 |
80 | To "propagate" a work means to do anything with it that, without
81 | permission, would make you directly or secondarily liable for
82 | infringement under applicable copyright law, except executing it on a
83 | computer or modifying a private copy. Propagation includes copying,
84 | distribution (with or without modification), making available to the
85 | public, and in some countries other activities as well.
86 |
87 | To "convey" a work means any kind of propagation that enables other
88 | parties to make or receive copies. Mere interaction with a user through
89 | a computer network, with no transfer of a copy, is not conveying.
90 |
91 | An interactive user interface displays "Appropriate Legal Notices"
92 | to the extent that it includes a convenient and prominently visible
93 | feature that (1) displays an appropriate copyright notice, and (2)
94 | tells the user that there is no warranty for the work (except to the
95 | extent that warranties are provided), that licensees may convey the
96 | work under this License, and how to view a copy of this License. If
97 | the interface presents a list of user commands or options, such as a
98 | menu, a prominent item in the list meets this criterion.
99 |
100 | 1. Source Code.
101 |
102 | The "source code" for a work means the preferred form of the work
103 | for making modifications to it. "Object code" means any non-source
104 | form of a work.
105 |
106 | A "Standard Interface" means an interface that either is an official
107 | standard defined by a recognized standards body, or, in the case of
108 | interfaces specified for a particular programming language, one that
109 | is widely used among developers working in that language.
110 |
111 | The "System Libraries" of an executable work include anything, other
112 | than the work as a whole, that (a) is included in the normal form of
113 | packaging a Major Component, but which is not part of that Major
114 | Component, and (b) serves only to enable use of the work with that
115 | Major Component, or to implement a Standard Interface for which an
116 | implementation is available to the public in source code form. A
117 | "Major Component", in this context, means a major essential component
118 | (kernel, window system, and so on) of the specific operating system
119 | (if any) on which the executable work runs, or a compiler used to
120 | produce the work, or an object code interpreter used to run it.
121 |
122 | The "Corresponding Source" for a work in object code form means all
123 | the source code needed to generate, install, and (for an executable
124 | work) run the object code and to modify the work, including scripts to
125 | control those activities. However, it does not include the work's
126 | System Libraries, or general-purpose tools or generally available free
127 | programs which are used unmodified in performing those activities but
128 | which are not part of the work. For example, Corresponding Source
129 | includes interface definition files associated with source files for
130 | the work, and the source code for shared libraries and dynamically
131 | linked subprograms that the work is specifically designed to require,
132 | such as by intimate data communication or control flow between those
133 | subprograms and other parts of the work.
134 |
135 | The Corresponding Source need not include anything that users
136 | can regenerate automatically from other parts of the Corresponding
137 | Source.
138 |
139 | The Corresponding Source for a work in source code form is that
140 | same work.
141 |
142 | 2. Basic Permissions.
143 |
144 | All rights granted under this License are granted for the term of
145 | copyright on the Program, and are irrevocable provided the stated
146 | conditions are met. This License explicitly affirms your unlimited
147 | permission to run the unmodified Program. The output from running a
148 | covered work is covered by this License only if the output, given its
149 | content, constitutes a covered work. This License acknowledges your
150 | rights of fair use or other equivalent, as provided by copyright law.
151 |
152 | You may make, run and propagate covered works that you do not
153 | convey, without conditions so long as your license otherwise remains
154 | in force. You may convey covered works to others for the sole purpose
155 | of having them make modifications exclusively for you, or provide you
156 | with facilities for running those works, provided that you comply with
157 | the terms of this License in conveying all material for which you do
158 | not control copyright. Those thus making or running the covered works
159 | for you must do so exclusively on your behalf, under your direction
160 | and control, on terms that prohibit them from making any copies of
161 | your copyrighted material outside their relationship with you.
162 |
163 | Conveying under any other circumstances is permitted solely under
164 | the conditions stated below. Sublicensing is not allowed; section 10
165 | makes it unnecessary.
166 |
167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
168 |
169 | No covered work shall be deemed part of an effective technological
170 | measure under any applicable law fulfilling obligations under article
171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
172 | similar laws prohibiting or restricting circumvention of such
173 | measures.
174 |
175 | When you convey a covered work, you waive any legal power to forbid
176 | circumvention of technological measures to the extent such circumvention
177 | is effected by exercising rights under this License with respect to
178 | the covered work, and you disclaim any intention to limit operation or
179 | modification of the work as a means of enforcing, against the work's
180 | users, your or third parties' legal rights to forbid circumvention of
181 | technological measures.
182 |
183 | 4. Conveying Verbatim Copies.
184 |
185 | You may convey verbatim copies of the Program's source code as you
186 | receive it, in any medium, provided that you conspicuously and
187 | appropriately publish on each copy an appropriate copyright notice;
188 | keep intact all notices stating that this License and any
189 | non-permissive terms added in accord with section 7 apply to the code;
190 | keep intact all notices of the absence of any warranty; and give all
191 | recipients a copy of this License along with the Program.
192 |
193 | You may charge any price or no price for each copy that you convey,
194 | and you may offer support or warranty protection for a fee.
195 |
196 | 5. Conveying Modified Source Versions.
197 |
198 | You may convey a work based on the Program, or the modifications to
199 | produce it from the Program, in the form of source code under the
200 | terms of section 4, provided that you also meet all of these conditions:
201 |
202 | a) The work must carry prominent notices stating that you modified
203 | it, and giving a relevant date.
204 |
205 | b) The work must carry prominent notices stating that it is
206 | released under this License and any conditions added under section
207 | 7. This requirement modifies the requirement in section 4 to
208 | "keep intact all notices".
209 |
210 | c) You must license the entire work, as a whole, under this
211 | License to anyone who comes into possession of a copy. This
212 | License will therefore apply, along with any applicable section 7
213 | additional terms, to the whole of the work, and all its parts,
214 | regardless of how they are packaged. This License gives no
215 | permission to license the work in any other way, but it does not
216 | invalidate such permission if you have separately received it.
217 |
218 | d) If the work has interactive user interfaces, each must display
219 | Appropriate Legal Notices; however, if the Program has interactive
220 | interfaces that do not display Appropriate Legal Notices, your
221 | work need not make them do so.
222 |
223 | A compilation of a covered work with other separate and independent
224 | works, which are not by their nature extensions of the covered work,
225 | and which are not combined with it such as to form a larger program,
226 | in or on a volume of a storage or distribution medium, is called an
227 | "aggregate" if the compilation and its resulting copyright are not
228 | used to limit the access or legal rights of the compilation's users
229 | beyond what the individual works permit. Inclusion of a covered work
230 | in an aggregate does not cause this License to apply to the other
231 | parts of the aggregate.
232 |
233 | 6. Conveying Non-Source Forms.
234 |
235 | You may convey a covered work in object code form under the terms
236 | of sections 4 and 5, provided that you also convey the
237 | machine-readable Corresponding Source under the terms of this License,
238 | in one of these ways:
239 |
240 | a) Convey the object code in, or embodied in, a physical product
241 | (including a physical distribution medium), accompanied by the
242 | Corresponding Source fixed on a durable physical medium
243 | customarily used for software interchange.
244 |
245 | b) Convey the object code in, or embodied in, a physical product
246 | (including a physical distribution medium), accompanied by a
247 | written offer, valid for at least three years and valid for as
248 | long as you offer spare parts or customer support for that product
249 | model, to give anyone who possesses the object code either (1) a
250 | copy of the Corresponding Source for all the software in the
251 | product that is covered by this License, on a durable physical
252 | medium customarily used for software interchange, for a price no
253 | more than your reasonable cost of physically performing this
254 | conveying of source, or (2) access to copy the
255 | Corresponding Source from a network server at no charge.
256 |
257 | c) Convey individual copies of the object code with a copy of the
258 | written offer to provide the Corresponding Source. This
259 | alternative is allowed only occasionally and noncommercially, and
260 | only if you received the object code with such an offer, in accord
261 | with subsection 6b.
262 |
263 | d) Convey the object code by offering access from a designated
264 | place (gratis or for a charge), and offer equivalent access to the
265 | Corresponding Source in the same way through the same place at no
266 | further charge. You need not require recipients to copy the
267 | Corresponding Source along with the object code. If the place to
268 | copy the object code is a network server, the Corresponding Source
269 | may be on a different server (operated by you or a third party)
270 | that supports equivalent copying facilities, provided you maintain
271 | clear directions next to the object code saying where to find the
272 | Corresponding Source. Regardless of what server hosts the
273 | Corresponding Source, you remain obligated to ensure that it is
274 | available for as long as needed to satisfy these requirements.
275 |
276 | e) Convey the object code using peer-to-peer transmission, provided
277 | you inform other peers where the object code and Corresponding
278 | Source of the work are being offered to the general public at no
279 | charge under subsection 6d.
280 |
281 | A separable portion of the object code, whose source code is excluded
282 | from the Corresponding Source as a System Library, need not be
283 | included in conveying the object code work.
284 |
285 | A "User Product" is either (1) a "consumer product", which means any
286 | tangible personal property which is normally used for personal, family,
287 | or household purposes, or (2) anything designed or sold for incorporation
288 | into a dwelling. In determining whether a product is a consumer product,
289 | doubtful cases shall be resolved in favor of coverage. For a particular
290 | product received by a particular user, "normally used" refers to a
291 | typical or common use of that class of product, regardless of the status
292 | of the particular user or of the way in which the particular user
293 | actually uses, or expects or is expected to use, the product. A product
294 | is a consumer product regardless of whether the product has substantial
295 | commercial, industrial or non-consumer uses, unless such uses represent
296 | the only significant mode of use of the product.
297 |
298 | "Installation Information" for a User Product means any methods,
299 | procedures, authorization keys, or other information required to install
300 | and execute modified versions of a covered work in that User Product from
301 | a modified version of its Corresponding Source. The information must
302 | suffice to ensure that the continued functioning of the modified object
303 | code is in no case prevented or interfered with solely because
304 | modification has been made.
305 |
306 | If you convey an object code work under this section in, or with, or
307 | specifically for use in, a User Product, and the conveying occurs as
308 | part of a transaction in which the right of possession and use of the
309 | User Product is transferred to the recipient in perpetuity or for a
310 | fixed term (regardless of how the transaction is characterized), the
311 | Corresponding Source conveyed under this section must be accompanied
312 | by the Installation Information. But this requirement does not apply
313 | if neither you nor any third party retains the ability to install
314 | modified object code on the User Product (for example, the work has
315 | been installed in ROM).
316 |
317 | The requirement to provide Installation Information does not include a
318 | requirement to continue to provide support service, warranty, or updates
319 | for a work that has been modified or installed by the recipient, or for
320 | the User Product in which it has been modified or installed. Access to a
321 | network may be denied when the modification itself materially and
322 | adversely affects the operation of the network or violates the rules and
323 | protocols for communication across the network.
324 |
325 | Corresponding Source conveyed, and Installation Information provided,
326 | in accord with this section must be in a format that is publicly
327 | documented (and with an implementation available to the public in
328 | source code form), and must require no special password or key for
329 | unpacking, reading or copying.
330 |
331 | 7. Additional Terms.
332 |
333 | "Additional permissions" are terms that supplement the terms of this
334 | License by making exceptions from one or more of its conditions.
335 | Additional permissions that are applicable to the entire Program shall
336 | be treated as though they were included in this License, to the extent
337 | that they are valid under applicable law. If additional permissions
338 | apply only to part of the Program, that part may be used separately
339 | under those permissions, but the entire Program remains governed by
340 | this License without regard to the additional permissions.
341 |
342 | When you convey a copy of a covered work, you may at your option
343 | remove any additional permissions from that copy, or from any part of
344 | it. (Additional permissions may be written to require their own
345 | removal in certain cases when you modify the work.) You may place
346 | additional permissions on material, added by you to a covered work,
347 | for which you have or can give appropriate copyright permission.
348 |
349 | Notwithstanding any other provision of this License, for material you
350 | add to a covered work, you may (if authorized by the copyright holders of
351 | that material) supplement the terms of this License with terms:
352 |
353 | a) Disclaiming warranty or limiting liability differently from the
354 | terms of sections 15 and 16 of this License; or
355 |
356 | b) Requiring preservation of specified reasonable legal notices or
357 | author attributions in that material or in the Appropriate Legal
358 | Notices displayed by works containing it; or
359 |
360 | c) Prohibiting misrepresentation of the origin of that material, or
361 | requiring that modified versions of such material be marked in
362 | reasonable ways as different from the original version; or
363 |
364 | d) Limiting the use for publicity purposes of names of licensors or
365 | authors of the material; or
366 |
367 | e) Declining to grant rights under trademark law for use of some
368 | trade names, trademarks, or service marks; or
369 |
370 | f) Requiring indemnification of licensors and authors of that
371 | material by anyone who conveys the material (or modified versions of
372 | it) with contractual assumptions of liability to the recipient, for
373 | any liability that these contractual assumptions directly impose on
374 | those licensors and authors.
375 |
376 | All other non-permissive additional terms are considered "further
377 | restrictions" within the meaning of section 10. If the Program as you
378 | received it, or any part of it, contains a notice stating that it is
379 | governed by this License along with a term that is a further
380 | restriction, you may remove that term. If a license document contains
381 | a further restriction but permits relicensing or conveying under this
382 | License, you may add to a covered work material governed by the terms
383 | of that license document, provided that the further restriction does
384 | not survive such relicensing or conveying.
385 |
386 | If you add terms to a covered work in accord with this section, you
387 | must place, in the relevant source files, a statement of the
388 | additional terms that apply to those files, or a notice indicating
389 | where to find the applicable terms.
390 |
391 | Additional terms, permissive or non-permissive, may be stated in the
392 | form of a separately written license, or stated as exceptions;
393 | the above requirements apply either way.
394 |
395 | 8. Termination.
396 |
397 | You may not propagate or modify a covered work except as expressly
398 | provided under this License. Any attempt otherwise to propagate or
399 | modify it is void, and will automatically terminate your rights under
400 | this License (including any patent licenses granted under the third
401 | paragraph of section 11).
402 |
403 | However, if you cease all violation of this License, then your
404 | license from a particular copyright holder is reinstated (a)
405 | provisionally, unless and until the copyright holder explicitly and
406 | finally terminates your license, and (b) permanently, if the copyright
407 | holder fails to notify you of the violation by some reasonable means
408 | prior to 60 days after the cessation.
409 |
410 | Moreover, your license from a particular copyright holder is
411 | reinstated permanently if the copyright holder notifies you of the
412 | violation by some reasonable means, this is the first time you have
413 | received notice of violation of this License (for any work) from that
414 | copyright holder, and you cure the violation prior to 30 days after
415 | your receipt of the notice.
416 |
417 | Termination of your rights under this section does not terminate the
418 | licenses of parties who have received copies or rights from you under
419 | this License. If your rights have been terminated and not permanently
420 | reinstated, you do not qualify to receive new licenses for the same
421 | material under section 10.
422 |
423 | 9. Acceptance Not Required for Having Copies.
424 |
425 | You are not required to accept this License in order to receive or
426 | run a copy of the Program. Ancillary propagation of a covered work
427 | occurring solely as a consequence of using peer-to-peer transmission
428 | to receive a copy likewise does not require acceptance. However,
429 | nothing other than this License grants you permission to propagate or
430 | modify any covered work. These actions infringe copyright if you do
431 | not accept this License. Therefore, by modifying or propagating a
432 | covered work, you indicate your acceptance of this License to do so.
433 |
434 | 10. Automatic Licensing of Downstream Recipients.
435 |
436 | Each time you convey a covered work, the recipient automatically
437 | receives a license from the original licensors, to run, modify and
438 | propagate that work, subject to this License. You are not responsible
439 | for enforcing compliance by third parties with this License.
440 |
441 | An "entity transaction" is a transaction transferring control of an
442 | organization, or substantially all assets of one, or subdividing an
443 | organization, or merging organizations. If propagation of a covered
444 | work results from an entity transaction, each party to that
445 | transaction who receives a copy of the work also receives whatever
446 | licenses to the work the party's predecessor in interest had or could
447 | give under the previous paragraph, plus a right to possession of the
448 | Corresponding Source of the work from the predecessor in interest, if
449 | the predecessor has it or can get it with reasonable efforts.
450 |
451 | You may not impose any further restrictions on the exercise of the
452 | rights granted or affirmed under this License. For example, you may
453 | not impose a license fee, royalty, or other charge for exercise of
454 | rights granted under this License, and you may not initiate litigation
455 | (including a cross-claim or counterclaim in a lawsuit) alleging that
456 | any patent claim is infringed by making, using, selling, offering for
457 | sale, or importing the Program or any portion of it.
458 |
459 | 11. Patents.
460 |
461 | A "contributor" is a copyright holder who authorizes use under this
462 | License of the Program or a work on which the Program is based. The
463 | work thus licensed is called the contributor's "contributor version".
464 |
465 | A contributor's "essential patent claims" are all patent claims
466 | owned or controlled by the contributor, whether already acquired or
467 | hereafter acquired, that would be infringed by some manner, permitted
468 | by this License, of making, using, or selling its contributor version,
469 | but do not include claims that would be infringed only as a
470 | consequence of further modification of the contributor version. For
471 | purposes of this definition, "control" includes the right to grant
472 | patent sublicenses in a manner consistent with the requirements of
473 | this License.
474 |
475 | Each contributor grants you a non-exclusive, worldwide, royalty-free
476 | patent license under the contributor's essential patent claims, to
477 | make, use, sell, offer for sale, import and otherwise run, modify and
478 | propagate the contents of its contributor version.
479 |
480 | In the following three paragraphs, a "patent license" is any express
481 | agreement or commitment, however denominated, not to enforce a patent
482 | (such as an express permission to practice a patent or covenant not to
483 | sue for patent infringement). To "grant" such a patent license to a
484 | party means to make such an agreement or commitment not to enforce a
485 | patent against the party.
486 |
487 | If you convey a covered work, knowingly relying on a patent license,
488 | and the Corresponding Source of the work is not available for anyone
489 | to copy, free of charge and under the terms of this License, through a
490 | publicly available network server or other readily accessible means,
491 | then you must either (1) cause the Corresponding Source to be so
492 | available, or (2) arrange to deprive yourself of the benefit of the
493 | patent license for this particular work, or (3) arrange, in a manner
494 | consistent with the requirements of this License, to extend the patent
495 | license to downstream recipients. "Knowingly relying" means you have
496 | actual knowledge that, but for the patent license, your conveying the
497 | covered work in a country, or your recipient's use of the covered work
498 | in a country, would infringe one or more identifiable patents in that
499 | country that you have reason to believe are valid.
500 |
501 | If, pursuant to or in connection with a single transaction or
502 | arrangement, you convey, or propagate by procuring conveyance of, a
503 | covered work, and grant a patent license to some of the parties
504 | receiving the covered work authorizing them to use, propagate, modify
505 | or convey a specific copy of the covered work, then the patent license
506 | you grant is automatically extended to all recipients of the covered
507 | work and works based on it.
508 |
509 | A patent license is "discriminatory" if it does not include within
510 | the scope of its coverage, prohibits the exercise of, or is
511 | conditioned on the non-exercise of one or more of the rights that are
512 | specifically granted under this License. You may not convey a covered
513 | work if you are a party to an arrangement with a third party that is
514 | in the business of distributing software, under which you make payment
515 | to the third party based on the extent of your activity of conveying
516 | the work, and under which the third party grants, to any of the
517 | parties who would receive the covered work from you, a discriminatory
518 | patent license (a) in connection with copies of the covered work
519 | conveyed by you (or copies made from those copies), or (b) primarily
520 | for and in connection with specific products or compilations that
521 | contain the covered work, unless you entered into that arrangement,
522 | or that patent license was granted, prior to 28 March 2007.
523 |
524 | Nothing in this License shall be construed as excluding or limiting
525 | any implied license or other defenses to infringement that may
526 | otherwise be available to you under applicable patent law.
527 |
528 | 12. No Surrender of Others' Freedom.
529 |
530 | If conditions are imposed on you (whether by court order, agreement or
531 | otherwise) that contradict the conditions of this License, they do not
532 | excuse you from the conditions of this License. If you cannot convey a
533 | covered work so as to satisfy simultaneously your obligations under this
534 | License and any other pertinent obligations, then as a consequence you may
535 | not convey it at all. For example, if you agree to terms that obligate you
536 | to collect a royalty for further conveying from those to whom you convey
537 | the Program, the only way you could satisfy both those terms and this
538 | License would be to refrain entirely from conveying the Program.
539 |
540 | 13. Remote Network Interaction; Use with the GNU General Public License.
541 |
542 | Notwithstanding any other provision of this License, if you modify the
543 | Program, your modified version must prominently offer all users
544 | interacting with it remotely through a computer network (if your version
545 | supports such interaction) an opportunity to receive the Corresponding
546 | Source of your version by providing access to the Corresponding Source
547 | from a network server at no charge, through some standard or customary
548 | means of facilitating copying of software. This Corresponding Source
549 | shall include the Corresponding Source for any work covered by version 3
550 | of the GNU General Public License that is incorporated pursuant to the
551 | following paragraph.
552 |
553 | Notwithstanding any other provision of this License, you have
554 | permission to link or combine any covered work with a work licensed
555 | under version 3 of the GNU General Public License into a single
556 | combined work, and to convey the resulting work. The terms of this
557 | License will continue to apply to the part which is the covered work,
558 | but the work with which it is combined will remain governed by version
559 | 3 of the GNU General Public License.
560 |
561 | 14. Revised Versions of this License.
562 |
563 | The Free Software Foundation may publish revised and/or new versions of
564 | the GNU Affero General Public License from time to time. Such new versions
565 | will be similar in spirit to the present version, but may differ in detail to
566 | address new problems or concerns.
567 |
568 | Each version is given a distinguishing version number. If the
569 | Program specifies that a certain numbered version of the GNU Affero General
570 | Public License "or any later version" applies to it, you have the
571 | option of following the terms and conditions either of that numbered
572 | version or of any later version published by the Free Software
573 | Foundation. If the Program does not specify a version number of the
574 | GNU Affero General Public License, you may choose any version ever published
575 | by the Free Software Foundation.
576 |
577 | If the Program specifies that a proxy can decide which future
578 | versions of the GNU Affero General Public License can be used, that proxy's
579 | public statement of acceptance of a version permanently authorizes you
580 | to choose that version for the Program.
581 |
582 | Later license versions may give you additional or different
583 | permissions. However, no additional obligations are imposed on any
584 | author or copyright holder as a result of your choosing to follow a
585 | later version.
586 |
587 | 15. Disclaimer of Warranty.
588 |
589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
597 |
598 | 16. Limitation of Liability.
599 |
600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
608 | SUCH DAMAGES.
609 |
610 | 17. Interpretation of Sections 15 and 16.
611 |
612 | If the disclaimer of warranty and limitation of liability provided
613 | above cannot be given local legal effect according to their terms,
614 | reviewing courts shall apply local law that most closely approximates
615 | an absolute waiver of all civil liability in connection with the
616 | Program, unless a warranty or assumption of liability accompanies a
617 | copy of the Program in return for a fee.
618 |
619 | END OF TERMS AND CONDITIONS
620 |
621 | How to Apply These Terms to Your New Programs
622 |
623 | If you develop a new program, and you want it to be of the greatest
624 | possible use to the public, the best way to achieve this is to make it
625 | free software which everyone can redistribute and change under these terms.
626 |
627 | To do so, attach the following notices to the program. It is safest
628 | to attach them to the start of each source file to most effectively
629 | state the exclusion of warranty; and each file should have at least
630 | the "copyright" line and a pointer to where the full notice is found.
631 |
632 |
633 | Copyright (C)
634 |
635 | This program is free software: you can redistribute it and/or modify
636 | it under the terms of the GNU Affero General Public License as published
637 | by the Free Software Foundation, either version 3 of the License, or
638 | (at your option) any later version.
639 |
640 | This program is distributed in the hope that it will be useful,
641 | but WITHOUT ANY WARRANTY; without even the implied warranty of
642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
643 | GNU Affero General Public License for more details.
644 |
645 | You should have received a copy of the GNU Affero General Public License
646 | along with this program. If not, see .
647 |
648 | Also add information on how to contact you by electronic and paper mail.
649 |
650 | If your software can interact with users remotely through a computer
651 | network, you should also make sure that it provides a way for users to
652 | get its source. For example, if your program is a web application, its
653 | interface could display a "Source" link that leads users to an archive
654 | of the code. There are many ways you could offer source, and different
655 | solutions will be better for different programs; see section 13 for the
656 | specific requirements.
657 |
658 | You should also get your employer (if you work as a programmer) or school,
659 | if any, to sign a "copyright disclaimer" for the program, if necessary.
660 | For more information on this, and how to apply and follow the GNU AGPL, see
661 | .
662 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # code49-decoder
2 |
3 | Code49 Decoder **(For [Arknights](https://ak.hypergryph.com/) PV4 puzzle ONLY)**
4 |
5 | Thanks to [lukecyca](https://github.com/lukecyca)'s [code49 encoder](https://github.com/lukecyca/code49)
6 |
7 | **It treats Code49 as Mode-0, and ignores other non-data characters.**
8 |
9 | ## About
10 |
11 | Decoder is written as a simple inverse program of [code49 encoder](https://github.com/lukecyca/code49).
12 |
13 | **Note:** [Code49 encoder](https://github.com/lukecyca/code49) is in Python2, our decoder is in Python3, so some of the original codes are rewritten into Python3.
14 |
15 | ## References
16 |
17 | **Code 49 encoder source code:**
18 | **Code 49 specification:**
19 |
--------------------------------------------------------------------------------
/code49/__init__.py:
--------------------------------------------------------------------------------
1 | """Implements code49 stacked bar code
2 | AKA USS-49
3 | https://code.google.com/p/postscriptbarcode/wiki/Code49
4 |
5 | Currently only mode 0 is implemented, which is restricted to uppercase alphanumeric
6 | characters.
7 |
8 | """
9 |
10 |
11 | # [Deprecated] Python3 removed `xrange`, so we implement a new one
12 | #
13 | # def _chunks(l, n):
14 | # """ Yield successive n-sized chunks from l."""
15 | # for i in xrange(0, len(l), n):
16 | # yield l[i:i + n]
17 |
18 | def _chunks(l, n):
19 | ret = []
20 | for i in range(0, len(l), n):
21 | ret.append(l[i:i + n])
22 | return ret
23 |
24 |
25 | EVEN_PARITY_PATTERNS = [
26 | "11521132", "25112131", "14212132", "25121221", "14221222", "12412132", "23321221",
27 | "12421222", "21521221", "15112222", "15121312", "13312222", "24221311", "13321312",
28 | "11512222", "22421311", "11521312", "25112311", "14212312", "23312311", "12412312",
29 | "21512311", "16121131", "14321131", "12521131", "15212131", "15221221", "13412131",
30 | "13421221", "11612131", "16112221", "16121311", "14312221", "14321311", "12512221",
31 | "12521311", "15212311", "13412311", "11612311", "11131135", "31131133", "51131131",
32 | "21122134", "41122132", "21131224", "41131222", "11113135", "31113133", "51113131",
33 | "11122225", "31122223", "51122221", "11131315", "31131313", "51131311", "21113224",
34 | "41113222", "21122314", "41122312", "11113315", "31113313", "51113311", "12131134",
35 | "32131132", "21231133", "41231131", "22122133", "42122131", "11222134", "22131223",
36 | "42131221", "11231224", "31231222", "12113134", "32113132", "12122224", "32122222",
37 | "12131314", "32131312", "21231313", "41231311", "22113223", "42113221", "11213224",
38 | "22122313", "42122311", "11222314", "31222312", "12113314", "32113312", "21213313",
39 | "41213311", "13131133", "33131131", "22231132", "11331133", "31331131", "23122132",
40 | "12222133", "23131222", "12231223", "32231221", "21331222", "13113133", "33113131",
41 | "13122223", "33122221", "11313133", "13131313", "33131311", "11322223", "22231312",
42 | "11331313", "31331311", "23113222", "12213223", "23122312", "12222313", "32222311",
43 | "21322312", "13113313", "33113311", "22213312", "11313313", "31313311", "14131132",
44 | "23231131", "12331132", "21431131", "24122131", "13222132", "24131221", "13231222",
45 | "11422132", "22331221", "11431222", "14113132", "14122222", "12313132", "14131312",
46 | "12322222", "23231311", "12331312", "21431311", "24113221", "13213222", "24122311",
47 | "13222312", "11413222", "22322311", "11422312", "14113312", "23213311", "12313312",
48 | "21413311", "15131131", "13331131", "14222131", "14231221", "12422131", "12431221",
49 | "15113131", "15122221", "13313131", "15131311", "13322221", "11513131", "13331311",
50 | "11522221", "14213221", "14222311", "12413221", "12422311", "15113311", "13313311",
51 | "11513311", "11141134", "31141132", "21132133", "41132131", "21141223", "41141221",
52 | "11123134", "31123132", "11132224", "31132222", "11141314", "31141312", "21114133",
53 | "41114131", "21123223", "41123221", "21132313", "41132311", "11114224", "31114222",
54 | "11123314", "31123312", "21114313", "41114311", "12141133", "32141131", "21241132",
55 | "22132132", "11232133", "22141222", "11241223", "31241221", "12123133", "32123131",
56 | "12132223", "32132221", "12141313", "32141311", "21241312", "22114132", "11214133",
57 | "22123222", "11223223", "22132312", "11232313", "31232311", "12114223", "32114221",
58 | "12123313", "32123311", "21223312", "22114312", "11214313", "31214311", "13141132",
59 | "22241131", "11341132", "23132131", "12232132", "23141221", "12241222", "21341221",
60 | "13123132", "13132222", "11323132", "13141312", "11332222", "22241311", "11341312",
61 | "23114131", "12214132", "23123221", "12223222", "23132311", "12232312", "21332311",
62 | "13114222", "13123312", "11314222", "22223311", "11323312", "23114311", "12214312",
63 | "21314311", "14141131", "12341131", "13232131", "13241221", "11432131", "14123131",
64 | "14132221", "12323131", "14141311", "12332221", "12341311", "13214131", "13223221",
65 | "11414131", "13232311", "11423221", "11432311", "14114221", "14123311", "12314221",
66 | "12323311", "13214311", "11414311", "11151133", "31151131", "21142132", "21151222",
67 | "11133133", "31133131", "11142223", "31142221", "11151313", "31151311", "21124132",
68 | "21133222", "21142312", "11115133", "31115131", "11124223", "31124221", "11133313",
69 | "31133311", "21115222", "21124312", "12151132", "21251131", "22142131", "11242132",
70 | "22151221", "11251222", "12133132", "12142222", "12151312", "21251311", "22124131",
71 | "11224132", "22133221", "11233222", "22142311", "11242312", "12115132", "12124222",
72 | "12133312", "21233311", "22115221", "11215222", "22124311", "11224312", "13151131",
73 | "12242131", "12251221", "13133131", "13142221", "11333131", "13151311", "11342221",
74 | "12224131", "12233221", "12242311", "13115131", "13124221", "11315131", "13133311",
75 | "11324221", "11333311", "12215221", "12224311", "11161132", "21152131", "21161221",
76 | "11143132", "11152222", "11161312", "21134131", "21143221", "21152311", "11125132",
77 | "11134222", "11143312", "21116131", "21125221", "21134311", "12161131", "11252131",
78 | "12143131", "12152221", "12161311", "11234131", "11243221", "11252311", "12125131",
79 | "12134221", "12143311", "11216131", "11225221", "11234311", "11111236", "31111234",
80 | "51111232", "21111325", "41111323", "61111321", "11111416", "31111414", "51111412",
81 | "31211143", "51211141", "12111235", "32111233", "52111231", "21211234", "41211232",
82 | "22111324", "42111322", "11211325", "31211323", "51211321", "12111415", "32111413",
83 | "52111411", "21211414", "41211412", "12211144", "32211142", "21311143", "41311141",
84 | "13111234", "33111232", "22211233", "42211231", "11311234", "31311232", "23111323",
85 | "43111321", "12211324", "32211322", "21311323", "41311321", "13111414", "33111412",
86 | "22211413", "42211411", "11311414", "31311412", "13211143", "33211141", "22311142",
87 | "11411143", "31411141", "14111233", "34111231", "23211232", "12311233", "32311231",
88 | "21411232", "24111322", "13211323", "33211321", "22311322", "11411323", "31411321",
89 | "14111413", "34111411", "23211412", "12311413", "32311411", "21411412", "14211142",
90 | "23311141", "12411142", "21511141", "15111232", "24211231", "13311232", "22411231",
91 | "11511232", "25111321", "14211322", "23311321", "12411322", "21511321", "15111412",
92 | "24211411", "13311412", "22411411", "11511412", "15211141", "13411141", "11611141",
93 | "16111231", "14311231", "12511231", "15211321", "13411321", "11611321", "16111411",
94 | "14311411", "12511411", "21121144", "41121142", "11112145", "31112143", "51112141",
95 | "11121235", "31121233", "51121231", "21112234", "41112232", "21121324", "41121322",
96 | "11112325", "31112323", "51112321", "11121415", "31121413", "51121411", "21112414",
97 | "41112412", "22121143", "42121141", "11221144", "31221142", "12112144", "32112142",
98 | "12121234", "32121232", "21221233", "41221231", "22112233", "42112231", "11212234",
99 | "22121323", "42121321", "11221324", "31221322", "12112324", "32112322", "12121414",
100 | "32121412", "21221413", "41221411", "22112413", "42112411", "11212414", "31212412",
101 | "23121142", "12221143", "32221141", "21321142", "13112143", "33112141", "13121233",
102 | "33121231", "11312143", "22221232", "11321233", "31321231", "23112232", "12212233",
103 | "23121322", "12221323", "32221321", "21321322", "13112323", "33112321", "13121413",
104 | "33121411", "11312323", "22221412", "11321413", "31321411", "23112412", "12212413",
105 | "32212411", "21312412", "24121141", "13221142", "22321141", "11421142", "14112142",
106 | "14121232", "12312142", "23221231", "12321232", "21421231", "24112231", "13212232",
107 | "24121321", "13221322", "11412232", "22321321", "11421322", "14112322", "14121412",
108 | "12312322", "23221411", "12321412", "21421411", "24112411", "13212412", "22312411",
109 | "11412412", "14221141", "12421141", "15112141", "15121231", "13312141", "13321231",
110 | "11512141", "11521231", "14212231", "14221321", "12412231", "12421321", "15112321",
111 | "15121411", "13312321", "13321411", "11512321", "11521411", "14212411", "12412411",
112 | "21131143", "41131141", "11122144", "31122142", "11131234", "31131232", "21113143",
113 | "41113141", "21122233", "41122231", "21131323", "41131321", "11113234", "31113232",
114 | "11122324", "31122322", "11131414", "31131412", "21113323", "41113321", "21122413",
115 | "41122411", "11113414", "31113412", "22131142", "11231143", "31231141", "12122143",
116 | "32122141", "12131233", "32131231", "21231232", "22113142", "11213143", "22122232",
117 | "11222233", "22131322", "11231323", "31231321", "12113233", "32113231", "12122323",
118 | "32122321", "12131413", "32131411", "21231412", "22113322", "11213323", "22122412",
119 | "11222413", "31222411", "12113413", "32113411", "21213412", "23131141", "12231142",
120 | "21331141", "13122142", "13131232", "11322142", "22231231", "11331232", "23113141",
121 | "12213142", "23122231", "12222232", "23131321", "12231322", "21331321", "13113232",
122 | "13122322", "11313232", "13131412", "11322322", "22231411", "11331412", "23113321",
123 | "12213322", "23122411", "12222412", "21322411", "13113412", "22213411", "11313412",
124 | "13231141", "11431141", "14122141", "14131231", "12322141", "12331231", "13213141",
125 | "13222231", "11413141", "13231321", "11422231", "11431321", "14113231", "14122321",
126 | "12313231", "14131411", "12322321", "12331411", "13213321", "13222411", "11413321",
127 | "11422411", "14113411", "12313411", "21141142", "11132143", "31132141", "11141233",
128 | "31141231", "21123142", "21132232", "21141322", "11114143", "31114141", "11123233",
129 | "31123231", "11132323", "31132321", "11141413", "31141411", "21114232", "21123322",
130 | "21132412", "11114323", "31114321", "11123413", "31123411", "22141141", "11241142",
131 | "12132142", "12141232", "21241231", "22123141", "11223142", "22132231", "11232232",
132 | "22141321", "11241322", "12114142", "12123232", "12132322", "12141412", "21241411",
133 | "22114231", "11214232", "22123321", "11223322", "22132411", "11232412", "12114322",
134 | "12123412", "21223411", "12241141", "13132141", "13141231", "11332141", "11341231",
135 | "12223141", "12232231", "12241321", "13114141", "13123231", "11314141", "13132321",
136 | "11323231", "13141411", "11332321", "11341411", "12214231", "12223321", "12232411",
137 | "13114321", "13123411", "11314321", "11323411", "21151141", "11142142", "11151232",
138 | "21133141", "21142231", "21151321", "11124142", "11133232", "11142322", "11151412",
139 | "21115141", "21124231", "21133321", "21142411", "11115232", "11124322", "11133412",
140 | "11251141", "12142141", "12151231", "11233141", "11242231", "11251321", "12124141",
141 | "12133231", "12142321", "12151411", "11215141", "11224231", "11233321", "11242411",
142 | "12115231", "12124321", "12133411", "11152141", "11161231", "11134141", "11143231",
143 | "11152321", "11161411", "11116141", "11125231", "11134321", "11143411", "21111244",
144 | "41111242", "11111335", "31111333", "51111331", "21111424", "41111422", "11111515",
145 | "31111513", "51111511", "21211153", "41211151", "22111243", "42111241", "11211244",
146 | "31211242", "12111334", "32111332", "21211333", "41211331", "22111423", "42111421",
147 | "11211424", "31211422", "12111514", "32111512", "21211513", "41211511", "22211152",
148 | "11311153", "31311151", "23111242", "12211243", "32211241", "21311242", "13111333",
149 | "33111331", "22211332", "11311333", "31311331", "23111422", "12211423", "32211421",
150 | "21311422", "13111513", "33111511", "22211512", "11311513", "31311511", "23211151",
151 | "12311152", "21411151", "24111241", "13211242", "22311241", "11411242", "14111332",
152 | "23211331", "12311332", "21411331", "24111421", "13211422", "22311421", "11411422",
153 | "14111512", "23211511", "12311512", "21411511", "13311151", "11511151", "14211241",
154 | "12411241", "15111331", "13311331", "11511331", "14211421", "12411421", "15111511",
155 | "13311511", "11511511", "31121152", "21112153", "41112151", "21121243", "41121241",
156 | "11112244", "31112242", "11121334", "31121332", "21112333", "41112331", "21121423",
157 | "41121421", "11112424", "31112422", "11121514", "31121512", "21112513", "41112511",
158 | "12121153", "32121151", "21221152", "22112152", "11212153", "22121242", "11221243",
159 | "31221241", "12112243", "32112241", "12121333", "32121331", "21221332", "22112332",
160 | "11212333", "22121422", "11221423", "31221421", "12112423", "32112421", "12121513",
161 | "32121511", "21221512", "22112512", "11212513", "31212511", "13121152", "22221151",
162 | "11321152", "23112151", "12212152", "23121241", "12221242", "21321241", "13112242",
163 | "13121332", "11312242", "22221331", "11321332", "23112331", "12212332", "23121421",
164 | "12221422", "21321421", "13112422", "13121512", "11312422", "22221511", "11321512",
165 | "23112511", "12212512", "21312511", "14121151", "12321151", "13212151", "13221241",
166 | "11412151", "11421241", "14112241", "14121331", "12312241", "12321331", "13212331",
167 | "13221421", "11412331", "11421421", "14112421", "14121511", "12312421", "12321511",
168 | "13212511", "11412511", "11131153", "31131151", "21122152", "21131242", "11113153",
169 | "31113151", "11122243", "31122241", "11131333", "31131331", "21113242", "21122332",
170 | "21131422", "11113333", "31113331", "11122423", "31122421", "11131513", "31131511",
171 | "21113422", "21122512", "12131152", "21231151", "22122151", "11222152", "22131241",
172 | "11231242", "12113152", "12122242", "12131332", "21231331", "22113241", "11213242",
173 | "22122331", "11222332", "22131421", "11231422", "12113332", "12122422", "12131512",
174 | "21231511", "22113421", "11213422", "22122511", "11222512", "13131151", "11331151",
175 | "12222151", "12231241", "13113151", "13122241", "11313151", "13131331", "11322241",
176 | "11331331", "12213241", "12222331", "12231421", "13113331", "13122421", "11313331",
177 | "13131511", "11322421", "11331511", "12213421", "12222511", "11141152", "21132151",
178 | "21141241", "11123152", "11132242", "11141332", "21114151", "21123241", "21132331",
179 | "21141421", "11114242", "11123332", "11132422", "11141512", "21114331", "21123421",
180 | "21132511", "12141151", "11232151", "11241241", "12123151", "12132241", "12141331",
181 | "11214151", "11223241", "11232331", "11241421", "12114241", "12123331", "12132421",
182 | "12141511", "11214331", "11223421", "11232511", "11151151", "11133151", "11142241",
183 | "11151331", "11115151", "11124241", "11133331", "11142421", "11151511", "11111254",
184 | "31111252", "21111343", "41111341", "11111434", "31111432", "21111523", "41111521",
185 | "11111614", "31111612", "31211161", "12111253", "32111251", "21211252", "22111342",
186 | "11211343", "31211341", "12111433", "32111431", "21211432", "22111522", "11211523",
187 | "31211521", "12111613", "32111611", "21211612", "12211162", "21311161", "13111252",
188 | "22211251", "11311252", "23111341", "12211342", "21311341", "13111432", "22211431",
189 | "11311432", "23111521", "12211522", "21311521", "13111612", "22211611", "11311612",
190 | "13211161", "11411161", "14111251", "12311251", "13211341", "11411341", "14111431",
191 | "12311431", "13211521", "11411521", "14111611", "12311611", "21121162", "11112163",
192 | "31112161", "11121253", "31121251", "21112252", "21121342", "11112343", "31112341",
193 | "11121433", "31121431", "21112432", "21121522", "11112523", "31112521", "11121613",
194 | "31121611", "22121161", "11221162", "12112162", "12121252", "21221251", "22112251",
195 | "11212252", "22121341", "11221342", "12112342", "12121432", "21221431", "22112431",
196 | "11212432", "22121521", "11221522", "12112522", "12121612", "21221611", "12221161",
197 | "13112161", "13121251", "11312161", "11321251", "32121115", "52121113", "21221116",
198 | "41221114", "61221112", "22112116", "42112114", "31212115", "51212113", "13121116",
199 | "33121114", "22221115", "42221113", "11321116", "31321114", "51321112", "23112115",
200 | "43112113", "12212116", "32212114", "52212112", "21312115", "41312113", "61312111",
201 | "14121115", "34121113", "23221114", "43221112", "12321115", "32321113", "52321111",
202 | "21421114", "41421112", "24112114", "13212115", "33212113", "22312114", "42312112",
203 | "11412115", "31412113", "51412111", "15121114", "24221113", "13321114", "33321112",
204 | "22421113", "42421111", "11521114", "31521112", "25112113", "14212114", "34212112",
205 | "23312113", "43312111", "12412114", "32412112", "21512113", "41512111", "16121113",
206 | "25221112", "14321113", "34321111", "23421112", "12521113", "32521111", "15212113",
207 | "24312112", "13412113", "33412111", "22512112", "11612113", "31612111", "31131115",
208 | "51131113", "21122116", "41122114", "61122112", "31113115", "51113113", "12131116",
209 | "32131114", "52131112", "21231115", "41231113", "61231111", "22122115", "42122113",
210 | "11222116", "31222114", "51222112", "12113116", "32113114", "52113112", "21213115",
211 | "41213113", "61213111", "13131115", "33131113", "22231114", "42231112", "11331115",
212 | "31331113", "51331111", "23122114", "43122112", "12222115", "32222113", "52222111",
213 | "21322114", "41322112", "13113115", "33113113", "22213114", "42213112", "11313115",
214 | "31313113", "51313111", "14131114", "34131112", "23231113", "43231111", "12331114",
215 | "32331112", "21431113", "41431111", "24122113", "13222114", "33222112", "22322113",
216 | "42322111", "11422114", "31422112", "14113114", "34113112", "23213113", "43213111",
217 | "12313114", "32313112", "21413113", "41413111", "15131113", "24231112", "13331113",
218 | "33331111", "22431112", "25122112", "14222113", "34222111", "23322112", "12422113",
219 | "32422111", "21522112", "15113113", "24213112", "13313113", "33313111", "22413112",
220 | "11513113", "31513111", "16131112", "25231111", "14331112", "23431111", "15222112",
221 | "24322111", "13422112", "22522111", "16113112", "25213111", "14313112", "23413111",
222 | "12513112", "21613111", "11141116", "31141114", "51141112", "21132115", "41132113",
223 | "61132111", "11123116", "31123114", "51123112", "21114115", "41114113", "61114111",
224 | "12141115", "32141113", "52141111", "21241114", "41241112", "22132114", "42132112",
225 | "11232115", "31232113", "51232111", "12123115", "32123113", "52123111", "21223114",
226 | "41223112", "22114114", "42114112", "11214115", "31214113", "51214111", "13141114",
227 | "33141112", "22241113", "42241111", "11341114", "31341112", "23132113", "43132111",
228 | "12232114", "32232112", "21332113", "41332111", "13123114", "33123112", "22223113",
229 | "42223111", "11323114", "31323112", "23114113", "43114111", "12214114", "32214112",
230 | "21314113", "41314111", "14141113", "34141111", "23241112", "12341113", "32341111",
231 | "24132112", "13232113", "33232111", "22332112", "11432113", "31432111", "14123113",
232 | "34123111", "23223112", "12323113", "32323111", "21423112", "24114112", "13214113",
233 | "33214111", "22314112", "11414113", "31414111", "15141112", "24241111", "13341112",
234 | "25132111", "14232112", "23332111", "12432112", "15123112", "24223111", "13323112",
235 | "22423111", "11523112", "25114111", "14214112", "23314111", "12414112", "21514111",
236 | "16141111", "14341111", "15232111", "13432111", "16123111", "14323111", "12523111",
237 | "15214111", "13414111", "11614111", "11151115", "31151113", "51151111", "21142114",
238 | "41142112", "11133115", "31133113", "51133111", "21124114", "41124112", "11115115",
239 | "31115113", "51115111", "12151114", "32151112", "21251113", "41251111", "22142113",
240 | "42142111", "11242114", "31242112", "12133114", "32133112", "21233113", "41233111",
241 | "22124113", "42124111", "11224114", "31224112", "12115114", "32115112", "21215113",
242 | "41215111", "13151113", "33151111", "22251112", "23142112", "12242113", "32242111",
243 | "21342112", "13133113", "33133111", "22233112", "11333113", "31333111", "23124112",
244 | "12224113", "32224111", "21324112", "13115113", "33115111", "22215112", "11315113",
245 | "31315111", "14151112", "23251111", "24142111", "13242112", "22342111", "14133112",
246 | "23233111", "12333112", "21433111", "24124111", "13224112", "22324111", "11424112",
247 | "14115112", "23215111", "12315112", "21415111", "15151111", "14242111", "15133111",
248 | "13333111", "14224111", "12424111", "15115111", "13315111", "11515111", "11161114",
249 | "31161112", "21152113", "41152111", "11143114", "31143112", "21134113", "41134111",
250 | "11125114", "31125112", "21116113", "41116111", "12161113", "32161111", "22152112",
251 | "11252113", "31252111", "12143113", "32143111", "21243112", "22134112", "11234113",
252 | "31234111", "12125113", "32125111", "21225112", "22116112", "11216113", "31216111",
253 | "13161112", "23152111", "12252112", "13143112", "22243111", "11343112", "23134111",
254 | "12234112", "21334111", "13125112", "22225111", "11325112", "23116111", "12216112",
255 | "21316111", "14161111", "13252111", "14143111", "12343111", "13234111", "11434111",
256 | "14125111", "12325111", "13216111", "11416111", "31111216", "51111214", "31211125",
257 | "51211123", "32111215", "52111213", "21211216", "41211214", "61211212", "12211126",
258 | "32211124", "52211122", "21311125", "41311123", "61311121", "13111216", "33111214",
259 | "22211215", "42211213", "11311216", "31311214", "51311212", "13211125", "33211123",
260 | "22311124", "42311122", "11411125", "31411123", "51411121", "14111215", "34111213",
261 | "23211214", "43211212", "12311215", "32311213", "52311211", "21411214", "41411212",
262 | "14211124", "34211122", "23311123", "43311121", "12411124", "32411122", "21511123",
263 | "41511121", "15111214", "24211213", "13311214", "33311212", "22411213", "42411211",
264 | "11511214", "31511212", "15211123", "24311122", "13411123", "33411121", "22511122",
265 | "11611123", "31611121", "16111213", "25211212", "14311213", "34311211", "23411212",
266 | "12511213", "32511211", "21611212", "21121126", "41121124", "61121122", "31112125",
267 | "51112123", "31121215", "51121213", "21112216", "41112214", "61112212", "22121125",
268 | "42121123", "11221126", "31221124", "51221122", "12112126", "32112124", "52112122",
269 | "12121216", "32121214", "52121212", "21221215", "41221213", "61221211", "22112215",
270 | "42112213", "11212216", "31212214", "51212212", "23121124", "43121122", "12221125",
271 | "32221123", "52221121", "21321124", "41321122", "13112125", "33112123", "13121215",
272 | "33121213", "11312125", "22221214", "42221212", "11321215", "31321213", "51321211",
273 | "23112214", "43112212", "12212215", "32212213", "52212211", "21312214", "41312212",
274 | "24121123", "13221124", "33221122", "22321123", "42321121", "11421124", "31421122",
275 | "14112124", "34112122", "14121214", "34121212", "12312124", "23221213", "43221211",
276 | "12321214", "32321212", "21421213", "41421211", "24112213", "13212214", "33212212",
277 | "22312213", "42312211", "11412214", "31412212", "25121122", "14221123", "34221121",
278 | "23321122", "12421123", "32421121", "21521122", "15112123", "15121213", "13312123",
279 | "24221212", "13321213", "33321211", "11512123", "22421212", "11521213", "31521211",
280 | "25112212", "14212213", "34212211", "23312212", "12412213", "32412211", "21512212",
281 | "15221122", "24321121", "13421122", "22521121", "16112122", "16121212", "14312122",
282 | "25221211", "14321212", "12512122", "23421211", "12521212", "15212212", "24312211",
283 | "13412212", "22512211", "11612212", "21131125", "41131123", "61131121", "11122126",
284 | "31122124", "51122122", "11131216", "31131214", "51131212", "21113125", "41113123",
285 | "61113121", "21122215", "41122213", "61122211", "11113216", "31113214", "51113212",
286 | "22131124", "42131122", "11231125", "31231123", "51231121", "12122125", "32122123",
287 | "52122121", "12131215", "32131213", "52131211", "21231214", "41231212", "22113124",
288 | "42113122", "11213125", "22122214", "42122212", "11222215", "31222213", "51222211",
289 | "12113215", "32113213", "52113211", "21213214", "41213212", "23131123", "43131121",
290 | "12231124", "32231122", "21331123", "41331121", "13122124", "33122122", "13131214",
291 | "33131212", "11322124", "22231213", "42231211", "11331214", "31331212", "23113123",
292 | "43113121", "12213124", "23122213", "43122211", "12222214", "32222212", "21322213",
293 | "41322211", "13113214", "33113212", "22213213", "42213211", "11313214", "31313212",
294 | "24131122", "13231123", "33231121", "22331122", "11431123", "31431121", "14122123",
295 | "34122121", "14131213", "34131211", "12322123", "23231212", "12331213", "32331211",
296 | "21431212", "24113122", "13213123", "24122212", "13222213", "33222211", "11413123",
297 | "22322212", "11422213", "31422211", "14113213", "34113211", "23213212", "12313213",
298 | "32313211", "21413212", "25131121", "14231122", "23331121", "12431122", "15122122",
299 | "15131212", "13322122", "24231211", "13331212", "11522122", "22431211", "25113121",
300 | "14213122", "25122211", "14222212", "12413122", "23322211", "12422212", "21522211",
301 | "15113212", "24213211", "13313212", "22413211", "11513212", "15231121", "13431121",
302 | "16122121", "16131211", "14322121", "14331211", "12522121", "15213121", "15222211",
303 | "13413121", "13422211", "11613121", "16113211", "14313211", "12513211", "21141124",
304 | "41141122", "11132125", "31132123", "51132121", "11141215", "31141213", "51141211",
305 | "21123124", "41123122", "21132214", "41132212", "11114125", "31114123", "51114121",
306 | "11123215", "31123213", "51123211", "21114214", "41114212", "22141123", "42141121",
307 | "11241124", "31241122", "12132124", "32132122", "12141214", "32141212", "21241213",
308 | "41241211", "22123123", "42123121", "11223124", "22132213", "42132211", "11232214",
309 | "31232212", "12114124", "32114122", "12123214", "32123212", "21223213", "41223211",
310 | "22114213", "42114211", "11214214", "31214212", "23141122", "12241123", "32241121",
311 | "21341122", "13132123", "33132121", "13141213", "33141211", "11332123", "22241212",
312 | "11341213", "31341211", "23123122", "12223123", "23132212", "12232213", "32232211",
313 | "21332212", "13114123", "33114121", "13123213", "33123211", "11314123", "22223212",
314 | "11323213", "31323211", "23114212", "12214213", "32214211", "21314212", "24141121",
315 | "13241122", "22341121", "14132122", "14141212", "12332122", "23241211", "12341212",
316 | "24123121", "13223122", "24132211", "13232212", "11423122", "22332211", "11432212",
317 | "14114122", "14123212", "12314122", "23223211", "12323212", "21423211", "24114211",
318 | "13214212", "22314211", "11414212", "14241121", "15132121", "15141211", "13332121",
319 | "13341211", "14223121", "14232211", "12423121", "12432211", "15114121", "15123211",
320 | "13314121", "13323211", "11514121", "11523211", "14214211", "12414211", "21151123",
321 | "41151121", "11142124", "31142122", "11151214", "31151212", "21133123", "41133121",
322 | "21142213", "41142211", "11124124", "31124122", "11133214", "31133212", "21115123",
323 | "41115121", "21124213", "41124211", "11115214", "31115212", "22151122", "11251123",
324 | "31251121", "12142123", "32142121", "12151213", "32151211", "21251212", "22133122",
325 | "11233123", "22142212", "11242213", "31242211", "12124123", "32124121", "12133213",
326 | "32133211", "21233212", "22115122", "11215123", "22124212", "11224213", "31224211",
327 | "12115213", "32115211", "21215212", "23151121", "12251122", "13142122", "13151212",
328 | "11342122", "22251211", "23133121", "12233122", "23142211", "12242212", "21342211",
329 | "13124122", "13133212", "11324122", "22233211", "11333212", "23115121", "12215122",
330 | "23124211", "12224212", "21324211", "13115212", "22215211", "11315212", "13251121",
331 | "14142121", "14151211", "12342121", "13233121", "13242211", "11433121", "14124121",
332 | "14133211", "12324121", "12333211", "13215121", "13224211", "11415121", "11424211",
333 | "14115211", "12315211", "21161122", "11152123", "31152121", "11161213", "31161211",
334 | "21143122", "21152212", "11134123", "31134121", "11143213", "31143211", "21125122",
335 | "21134212", "11116123", "31116121", "11125213", "31125211", "22161121", "12152122",
336 | "12161212", "22143121", "11243122", "22152211", "11252212", "12134122", "12143212",
337 | "21243211", "22125121", "11225122", "22134211", "11234212", "12116122", "12125212",
338 | "21225211", "13152121", "13161211", "12243121", "12252211", "13134121", "13143211",
339 | "11334121", "11343211", "12225121", "12234211", "13116121", "13125211", "11316121",
340 | "11325211", "21111226", "41111224", "61111222", "31111315", "51111313", "21211135",
341 | "41211133", "61211131", "22111225", "42111223", "11211226", "31211224", "51211222",
342 | "12111316", "32111314", "52111312", "21211315", "41211313", "61211311", "22211134",
343 | "42211132", "11311135", "31311133", "51311131", "23111224", "43111222", "12211225",
344 | "32211223", "52211221", "21311224", "41311222", "13111315", "33111313", "22211314",
345 | "42211312", "11311315", "31311313", "51311311", "23211133", "43211131", "12311134",
346 | "32311132", "21411133", "41411131", "24111223", "13211224", "33211222", "22311223",
347 | "42311221", "11411224", "31411222", "14111314", "34111312", "23211313", "43211311",
348 | "12311314", "32311312", "21411313", "41411311", "24211132", "13311133", "33311131",
349 | "22411132", "11511133", "31511131", "25111222", "14211223", "34211221", "23311222",
350 | "12411223", "32411221", "21511222", "15111313", "24211312", "13311313", "33311311",
351 | "22411312", "11511313", "31511311", "25211131", "14311132", "23411131", "12511132",
352 | "21611131", "15211222", "24311221", "13411222", "22511221", "11611222", "16111312",
353 | "25211311", "14311312", "23411311", "12511312", "21611311", "31121134", "51121132",
354 | "21112135", "41112133", "61112131", "21121225", "41121223", "61121221", "11112226",
355 | "31112224", "51112222", "11121316", "31121314", "51121312", "21112315", "41112313",
356 | "61112311", "12121135", "32121133", "52121131", "21221134", "41221132", "22112134",
357 | "42112132", "11212135", "22121224", "42121222", "11221225", "31221223", "51221221",
358 | "12112225", "32112223", "52112221", "12121315", "32121313", "52121311", "21221314",
359 | "41221312", "22112314", "42112312", "11212315", "31212313", "51212311", "13121134",
360 | "33121132", "22221133", "42221131", "11321134", "31321132", "23112133", "43112131",
361 | "12212134", "23121223", "43121221", "12221224", "32221222", "21321223", "41321221",
362 | "13112224", "33112222", "13121314", "33121312", "11312224", "22221313", "42221311",
363 | "11321314", "31321312", "23112313", "43112311", "12212314", "32212312", "21312313",
364 | "41312311", "14121133", "34121131", "23221132", "12321133", "32321131", "21421132",
365 | "24112132", "13212133", "24121222", "13221223", "33221221", "11412133", "22321222",
366 | "11421223", "31421221", "14112223", "34112221", "14121313", "34121311", "12312223",
367 | "23221312", "12321313", "32321311", "21421312", "24112312", "13212313", "33212311",
368 | "22312312", "11412313", "31412311", "15121132", "24221131", "13321132", "22421131",
369 | ]
370 |
371 | ODD_PARITY_PATTERNS = [
372 | "22121116", "42121114", "31221115", "51221113", "32112115", "52112113", "21212116",
373 | "41212114", "61212112", "23121115", "43121113", "12221116", "32221114", "52221112",
374 | "21321115", "41321113", "61321111", "13112116", "33112114", "22212115", "42212113",
375 | "11312116", "31312114", "51312112", "24121114", "13221115", "33221113", "22321114",
376 | "42321112", "11421115", "31421113", "51421111", "14112115", "34112113", "23212114",
377 | "43212112", "12312115", "32312113", "52312111", "21412114", "41412112", "25121113",
378 | "14221114", "34221112", "23321113", "43321111", "12421114", "32421112", "21521113",
379 | "41521111", "15112114", "24212113", "13312114", "33312112", "22412113", "42412111",
380 | "11512114", "31512112", "15221113", "24321112", "13421113", "33421111", "22521112",
381 | "16112113", "25212112", "14312113", "34312111", "23412112", "12512113", "32512111",
382 | "21612112", "21131116", "41131114", "61131112", "31122115", "51122113", "21113116",
383 | "41113114", "61113112", "22131115", "42131113", "11231116", "31231114", "51231112",
384 | "12122116", "32122114", "52122112", "21222115", "41222113", "61222111", "22113115",
385 | "42113113", "11213116", "31213114", "51213112", "23131114", "43131112", "12231115",
386 | "32231113", "52231111", "21331114", "41331112", "13122115", "33122113", "22222114",
387 | "42222112", "11322115", "31322113", "51322111", "23113114", "43113112", "12213115",
388 | "32213113", "52213111", "21313114", "41313112", "24131113", "13231114", "33231112",
389 | "22331113", "42331111", "11431114", "31431112", "14122114", "34122112", "23222113",
390 | "43222111", "12322114", "32322112", "21422113", "41422111", "24113113", "13213114",
391 | "33213112", "22313113", "42313111", "11413114", "31413112", "25131112", "14231113",
392 | "34231111", "23331112", "12431113", "32431111", "15122113", "24222112", "13322113",
393 | "33322111", "22422112", "11522113", "31522111", "25113112", "14213113", "34213111",
394 | "23313112", "12413113", "32413111", "21513112", "15231112", "24331111", "13431112",
395 | "16122112", "25222111", "14322112", "23422111", "12522112", "15213112", "24313111",
396 | "13413112", "22513111", "11613112", "21141115", "41141113", "61141111", "11132116",
397 | "31132114", "51132112", "21123115", "41123113", "61123111", "11114116", "31114114",
398 | "51114112", "22141114", "42141112", "11241115", "31241113", "51241111", "12132115",
399 | "32132113", "52132111", "21232114", "41232112", "22123114", "42123112", "11223115",
400 | "31223113", "51223111", "12114115", "32114113", "52114111", "21214114", "41214112",
401 | "23141113", "43141111", "12241114", "32241112", "21341113", "41341111", "13132114",
402 | "33132112", "22232113", "42232111", "11332114", "31332112", "23123113", "43123111",
403 | "12223114", "32223112", "21323113", "41323111", "13114114", "33114112", "22214113",
404 | "42214111", "11314114", "31314112", "24141112", "13241113", "33241111", "22341112",
405 | "14132113", "34132111", "23232112", "12332113", "32332111", "21432112", "24123112",
406 | "13223113", "33223111", "22323112", "11423113", "31423111", "14114113", "34114111",
407 | "23214112", "12314113", "32314111", "21414112", "25141111", "14241112", "23341111",
408 | "15132112", "24232111", "13332112", "22432111", "25123111", "14223112", "23323111",
409 | "12423112", "21523111", "15114112", "24214111", "13314112", "22414111", "11514112",
410 | "15241111", "16132111", "14332111", "15223111", "13423111", "16114111", "14314111",
411 | "12514111", "21151114", "41151112", "11142115", "31142113", "51142111", "21133114",
412 | "41133112", "11124115", "31124113", "51124111", "21115114", "41115112", "22151113",
413 | "42151111", "11251114", "31251112", "12142114", "32142112", "21242113", "41242111",
414 | "22133113", "42133111", "11233114", "31233112", "12124114", "32124112", "21224113",
415 | "41224111", "22115113", "42115111", "11215114", "31215112", "23151112", "12251113",
416 | "32251111", "13142113", "33142111", "22242112", "11342113", "31342111", "23133112",
417 | "12233113", "32233111", "21333112", "13124113", "33124111", "22224112", "11324113",
418 | "31324111", "23115112", "12215113", "32215111", "21315112", "24151111", "13251112",
419 | "14142112", "23242111", "12342112", "24133111", "13233112", "22333111", "11433112",
420 | "14124112", "23224111", "12324112", "21424111", "24115111", "13215112", "22315111",
421 | "11415112", "14251111", "15142111", "13342111", "14233111", "12433111", "15124111",
422 | "13324111", "11524111", "14215111", "12415111", "21161113", "41161111", "11152114",
423 | "31152112", "21143113", "41143111", "11134114", "31134112", "21125113", "41125111",
424 | "11116114", "31116112", "22161112", "12152113", "32152111", "21252112", "22143112",
425 | "11243113", "31243111", "12134113", "32134111", "21234112", "22125112", "11225113",
426 | "31225111", "12116113", "32116111", "21216112", "23161111", "13152112", "22252111",
427 | "23143111", "12243112", "21343111", "13134112", "22234111", "11334112", "23125111",
428 | "12225112", "21325111", "13116112", "22216111", "11316112", "14152111", "13243111",
429 | "14134111", "12334111", "13225111", "11425111", "14116111", "12316111", "41111215",
430 | "61111213", "21211126", "41211124", "61211122", "22111216", "42111214", "31211215",
431 | "51211213", "22211125", "42211123", "11311126", "31311124", "51311122", "23111215",
432 | "43111213", "12211216", "32211214", "52211212", "21311215", "41311213", "61311211",
433 | "23211124", "43211122", "12311125", "32311123", "52311121", "21411124", "41411122",
434 | "24111214", "13211215", "33211213", "22311214", "42311212", "11411215", "31411213",
435 | "51411211", "24211123", "13311124", "33311122", "22411123", "42411121", "11511124",
436 | "31511122", "25111213", "14211214", "34211212", "23311213", "43311211", "12411214",
437 | "32411212", "21511213", "41511211", "25211122", "14311123", "34311121", "23411122",
438 | "12511123", "32511121", "21611122", "15211213", "24311212", "13411213", "33411211",
439 | "22511212", "11611213", "31611211", "31121125", "51121123", "21112126", "41112124",
440 | "61112122", "21121216", "41121214", "61121212", "31112215", "51112213", "12121126",
441 | "32121124", "52121122", "21221125", "41221123", "61221121", "22112125", "42112123",
442 | "11212126", "22121215", "42121213", "11221216", "31221214", "51221212", "12112216",
443 | "32112214", "52112212", "21212215", "41212213", "61212211", "13121125", "33121123",
444 | "22221124", "42221122", "11321125", "31321123", "51321121", "23112124", "43112122",
445 | "12212125", "23121214", "43121212", "12221215", "32221213", "52221211", "21321214",
446 | "41321212", "13112215", "33112213", "22212214", "42212212", "11312215", "31312213",
447 | "51312211", "14121124", "34121122", "23221123", "43221121", "12321124", "32321122",
448 | "21421123", "41421121", "24112123", "13212124", "24121213", "13221214", "33221212",
449 | "11412124", "22321213", "42321211", "11421214", "31421212", "14112214", "34112212",
450 | "23212213", "43212211", "12312214", "32312212", "21412213", "41412211", "15121123",
451 | "24221122", "13321123", "33321121", "22421122", "11521123", "31521121", "25112122",
452 | "14212123", "25121212", "14221213", "34221211", "12412123", "23321212", "12421213",
453 | "32421211", "21521212", "15112213", "24212212", "13312213", "33312211", "22412212",
454 | "11512213", "31512211", "16121122", "25221121", "14321122", "23421121", "12521122",
455 | "15212122", "15221212", "13412122", "24321211", "13421212", "11612122", "22521211",
456 | "16112212", "25212211", "14312212", "23412211", "12512212", "21612211", "11131126",
457 | "31131124", "51131122", "21122125", "41122123", "61122121", "21131215", "41131213",
458 | "61131211", "11113126", "31113124", "51113122", "11122216", "31122214", "51122212",
459 | "21113215", "41113213", "61113211", "12131125", "32131123", "52131121", "21231124",
460 | "41231122", "22122124", "42122122", "11222125", "22131214", "42131212", "11231215",
461 | "31231213", "51231211", "12113125", "32113123", "52113121", "12122215", "32122213",
462 | "52122211", "21222214", "41222212", "22113214", "42113212", "11213215", "31213213",
463 | "51213211", "13131124", "33131122", "22231123", "42231121", "11331124", "31331122",
464 | "23122123", "43122121", "12222124", "23131213", "43131211", "12231214", "32231212",
465 | "21331213", "41331211", "13113124", "33113122", "13122214", "33122212", "11313124",
466 | "22222213", "42222211", "11322214", "31322212", "23113213", "43113211", "12213214",
467 | "32213212", "21313213", "41313211", "14131123", "34131121", "23231122", "12331123",
468 | "32331121", "21431122", "24122122", "13222123", "24131212", "13231213", "33231211",
469 | "11422123", "22331212", "11431213", "31431211", "14113123", "34113121", "14122213",
470 | "34122211", "12313123", "23222212", "12322213", "32322211", "21422212", "24113212",
471 | "13213213", "33213211", "22313212", "11413213", "31413211", "15131122", "24231121",
472 | "13331122", "22431121", "25122121", "14222122", "25131211", "14231212", "12422122",
473 | "23331211", "12431212", "15113122", "15122212", "13313122", "24222211", "13322212",
474 | "11513122", "22422211", "11522212", "25113211", "14213212", "23313211", "12413212",
475 | "21513211", "16131121", "14331121", "15222121", "15231211", "13422121", "13431211",
476 | "16113121", "16122211", "14313121", "14322211", "12513121", "12522211", "15213211",
477 | "13413211", "11613211", "11141125", "31141123", "51141121", "21132124", "41132122",
478 | "21141214", "41141212", "11123125", "31123123", "51123121", "11132215", "31132213",
479 | "51132211", "21114124", "41114122", "21123214", "41123212", "11114215", "31114213",
480 | "51114211", "12141124", "32141122", "21241123", "41241121", "22132123", "42132121",
481 | "11232124", "22141213", "42141211", "11241214", "31241212", "12123124", "32123122",
482 | "12132214", "32132212", "21232213", "41232211", "22114123", "42114121", "11214124",
483 | "22123213", "42123211", "11223214", "31223212", "12114214", "32114212", "21214213",
484 | "41214211", "13141123", "33141121", "22241122", "11341123", "31341121", "23132122",
485 | "12232123", "23141212", "12241213", "32241211", "21341212", "13123123", "33123121",
486 | "13132213", "33132211", "11323123", "22232212", "11332213", "31332211", "23114122",
487 | "12214123", "23123212", "12223213", "32223211", "21323212", "13114213", "33114211",
488 | "22214212", "11314213", "31314211", "14141122", "23241121", "12341122", "24132121",
489 | "13232122", "24141211", "13241212", "11432122", "22341211", "14123122", "14132212",
490 | "12323122", "23232211", "12332212", "21432211", "24114121", "13214122", "24123211",
491 | "13223212", "11414122", "22323211", "11423212", "14114212", "23214211", "12314212",
492 | "21414211", "15141121", "13341121", "14232121", "14241211", "12432121", "15123121",
493 | "15132211", "13323121", "13332211", "11523121", "14214121", "14223211", "12414121",
494 | "12423211", "15114211", "13314211", "11514211", "11151124", "31151122", "21142123",
495 | "41142121", "21151213", "41151211", "11133124", "31133122", "11142214", "31142212",
496 | "21124123", "41124121", "21133213", "41133211", "11115124", "31115122", "11124214",
497 | "31124212", "21115213", "41115211", "12151123", "32151121", "21251122", "22142122",
498 | "11242123", "22151212", "11251213", "31251211", "12133123", "32133121", "12142213",
499 | "32142211", "21242212", "22124122", "11224123", "22133212", "11233213", "31233211",
500 | "12115123", "32115121", "12124213", "32124211", "21224212", "22115212", "11215213",
501 | "31215211", "13151122", "22251121", "23142121", "12242122", "23151211", "12251212",
502 | "13133122", "13142212", "11333122", "22242211", "11342212", "23124121", "12224122",
503 | "23133211", "12233212", "21333211", "13115122", "13124212", "11315122", "22224211",
504 | "11324212", "23115211", "12215212", "21315211", "14151121", "13242121", "13251211",
505 | "14133121", "14142211", "12333121", "12342211", "13224121", "13233211", "11424121",
506 | "11433211", "14115121", "14124211", "12315121", "12324211", "13215211", "11415211",
507 | "11161123", "31161121", "21152122", "21161212", "11143123", "31143121", "11152213",
508 | "31152211", "21134122", "21143212", "11125123", "31125121", "11134213", "31134211",
509 | "21116122", "21125212", "12161122", "22152121", "11252122", "22161211", "12143122",
510 | "12152212", "21252211", "22134121", "11234122", "22143211", "11243212", "12125122",
511 | "12134212", "21234211", "22116121", "11216122", "22125211", "11225212", "13161121",
512 | "12252121", "13143121", "13152211", "11343121", "12234121", "12243211", "13125121",
513 | "13134211", "11325121", "11334211", "12216121", "12225211", "31111225", "51111223",
514 | "21111316", "41111314", "61111312", "31211134", "51211132", "12111226", "32111224",
515 | "52111222", "21211225", "41211223", "61211221", "22111315", "42111313", "11211316",
516 | "31211314", "51211312", "12211135", "32211133", "52211131", "21311134", "41311132",
517 | "13111225", "33111223", "22211224", "42211222", "11311225", "31311223", "51311221",
518 | "23111314", "43111312", "12211315", "32211313", "52211311", "21311314", "41311312",
519 | "13211134", "33211132", "22311133", "42311131", "11411134", "31411132", "14111224",
520 | "34111222", "23211223", "43211221", "12311224", "32311222", "21411223", "41411221",
521 | "24111313", "13211314", "33211312", "22311313", "42311311", "11411314", "31411312",
522 | "14211133", "34211131", "23311132", "12411133", "32411131", "21511132", "15111223",
523 | "24211222", "13311223", "33311221", "22411222", "11511223", "31511221", "25111312",
524 | "14211313", "34211311", "23311312", "12411313", "32411311", "21511312", "15211132",
525 | "24311131", "13411132", "22511131", "11611132", "16111222", "25211221", "14311222",
526 | "23411221", "12511222", "21611221", "15211312", "24311311", "13411312", "22511311",
527 | "11611312", "21121135", "41121133", "61121131", "11112136", "31112134", "51112132",
528 | "11121226", "31121224", "51121222", "21112225", "41112223", "61112221", "21121315",
529 | "41121313", "61121311", "11112316", "31112314", "51112312", "22121134", "42121132",
530 | "11221135", "31221133", "51221131", "12112135", "32112133", "52112131", "12121225",
531 | "32121223", "52121221", "21221224", "41221222", "22112224", "42112222", "11212225",
532 | "22121314", "42121312", "11221315", "31221313", "51221311", "12112315", "32112313",
533 | "52112311", "21212314", "41212312", "23121133", "43121131", "12221134", "32221132",
534 | "21321133", "41321131", "13112134", "33112132", "13121224", "33121222", "11312134",
535 | "22221223", "42221221", "11321224", "31321222", "23112223", "43112221", "12212224",
536 | "23121313", "43121311", "12221314", "32221312", "21321313", "41321311", "13112314",
537 | "33112312", "22212313", "42212311", "11312314", "31312312", "24121132", "13221133",
538 | "33221131", "22321132", "11421133", "31421131", "14112133", "34112131", "14121223",
539 | "34121221", "12312133", "23221222", "12321223", "32321221", "21421222", "24112222",
540 | "13212223", "24121312", "13221313", "33221311", "11412223", "22321312", "11421313",
541 | "31421311", "14112313", "34112311", "23212312", "12312313", "32312311", "21412312",
542 | "25121131", "14221132", "23321131", "12421132", "21521131", "15112132", "15121222",
543 | "13312132", "24221221", "13321222", "11512132", "22421221", "11521222", "25112221",
544 | "14212222", "25121311", "14221312", "12412222", "23321311", "12421312", "21521311",
545 | "15112312", "24212311", "13312312", "22412311", "11512312", "15221131", "13421131",
546 | "16112131", "16121221", "14312131", "14321221", "12512131", "12521221", "15212221",
547 | "15221311", "13412221", "13421311", "11612221", "16112311", "14312311", "12512311",
548 | "21131134", "41131132", "11122135", "31122133", "51122131", "11131225", "31131223",
549 | "51131221", "21113134", "41113132", "21122224", "41122222", "21131314", "41131312",
550 | "11113225", "31113223", "51113221", "11122315", "31122313", "51122311", "21113314",
551 | "41113312", "22131133", "42131131", "11231134", "31231132", "12122134", "32122132",
552 | "12131224", "32131222", "21231223", "41231221", "22113133", "42113131", "11213134",
553 | "22122223", "42122221", "11222224", "22131313", "42131311", "11231314", "31231312",
554 | "12113224", "32113222", "12122314", "32122312", "21222313", "41222311", "22113313",
555 | "42113311", "11213314", "31213312", "23131132", "12231133", "32231131", "21331132",
556 | "13122133", "33122131", "13131223", "33131221", "11322133", "22231222", "11331223",
557 | "31331221", "23113132", "12213133", "23122222", "12222223", "23131312", "12231313",
558 | "32231311", "21331312", "13113223", "33113221", "13122313", "33122311", "11313223",
559 | "22222312", "11322313", "31322311", "23113312", "12213313", "32213311", "21313312",
560 | "24131131", "13231132", "22331131", "11431132", "14122132", "14131222", "12322132",
561 | "23231221", "12331222", "21431221", "24113131", "13213132", "24122221", "13222222",
562 | "24131311", "11413132", "13231312", "11422222", "22331311", "11431312", "14113222",
563 | "14122312", "12313222", "23222311", "12322312", "21422311", "24113311", "13213312",
564 | "22313311", "11413312", "14231131", "12431131", "15122131", "15131221", "13322131",
565 | "13331221", "11522131", "14213131", "14222221", "12413131", "14231311", "12422221",
566 | "12431311", "15113221", "15122311", "13313221", "13322311", "11513221", "11522311",
567 | "14213311", "12413311", "21141133", "41141131", "11132134", "31132132", "11141224",
568 | "31141222", "21123133", "41123131", "21132223", "41132221", "21141313", "41141311",
569 | "11114134", "31114132", "11123224", "31123222", "11132314", "31132312", "21114223",
570 | "41114221", "21123313", "41123311", "11114314", "31114312", "22141132", "11241133",
571 | "31241131", "12132133", "32132131", "12141223", "32141221", "21241222", "22123132",
572 | "11223133", "22132222", "11232223", "22141312", "11241313", "31241311", "12114133",
573 | "32114131", "12123223", "32123221", "12132313", "32132311", "21232312", "22114222",
574 | "11214223", "22123312", "11223313", "31223311", "12114313", "32114311", "21214312",
575 | "23141131", "12241132", "21341131", "13132132", "13141222", "11332132", "22241221",
576 | "11341222", "23123131", "12223132", "23132221", "12232222", "23141311", "12241312",
577 | "21341311", "13114132", "13123222", "11314132", "13132312", "11323222", "22232311",
578 | "11332312", "23114221", "12214222", "23123311", "12223312", "21323311", "13114312",
579 | "22214311", "11314312", "13241131", "14132131", "14141221", "12332131", "12341221",
580 | "13223131", "13232221", "11423131", "13241311", "11432221", "14114131", "14123221",
581 | "12314131", "14132311", "12323221", "12332311", "13214221", "13223311", "11414221",
582 | "11423311", "14114311", "12314311", "21151132", "11142133", "31142131", "11151223",
583 | "31151221", "21133132", "21142222", "21151312", "11124133", "31124131", "11133223",
584 | "31133221", "11142313", "31142311", "21115132", "21124222", "21133312", "11115223",
585 | "31115221", "11124313", "31124311", "22151131", "11251132", "12142132", "12151222",
586 | "21251221", "22133131", "11233132", "22142221", "11242222", "22151311", "11251312",
587 | "12124132", "12133222", "12142312", "21242311", "22115131", "11215132", "22124221",
588 | "11224222", "22133311", "11233312", "12115222", "12124312", "21224311", "12251131",
589 | "13142131", "13151221", "11342131", "12233131", "12242221", "12251311", "13124131",
590 | "13133221", "11324131", "13142311", "11333221", "11342311", "12215131", "12224221",
591 | "12233311", "13115221", "13124311", "11315221", "11324311", "21161131", "11152132",
592 | "11161222", "21143131", "21152221", "21161311", "11134132", "11143222", "11152312",
593 | "21125131", "21134221", "21143311", "11116132", "11125222", "11134312", "12152131",
594 | "12161221", "11243131", "11252221", "12134131", "12143221", "12152311", "11225131",
595 | "11234221", "11243311", "12116131", "12125221", "12134311", "21111235", "41111233",
596 | "61111231", "11111326", "31111324", "51111322", "21111415", "41111413", "61111411",
597 | "21211144", "41211142", "22111234", "42111232", "11211235", "31211233", "51211231",
598 | "12111325", "32111323", "52111321", "21211324", "41211322", "22111414", "42111412",
599 | "11211415", "31211413", "51211411", "22211143", "42211141", "11311144", "31311142",
600 | "23111233", "43111231", "12211234", "32211232", "21311233", "41311231", "13111324",
601 | "33111322", "22211323", "42211321", "11311324", "31311322", "23111413", "43111411",
602 | "12211414", "32211412", "21311413", "41311411", "23211142", "12311143", "32311141",
603 | "21411142", "24111232", "13211233", "33211231", "22311232", "11411233", "31411231",
604 | "14111323", "34111321", "23211322", "12311323", "32311321", "21411322", "24111412",
605 | "13211413", "33211411", "22311412", "11411413", "31411411", "24211141", "13311142",
606 | "22411141", "11511142", "25111231", "14211232", "23311231", "12411232", "21511231",
607 | "15111322", "24211321", "13311322", "22411321", "11511322", "25111411", "14211412",
608 | "23311411", "12411412", "21511411", "14311141", "12511141", "15211231", "13411231",
609 | "11611231", "16111321", "14311321", "12511321", "15211411", "13411411", "11611411",
610 | "31121143", "51121141", "21112144", "41112142", "21121234", "41121232", "11112235",
611 | "31112233", "51112231", "11121325", "31121323", "51121321", "21112324", "41112322",
612 | "21121414", "41121412", "11112415", "31112413", "51112411", "12121144", "32121142",
613 | "21221143", "41221141", "22112143", "42112141", "11212144", "22121233", "42121231",
614 | "11221234", "31221232", "12112234", "32112232", "12121324", "32121322", "21221323",
615 | "41221321", "22112323", "42112321", "11212324", "22121413", "42121411", "11221414",
616 | "31221412", "12112414", "32112412", "21212413", "41212411", "13121143", "33121141",
617 | "22221142", "11321143", "31321141", "23112142", "12212143", "23121232", "12221233",
618 | "32221231", "21321232", "13112233", "33112231", "13121323", "33121321", "11312233",
619 | "22221322", "11321323", "31321321", "23112322", "12212323", "23121412", "12221413",
620 | "32221411", "21321412", "13112413", "33112411", "22212412", "11312413", "31312411",
621 | "14121142", "23221141", "12321142", "21421141", "24112141", "13212142", "24121231",
622 | "13221232", "11412142", "22321231", "11421232", "14112232", "14121322", "12312232",
623 | "23221321", "12321322", "21421321", "24112321", "13212322", "24121411", "13221412",
624 | "11412322", "22321411", "11421412", "14112412", "23212411", "12312412", "21412411",
625 | "15121141", "13321141", "11521141", "14212141", "14221231", "12412141", "12421231",
626 | "15112231", "15121321", "13312231", "13321321", "11512231", "11521321", "14212321",
627 | "14221411", "12412321", "12421411", "15112411", "13312411", "11512411", "11131144",
628 | "31131142", "21122143", "41122141", "21131233", "41131231", "11113144", "31113142",
629 | "11122234", "31122232", "11131324", "31131322", "21113233", "41113231", "21122323",
630 | "41122321", "21131413", "41131411", "11113324", "31113322", "11122414", "31122412",
631 | "21113413", "41113411", "12131143", "32131141", "21231142", "22122142", "11222143",
632 | "22131232", "11231233", "31231231", "12113143", "32113141", "12122233", "32122231",
633 | "12131323", "32131321", "21231322", "22113232", "11213233", "22122322", "11222323",
634 | "22131412", "11231413", "31231411", "12113323", "32113321", "12122413", "32122411",
635 | "21222412", "22113412", "11213413", "31213411", "13131142", "22231141", "11331142",
636 | "23122141", "12222142", "23131231", "12231232", "21331231", "13113142", "13122232",
637 | "11313142", "13131322", "11322232", "22231321", "11331322", "23113231", "12213232",
638 | "23122321", "12222322", "23131411", "12231412", "21331411", "13113322", "13122412",
639 | "11313322", "22222411", "11322412", "23113411", "12213412", "21313411", "14131141",
640 | "12331141", "13222141", "13231231", "11422141", "11431231", "14113141", "14122231",
641 | "12313141", "14131321", "12322231", "12331321", "13213231", "13222321", "11413231",
642 | "13231411", "11422321", "11431411", "14113321", "14122411", "12313321", "12322411",
643 | "13213411", "11413411", "11141143", "31141141", "21132142", "21141232", "11123143",
644 | "31123141", "11132233", "31132231", "11141323", "31141321", "21114142", "21123232",
645 | "21132322", "21141412", "11114233", "31114231", "11123323", "31123321", "11132413",
646 | "31132411", "21114322", "21123412", "12141142", "21241141", "22132141", "11232142",
647 | "22141231", "11241232", "12123142", "12132232", "12141322", "21241321", "22114141",
648 | "11214142", "22123231", "11223232", "22132321", "11232322", "22141411", "11241412",
649 | "12114232", "12123322", "12132412", "21232411", "22114321", "11214322", "22123411",
650 | "11223412", "13141141", "11341141", "12232141", "12241231", "13123141", "13132231",
651 | "11323141", "13141321", "11332231", "11341321", "12214141", "12223231", "12232321",
652 | "12241411", "13114231", "13123321", "11314231", "13132411", "11323321", "11332411",
653 | "12214321", "12223411", "11151142", "21142141", "21151231", "11133142", "11142232",
654 | "11151322", "21124141", "21133231", "21142321", "21151411", "11115142", "11124232",
655 | "11133322", "11142412", "21115231", "21124321", "21133411", "12151141", "11242141",
656 | "11251231", "12133141", "12142231", "12151321", "11224141", "11233231", "11242321",
657 | "11251411", "12115141", "12124231", "12133321", "12142411", "11215231", "11224321",
658 | "11233411", "11161141", "11143141", "11152231", "11161321", "11125141", "11134231",
659 | "11143321", "11152411", "11111245", "31111243", "51111241", "21111334", "41111332",
660 | "11111425", "31111423", "51111421", "21111514", "41111512", "31211152", "12111244",
661 | "32111242", "21211243", "41211241", "22111333", "42111331", "11211334", "31211332",
662 | "12111424", "32111422", "21211423", "41211421", "22111513", "42111511", "11211514",
663 | "31211512", "12211153", "32211151", "21311152", "13111243", "33111241", "22211242",
664 | "11311243", "31311241", "23111332", "12211333", "32211331", "21311332", "13111423",
665 | "33111421", "22211422", "11311423", "31311421", "23111512", "12211513", "32211511",
666 | "21311512", "13211152", "22311151", "11411152", "14111242", "23211241", "12311242",
667 | "21411241", "24111331", "13211332", "22311331", "11411332", "14111422", "23211421",
668 | "12311422", "21411421", "24111511", "13211512", "22311511", "11411512", "14211151",
669 | "12411151", "15111241", "13311241", "11511241", "14211331", "12411331", "15111421",
670 | "13311421", "11511421", "14211511", "12411511", "21121153", "41121151", "11112154",
671 | "31112152", "11121244", "31121242", "21112243", "41112241", "21121333", "41121331",
672 | "11112334", "31112332", "11121424", "31121422", "21112423", "41112421", "21121513",
673 | "41121511", "11112514", "31112512", "22121152", "11221153", "31221151", "12112153",
674 | "32112151", "12121243", "32121241", "21221242", "22112242", "11212243", "22121332",
675 | "11221333", "31221331", "12112333", "32112331", "12121423", "32121421", "21221422",
676 | "22112422", "11212423", "22121512", "11221513", "31221511", "12112513", "32112511",
677 | "21212512", "23121151", "12221152", "21321151", "13112152", "13121242", "11312152",
678 | "22221241", "11321242", "23112241", "12212242", "23121331", "12221332", "21321331",
679 | "13112332", "13121422", "11312332", "22221421", "11321422", "23112421", "12212422",
680 | "23121511", "12221512", "21321511", "13112512", "22212511", "11312512", "13221151",
681 | "11421151", "14112151", "14121241", "12312151", "12321241", "13212241", "13221331",
682 | "11412241", "11421331", "14112331", "14121421", "12312331", "12321421", "13212421",
683 | "13221511", "11412421", "11421511", "14112511", "12312511", "21131152", "11122153",
684 | "31122151", "11131243", "31131241", "21113152", "21122242", "21131332", "11113243",
685 | "31113241", "11122333", "31122331", "11131423", "31131421", "21113332", "21122422",
686 | "21131512", "11113423", "31113421", "11122513", "31122511", "22131151", "11231152",
687 | "12122152", "12131242", "21231241", "22113151", "11213152", "22122241", "11222242",
688 | "22131331", "11231332", "12113242", "12122332", "12131422", "21231421", "22113331",
689 | "11213332", "22122421", "11222422", "22131511", "11231512", "12113422", "12122512",
690 | "21222511", "12231151", "13122151", "13131241", "11322151", "11331241", "12213151",
691 | "12222241", "12231331", "13113241", "13122331", "11313241", "13131421", "11322331",
692 | "11331421", "12213331", "12222421", "12231511", "13113421", "13122511", "11313421",
693 | "11322511", "21141151", "11132152", "11141242", "21123151", "21132241", "21141331",
694 | "11114152", "11123242", "11132332", "11141422", "21114241", "21123331", "21132421",
695 | "21141511", "11114332", "11123422", "11132512", "11241151", "12132151", "12141241",
696 | "11223151", "11232241", "11241331", "12114151", "12123241", "12132331", "12141421",
697 | "11214241", "11223331", "11232421", "11241511", "12114331", "12123421", "12132511",
698 | "11142151", "11151241", "11124151", "11133241", "11142331", "11151421", "11115241",
699 | "11124331", "11133421", "11142511", "21111253", "41111251", "11111344", "31111342",
700 | "21111433", "41111431", "11111524", "31111522", "21111613", "41111611", "21211162",
701 | "22111252", "11211253", "31211251", "12111343", "32111341", "21211342", "22111432",
702 | "11211433", "31211431", "12111523", "32111521", "21211522", "22111612", "11211613",
703 | "31211611", "22211161", "11311162", "23111251", "12211252", "21311251", "13111342",
704 | "22211341", "11311342", "23111431", "12211432", "21311431", "13111522", "22211521",
705 | "11311522", "23111611", "12211612", "21311611", "12311161", "13211251", "11411251",
706 | "14111341", "12311341", "13211431", "11411431", "14111521", "12311521", "13211611",
707 | "11411611", "31121161", "21112162", "21121252", "11112253", "31112251", "11121343",
708 | "31121341", "21112342", "21121432", "11112433", "31112431", "11121523", "31121521",
709 | "21112522", "21121612", "12121162", "21221161", "22112161", "11212162", "22121251",
710 | "11221252", "12112252", "12121342", "21221341", "22112341", "11212342", "22121431",
711 | "11221432", "12112432", "12121522", "21221521", "22112521", "11212522", "22121611",
712 | "11221612", "13121161", "11321161", "12212161", "12221251", "13112251", "13121341",
713 | "11312251", "11321341", "12212341", "12221431", "13112431", "13121521", "11312431",
714 | "11321521", "12212521", "12221611", "11131162", "21122161", "21131251", "11113162",
715 | ]
716 |
717 | # Indicates the parity to use for each word on each row
718 | ROW_PARITY = [
719 | "1001", "0101", "1100", "0011", "1010", "0110", "1111", "0000"
720 | ]
721 |
722 | # Weights used in checksum algorithm
723 | X_WEIGHTS = [
724 | 1, 9, 31, 26, 2, 12, 17, 23, 37, 18, 22, 6, 27, 44, 15, 43,
725 | 39, 11, 13, 5, 41, 33, 36, 8, 4, 32, 3, 19, 40, 25, 29, 10
726 | ]
727 |
728 | Y_WEIGHTS = [
729 | 9, 31, 26, 2, 12, 17, 23, 37, 18, 22, 6, 27, 44, 15, 43, 39,
730 | 11, 13, 5, 41, 33, 36, 8, 4, 32, 3, 19, 40, 25, 29, 10, 24
731 | ]
732 |
733 | Z_WEIGHTS = [
734 | 31, 26, 2, 12, 17, 23, 37, 18, 22, 6, 27, 44, 15, 43, 39, 11,
735 | 13, 5, 41, 33, 36, 8, 4, 32, 3, 19, 40, 25, 29, 10, 24, 30
736 | ]
737 |
738 |
739 | CHAR_MAP = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%"
740 |
741 | # Pad is the value added to complete incomplete rows
742 | PAD = 48
743 |
744 | # We only support mode 0.
745 | # Other modes are used for more efficient numeric encoding, shift values.
746 | MODE = 0
747 |
748 |
749 | def encode(text):
750 | if len(text) > 49:
751 | raise ValueError("Limited to 49 characters")
752 |
753 | if any([ord(c) > 127 for c in text]):
754 | raise ValueError("High ASCII characters not allowed")
755 |
756 | # [Modified] Here we need to convert map into list first
757 | #
758 | # words = map(CHAR_MAP.index, text)
759 | words = list(map(CHAR_MAP.index, text))
760 | length = len(words)
761 |
762 | # Add an extra row (7 pads)
763 | if length <= 7 or length > 42 or (length % 7 > 2 and length <= 42):
764 | words.extend([PAD] * 7)
765 |
766 | # Fill out the rest of the row
767 | words.extend([PAD] * ((7 - length) % 7))
768 |
769 | # Add row count and mode
770 | words[-1] = len(words) - 14 + MODE
771 |
772 | rows = list(_chunks(words, 7))
773 |
774 | # Init check counters
775 | x_check = rows[-1][6] * 20
776 | y_check = rows[-1][6] * 16
777 | z_check = rows[-1][6] * 38
778 | posn = 0
779 |
780 | # Go over each row except the last one (it is accumulated later)
781 | for row in rows[:-1]:
782 | # Row sum
783 | row.append(sum(row) % 49)
784 |
785 | # Accumulate check counters
786 | for j in range(4):
787 | curr_value = row[j * 2] * 49 + row[j * 2 + 1]
788 | x_check += X_WEIGHTS[posn] * curr_value
789 | y_check += Y_WEIGHTS[posn] * curr_value
790 | z_check += Z_WEIGHTS[posn] * curr_value
791 | posn += 1
792 |
793 | if len(rows) >= 7:
794 | # Write Z Check
795 |
796 | # [Modified] Integer division required
797 | #
798 | # rows[-1][0] = (z_check % 2401) / 49
799 | rows[-1][0] = (z_check % 2401) // 49
800 | rows[-1][1] = (z_check % 2401) % 49
801 |
802 | curr_value = rows[-1][0] * 49 + rows[-1][1]
803 | x_check += X_WEIGHTS[posn] * curr_value
804 | y_check += Y_WEIGHTS[posn] * curr_value
805 | posn += 1
806 |
807 | # Write Y Check
808 |
809 | # [Modified] Integer division required
810 | #
811 | # rows[-1][2] = (y_check % 2401) / 49
812 | rows[-1][2] = (y_check % 2401) // 49
813 | rows[-1][3] = (y_check % 2401) % 49
814 |
815 | curr_value = rows[-1][2] * 49 + rows[-1][3]
816 | x_check += X_WEIGHTS[posn] * curr_value
817 |
818 | # Write X Check
819 |
820 | # [Modified] Integer division required
821 | #
822 | # rows[-1][4] = (x_check % 2401) / 49
823 | rows[-1][4] = (x_check % 2401) // 49
824 | rows[-1][5] = (x_check % 2401) % 49
825 |
826 | # Last row's check character
827 | rows[-1].append(sum(rows[-1]) % 49)
828 |
829 | # The final symbol is a list of rows, each containing a
830 | # string of integers representing line widths
831 | symbol = []
832 | for i, row in enumerate(rows):
833 | pattern = '11' # Every row starts with 11
834 |
835 | for j in range(4):
836 | val = row[j * 2] * 49 + row[j * 2 + 1]
837 | print(row[j * 2], row[j * 2 + 1])
838 |
839 | # Last row uses all even parity
840 | if ROW_PARITY[i][j] == '0' or len(rows) == i + 1:
841 | pattern += EVEN_PARITY_PATTERNS[val]
842 |
843 | else:
844 | pattern += ODD_PARITY_PATTERNS[val]
845 |
846 | # Every row ends with 4
847 | pattern += '4'
848 | symbol.append(pattern)
849 |
850 | return symbol
851 |
852 | # [Modified] Useless code for decoder
853 | #
854 | # if __name__ == "__main__":
855 | # from fpdf import FPDF
856 |
857 | # symbol = encode('MULTIPLE ROWS IN CODE 49')
858 |
859 | # pdf = FPDF()
860 | # pdf.add_page()
861 |
862 | # base_width = 0.5
863 | # x, y = 40, 40
864 | # h = 5
865 | # for row in symbol:
866 | # x = 40
867 | # pdf.rect(x, y - base_width / 2, base_width * 70, base_width, 'F')
868 | # for i, c in enumerate(row):
869 | # line_width = base_width * int(c)
870 | # if i % 2 == 0:
871 | # pdf.rect(x, y, line_width, h, 'F')
872 |
873 | # x += line_width
874 |
875 | # y += h
876 |
877 | # pdf.rect(40, y - base_width / 2, base_width * 70, base_width, 'F')
878 |
879 | # pdf.output('code49.pdf', 'F')
880 |
--------------------------------------------------------------------------------
/main.py:
--------------------------------------------------------------------------------
1 | import code49 as c49
2 |
3 |
4 | # Decoder
5 | def decode(code):
6 | # Buffer & index
7 | buffer, index = '', 0
8 |
9 | # For each line except last line (Ignore checksum)
10 | for i, row in enumerate(code[:-1]):
11 | # Extract pattern, remove head '11' and tail '4'
12 | ptrn = row[2:-1]
13 |
14 | # For each symbol
15 | for j in range(4):
16 | # Get value
17 | val = None
18 | if c49.ROW_PARITY[i][j] == '0' or len(code) == i + 1:
19 | val = c49.EVEN_PARITY_PATTERNS.index(ptrn[j << 3:(j + 1) << 3])
20 | else:
21 | val = c49.ODD_PARITY_PATTERNS.index(ptrn[j << 3:(j + 1) << 3])
22 |
23 | # Extract 2 characters from value
24 | c1, c2 = val // 49, val % 49
25 |
26 | # Append buffer
27 | try:
28 | index += 1
29 | buffer += c49.CHAR_MAP[c1]
30 | except:
31 | pass
32 |
33 | try:
34 | index += 1
35 | if index % 8 != 0 or index == 0:
36 | buffer += c49.CHAR_MAP[c2]
37 | except:
38 | pass
39 |
40 | # Return buffer
41 | return buffer
42 |
43 |
44 | # Main entry
45 | if __name__ == '__main__':
46 | # Test encoder
47 | # test.test_cases()
48 |
49 | # Decode
50 | code = [
51 | '11143121314115211131114321124131314',
52 | '11221611211411251111225122311314214',
53 | '11123232212411212332131231332321114',
54 | '11251311211242114112215212413213114',
55 | '11123121511212521211113243422213114',
56 | '11224211311211313421211153141112154'
57 | ]
58 | text = decode(code)
59 | print(text)
60 |
--------------------------------------------------------------------------------
/test/__init__.py:
--------------------------------------------------------------------------------
1 | import code49 as c49
2 |
3 |
4 | # Test encoder
5 | def test_encoder(text, code):
6 | # Encode text
7 | tmp = c49.encode(text)
8 |
9 | # Length match
10 | assert len(tmp) == len(code), f'length not match: {len(tmp)} != {len(code)}'
11 |
12 | # Row match
13 | for i, row in enumerate(tmp):
14 | assert row == code[i], f'row {i + 1} not match: {i} != {code[i]}'
15 |
16 | # Matched
17 | print('test matched')
18 |
19 |
20 | # Test cases
21 | def test_cases():
22 | test_encoder(
23 | '0',
24 | [
25 | '11215211132242113122421131122125214',
26 | '11224211311115222224211213511311314'
27 | ]
28 | )
29 | test_encoder(
30 | 'TEST',
31 | [
32 | '11213413112211411422421131111131624',
33 | '11224211311213224122321321142123124'
34 | ]
35 | )
36 | test_encoder(
37 | '-A.5 $/0+W%7',
38 | [
39 | '11142121413111321434113211111511424',
40 | '11511311311221141441211232121124324',
41 | '11224211311314141122241212111114164'
42 | ]
43 | )
44 | test_encoder(
45 | 'THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG. 123',
46 | [
47 | '11113141321114141323122114122421224',
48 | '11211131431221341214222113212113244',
49 | '11314211312124112343311121122125124',
50 | '11511151111141211513222123151121324',
51 | '11122333112523111111314132123134114',
52 | '11341221215131221111212324122133224',
53 | '11233211311223123224212113116131124',
54 | '11511151111122512211141152311332124'
55 | ]
56 | )
57 |
--------------------------------------------------------------------------------